diff options
author | Isaac Katzenelson <isaack@android.com> | 2013-06-25 23:55:17 +0000 |
---|---|---|
committer | Isaac Katzenelson <isaack@android.com> | 2013-06-25 23:56:08 +0000 |
commit | 21270b873715d23159bc26b0caadfa5cb4d916b4 (patch) | |
tree | a7f3eb5c2e59c2ea919bee3f9112f54a3837696a | |
parent | 97efecdb39c7149fe819f229f9a38401062e7000 (diff) | |
download | android_packages_apps_Calendar-21270b873715d23159bc26b0caadfa5cb4d916b4.tar.gz android_packages_apps_Calendar-21270b873715d23159bc26b0caadfa5cb4d916b4.tar.bz2 android_packages_apps_Calendar-21270b873715d23159bc26b0caadfa5cb4d916b4.zip |
Revert "Add timely fragment"
This reverts commit bf44e272f0c5a6df2217e2efae2ae4ec0b24e073.
Change-Id: Ib8e7d1df0b686c5951d15884827effd604efa120
(cherry picked from commit 376fa68925efc5a9ddd38ed1013c2fa57255f8f2)
-rw-r--r-- | res/layout/timely_fragment.xml | 28 | ||||
-rw-r--r-- | res/values/arrays.xml | 1 | ||||
-rw-r--r-- | src/com/android/calendar/AllInOneActivity.java | 19 | ||||
-rw-r--r-- | src/com/android/calendar/CalendarController.java | 3 | ||||
-rw-r--r-- | src/com/android/calendar/CalendarViewAdapter.java | 16 | ||||
-rw-r--r-- | src/com/android/calendar/TimelyFragment.java | 151 |
6 files changed, 1 insertions, 217 deletions
diff --git a/res/layout/timely_fragment.xml b/res/layout/timely_fragment.xml deleted file mode 100644 index 8f94fbe1..00000000 --- a/res/layout/timely_fragment.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?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> diff --git a/res/values/arrays.xml b/res/values/arrays.xml index 9b1c7a2b..b14854a3 100644 --- a/res/values/arrays.xml +++ b/res/values/arrays.xml @@ -222,7 +222,6 @@ <item>Week</item> <item>Month</item> <item>Agenda</item> - <item>Timely</item> </string-array> <!-- Experimental options for skipping reminders. [CHAR LIMIT = 37] --> diff --git a/src/com/android/calendar/AllInOneActivity.java b/src/com/android/calendar/AllInOneActivity.java index 1c8fa9c9..d7d553f4 100644 --- a/src/com/android/calendar/AllInOneActivity.java +++ b/src/com/android/calendar/AllInOneActivity.java @@ -101,7 +101,6 @@ 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; @@ -488,9 +487,6 @@ 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; @@ -900,16 +896,6 @@ 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); @@ -1303,11 +1289,6 @@ 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 + diff --git a/src/com/android/calendar/CalendarController.java b/src/com/android/calendar/CalendarController.java index bf5b6d36..15733715 100644 --- a/src/com/android/calendar/CalendarController.java +++ b/src/com/android/calendar/CalendarController.java @@ -139,8 +139,7 @@ public class CalendarController { final int WEEK = 3; final int MONTH = 4; final int EDIT = 5; - final int TIMELY = 6; - final int MAX_VALUE = 6; + final int MAX_VALUE = 5; } public static class EventInfo { diff --git a/src/com/android/calendar/CalendarViewAdapter.java b/src/com/android/calendar/CalendarViewAdapter.java index c82bc9b4..f07d4d8a 100644 --- a/src/com/android/calendar/CalendarViewAdapter.java +++ b/src/com/android/calendar/CalendarViewAdapter.java @@ -50,7 +50,6 @@ 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; @@ -63,7 +62,6 @@ 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. @@ -205,11 +203,6 @@ 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; @@ -239,9 +232,6 @@ 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; @@ -296,12 +286,6 @@ 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; diff --git a/src/com/android/calendar/TimelyFragment.java b/src/com/android/calendar/TimelyFragment.java deleted file mode 100644 index e3df4944..00000000 --- a/src/com/android/calendar/TimelyFragment.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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. - */ - -package com.android.calendar; - -import android.app.Fragment; -import android.content.Context; -import android.graphics.Color; -import android.graphics.Typeface; -import android.os.Bundle; -import android.text.format.Time; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.ListView; -import android.widget.TextView; - -import com.android.calendar.CalendarController.EventInfo; -import com.android.calendar.CalendarController.EventType; - -/** - * This is the base class for Day and Week Activities. - */ -public class TimelyFragment extends Fragment implements CalendarController.EventHandler { - - ListView mList; - TimelyAdapter mAdapter; - - public TimelyFragment() { - } - - @Override - public void onCreate(Bundle icicle) { - super.onCreate(icicle); - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - View v = inflater.inflate(R.layout.timely_fragment, null); - ListView mList = (ListView)v.findViewById(R.id.timely_list); - if (mList != null) { - mAdapter = new TimelyAdapter(getActivity()); - mList.setAdapter(mAdapter); - } - return v; - } - - - private void goTo(Time goToTime, boolean ignoreTime, boolean animateToday) { - } - - @Override - public void eventsChanged() { - } - - @Override - public void handleEvent(EventInfo msg) { - if (msg.eventType == EventType.GO_TO) { - goTo(msg.selectedTime, (msg.extraLong & CalendarController.EXTRA_GOTO_DATE) != 0, - (msg.extraLong & CalendarController.EXTRA_GOTO_TODAY) != 0); - } else if (msg.eventType == EventType.EVENTS_CHANGED) { - eventsChanged(); - } - } - - @Override - public long getSupportedEventTypes() { - return 0; - } - - private class TimelyAdapter extends BaseAdapter { - private static final int EVENT_NUM = 10000; - int [] mTypes = new int [EVENT_NUM]; - Context mContext; - - public TimelyAdapter(Context c) { - mContext = c; - for (int i = 0; i < EVENT_NUM; i++) { - if (i % 30 == 0) { - mTypes[i] = 0; // month - } else { - if (Math.random() < 0.75) { - mTypes[i] = 1; // full day - } else { - mTypes[i] = 2; //empty day - } - } - } - } - - @Override - public int getCount() { - return EVENT_NUM; - } - - @Override - public Object getItem(int arg0) { - return null; - } - - @Override - public long getItemId(int arg0) { - return arg0; - } - - @Override - public View getView(int position, View v, ViewGroup arg2) { - TextView view; - if (v == null) { - view = new TextView(mContext); - } else { - view = (TextView) v; - } - if (mTypes[position] == 0) { - view.setTextColor(Color.RED); - view.setHeight(100); - view.setText(" Month Header"); - view.setTypeface(Typeface.DEFAULT_BOLD); - view.setTextSize(30); - } else if (mTypes[position] == 1) { - view.setTextColor(Color.BLACK); - view.setHeight(250); - view.setText(" Day with events"); - view.setTypeface(Typeface.DEFAULT); - view.setTextSize(30); - } else { - view.setTextColor(Color.GRAY); - view.setHeight(100); - view.setText(" Empty Day"); - view.setTypeface(Typeface.DEFAULT); - view.setTextSize(30); - } - return view; - } - } -} |