Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a97f4a11 authored by Mike LeBeau's avatar Mike LeBeau
Browse files

Remove dimmed background (and accompanying animation) for global

search, since we should never really see that background anyway,
and I suspect the animation is using a significant amount of CPU.
parent fea1a459
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.util.Log;
import android.view.ContextThemeWrapper;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -165,7 +166,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
     * @param context Application Context we can use for system acess
     */
    public SearchDialog(Context context) {
        super(context, com.android.internal.R.style.Theme_SearchBar);
        super(context, com.android.internal.R.style.Theme_GlobalSearchBar);
    }

    /**
@@ -393,6 +394,21 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
                getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
                        inputManager.showSoftInputUnchecked(0, null);
            }
            
            // The Dialog uses a ContextThemeWrapper for the context; use this to change the
            // theme out from underneath us, between the global search theme and the in-app
            // search theme. They are identical except that the global search theme does not
            // dim the background of the window (because global search is full screen so it's
            // not needed and this should save a little bit of time on global search invocation).
            Object context = getContext();
            if (context instanceof ContextThemeWrapper) {
                ContextThemeWrapper wrapper = (ContextThemeWrapper) context;
                if (globalSearch) {
                    wrapper.setTheme(com.android.internal.R.style.Theme_GlobalSearchBar);
                } else {
                    wrapper.setTheme(com.android.internal.R.style.Theme_SearchBar);
                }
            }
            show();
        }

+6 −0
Original line number Diff line number Diff line
@@ -369,6 +369,12 @@
        <item name="windowContentOverlay">@null</item>        
    </style>
    
    <!-- Theme for the search input bar when doing global search. The only
         difference from non-global search is that we do not dim the background. -->
    <style name="Theme.GlobalSearchBar" parent="Theme.Panel">
        <item name="windowContentOverlay">@null</item>
    </style>

    <!-- Menu Themes -->
    <eat-comment />