mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
Use TextClock for today's date in event widget
This commit is contained in:
@@ -16,7 +16,10 @@ import com.simplemobiletools.calendar.pro.extensions.launchNewEventIntent
|
|||||||
import com.simplemobiletools.calendar.pro.extensions.widgetsDB
|
import com.simplemobiletools.calendar.pro.extensions.widgetsDB
|
||||||
import com.simplemobiletools.calendar.pro.services.WidgetService
|
import com.simplemobiletools.calendar.pro.services.WidgetService
|
||||||
import com.simplemobiletools.calendar.pro.services.WidgetServiceEmpty
|
import com.simplemobiletools.calendar.pro.services.WidgetServiceEmpty
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||||
|
import com.simplemobiletools.commons.extensions.getColoredBitmap
|
||||||
|
import com.simplemobiletools.commons.extensions.getLaunchIntent
|
||||||
|
import com.simplemobiletools.commons.extensions.setTextSize
|
||||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
|
|
||||||
@@ -46,9 +49,6 @@ class MyWidgetListProvider : AppWidgetProvider() {
|
|||||||
setTextSize(R.id.widget_event_list_today, fontSize)
|
setTextSize(R.id.widget_event_list_today, fontSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
val todayText = Formatter.getLongestDate(getNowSeconds())
|
|
||||||
views.setText(R.id.widget_event_list_today, todayText)
|
|
||||||
|
|
||||||
views.setImageViewBitmap(R.id.widget_event_new_event, context.resources.getColoredBitmap(R.drawable.ic_plus_vector, textColor))
|
views.setImageViewBitmap(R.id.widget_event_new_event, context.resources.getColoredBitmap(R.drawable.ic_plus_vector, textColor))
|
||||||
setupIntent(context, views, NEW_EVENT, R.id.widget_event_new_event)
|
setupIntent(context, views, NEW_EVENT, R.id.widget_event_new_event)
|
||||||
setupIntent(context, views, LAUNCH_CAL, R.id.widget_event_list_today)
|
setupIntent(context, views, LAUNCH_CAL, R.id.widget_event_list_today)
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:src="@drawable/widget_round_background" />
|
android:src="@drawable/widget_round_background" />
|
||||||
|
|
||||||
<TextView
|
<TextClock
|
||||||
android:id="@+id/widget_event_list_today"
|
android:id="@+id/widget_event_list_today"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -23,12 +23,16 @@
|
|||||||
android:layout_alignBottom="@+id/widget_event_go_to_today"
|
android:layout_alignBottom="@+id/widget_event_go_to_today"
|
||||||
android:layout_toStartOf="@+id/widget_event_go_to_today"
|
android:layout_toStartOf="@+id/widget_event_go_to_today"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
|
android:format12Hour="MMM d yyyy (EEEE)"
|
||||||
|
android:format24Hour="MMM d yyyy (EEEE)"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
|
android:includeFontPadding="false"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
|
android:paddingTop="@dimen/medium_margin"
|
||||||
android:paddingEnd="@dimen/medium_margin"
|
android:paddingEnd="@dimen/medium_margin"
|
||||||
android:textSize="@dimen/normal_text_size"
|
android:textSize="@dimen/normal_text_size"
|
||||||
tools:text="July 18" />
|
tools:text="May 25 2022 (Wednesday)" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/widget_event_go_to_today"
|
android:id="@+id/widget_event_go_to_today"
|
||||||
|
Reference in New Issue
Block a user