fix: some widget sting newlines
This commit is contained in:
parent
ea678ef55e
commit
7951c2cf37
10 changed files with 41 additions and 24 deletions
|
@ -73,7 +73,7 @@
|
|||
android:resource="@xml/upcoming_widget_info" />
|
||||
</receiver>
|
||||
<activity
|
||||
android:name=".widgets.upcoming.UpcomingWidgetConfigureActivity"
|
||||
android:name=".widgets.upcoming.UpcomingWidgetConfigure"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
|
||||
}
|
|
@ -10,8 +10,8 @@
|
|||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:left="-2dp"
|
||||
android:right="-2dp"
|
||||
android:left="-3dp"
|
||||
android:right="-3dp"
|
||||
android:bottom="-50dp">
|
||||
<shape>
|
||||
<stroke android:width="2dp" android:color="@color/bg_white" />
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="@string/episodes_watched"/>
|
||||
android:text="@string/episodes_watched_n"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -181,7 +181,7 @@
|
|||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="@string/chapters_read"/>
|
||||
android:text="@string/chapters_read_n"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -50,7 +50,9 @@
|
|||
|
||||
<string name="username">Username</string>
|
||||
<string name="chapters_read">"Chapters Read "</string>
|
||||
<string name="chapters_read_n">"Chapters\nRead "</string>
|
||||
<string name="episodes_watched">"Episodes Watched "</string>
|
||||
<string name="episodes_watched_n">"Episodes\nWatched "</string>
|
||||
<string name="continue_reading">Continue Reading</string>
|
||||
<string name="continue_watching">Continue Watching</string>
|
||||
<string name="recommended">Recommended</string>
|
||||
|
@ -822,8 +824,8 @@ Non quae tempore quo provident laudantium qui illo dolor vel quia dolor et exerc
|
|||
<string name="password">Password</string>
|
||||
|
||||
<string name="profile_stats_widget">Track progress directly from your home screen</string>
|
||||
<string name="anime_watched">Anime Watched</string>
|
||||
<string name="manga_read">Manga Read</string>
|
||||
<string name="anime_watched">Anime\nWatched</string>
|
||||
<string name="manga_read">Manga\nRead</string>
|
||||
<string name="loading">Loading…</string>
|
||||
<string name="user_stats">%1$s\'s Stats</string>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:description="@string/upcoming_anime"
|
||||
android:configure="ani.dantotsu.widgets.upcoming.UpcomingWidgetConfigureActivity"
|
||||
android:configure="ani.dantotsu.widgets.upcoming.UpcomingWidgetConfigure"
|
||||
android:initialKeyguardLayout="@layout/upcoming_widget"
|
||||
android:initialLayout="@layout/upcoming_widget"
|
||||
android:minWidth="160dp"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:description="@string/upcoming_anime"
|
||||
android:configure="ani.dantotsu.widgets.upcoming.UpcomingWidgetConfigureActivity"
|
||||
android:configure="ani.dantotsu.widgets.upcoming.UpcomingWidgetConfigure"
|
||||
android:initialKeyguardLayout="@layout/upcoming_widget"
|
||||
android:initialLayout="@layout/upcoming_widget"
|
||||
android:minWidth="160dp"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue