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

Commit bf44e272 authored by Isaac Katzenelson's avatar Isaac Katzenelson
Browse files

Add timely fragment

Change-Id: Ieef1dbc5faa048a896b0ea06404d32e415a8b3b3
parent ddf32b8a
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >
    <ListView
        android:id="@+id/timely_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#FFFFFFFF"/>

</LinearLayout>
+1 −0
Original line number Diff line number Diff line
@@ -222,6 +222,7 @@
        <item>Week</item>
        <item>Month</item>
        <item>Agenda</item>
        <item>Timely</item>
    </string-array>

    <!-- Experimental options for skipping reminders. [CHAR LIMIT = 37] -->
+19 −0
Original line number Diff line number Diff line
@@ -101,6 +101,7 @@ public class AllInOneActivity extends AbstractCalendarActivity implements EventH
    private static final int BUTTON_WEEK_INDEX = 1;
    private static final int BUTTON_MONTH_INDEX = 2;
    private static final int BUTTON_AGENDA_INDEX = 3;
    private static final int BUTTON_TIMELY_INDEX = 4;

    private CalendarController mController;
    private static boolean mIsMultipane;
@@ -487,6 +488,9 @@ public class AllInOneActivity extends AbstractCalendarActivity implements EventH
            case ViewType.MONTH:
                mActionBar.setSelectedNavigationItem(BUTTON_MONTH_INDEX);
                break;
            case ViewType.TIMELY:
                mActionBar.setSelectedNavigationItem(BUTTON_TIMELY_INDEX);
                break;
            default:
                mActionBar.setSelectedNavigationItem(BUTTON_DAY_INDEX);
                break;
@@ -896,6 +900,16 @@ public class AllInOneActivity extends AbstractCalendarActivity implements EventH
                }
                frag = new DayFragment(timeMillis, 1);
                break;
            case ViewType.TIMELY:
              // TODO: support tabs for tablets
//                if (mActionBar = null && (mActionBar.getSelectedTab() != mDayTab)) {
//                    mActionBar.selectTab(mDayTab);
  //              }
                if (mActionBarMenuSpinnerAdapter != null) {
                    mActionBar.setSelectedNavigationItem(CalendarViewAdapter.TIMELY_BUTTON_INDEX);
                }
                frag = new TimelyFragment();
                break;
            case ViewType.MONTH:
                if (mActionBar != null && (mActionBar.getSelectedTab() != mMonthTab)) {
                    mActionBar.selectTab(mMonthTab);
@@ -1289,6 +1303,11 @@ public class AllInOneActivity extends AbstractCalendarActivity implements EventH
                    mController.sendEvent(this, EventType.GO_TO, null, null, -1, ViewType.AGENDA);
                }
                break;
            case CalendarViewAdapter.TIMELY_BUTTON_INDEX:
                if (mCurrentView != ViewType.TIMELY) {
                    mController.sendEvent(this, EventType.GO_TO, null, null, -1, ViewType.TIMELY);
                }
                break;
            default:
                Log.w(TAG, "ItemSelected event from unknown button: " + itemPosition);
                Log.w(TAG, "CurrentView:" + mCurrentView + " Button:" + itemPosition +
+2 −1
Original line number Diff line number Diff line
@@ -139,7 +139,8 @@ public class CalendarController {
        final int WEEK = 3;
        final int MONTH = 4;
        final int EDIT = 5;
        final int MAX_VALUE = 5;
        final int TIMELY = 6;
        final int MAX_VALUE = 6;
    }

    public static class EventInfo {
+16 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ public class CalendarViewAdapter extends BaseAdapter {
    // Week view: show the month + year
    // Month view: show the month + year
    // Agenda view: show day of the week + full date underneath
    // Timely View: Temporary - show  the new timely view
    private int mCurrentMainView;

    private final LayoutInflater mInflater;
@@ -62,6 +63,7 @@ public class CalendarViewAdapter extends BaseAdapter {
    public static final int WEEK_BUTTON_INDEX = 1;
    public static final int MONTH_BUTTON_INDEX = 2;
    public static final int AGENDA_BUTTON_INDEX = 3;
    public static final int TIMELY_BUTTON_INDEX = 4;

    // The current selected event's time, used to calculate the date and day of the week
    // for the buttons.
@@ -203,6 +205,11 @@ public class CalendarViewAdapter extends BaseAdapter {
                    weekDay.setText(buildDayOfWeek());
                    date.setText(buildFullDate());
                    break;
                case ViewType.TIMELY:
                    weekDay.setVisibility(View.VISIBLE);
                    weekDay.setText(buildDayOfWeek());
                    date.setText(buildFullDate());
                    break;
                default:
                    v = null;
                    break;
@@ -232,6 +239,9 @@ public class CalendarViewAdapter extends BaseAdapter {
                case ViewType.AGENDA:
                    title.setText(mButtonNames [AGENDA_BUTTON_INDEX]);
                    break;
                case ViewType.TIMELY:
                    title.setText(mButtonNames [TIMELY_BUTTON_INDEX]);
                    break;
                default:
                    v = null;
                    break;
@@ -286,6 +296,12 @@ public class CalendarViewAdapter extends BaseAdapter {
                    date.setText(buildMonthDayDate());
                }
                break;
            case TIMELY_BUTTON_INDEX:
                viewType.setText(mButtonNames [TIMELY_BUTTON_INDEX]);
                if (mShowDate) {
                    date.setText(buildMonthDayDate());
                }
                break;
            default:
                v = convertView;
                break;
Loading