From 97fcaba272915d3c9399337363c16433d0fe4b3a Mon Sep 17 00:00:00 2001 From: Raj Yengisetty Date: Tue, 9 Sep 2014 22:26:43 -0700 Subject: Re-add Fade side pages and Page outline options. Change-Id: Iaab1dbd980d065e631d8f3cfe363f3a0b5897f86 --- .../action_navigation_previous_light.png | Bin 0 -> 627 bytes res/drawable-hdpi/overflow_options_menu.png | Bin 0 -> 342 bytes .../action_navigation_previous_light.png | Bin 0 -> 409 bytes res/drawable-mdpi/overflow_options_menu.png | Bin 0 -> 216 bytes .../action_navigation_previous_light.png | Bin 0 -> 810 bytes res/drawable-xhdpi/overflow_options_menu.png | Bin 0 -> 355 bytes .../action_navigation_previous_light.png | Bin 0 -> 1327 bytes res/drawable-xxhdpi/overflow_options_menu.png | Bin 0 -> 617 bytes res/drawable/handle_left.png | Bin 370 -> 0 bytes res/layout/dynamic_grid_size_screen.xml | 4 +- res/layout/settings_transitions_screen.xml | 66 ++++++++++++++------- src/com/android/launcher3/Launcher.java | 12 ++-- .../launcher3/TransitionEffectsFragment.java | 26 ++++---- .../list/SettingsPinnedHeaderAdapter.java | 4 +- 14 files changed, 67 insertions(+), 45 deletions(-) create mode 100644 res/drawable-hdpi/action_navigation_previous_light.png create mode 100644 res/drawable-hdpi/overflow_options_menu.png create mode 100644 res/drawable-mdpi/action_navigation_previous_light.png create mode 100644 res/drawable-mdpi/overflow_options_menu.png create mode 100644 res/drawable-xhdpi/action_navigation_previous_light.png create mode 100644 res/drawable-xhdpi/overflow_options_menu.png create mode 100644 res/drawable-xxhdpi/action_navigation_previous_light.png create mode 100644 res/drawable-xxhdpi/overflow_options_menu.png delete mode 100644 res/drawable/handle_left.png diff --git a/res/drawable-hdpi/action_navigation_previous_light.png b/res/drawable-hdpi/action_navigation_previous_light.png new file mode 100644 index 000000000..874466f73 Binary files /dev/null and b/res/drawable-hdpi/action_navigation_previous_light.png differ diff --git a/res/drawable-hdpi/overflow_options_menu.png b/res/drawable-hdpi/overflow_options_menu.png new file mode 100644 index 000000000..a074c10d0 Binary files /dev/null and b/res/drawable-hdpi/overflow_options_menu.png differ diff --git a/res/drawable-mdpi/action_navigation_previous_light.png b/res/drawable-mdpi/action_navigation_previous_light.png new file mode 100644 index 000000000..f50c8f2b5 Binary files /dev/null and b/res/drawable-mdpi/action_navigation_previous_light.png differ diff --git a/res/drawable-mdpi/overflow_options_menu.png b/res/drawable-mdpi/overflow_options_menu.png new file mode 100644 index 000000000..b6d614fca Binary files /dev/null and b/res/drawable-mdpi/overflow_options_menu.png differ diff --git a/res/drawable-xhdpi/action_navigation_previous_light.png b/res/drawable-xhdpi/action_navigation_previous_light.png new file mode 100644 index 000000000..22bd16362 Binary files /dev/null and b/res/drawable-xhdpi/action_navigation_previous_light.png differ diff --git a/res/drawable-xhdpi/overflow_options_menu.png b/res/drawable-xhdpi/overflow_options_menu.png new file mode 100644 index 000000000..7be3c2a4f Binary files /dev/null and b/res/drawable-xhdpi/overflow_options_menu.png differ diff --git a/res/drawable-xxhdpi/action_navigation_previous_light.png b/res/drawable-xxhdpi/action_navigation_previous_light.png new file mode 100644 index 000000000..ca3d00c4e Binary files /dev/null and b/res/drawable-xxhdpi/action_navigation_previous_light.png differ diff --git a/res/drawable-xxhdpi/overflow_options_menu.png b/res/drawable-xxhdpi/overflow_options_menu.png new file mode 100644 index 000000000..a0cb8a418 Binary files /dev/null and b/res/drawable-xxhdpi/overflow_options_menu.png differ diff --git a/res/drawable/handle_left.png b/res/drawable/handle_left.png deleted file mode 100644 index b78889ec0..000000000 Binary files a/res/drawable/handle_left.png and /dev/null differ diff --git a/res/layout/dynamic_grid_size_screen.xml b/res/layout/dynamic_grid_size_screen.xml index 5109e73d8..f7cafaff0 100644 --- a/res/layout/dynamic_grid_size_screen.xml +++ b/res/layout/dynamic_grid_size_screen.xml @@ -21,7 +21,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:adjustViewBounds="true" - android:src="@drawable/handle_left" /> + android:src="@drawable/action_navigation_previous_light" /> diff --git a/res/layout/settings_transitions_screen.xml b/res/layout/settings_transitions_screen.xml index 8457841a5..dd47636e2 100644 --- a/res/layout/settings_transitions_screen.xml +++ b/res/layout/settings_transitions_screen.xml @@ -7,32 +7,54 @@ android:paddingTop="@dimen/overview_panel_bottom_padding" android:clickable="true" > - + - + android:orientation="horizontal" + android:background="@drawable/listitem_bg" + android:layout_alignParentLeft="true" + android:clickable="true" > - + + + + + - + android:orientation="horizontal" + android:layout_alignParentRight="true" + android:background="@drawable/listitem_bg" + android:clickable="true" > + + + + - + \ No newline at end of file diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 2ddb5271c..17ddb7e7e 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1450,7 +1450,7 @@ public class Launcher extends Activity anim.addListener(mAnimatorListener); } - public void onClickTransitionEffectOverflowMenuButton(View v) { + public void onClickTransitionEffectOverflowMenuButton(View v, final boolean drawer) { final PopupMenu popupMenu = new PopupMenu(this, v); final Menu menu = popupMenu.getMenu(); @@ -1458,22 +1458,22 @@ public class Launcher extends Activity MenuItem pageOutlines = menu.findItem(R.id.scrolling_page_outlines); MenuItem fadeAdjacent = menu.findItem(R.id.scrolling_fade_adjacent); - pageOutlines.setVisible(!isAllAppsVisible()); + pageOutlines.setVisible(!drawer); pageOutlines.setChecked(SettingsProvider.getBoolean(this, SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_PAGE_OUTLINES, R.bool.preferences_interface_homescreen_scrolling_page_outlines_default )); fadeAdjacent.setChecked(SettingsProvider.getBoolean(this, - !isAllAppsVisible() ? + !drawer ? SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_FADE_ADJACENT : SettingsProvider.SETTINGS_UI_DRAWER_SCROLLING_FADE_ADJACENT, - !isAllAppsVisible() ? + !drawer ? R.bool.preferences_interface_homescreen_scrolling_fade_adjacent_default : R.bool.preferences_interface_drawer_scrolling_fade_adjacent_default )); - final PagedView pagedView = !isAllAppsVisible() ? mWorkspace : mAppsCustomizeContent; + final PagedView pagedView = !drawer ? mWorkspace : mAppsCustomizeContent; popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override @@ -1486,7 +1486,7 @@ public class Launcher extends Activity break; case R.id.scrolling_fade_adjacent: SettingsProvider.get(Launcher.this).edit() - .putBoolean(!isAllAppsVisible() ? + .putBoolean(!drawer ? SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_FADE_ADJACENT : SettingsProvider.SETTINGS_UI_DRAWER_SCROLLING_FADE_ADJACENT, !item.isChecked()).commit(); pagedView.setFadeInAdjacentScreens(!item.isChecked()); diff --git a/src/com/android/launcher3/TransitionEffectsFragment.java b/src/com/android/launcher3/TransitionEffectsFragment.java index bb7c5abf2..8f51e2435 100644 --- a/src/com/android/launcher3/TransitionEffectsFragment.java +++ b/src/com/android/launcher3/TransitionEffectsFragment.java @@ -2,19 +2,13 @@ package com.android.launcher3; import android.animation.Animator; import android.animation.ObjectAnimator; -import android.animation.ValueAnimator; import android.app.Fragment; import android.content.Context; -import android.content.Intent; -import android.content.res.Resources; import android.content.res.TypedArray; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; import android.graphics.Color; import android.graphics.drawable.AnimationDrawable; import android.os.Bundle; import android.util.DisplayMetrics; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; @@ -24,7 +18,6 @@ import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListView; -import android.widget.ScrollView; import android.widget.TextView; import com.android.launcher3.settings.SettingsProvider; @@ -40,7 +33,7 @@ public class TransitionEffectsFragment extends Fragment { TypedArray mTransitionDrawables; String mCurrentState; int mCurrentPosition; - boolean mPageOrDrawer; + boolean mIsDrawer; String mSettingsProviderValue; int mPreferenceValue; @@ -78,19 +71,19 @@ public class TransitionEffectsFragment extends Fragment { View v = inflater.inflate(R.layout.settings_transitions_screen, container, false); mListView = (ListView) v.findViewById(R.id.settings_transitions_list); - Launcher launcher = (Launcher) getActivity(); + final Launcher launcher = (Launcher) getActivity(); LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) mListView.getLayoutParams(); lp.bottomMargin = ((FrameLayout.LayoutParams) launcher.getOverviewPanel() .findViewById(R.id.settings_container).getLayoutParams()).bottomMargin; mListView.setLayoutParams(lp); - mPageOrDrawer = getArguments().getBoolean(PAGE_OR_DRAWER_SCROLL_SELECT); + mIsDrawer = getArguments().getBoolean(PAGE_OR_DRAWER_SCROLL_SELECT); - mSettingsProviderValue = mPageOrDrawer ? + mSettingsProviderValue = mIsDrawer ? SettingsProvider.SETTINGS_UI_DRAWER_SCROLLING_TRANSITION_EFFECT : SettingsProvider.SETTINGS_UI_HOMESCREEN_SCROLLING_TRANSITION_EFFECT; - mPreferenceValue = mPageOrDrawer ? R.string.preferences_interface_drawer_scrolling_transition_effect + mPreferenceValue = mIsDrawer ? R.string.preferences_interface_drawer_scrolling_transition_effect : R.string.preferences_interface_homescreen_scrolling_transition_effect; mTransitionIcon = (ImageView) v.findViewById(R.id.settings_transition_image); @@ -103,6 +96,13 @@ public class TransitionEffectsFragment extends Fragment { setEffect(); } }); + View options = v.findViewById(R.id.transition_options_menu); + options.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + launcher.onClickTransitionEffectOverflowMenuButton(view, mIsDrawer); + } + }); String[] titles = getResources().getStringArray( R.array.transition_effect_entries); @@ -124,7 +124,7 @@ public class TransitionEffectsFragment extends Fragment { } public void setEffect() { - ((Launcher) getActivity()).setTransitionEffect(mPageOrDrawer, mCurrentState); + ((Launcher) getActivity()).setTransitionEffect(mIsDrawer, mCurrentState); } private int mapEffectToPosition(String effect) { diff --git a/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java b/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java index b09d1d716..35949e049 100644 --- a/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java +++ b/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java @@ -312,7 +312,7 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter { mLauncher.onClickTransitionEffectButton(v, true); break; case 1: - onClickTransitionEffectButton(); + onClickSortButton(); break; case 2: onIconLabelsBooleanChanged(v, @@ -380,7 +380,7 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter { ((TextView) v.findViewById(R.id.item_state)).setText(state); } - private void onClickTransitionEffectButton() { + private void onClickSortButton() { int sort = SettingsProvider.getIntCustomDefault(mLauncher, SettingsProvider.SETTINGS_UI_DRAWER_SORT_MODE, 0); -- cgit v1.2.3