From 1c9a3a615a0b7ba778e233540dc0bd7d54e0b124 Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Thu, 19 Sep 2024 19:05:31 +0530 Subject: [PATCH] Fix event display selector for tablets --- .../SelectCalendarsSimpleAdapter.java | 8 ++++++-- app/src/main/res/layout/mini_calendar_item.xml | 4 ++-- app/src/main/res/values/colors.xml | 16 ++++++++-------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java b/app/src/main/java/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java index 522fb1818..685f34181 100644 --- a/app/src/main/java/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java +++ b/app/src/main/java/com/android/calendar/selectcalendars/SelectCalendarsSimpleAdapter.java @@ -19,6 +19,7 @@ package com.android.calendar.selectcalendars; import android.content.Context; import android.content.res.Resources; import android.database.Cursor; +import android.graphics.PorterDuff; import android.graphics.Rect; import android.provider.CalendarContract.Calendars; import android.view.LayoutInflater; @@ -28,6 +29,7 @@ import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.CheckBox; +import android.widget.ImageView; import android.widget.ListAdapter; import android.widget.TextView; @@ -181,8 +183,8 @@ public class SelectCalendarsSimpleAdapter extends BaseAdapter implements ListAda TextView calendarName = (TextView) view.findViewById(R.id.calendar); calendarName.setText(name); - View colorView = view.findViewById(R.id.color); - colorView.setBackgroundColor(color); + ImageView colorView = view.findViewById(R.id.color); + colorView.setColorFilter(color, PorterDuff.Mode.SRC_ATOP); colorView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { @@ -207,8 +209,10 @@ public class SelectCalendarsSimpleAdapter extends BaseAdapter implements ListAda int textColor; if (selected) { textColor = mColorCalendarVisible; + colorView.setImageResource(R.drawable.circle); } else { textColor = mColorCalendarHidden; + colorView.setImageResource(R.drawable.circle_outline); } calendarName.setTextColor(textColor); diff --git a/app/src/main/res/layout/mini_calendar_item.xml b/app/src/main/res/layout/mini_calendar_item.xml index 7310d015e..23b5dfbc0 100644 --- a/app/src/main/res/layout/mini_calendar_item.xml +++ b/app/src/main/res/layout/mini_calendar_item.xml @@ -20,14 +20,14 @@ android:layout_height="48dip" android:minHeight="?android:attr/listPreferredItemHeight" > - diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index a7747a591..81ca80e0e 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -105,8 +105,8 @@ @android:color/transparent @color/color_default_primary_text - @color/background_color - @color/foreground_color + @color/e_primary_text_color + @color/e_disabled_color @color/color_default_primary_text @color/color_default_secondary_text #61000000 @@ -215,7 +215,7 @@ #303030 @color/bg_black - #FFDDDDDD + @color/colorPrimary @color/color_default_primary_text @color/color_default_secondary_text @color/grid_line_black @@ -293,8 +293,8 @@ #FFDDDDDD - #ffffff - #757575 + @color/calendar_visible + @color/calendar_hidden #ffffff #757575 #61ffffff @@ -322,7 +322,7 @@ #424242 @color/color_non_focus_item_bg - #FFDDDDDD + @color/colorPrimary @color/color_default_primary_text @color/color_default_secondary_text @color/grid_line_dark @@ -399,8 +399,8 @@ #FFDDDDDD - #ffffff - #757575 + @color/calendar_visible + @color/calendar_hidden #ffffff #757575 #61ffffff -- GitLab