fix: some widget sting newlines
This commit is contained in:
parent
ea678ef55e
commit
7951c2cf37
10 changed files with 41 additions and 24 deletions
|
@ -215,6 +215,8 @@ class ProfileStatsConfigure : AppCompatActivity(),
|
|||
extras.getInt(SimpleColorDialog.COLOR)
|
||||
)
|
||||
.apply()
|
||||
(binding.topBackgroundButton as MaterialButton).iconTint =
|
||||
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||
}
|
||||
|
||||
ProfileStatsWidget.PREF_BACKGROUND_FADE -> {
|
||||
|
@ -227,6 +229,8 @@ class ProfileStatsConfigure : AppCompatActivity(),
|
|||
extras.getInt(SimpleColorDialog.COLOR)
|
||||
)
|
||||
.apply()
|
||||
(binding.bottomBackgroundButton as MaterialButton).iconTint =
|
||||
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||
}
|
||||
|
||||
ProfileStatsWidget.PREF_TITLE_TEXT_COLOR -> {
|
||||
|
@ -239,6 +243,8 @@ class ProfileStatsConfigure : AppCompatActivity(),
|
|||
extras.getInt(SimpleColorDialog.COLOR)
|
||||
)
|
||||
.apply()
|
||||
(binding.titleColorButton as MaterialButton).iconTint =
|
||||
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||
}
|
||||
|
||||
ProfileStatsWidget.PREF_STATS_TEXT_COLOR -> {
|
||||
|
@ -251,6 +257,8 @@ class ProfileStatsConfigure : AppCompatActivity(),
|
|||
extras.getInt(SimpleColorDialog.COLOR)
|
||||
)
|
||||
.apply()
|
||||
(binding.statsColorButton as MaterialButton).iconTint =
|
||||
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -173,7 +173,7 @@ class ProfileStatsWidget : AppWidgetProvider() {
|
|||
)
|
||||
setTextViewText(
|
||||
R.id.topRightLabel,
|
||||
context.getString(R.string.episodes_watched)
|
||||
context.getString(R.string.episodes_watched_n)
|
||||
)
|
||||
|
||||
setTextViewText(
|
||||
|
@ -191,7 +191,7 @@ class ProfileStatsWidget : AppWidgetProvider() {
|
|||
)
|
||||
setTextViewText(
|
||||
R.id.bottomRightLabel,
|
||||
context.getString(R.string.chapters_read)
|
||||
context.getString(R.string.chapters_read_n)
|
||||
)
|
||||
|
||||
val intent = Intent(context, ProfileActivity::class.java)
|
||||
|
|
|
@ -10,7 +10,6 @@ import android.graphics.drawable.GradientDrawable
|
|||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.widget.RemoteViews
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import ani.dantotsu.MainActivity
|
||||
import ani.dantotsu.R
|
||||
|
@ -19,7 +18,7 @@ import ani.dantotsu.widgets.WidgetSizeProvider
|
|||
|
||||
/**
|
||||
* Implementation of App Widget functionality.
|
||||
* App Widget Configuration implemented in [UpcomingWidgetConfigureActivity]
|
||||
* App Widget Configuration implemented in [UpcomingWidgetConfigure]
|
||||
*/
|
||||
class UpcomingWidget : AppWidgetProvider() {
|
||||
override fun onUpdate(
|
||||
|
@ -118,7 +117,7 @@ class UpcomingWidget : AppWidgetProvider() {
|
|||
PendingIntent.getActivity(
|
||||
context,
|
||||
1,
|
||||
Intent(context, UpcomingWidgetConfigureActivity::class.java).apply {
|
||||
Intent(context, UpcomingWidgetConfigure::class.java).apply {
|
||||
putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)
|
||||
},
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||
|
|
|
@ -19,12 +19,12 @@ import eltos.simpledialogfragment.color.SimpleColorDialog
|
|||
/**
|
||||
* The configuration screen for the [UpcomingWidget] AppWidget.
|
||||
*/
|
||||
class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
||||
class UpcomingWidgetConfigure : AppCompatActivity(),
|
||||
SimpleDialog.OnDialogResultListener {
|
||||
private var appWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID
|
||||
private var isMonetEnabled = false
|
||||
private var onClickListener = View.OnClickListener {
|
||||
val context = this@UpcomingWidgetConfigureActivity
|
||||
val context = this@UpcomingWidgetConfigure
|
||||
val appWidgetManager = AppWidgetManager.getInstance(context)
|
||||
|
||||
updateAppWidget(
|
||||
|
@ -55,7 +55,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
|||
SimpleColorDialog().title(R.string.custom_theme)
|
||||
.colorPreset(topBackground)
|
||||
.colors(
|
||||
this@UpcomingWidgetConfigureActivity,
|
||||
this@UpcomingWidgetConfigure,
|
||||
SimpleColorDialog.MATERIAL_COLOR_PALLET
|
||||
)
|
||||
.setupColorWheelAlpha(true)
|
||||
|
@ -64,7 +64,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
|||
.gridNumColumn(5)
|
||||
.choiceMode(SimpleColorDialog.SINGLE_CHOICE)
|
||||
.neg()
|
||||
.show(this@UpcomingWidgetConfigureActivity, tag)
|
||||
.show(this@UpcomingWidgetConfigure, tag)
|
||||
}
|
||||
val bottomBackground = prefs.getInt(UpcomingWidget.PREF_BACKGROUND_FADE, Color.parseColor("#00000000"))
|
||||
(binding.bottomBackgroundButton as MaterialButton).iconTint = ColorStateList.valueOf(bottomBackground)
|
||||
|
@ -73,7 +73,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
|||
SimpleColorDialog().title(R.string.custom_theme)
|
||||
.colorPreset(bottomBackground)
|
||||
.colors(
|
||||
this@UpcomingWidgetConfigureActivity,
|
||||
this@UpcomingWidgetConfigure,
|
||||
SimpleColorDialog.MATERIAL_COLOR_PALLET
|
||||
)
|
||||
.setupColorWheelAlpha(true)
|
||||
|
@ -82,7 +82,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
|||
.gridNumColumn(5)
|
||||
.choiceMode(SimpleColorDialog.SINGLE_CHOICE)
|
||||
.neg()
|
||||
.show(this@UpcomingWidgetConfigureActivity, tag)
|
||||
.show(this@UpcomingWidgetConfigure, tag)
|
||||
}
|
||||
val titleTextColor = prefs.getInt(UpcomingWidget.PREF_TITLE_TEXT_COLOR, Color.WHITE)
|
||||
(binding.titleColorButton as MaterialButton).iconTint = ColorStateList.valueOf(titleTextColor)
|
||||
|
@ -91,7 +91,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
|||
SimpleColorDialog().title(R.string.custom_theme)
|
||||
.colorPreset(titleTextColor)
|
||||
.colors(
|
||||
this@UpcomingWidgetConfigureActivity,
|
||||
this@UpcomingWidgetConfigure,
|
||||
SimpleColorDialog.MATERIAL_COLOR_PALLET
|
||||
)
|
||||
.allowCustom(true)
|
||||
|
@ -99,7 +99,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
|||
.gridNumColumn(5)
|
||||
.choiceMode(SimpleColorDialog.SINGLE_CHOICE)
|
||||
.neg()
|
||||
.show(this@UpcomingWidgetConfigureActivity, tag)
|
||||
.show(this@UpcomingWidgetConfigure, tag)
|
||||
}
|
||||
val countdownTextColor = prefs.getInt(UpcomingWidget.PREF_COUNTDOWN_TEXT_COLOR, Color.WHITE)
|
||||
(binding.countdownColorButton as MaterialButton).iconTint = ColorStateList.valueOf(countdownTextColor)
|
||||
|
@ -108,7 +108,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
|||
SimpleColorDialog().title(R.string.custom_theme)
|
||||
.colorPreset(countdownTextColor)
|
||||
.colors(
|
||||
this@UpcomingWidgetConfigureActivity,
|
||||
this@UpcomingWidgetConfigure,
|
||||
SimpleColorDialog.MATERIAL_COLOR_PALLET
|
||||
)
|
||||
.allowCustom(true)
|
||||
|
@ -116,7 +116,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
|||
.gridNumColumn(5)
|
||||
.choiceMode(SimpleColorDialog.SINGLE_CHOICE)
|
||||
.neg()
|
||||
.show(this@UpcomingWidgetConfigureActivity, tag)
|
||||
.show(this@UpcomingWidgetConfigure, tag)
|
||||
}
|
||||
binding.useAppTheme.setOnCheckedChangeListener { _, isChecked ->
|
||||
isMonetEnabled = isChecked
|
||||
|
@ -186,6 +186,8 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
|||
extras.getInt(SimpleColorDialog.COLOR)
|
||||
)
|
||||
.apply()
|
||||
(binding.topBackgroundButton as MaterialButton).iconTint =
|
||||
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||
}
|
||||
|
||||
UpcomingWidget.PREF_BACKGROUND_FADE -> {
|
||||
|
@ -198,6 +200,8 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
|||
extras.getInt(SimpleColorDialog.COLOR)
|
||||
)
|
||||
.apply()
|
||||
(binding.bottomBackgroundButton as MaterialButton).iconTint =
|
||||
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||
}
|
||||
|
||||
UpcomingWidget.PREF_TITLE_TEXT_COLOR -> {
|
||||
|
@ -210,6 +214,8 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
|||
extras.getInt(SimpleColorDialog.COLOR)
|
||||
)
|
||||
.apply()
|
||||
(binding.titleColorButton as MaterialButton).iconTint =
|
||||
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||
}
|
||||
|
||||
UpcomingWidget.PREF_COUNTDOWN_TEXT_COLOR -> {
|
||||
|
@ -222,6 +228,8 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
|||
extras.getInt(SimpleColorDialog.COLOR)
|
||||
)
|
||||
.apply()
|
||||
(binding.countdownColorButton as MaterialButton).iconTint =
|
||||
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue