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

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

Merge "Change day header background in agenda view" into jb-dev

parents bceaf81e e927121e
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
-->
<GridLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@color/agenda_day_bar_background_color"
    android:background="@drawable/agenda_item_bg_primary"
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:columnCount="2"
@@ -55,13 +55,15 @@
    <TextView
        android:id="@+id/day"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_width="0dip"
        android:gravity="center_vertical"
        android:layout_gravity="center_vertical|left"
        android:layout_gravity="center_vertical|fill_horizontal"
        android:layout_column="1"
        android:layout_row="1"
        android:layout_marginTop="2dip"
        android:layout_marginLeft="8dip"
        android:layout_marginRight="16dip"
        android:ellipsize="marquee"
        android:textSize="14sp"
        android:singleLine="true"
        android:minHeight="42dip"
+3 −13
Original line number Diff line number Diff line
@@ -52,17 +52,16 @@ public class AgendaByDayAdapter extends BaseAdapter {
    private Time mTmpTime;
    private String mTimeZone;
    // Note: Formatter is not thread safe. Fine for now as it is only used by the main thread.
    private Formatter mFormatter;
    private StringBuilder mStringBuilder;
    private final Formatter mFormatter;
    private final StringBuilder mStringBuilder;

    static class ViewHolder {
        TextView dayView;
        TextView dateView;
        int julianDay;
        boolean grayed;
    }

    private Runnable mTZUpdater = new Runnable() {
    private final Runnable mTZUpdater = new Runnable() {
        @Override
        public void run() {
            mTimeZone = Utils.getTimeZone(mContext, this);
@@ -192,7 +191,6 @@ public class AgendaByDayAdapter extends BaseAdapter {
                holder.dayView = (TextView) agendaDayView.findViewById(R.id.day);
                holder.dateView = (TextView) agendaDayView.findViewById(R.id.date);
                holder.julianDay = row.mDay;
                holder.grayed = false;
                agendaDayView.setTag(holder);
            }

@@ -232,14 +230,6 @@ public class AgendaByDayAdapter extends BaseAdapter {
            holder.dayView.setText(dayViewText);
            holder.dateView.setText(dateViewText);

            // Set the background of the view, it is grayed for day that are in the past and today
            if (row.mDay > mTodayJulianDay) {
                agendaDayView.setBackgroundResource(R.drawable.agenda_item_bg_primary);
                holder.grayed = false;
            } else {
                agendaDayView.setBackgroundResource(R.drawable.agenda_item_bg_secondary);
                holder.grayed = true;
            }
            return agendaDayView;
        } else if (row.mType == TYPE_MEETING) {
            View itemView = mAgendaAdapter.getView(row.mPosition, convertView, parent);
+1 −8
Original line number Diff line number Diff line
@@ -139,14 +139,7 @@ public class AgendaListView extends ListView implements OnItemClickListener {
        for (int i = 0; i < childCount; ++i) {
            View listItem = getChildAt(i);
            Object o = listItem.getTag();
            if (o instanceof AgendaByDayAdapter.ViewHolder) {
                // day view - check if day in the past and not grayed yet
                AgendaByDayAdapter.ViewHolder holder = (AgendaByDayAdapter.ViewHolder) o;
                if (holder.julianDay <= todayJulianDay && !holder.grayed) {
                    needUpdate = true;
                    break;
                }
            } else if (o instanceof AgendaAdapter.ViewHolder) {
            if (o instanceof AgendaAdapter.ViewHolder) {
                // meeting view - check if event in the past or started already and not grayed yet
                // All day meetings for a day are grayed out
                AgendaAdapter.ViewHolder holder = (AgendaAdapter.ViewHolder) o;