Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe641eee authored by Isaac Katzenelson's avatar Isaac Katzenelson Committed by Android (Google) Code Review
Browse files

Merge "Fix calendar controls" into jb-dev

parents 4e4e4dd3 31489e97
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,10 @@
        android:showAsAction="collapseActionView"
        android:actionViewClass="android.widget.SearchView"
        android:imeOptions="actionSearch" />
    <item
        android:id="@+id/action_hide_controls"
        android:alphabeticShortcut="h"
        android:title="@string/hide_controls" />
    <item
        android:id="@+id/action_settings"
        android:alphabeticShortcut="s"
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!-- turn on/off the mini-calendar and calendar picker -->
    <!-- supported only for x-large devices  -->
    <bool name="show_calendar_controls">false</bool>
    <bool name="show_calendar_controls">true</bool>
    <!-- turn on/off month with agenda view -->
    <!-- not supported for X-large devices -->
    <bool name="show_agenda_with_month">false</bool>
+17 −11
Original line number Diff line number Diff line
@@ -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) {
                    // hide minimonth and calendar frag
                    mShowSideViews = false;
                boolean noControlsView = event.viewType == ViewType.MONTH || event.viewType == ViewType.AGENDA;
                if (mControlsMenu != null) {
                        mControlsMenu.setVisible(false);
                        mControlsMenu.setEnabled(false);
                    mControlsMenu.setVisible(!noControlsView);
                    mControlsMenu.setEnabled(!noControlsView);
                }
                if (noControlsView || mHideControls) {
                    // hide minimonth and calendar frag
                    mShowSideViews = 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)) {
+2 −0
Original line number Diff line number Diff line
@@ -63,6 +63,8 @@ public class GeneralPreferences extends PreferenceFragment implements
    public static final String KEY_ALERTS_RINGTONE = "preferences_alerts_ringtone";
    public static final String KEY_ALERTS_POPUP = "preferences_alerts_popup";

    public static final String KEY_SHOW_CONTROLS = "preferences_show_controls";

    public static final String KEY_DEFAULT_REMINDER = "preferences_default_reminder";
    public static final int NO_REMINDER = -1;
    public static final String NO_REMINDER_STRING = "-1";