diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2cd54e874c..e3ff41fa33 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -73,7 +73,7 @@ android:resource="@xml/upcoming_widget_info" /> diff --git a/app/src/main/java/ani/dantotsu/widgets/statistics/ProfileStatsConfigure.kt b/app/src/main/java/ani/dantotsu/widgets/statistics/ProfileStatsConfigure.kt index 1050efaf3f..b3ddec4611 100644 --- a/app/src/main/java/ani/dantotsu/widgets/statistics/ProfileStatsConfigure.kt +++ b/app/src/main/java/ani/dantotsu/widgets/statistics/ProfileStatsConfigure.kt @@ -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)) } } } diff --git a/app/src/main/java/ani/dantotsu/widgets/statistics/ProfileStatsWidget.kt b/app/src/main/java/ani/dantotsu/widgets/statistics/ProfileStatsWidget.kt index 45a2a589c6..06202ea05e 100644 --- a/app/src/main/java/ani/dantotsu/widgets/statistics/ProfileStatsWidget.kt +++ b/app/src/main/java/ani/dantotsu/widgets/statistics/ProfileStatsWidget.kt @@ -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) diff --git a/app/src/main/java/ani/dantotsu/widgets/upcoming/UpcomingWidget.kt b/app/src/main/java/ani/dantotsu/widgets/upcoming/UpcomingWidget.kt index ae2d8d89fa..fc8850f3f9 100644 --- a/app/src/main/java/ani/dantotsu/widgets/upcoming/UpcomingWidget.kt +++ b/app/src/main/java/ani/dantotsu/widgets/upcoming/UpcomingWidget.kt @@ -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 diff --git a/app/src/main/java/ani/dantotsu/widgets/upcoming/UpcomingWidgetConfigureActivity.kt b/app/src/main/java/ani/dantotsu/widgets/upcoming/UpcomingWidgetConfigure.kt similarity index 88% rename from app/src/main/java/ani/dantotsu/widgets/upcoming/UpcomingWidgetConfigureActivity.kt rename to app/src/main/java/ani/dantotsu/widgets/upcoming/UpcomingWidgetConfigure.kt index eae1a1ef65..a465a48ac0 100644 --- a/app/src/main/java/ani/dantotsu/widgets/upcoming/UpcomingWidgetConfigureActivity.kt +++ b/app/src/main/java/ani/dantotsu/widgets/upcoming/UpcomingWidgetConfigure.kt @@ -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)) } } diff --git a/app/src/main/res/drawable/widget_stats_rounded.xml b/app/src/main/res/drawable/widget_stats_rounded.xml index c4fbc84909..933eab8bde 100644 --- a/app/src/main/res/drawable/widget_stats_rounded.xml +++ b/app/src/main/res/drawable/widget_stats_rounded.xml @@ -10,8 +10,8 @@ diff --git a/app/src/main/res/layout/statistics_widget.xml b/app/src/main/res/layout/statistics_widget.xml index 1cab726719..d4bb070fbc 100644 --- a/app/src/main/res/layout/statistics_widget.xml +++ b/app/src/main/res/layout/statistics_widget.xml @@ -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"/> @@ -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"/> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c2fedfed30..5f02f550a6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -50,7 +50,9 @@ Username "Chapters Read " + "Chapters\nRead " "Episodes Watched " + "Episodes\nWatched " Continue Reading Continue Watching Recommended @@ -822,8 +824,8 @@ Non quae tempore quo provident laudantium qui illo dolor vel quia dolor et exerc Password Track progress directly from your home screen - Anime Watched - Manga Read + Anime\nWatched + Manga\nRead Loading… %1$s\'s Stats diff --git a/app/src/main/res/xml-v31/upcoming_widget_info.xml b/app/src/main/res/xml-v31/upcoming_widget_info.xml index a7f86b35ed..d9983e5098 100644 --- a/app/src/main/res/xml-v31/upcoming_widget_info.xml +++ b/app/src/main/res/xml-v31/upcoming_widget_info.xml @@ -1,7 +1,7 @@