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

Commit 8abebcde authored by Adam Powell's avatar Adam Powell
Browse files

New opaque cab assets; search dialog tweaks.

* New opaque assets (now actually opaque!)

* SearchDialog determines theme to use from parent context

* SearchDialog now disallows action modes

Change-Id: If05fe64d7cc4460678d78412275ee988ddb47e9e
parent b9537db8
Loading
Loading
Loading
Loading
+18 −5
Original line number Original line Diff line number Diff line
@@ -29,12 +29,13 @@ import android.content.res.Configuration;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.net.Uri;
import android.os.Bundle;
import android.os.Bundle;
import android.os.SystemClock;
import android.speech.RecognizerIntent;
import android.speech.RecognizerIntent;
import android.text.InputType;
import android.text.InputType;
import android.text.TextUtils;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.AttributeSet;
import android.util.Log;
import android.util.Log;
import android.util.TypedValue;
import android.view.ActionMode;
import android.view.Gravity;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.MotionEvent;
@@ -50,9 +51,6 @@ import android.widget.LinearLayout;
import android.widget.SearchView;
import android.widget.SearchView;
import android.widget.TextView;
import android.widget.TextView;


import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicLong;

/**
/**
 * Search dialog. This is controlled by the 
 * Search dialog. This is controlled by the 
 * SearchManager and runs in the current foreground process.
 * SearchManager and runs in the current foreground process.
@@ -110,13 +108,20 @@ public class SearchDialog extends Dialog {
        }
        }
    };
    };


    static int resolveDialogTheme(Context context) {
        TypedValue outValue = new TypedValue();
        context.getTheme().resolveAttribute(com.android.internal.R.attr.searchDialogTheme,
                outValue, true);
        return outValue.resourceId;
    }

    /**
    /**
     * Constructor - fires it up and makes it look like the search UI.
     * Constructor - fires it up and makes it look like the search UI.
     * 
     * 
     * @param context Application Context we can use for system acess
     * @param context Application Context we can use for system acess
     */
     */
    public SearchDialog(Context context, SearchManager searchManager) {
    public SearchDialog(Context context, SearchManager searchManager) {
        super(context, com.android.internal.R.style.Theme_SearchBar);
        super(context, resolveDialogTheme(context));


        // Save voice intent for later queries/launching
        // Save voice intent for later queries/launching
        mVoiceWebSearchIntent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
        mVoiceWebSearchIntent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH);
@@ -642,6 +647,14 @@ public class SearchDialog extends Dialog {
            }
            }
            return super.dispatchKeyEventPreIme(event);
            return super.dispatchKeyEventPreIme(event);
        }
        }

        /**
         * Don't allow action modes in a SearchBar, it looks silly.
         */
        @Override
        public ActionMode startActionModeForChild(View child, ActionMode.Callback callback) {
            return null;
        }
    }
    }


    private boolean isEmpty(AutoCompleteTextView actv) {
    private boolean isEmpty(AutoCompleteTextView actv) {
−4.9 KiB
Loading image diff...
−5.9 KiB
Loading image diff...
+3.87 KiB
Loading image diff...
+4.97 KiB
Loading image diff...
Loading