Merge branch 'master' of github.com:tommasoberlose/another-widget

This commit is contained in:
Tommaso Berlose
2020-10-03 17:36:41 +02:00
66 changed files with 92 additions and 76 deletions

View File

@ -7,7 +7,7 @@ object Constants {
const val RESULT_APP_NAME = "RESULT_APP_NAME"
const val RESULT_APP_PACKAGE = "RESULT_APP_PACKAGE"
const val CUSTOM_FONT_PRODUCT_SANS = 1
const val CUSTOM_FONT_GOOGLE_SANS = 1
enum class ClockBottomMargin(val value: Int) {
NONE(0),
SMALL(1),

View File

@ -91,7 +91,7 @@ object Preferences : KotprefModel() {
var showAcceptedEvents by booleanPref(default = true)
var showOnlyBusyEvents by booleanPref(default = false)
var secondRowInformation by intPref(key = "PREF_SECOND_ROW_INFORMATION", default = 0)
var customFont by intPref(key = "PREF_CUSTOM_FONT", default = Constants.CUSTOM_FONT_PRODUCT_SANS)
var customFont by intPref(key = "PREF_CUSTOM_FONT", default = Constants.CUSTOM_FONT_GOOGLE_SANS)
var customFontFile by stringPref(key = "PREF_CUSTOM_FONT_FILE")
var showNextEvent by booleanPref(key = "PREF_SHOW_NEXT_EVENT", default = true)

View File

@ -751,10 +751,10 @@ class MainWidget : AppWidgetProvider() {
}
// Custom Font
if (Preferences.customFont == Constants.CUSTOM_FONT_PRODUCT_SANS) {
val productSans: Typeface = Typeface.createFromAsset(context.assets, "fonts/product_sans_regular.ttf")
if (Preferences.customFont == Constants.CUSTOM_FONT_GOOGLE_SANS) {
val googleSans: Typeface = Typeface.createFromAsset(context.assets, "fonts/google_sans_regular.ttf")
listOf<TextView>(v.empty_date, v.divider1, v.temp, v.next_event, v.next_event_difference_time, v.next_event_date, v.divider2, v.calendar_temp, v.divider3, v.special_temp).forEach {
it.typeface = productSans
it.typeface = googleSans
}
}