Make landscape all apps caret clickable when in all apps as well as workspace am: 5441a9d30a

Change-Id: Iad49b3b93c3443c487193f901c1c28c52d27b419
This commit is contained in:
Adam Cohen 2017-07-14 22:10:06 +00:00
commit 1add00e874
4 changed files with 28 additions and 11 deletions

View File

@ -60,13 +60,6 @@
android:id="@+id/overview_panel"
android:visibility="gone" />
<com.android.launcher3.pageindicators.PageIndicatorCaretLandscape
android:id="@+id/page_indicator"
android:theme="@style/HomeScreenElementTheme"
android:layout_width="@dimen/dynamic_grid_min_page_indicator_size"
android:layout_height="@dimen/dynamic_grid_min_page_indicator_size"
android:layout_gravity="bottom|left"/>
<include layout="@layout/widgets_view"
android:id="@+id/widgets_view"
android:layout_width="match_parent"
@ -79,6 +72,13 @@
android:layout_height="match_parent"
android:visibility="invisible" />
<com.android.launcher3.pageindicators.PageIndicatorCaretLandscape
android:id="@+id/page_indicator"
android:theme="@style/HomeScreenElementTheme"
android:layout_width="@dimen/dynamic_grid_min_page_indicator_size"
android:layout_height="@dimen/dynamic_grid_min_page_indicator_size"
android:layout_gravity="bottom|left"/>
</com.android.launcher3.dragndrop.DragLayer>
</com.android.launcher3.LauncherRootView>

View File

@ -26,7 +26,7 @@
<!-- Dynamic grid -->
<dimen name="dynamic_grid_overview_bar_item_width">120dp</dimen>
<dimen name="dynamic_grid_min_page_indicator_size">24dp</dimen>
<dimen name="dynamic_grid_min_page_indicator_size">48dp</dimen>
<dimen name="folder_preview_padding">5dp</dimen>
<!-- Hotseat -->

View File

@ -2256,8 +2256,9 @@ public class Launcher extends BaseActivity
if (v instanceof FolderIcon) {
onClickFolderIcon(v);
}
} else if ((FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && v instanceof PageIndicator) ||
(v == mAllAppsButton && mAllAppsButton != null)) {
} else if ((FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP && v instanceof PageIndicator)) {
onClickAllAppsCaret(v);
} else if (v == mAllAppsButton && mAllAppsButton != null) {
onClickAllAppsButton(v);
} else if (tag instanceof AppInfo) {
startAppShortcutOrInfoActivity(v);
@ -2322,6 +2323,22 @@ public class Launcher extends BaseActivity
}
}
/**
* Event handler for the swipe up caret
*
* @param v The view that was clicked.
*/
protected void onClickAllAppsCaret(View v) {
if (LOGD) Log.d(TAG, "onClickAllAppsCaret");
if (!isAppsViewVisible()) {
getUserEventDispatcher().logActionOnControl(Action.Touch.TAP,
ControlType.ALL_APPS_BUTTON);
showAppsView(true /* animated */, true /* updatePredictedApps */);
} else {
showWorkspace(true);
}
}
private void onClickPendingAppItem(final View v, final String packageName,
boolean downloadStarted) {
if (downloadStarted) {

View File

@ -57,7 +57,7 @@ public class PageIndicatorCaretLandscape extends PageIndicator {
protected void onDraw(Canvas canvas) {
Rect drawableBounds = getCaretDrawable().getBounds();
int count = canvas.save();
canvas.translate(getWidth() - drawableBounds.width(),
canvas.translate((getWidth() - drawableBounds.width()) / 2,
getHeight() - drawableBounds.height());
getCaretDrawable().draw(canvas);
canvas.restoreToCount(count);