summaryrefslogtreecommitdiffstats
path: root/src/com/android/calendar/AllInOneActivity.java
diff options
context:
space:
mode:
authorIsaac Katzenelson <isaack@android.com>2012-05-14 11:25:58 -0700
committerIsaac Katzenelson <isaack@android.com>2012-05-16 21:13:21 -0700
commit31489e9749cbcb6574b6b60c7942241aa2d8df7b (patch)
tree4d279477ae2dd6af0b389f00077baed699bd1ed1 /src/com/android/calendar/AllInOneActivity.java
parent6832f8d86daf40936c9d3af4d9940e4dce1f082a (diff)
downloadandroid_packages_apps_Calendar-31489e9749cbcb6574b6b60c7942241aa2d8df7b.tar.gz
android_packages_apps_Calendar-31489e9749cbcb6574b6b60c7942241aa2d8df7b.tar.bz2
android_packages_apps_Calendar-31489e9749cbcb6574b6b60c7942241aa2d8df7b.zip
Fix calendar controls
Bug: 6443923 Missing control over visible calendars in portrait on nakasi Change-Id: I698c4a1b043dcd2210ee02a50e76c5dbe8fc0c73
Diffstat (limited to 'src/com/android/calendar/AllInOneActivity.java')
-rw-r--r--src/com/android/calendar/AllInOneActivity.java28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/com/android/calendar/AllInOneActivity.java b/src/com/android/calendar/AllInOneActivity.java
index 06a122ec..2399a7a2 100644
--- a/src/com/android/calendar/AllInOneActivity.java
+++ b/src/com/android/calendar/AllInOneActivity.java
@@ -374,10 +374,13 @@ public class AllInOneActivity extends Activity implements EventHandler,
mControlsAnimateHeight = (int)res.getDimension(R.dimen.calendar_controls_height);
+ mHideControls = !Utils.getSharedPreference(
+ this, GeneralPreferences.KEY_SHOW_CONTROLS, true);
mIsMultipane = Utils.getConfigBool(this, R.bool.multiple_pane_config);
mIsTabletConfig = Utils.getConfigBool(this, R.bool.tablet_config);
mShowAgendaWithMonth = Utils.getConfigBool(this, R.bool.show_agenda_with_month);
- mShowCalendarControls = Utils.getConfigBool(this, R.bool.show_calendar_controls);
+ mShowCalendarControls =
+ Utils.getConfigBool(this, R.bool.show_calendar_controls);
mShowEventDetailsWithAgenda =
Utils.getConfigBool(this, R.bool.show_event_details_with_agenda);
mShowEventInfoFullScreenAgenda =
@@ -783,7 +786,14 @@ public class AllInOneActivity extends Activity implements EventHandler,
return true;
case R.id.action_hide_controls:
mHideControls = !mHideControls;
+ Utils.setSharedPreference(
+ this, GeneralPreferences.KEY_SHOW_CONTROLS, !mHideControls);
item.setTitle(mHideControls ? mShowString : mHideString);
+ if (!mHideControls) {
+ mMiniMonth.setVisibility(View.VISIBLE);
+ mCalendarsList.setVisibility(View.VISIBLE);
+ mMiniMonthContainer.setVisibility(View.VISIBLE);
+ }
final ObjectAnimator slideAnimation = ObjectAnimator.ofInt(this, "controlsOffset",
mHideControls ? 0 : mControlsAnimateWidth,
mHideControls ? mControlsAnimateWidth : 0);
@@ -1088,17 +1098,17 @@ public class AllInOneActivity extends Activity implements EventHandler,
if (mSearchView != null) {
mSearchView.clearFocus();
}
-
if (mShowCalendarControls) {
int animationSize = (mOrientation == Configuration.ORIENTATION_LANDSCAPE) ?
mControlsAnimateWidth : mControlsAnimateHeight;
- if (event.viewType == ViewType.MONTH || event.viewType == ViewType.AGENDA) {
+ boolean noControlsView = event.viewType == ViewType.MONTH || event.viewType == ViewType.AGENDA;
+ if (mControlsMenu != null) {
+ mControlsMenu.setVisible(!noControlsView);
+ mControlsMenu.setEnabled(!noControlsView);
+ }
+ if (noControlsView || mHideControls) {
// hide minimonth and calendar frag
mShowSideViews = false;
- if (mControlsMenu != null) {
- mControlsMenu.setVisible(false);
- mControlsMenu.setEnabled(false);
- }
if (!mHideControls) {
final ObjectAnimator slideAnimation = ObjectAnimator.ofInt(this,
"controlsOffset", 0, animationSize);
@@ -1117,10 +1127,6 @@ public class AllInOneActivity extends Activity implements EventHandler,
mMiniMonth.setVisibility(View.VISIBLE);
mCalendarsList.setVisibility(View.VISIBLE);
mMiniMonthContainer.setVisibility(View.VISIBLE);
- if (mControlsMenu != null) {
- mControlsMenu.setVisible(true);
- mControlsMenu.setEnabled(true);
- }
if (!mHideControls &&
(mController.getPreviousViewType() == ViewType.MONTH ||
mController.getPreviousViewType() == ViewType.AGENDA)) {