Loading quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java +10 −2 Original line number Diff line number Diff line Loading @@ -28,14 +28,15 @@ import android.text.StaticLayout; import android.text.TextPaint; import android.util.AttributeSet; import android.view.View; import android.view.accessibility.AccessibilityManager; import androidx.annotation.ColorInt; import androidx.core.content.ContextCompat; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.allapps.FloatingHeaderRow; import com.android.launcher3.allapps.FloatingHeaderView; import com.android.launcher3.util.Themes; /** * A view which shows a horizontal divider Loading @@ -54,6 +55,7 @@ public class AppsDividerView extends View implements FloatingHeaderRow { private final @ColorInt int mStrokeColor; private final @ColorInt int mAllAppsLabelTextColor; private final AccessibilityManager mAccessibilityManager; private Layout mAllAppsLabelLayout; private boolean mShowAllAppsLabel; Loading Loading @@ -87,7 +89,8 @@ public class AppsDividerView extends View implements FloatingHeaderRow { mAllAppsLabelTextColor = ContextCompat.getColor(context, R.color.material_color_on_surface_variant); mShowAllAppsLabel = !ALL_APPS_VISITED_COUNT.hasReachedMax(context); mAccessibilityManager = AccessibilityManager.getInstance(context); setShowAllAppsLabel(!ALL_APPS_VISITED_COUNT.hasReachedMax(context)); } public void setup(FloatingHeaderView parent, FloatingHeaderRow[] rows, boolean tabsHidden) { Loading @@ -99,6 +102,9 @@ public class AppsDividerView extends View implements FloatingHeaderRow { /** {@code true} if all apps label should be shown in place of divider. */ public void setShowAllAppsLabel(boolean showAllAppsLabel) { if (mAccessibilityManager.isEnabled() && !Utilities.isRunningInTestHarness()) { showAllAppsLabel = true; } if (showAllAppsLabel != mShowAllAppsLabel) { mShowAllAppsLabel = showAllAppsLabel; updateDividerType(); Loading Loading @@ -148,6 +154,7 @@ public class AppsDividerView extends View implements FloatingHeaderRow { mDividerType = dividerType; int topPadding; int bottomPadding; setContentDescription(null); switch (dividerType) { case LINE: topPadding = 0; Loading @@ -161,6 +168,7 @@ public class AppsDividerView extends View implements FloatingHeaderRow { bottomPadding = getResources() .getDimensionPixelSize(R.dimen.all_apps_label_bottom_padding); mPaint.setColor(mAllAppsLabelTextColor); setContentDescription(mAllAppsLabelLayout.getText()); break; case NONE: default: Loading quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java +4 −9 Original line number Diff line number Diff line Loading @@ -136,21 +136,16 @@ public class QuickstepOnboardingPrefs { }); } if (!ALL_APPS_VISITED_COUNT.hasReachedMax(launcher)) { if (!Utilities.isRunningInTestHarness()) { launcher.getStateManager().addStateListener(new StateListener<LauncherState>() { @Override public void onStateTransitionComplete(LauncherState finalState) { if (finalState == ALL_APPS) { ALL_APPS_VISITED_COUNT.increment(launcher); return; } boolean hasReachedMaxCount = ALL_APPS_VISITED_COUNT.hasReachedMax(launcher); launcher.getAppsView().getFloatingHeaderView().findFixedRowByType( AppsDividerView.class).setShowAllAppsLabel(!hasReachedMaxCount); if (hasReachedMaxCount) { launcher.getStateManager().removeStateListener(this); } launcher.getAppsView().getFloatingHeaderView() .findFixedRowByType(AppsDividerView.class) .setShowAllAppsLabel(!ALL_APPS_VISITED_COUNT.hasReachedMax(launcher)); } }); } Loading Loading
quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java +10 −2 Original line number Diff line number Diff line Loading @@ -28,14 +28,15 @@ import android.text.StaticLayout; import android.text.TextPaint; import android.util.AttributeSet; import android.view.View; import android.view.accessibility.AccessibilityManager; import androidx.annotation.ColorInt; import androidx.core.content.ContextCompat; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.allapps.FloatingHeaderRow; import com.android.launcher3.allapps.FloatingHeaderView; import com.android.launcher3.util.Themes; /** * A view which shows a horizontal divider Loading @@ -54,6 +55,7 @@ public class AppsDividerView extends View implements FloatingHeaderRow { private final @ColorInt int mStrokeColor; private final @ColorInt int mAllAppsLabelTextColor; private final AccessibilityManager mAccessibilityManager; private Layout mAllAppsLabelLayout; private boolean mShowAllAppsLabel; Loading Loading @@ -87,7 +89,8 @@ public class AppsDividerView extends View implements FloatingHeaderRow { mAllAppsLabelTextColor = ContextCompat.getColor(context, R.color.material_color_on_surface_variant); mShowAllAppsLabel = !ALL_APPS_VISITED_COUNT.hasReachedMax(context); mAccessibilityManager = AccessibilityManager.getInstance(context); setShowAllAppsLabel(!ALL_APPS_VISITED_COUNT.hasReachedMax(context)); } public void setup(FloatingHeaderView parent, FloatingHeaderRow[] rows, boolean tabsHidden) { Loading @@ -99,6 +102,9 @@ public class AppsDividerView extends View implements FloatingHeaderRow { /** {@code true} if all apps label should be shown in place of divider. */ public void setShowAllAppsLabel(boolean showAllAppsLabel) { if (mAccessibilityManager.isEnabled() && !Utilities.isRunningInTestHarness()) { showAllAppsLabel = true; } if (showAllAppsLabel != mShowAllAppsLabel) { mShowAllAppsLabel = showAllAppsLabel; updateDividerType(); Loading Loading @@ -148,6 +154,7 @@ public class AppsDividerView extends View implements FloatingHeaderRow { mDividerType = dividerType; int topPadding; int bottomPadding; setContentDescription(null); switch (dividerType) { case LINE: topPadding = 0; Loading @@ -161,6 +168,7 @@ public class AppsDividerView extends View implements FloatingHeaderRow { bottomPadding = getResources() .getDimensionPixelSize(R.dimen.all_apps_label_bottom_padding); mPaint.setColor(mAllAppsLabelTextColor); setContentDescription(mAllAppsLabelLayout.getText()); break; case NONE: default: Loading
quickstep/src/com/android/quickstep/util/QuickstepOnboardingPrefs.java +4 −9 Original line number Diff line number Diff line Loading @@ -136,21 +136,16 @@ public class QuickstepOnboardingPrefs { }); } if (!ALL_APPS_VISITED_COUNT.hasReachedMax(launcher)) { if (!Utilities.isRunningInTestHarness()) { launcher.getStateManager().addStateListener(new StateListener<LauncherState>() { @Override public void onStateTransitionComplete(LauncherState finalState) { if (finalState == ALL_APPS) { ALL_APPS_VISITED_COUNT.increment(launcher); return; } boolean hasReachedMaxCount = ALL_APPS_VISITED_COUNT.hasReachedMax(launcher); launcher.getAppsView().getFloatingHeaderView().findFixedRowByType( AppsDividerView.class).setShowAllAppsLabel(!hasReachedMaxCount); if (hasReachedMaxCount) { launcher.getStateManager().removeStateListener(this); } launcher.getAppsView().getFloatingHeaderView() .findFixedRowByType(AppsDividerView.class) .setShowAllAppsLabel(!ALL_APPS_VISITED_COUNT.hasReachedMax(launcher)); } }); } Loading