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

Commit aee8d2a0 authored by Abhisek Devkota's avatar Abhisek Devkota
Browse files

Revert "Allow no applications in navring, like in cm11"

This reverts commit 8d50e726.

Change-Id: I359f6fce3fd97aa7a98df864469471605d28cfe0
parent c29a0b07
Loading
Loading
Loading
Loading
+8 −15
Original line number Diff line number Diff line
@@ -181,17 +181,6 @@ public class SearchPanelView extends FrameLayout implements StatusBarPanel,
        }
    }

    private boolean hasItemsToShow() {
        for (int i = 0; i < mTargetViews.size(); i++) {
            View v = mTargetViews.get(i);
            View parent = (View) v.getParent();
            if (parent.getVisibility() == View.VISIBLE) {
                return true;
            }
        }
        return false;
    }

    public void replaceDrawable(ImageView v, ComponentName component, String name) {
        if (component != null) {
            try {
@@ -235,7 +224,7 @@ public class SearchPanelView extends FrameLayout implements StatusBarPanel,
    }

    public void show(final boolean show, boolean animate) {
        if (show && (mInEditMode || hasItemsToShow())) {
        if (show) {
            if (getVisibility() != View.VISIBLE) {
                setVisibility(View.VISIBLE);
                vibrate();
@@ -425,7 +414,7 @@ public class SearchPanelView extends FrameLayout implements StatusBarPanel,
                mPicker.cleanup();
            } else if (v == mLogo || v == mLogoLeft || v == mLogoRight) {
                mSelectedView = (ImageView) v;
                mPicker.pickShortcut();
                mPicker.pickShortcut(v != mLogo);
            }
        }
    }
@@ -464,11 +453,11 @@ public class SearchPanelView extends FrameLayout implements StatusBarPanel,

    private void updateDrawables() {
        mTargetActivities = NavigationRingHelpers.getTargetActions(mContext);
        boolean assistantAvailable = isAssistantAvailable();
        for (int i = 0; i < NavigationRingHelpers.MAX_ACTIONS; i++) {
            ImageView target = mTargetViews.get(i);
            String action = mTargetActivities[i];
            if (assistantAvailable && ((TextUtils.isEmpty(action) && target == mLogo)

            if (isAssistantAvailable() && ((TextUtils.isEmpty(action) && target == mLogo)
                    || ACTION_ASSIST.equals(action))) {
                maybeSwapSearchIcon(target);
                continue;
@@ -483,6 +472,10 @@ public class SearchPanelView extends FrameLayout implements StatusBarPanel,
    private void updateTargetVisibility() {
        for (int i = 0; i < mTargetViews.size(); i++) {
            View v = mTargetViews.get(i);
            // Special case, middle target never be invisible
            if (v == mLogo) {
                continue;
            }
            View parent = (View) v.getParent();
            String action = mTargetActivities[i];
            boolean visible = mInEditMode
+6 −4
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ public class ShortcutPickHelper {
        dialog.show();
    }

    public void pickShortcut() {
    public void pickShortcut(boolean showNone) {
        if (mFetchAppsTask == null) {
            mFetchAppsTask = new FetchAppsTask();
            mFetchAppsTask.execute();
@@ -230,9 +230,11 @@ public class ShortcutPickHelper {
            filter.addDataScheme("package");
            mContext.registerReceiver(mReceiver, filter);
        }

        if (showNone) {
            mActions.addAction(ACTION_NONE, R.string.navring_action_none, 0);

        } else {
            mActions.removeAction(ACTION_NONE);
        }
        AlertDialog.Builder builder = new AlertDialog.Builder(mContext)
                .setTitle(mContext.getString(R.string.navbar_dialog_title))
                .setItems(mActions.getEntries(), new DialogInterface.OnClickListener() {