summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaj Yengisetty <rajesh@cyngn.com>2014-11-10 18:35:00 (GMT)
committerAdnan <adnan@cyngn.com>2014-11-19 23:53:57 (GMT)
commit7360319a4322bc042a3cad30030070273a8d6c80 (patch)
tree2508062938db2a171514091cfaf24100ebe6e34d
parent2d1bb4321c662ee7b192b90c9476d6293c1f4885 (diff)
downloadandroid_packages_apps_Trebuchet-7360319a4322bc042a3cad30030070273a8d6c80.zip
android_packages_apps_Trebuchet-7360319a4322bc042a3cad30030070273a8d6c80.tar.gz
android_packages_apps_Trebuchet-7360319a4322bc042a3cad30030070273a8d6c80.tar.bz2
Replace ugly Drawer setting (Sort Mode)
Change-Id: Iabedd48c43cd30ea747af093fad6d3874495bced
-rw-r--r--src/com/android/launcher3/Launcher.java2
-rw-r--r--src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java18
2 files changed, 17 insertions, 3 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 1c07194..c4311bc 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -3347,7 +3347,7 @@ public class Launcher extends Activity
}
}
- protected AppsCustomizePagedView getAppsCustomizeContent() {
+ public AppsCustomizePagedView getAppsCustomizeContent() {
return mAppsCustomizeContent;
}
diff --git a/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java b/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
index dcf8801..22bfb60 100644
--- a/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
+++ b/src/com/android/launcher3/list/SettingsPinnedHeaderAdapter.java
@@ -12,8 +12,9 @@ import android.view.ViewGroup;
import android.widget.TextView;
import com.android.launcher3.Launcher;
import com.android.launcher3.OverviewSettingsPanel;
-import com.android.launcher3.PagedView;
+import com.android.launcher3.AppsCustomizePagedView;
import com.android.launcher3.R;
+
import com.android.launcher3.settings.SettingsProvider;
import android.view.View.OnClickListener;
import android.content.SharedPreferences;
@@ -214,7 +215,7 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
mLauncher.updateDynamicGrid();
} else if (value.equals(res
.getString(R.string.drawer_sorting_text))) {
- mLauncher.onClickSortModeButton(v);
+ onClickTransitionEffectButton();
} else if (value.equals(res
.getString(R.string.scroll_effect_text)) &&
((Integer)v.getTag() == OverviewSettingsPanel.DRAWER_SETTINGS_POSITION)) {
@@ -302,4 +303,17 @@ public class SettingsPinnedHeaderAdapter extends PinnedHeaderListAdapter {
R.string.setting_state_on);
((TextView) v.findViewById(R.id.item_state)).setText(state);
}
+
+ private void onClickTransitionEffectButton() {
+ int sort = SettingsProvider.getIntCustomDefault(mLauncher,
+ SettingsProvider.SETTINGS_UI_DRAWER_SORT_MODE, 0);
+
+ sort = (sort + 1) % AppsCustomizePagedView.SortMode.values().length;
+ mLauncher.getAppsCustomizeContent().setSortMode(
+ AppsCustomizePagedView.SortMode.getModeForValue(sort));
+
+ SettingsProvider.putInt(mLauncher, SettingsProvider.SETTINGS_UI_DRAWER_SORT_MODE, sort);
+
+ notifyDataSetChanged();
+ }
}