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" />
|
android:resource="@xml/upcoming_widget_info" />
|
||||||
</receiver>
|
</receiver>
|
||||||
<activity
|
<activity
|
||||||
android:name=".widgets.upcoming.UpcomingWidgetConfigureActivity"
|
android:name=".widgets.upcoming.UpcomingWidgetConfigure"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
|
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
|
||||||
|
|
|
@ -215,6 +215,8 @@ class ProfileStatsConfigure : AppCompatActivity(),
|
||||||
extras.getInt(SimpleColorDialog.COLOR)
|
extras.getInt(SimpleColorDialog.COLOR)
|
||||||
)
|
)
|
||||||
.apply()
|
.apply()
|
||||||
|
(binding.topBackgroundButton as MaterialButton).iconTint =
|
||||||
|
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileStatsWidget.PREF_BACKGROUND_FADE -> {
|
ProfileStatsWidget.PREF_BACKGROUND_FADE -> {
|
||||||
|
@ -227,6 +229,8 @@ class ProfileStatsConfigure : AppCompatActivity(),
|
||||||
extras.getInt(SimpleColorDialog.COLOR)
|
extras.getInt(SimpleColorDialog.COLOR)
|
||||||
)
|
)
|
||||||
.apply()
|
.apply()
|
||||||
|
(binding.bottomBackgroundButton as MaterialButton).iconTint =
|
||||||
|
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileStatsWidget.PREF_TITLE_TEXT_COLOR -> {
|
ProfileStatsWidget.PREF_TITLE_TEXT_COLOR -> {
|
||||||
|
@ -239,6 +243,8 @@ class ProfileStatsConfigure : AppCompatActivity(),
|
||||||
extras.getInt(SimpleColorDialog.COLOR)
|
extras.getInt(SimpleColorDialog.COLOR)
|
||||||
)
|
)
|
||||||
.apply()
|
.apply()
|
||||||
|
(binding.titleColorButton as MaterialButton).iconTint =
|
||||||
|
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||||
}
|
}
|
||||||
|
|
||||||
ProfileStatsWidget.PREF_STATS_TEXT_COLOR -> {
|
ProfileStatsWidget.PREF_STATS_TEXT_COLOR -> {
|
||||||
|
@ -251,6 +257,8 @@ class ProfileStatsConfigure : AppCompatActivity(),
|
||||||
extras.getInt(SimpleColorDialog.COLOR)
|
extras.getInt(SimpleColorDialog.COLOR)
|
||||||
)
|
)
|
||||||
.apply()
|
.apply()
|
||||||
|
(binding.statsColorButton as MaterialButton).iconTint =
|
||||||
|
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ class ProfileStatsWidget : AppWidgetProvider() {
|
||||||
)
|
)
|
||||||
setTextViewText(
|
setTextViewText(
|
||||||
R.id.topRightLabel,
|
R.id.topRightLabel,
|
||||||
context.getString(R.string.episodes_watched)
|
context.getString(R.string.episodes_watched_n)
|
||||||
)
|
)
|
||||||
|
|
||||||
setTextViewText(
|
setTextViewText(
|
||||||
|
@ -191,7 +191,7 @@ class ProfileStatsWidget : AppWidgetProvider() {
|
||||||
)
|
)
|
||||||
setTextViewText(
|
setTextViewText(
|
||||||
R.id.bottomRightLabel,
|
R.id.bottomRightLabel,
|
||||||
context.getString(R.string.chapters_read)
|
context.getString(R.string.chapters_read_n)
|
||||||
)
|
)
|
||||||
|
|
||||||
val intent = Intent(context, ProfileActivity::class.java)
|
val intent = Intent(context, ProfileActivity::class.java)
|
||||||
|
|
|
@ -10,7 +10,6 @@ import android.graphics.drawable.GradientDrawable
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.widget.RemoteViews
|
import android.widget.RemoteViews
|
||||||
import androidx.core.content.ContextCompat
|
|
||||||
import androidx.core.content.res.ResourcesCompat
|
import androidx.core.content.res.ResourcesCompat
|
||||||
import ani.dantotsu.MainActivity
|
import ani.dantotsu.MainActivity
|
||||||
import ani.dantotsu.R
|
import ani.dantotsu.R
|
||||||
|
@ -19,7 +18,7 @@ import ani.dantotsu.widgets.WidgetSizeProvider
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of App Widget functionality.
|
* Implementation of App Widget functionality.
|
||||||
* App Widget Configuration implemented in [UpcomingWidgetConfigureActivity]
|
* App Widget Configuration implemented in [UpcomingWidgetConfigure]
|
||||||
*/
|
*/
|
||||||
class UpcomingWidget : AppWidgetProvider() {
|
class UpcomingWidget : AppWidgetProvider() {
|
||||||
override fun onUpdate(
|
override fun onUpdate(
|
||||||
|
@ -118,7 +117,7 @@ class UpcomingWidget : AppWidgetProvider() {
|
||||||
PendingIntent.getActivity(
|
PendingIntent.getActivity(
|
||||||
context,
|
context,
|
||||||
1,
|
1,
|
||||||
Intent(context, UpcomingWidgetConfigureActivity::class.java).apply {
|
Intent(context, UpcomingWidgetConfigure::class.java).apply {
|
||||||
putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)
|
putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId)
|
||||||
},
|
},
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||||
|
|
|
@ -19,12 +19,12 @@ import eltos.simpledialogfragment.color.SimpleColorDialog
|
||||||
/**
|
/**
|
||||||
* The configuration screen for the [UpcomingWidget] AppWidget.
|
* The configuration screen for the [UpcomingWidget] AppWidget.
|
||||||
*/
|
*/
|
||||||
class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
class UpcomingWidgetConfigure : AppCompatActivity(),
|
||||||
SimpleDialog.OnDialogResultListener {
|
SimpleDialog.OnDialogResultListener {
|
||||||
private var appWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID
|
private var appWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID
|
||||||
private var isMonetEnabled = false
|
private var isMonetEnabled = false
|
||||||
private var onClickListener = View.OnClickListener {
|
private var onClickListener = View.OnClickListener {
|
||||||
val context = this@UpcomingWidgetConfigureActivity
|
val context = this@UpcomingWidgetConfigure
|
||||||
val appWidgetManager = AppWidgetManager.getInstance(context)
|
val appWidgetManager = AppWidgetManager.getInstance(context)
|
||||||
|
|
||||||
updateAppWidget(
|
updateAppWidget(
|
||||||
|
@ -55,7 +55,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
||||||
SimpleColorDialog().title(R.string.custom_theme)
|
SimpleColorDialog().title(R.string.custom_theme)
|
||||||
.colorPreset(topBackground)
|
.colorPreset(topBackground)
|
||||||
.colors(
|
.colors(
|
||||||
this@UpcomingWidgetConfigureActivity,
|
this@UpcomingWidgetConfigure,
|
||||||
SimpleColorDialog.MATERIAL_COLOR_PALLET
|
SimpleColorDialog.MATERIAL_COLOR_PALLET
|
||||||
)
|
)
|
||||||
.setupColorWheelAlpha(true)
|
.setupColorWheelAlpha(true)
|
||||||
|
@ -64,7 +64,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
||||||
.gridNumColumn(5)
|
.gridNumColumn(5)
|
||||||
.choiceMode(SimpleColorDialog.SINGLE_CHOICE)
|
.choiceMode(SimpleColorDialog.SINGLE_CHOICE)
|
||||||
.neg()
|
.neg()
|
||||||
.show(this@UpcomingWidgetConfigureActivity, tag)
|
.show(this@UpcomingWidgetConfigure, tag)
|
||||||
}
|
}
|
||||||
val bottomBackground = prefs.getInt(UpcomingWidget.PREF_BACKGROUND_FADE, Color.parseColor("#00000000"))
|
val bottomBackground = prefs.getInt(UpcomingWidget.PREF_BACKGROUND_FADE, Color.parseColor("#00000000"))
|
||||||
(binding.bottomBackgroundButton as MaterialButton).iconTint = ColorStateList.valueOf(bottomBackground)
|
(binding.bottomBackgroundButton as MaterialButton).iconTint = ColorStateList.valueOf(bottomBackground)
|
||||||
|
@ -73,7 +73,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
||||||
SimpleColorDialog().title(R.string.custom_theme)
|
SimpleColorDialog().title(R.string.custom_theme)
|
||||||
.colorPreset(bottomBackground)
|
.colorPreset(bottomBackground)
|
||||||
.colors(
|
.colors(
|
||||||
this@UpcomingWidgetConfigureActivity,
|
this@UpcomingWidgetConfigure,
|
||||||
SimpleColorDialog.MATERIAL_COLOR_PALLET
|
SimpleColorDialog.MATERIAL_COLOR_PALLET
|
||||||
)
|
)
|
||||||
.setupColorWheelAlpha(true)
|
.setupColorWheelAlpha(true)
|
||||||
|
@ -82,7 +82,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
||||||
.gridNumColumn(5)
|
.gridNumColumn(5)
|
||||||
.choiceMode(SimpleColorDialog.SINGLE_CHOICE)
|
.choiceMode(SimpleColorDialog.SINGLE_CHOICE)
|
||||||
.neg()
|
.neg()
|
||||||
.show(this@UpcomingWidgetConfigureActivity, tag)
|
.show(this@UpcomingWidgetConfigure, tag)
|
||||||
}
|
}
|
||||||
val titleTextColor = prefs.getInt(UpcomingWidget.PREF_TITLE_TEXT_COLOR, Color.WHITE)
|
val titleTextColor = prefs.getInt(UpcomingWidget.PREF_TITLE_TEXT_COLOR, Color.WHITE)
|
||||||
(binding.titleColorButton as MaterialButton).iconTint = ColorStateList.valueOf(titleTextColor)
|
(binding.titleColorButton as MaterialButton).iconTint = ColorStateList.valueOf(titleTextColor)
|
||||||
|
@ -91,7 +91,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
||||||
SimpleColorDialog().title(R.string.custom_theme)
|
SimpleColorDialog().title(R.string.custom_theme)
|
||||||
.colorPreset(titleTextColor)
|
.colorPreset(titleTextColor)
|
||||||
.colors(
|
.colors(
|
||||||
this@UpcomingWidgetConfigureActivity,
|
this@UpcomingWidgetConfigure,
|
||||||
SimpleColorDialog.MATERIAL_COLOR_PALLET
|
SimpleColorDialog.MATERIAL_COLOR_PALLET
|
||||||
)
|
)
|
||||||
.allowCustom(true)
|
.allowCustom(true)
|
||||||
|
@ -99,7 +99,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
||||||
.gridNumColumn(5)
|
.gridNumColumn(5)
|
||||||
.choiceMode(SimpleColorDialog.SINGLE_CHOICE)
|
.choiceMode(SimpleColorDialog.SINGLE_CHOICE)
|
||||||
.neg()
|
.neg()
|
||||||
.show(this@UpcomingWidgetConfigureActivity, tag)
|
.show(this@UpcomingWidgetConfigure, tag)
|
||||||
}
|
}
|
||||||
val countdownTextColor = prefs.getInt(UpcomingWidget.PREF_COUNTDOWN_TEXT_COLOR, Color.WHITE)
|
val countdownTextColor = prefs.getInt(UpcomingWidget.PREF_COUNTDOWN_TEXT_COLOR, Color.WHITE)
|
||||||
(binding.countdownColorButton as MaterialButton).iconTint = ColorStateList.valueOf(countdownTextColor)
|
(binding.countdownColorButton as MaterialButton).iconTint = ColorStateList.valueOf(countdownTextColor)
|
||||||
|
@ -108,7 +108,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
||||||
SimpleColorDialog().title(R.string.custom_theme)
|
SimpleColorDialog().title(R.string.custom_theme)
|
||||||
.colorPreset(countdownTextColor)
|
.colorPreset(countdownTextColor)
|
||||||
.colors(
|
.colors(
|
||||||
this@UpcomingWidgetConfigureActivity,
|
this@UpcomingWidgetConfigure,
|
||||||
SimpleColorDialog.MATERIAL_COLOR_PALLET
|
SimpleColorDialog.MATERIAL_COLOR_PALLET
|
||||||
)
|
)
|
||||||
.allowCustom(true)
|
.allowCustom(true)
|
||||||
|
@ -116,7 +116,7 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
||||||
.gridNumColumn(5)
|
.gridNumColumn(5)
|
||||||
.choiceMode(SimpleColorDialog.SINGLE_CHOICE)
|
.choiceMode(SimpleColorDialog.SINGLE_CHOICE)
|
||||||
.neg()
|
.neg()
|
||||||
.show(this@UpcomingWidgetConfigureActivity, tag)
|
.show(this@UpcomingWidgetConfigure, tag)
|
||||||
}
|
}
|
||||||
binding.useAppTheme.setOnCheckedChangeListener { _, isChecked ->
|
binding.useAppTheme.setOnCheckedChangeListener { _, isChecked ->
|
||||||
isMonetEnabled = isChecked
|
isMonetEnabled = isChecked
|
||||||
|
@ -186,6 +186,8 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
||||||
extras.getInt(SimpleColorDialog.COLOR)
|
extras.getInt(SimpleColorDialog.COLOR)
|
||||||
)
|
)
|
||||||
.apply()
|
.apply()
|
||||||
|
(binding.topBackgroundButton as MaterialButton).iconTint =
|
||||||
|
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||||
}
|
}
|
||||||
|
|
||||||
UpcomingWidget.PREF_BACKGROUND_FADE -> {
|
UpcomingWidget.PREF_BACKGROUND_FADE -> {
|
||||||
|
@ -198,6 +200,8 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
||||||
extras.getInt(SimpleColorDialog.COLOR)
|
extras.getInt(SimpleColorDialog.COLOR)
|
||||||
)
|
)
|
||||||
.apply()
|
.apply()
|
||||||
|
(binding.bottomBackgroundButton as MaterialButton).iconTint =
|
||||||
|
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||||
}
|
}
|
||||||
|
|
||||||
UpcomingWidget.PREF_TITLE_TEXT_COLOR -> {
|
UpcomingWidget.PREF_TITLE_TEXT_COLOR -> {
|
||||||
|
@ -210,6 +214,8 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
||||||
extras.getInt(SimpleColorDialog.COLOR)
|
extras.getInt(SimpleColorDialog.COLOR)
|
||||||
)
|
)
|
||||||
.apply()
|
.apply()
|
||||||
|
(binding.titleColorButton as MaterialButton).iconTint =
|
||||||
|
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||||
}
|
}
|
||||||
|
|
||||||
UpcomingWidget.PREF_COUNTDOWN_TEXT_COLOR -> {
|
UpcomingWidget.PREF_COUNTDOWN_TEXT_COLOR -> {
|
||||||
|
@ -222,6 +228,8 @@ class UpcomingWidgetConfigureActivity : AppCompatActivity(),
|
||||||
extras.getInt(SimpleColorDialog.COLOR)
|
extras.getInt(SimpleColorDialog.COLOR)
|
||||||
)
|
)
|
||||||
.apply()
|
.apply()
|
||||||
|
(binding.countdownColorButton as MaterialButton).iconTint =
|
||||||
|
ColorStateList.valueOf(extras.getInt(SimpleColorDialog.COLOR))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -10,8 +10,8 @@
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item
|
<item
|
||||||
android:left="-2dp"
|
android:left="-3dp"
|
||||||
android:right="-2dp"
|
android:right="-3dp"
|
||||||
android:bottom="-50dp">
|
android:bottom="-50dp">
|
||||||
<shape>
|
<shape>
|
||||||
<stroke android:width="2dp" android:color="@color/bg_white" />
|
<stroke android:width="2dp" android:color="@color/bg_white" />
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:fontFamily="@font/poppins_semi_bold"
|
android:fontFamily="@font/poppins_semi_bold"
|
||||||
android:text="@string/episodes_watched"/>
|
android:text="@string/episodes_watched_n"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:fontFamily="@font/poppins_semi_bold"
|
android:fontFamily="@font/poppins_semi_bold"
|
||||||
android:text="@string/chapters_read"/>
|
android:text="@string/chapters_read_n"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -50,7 +50,9 @@
|
||||||
|
|
||||||
<string name="username">Username</string>
|
<string name="username">Username</string>
|
||||||
<string name="chapters_read">"Chapters Read "</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">"Episodes Watched "</string>
|
||||||
|
<string name="episodes_watched_n">"Episodes\nWatched "</string>
|
||||||
<string name="continue_reading">Continue Reading</string>
|
<string name="continue_reading">Continue Reading</string>
|
||||||
<string name="continue_watching">Continue Watching</string>
|
<string name="continue_watching">Continue Watching</string>
|
||||||
<string name="recommended">Recommended</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="password">Password</string>
|
||||||
|
|
||||||
<string name="profile_stats_widget">Track progress directly from your home screen</string>
|
<string name="profile_stats_widget">Track progress directly from your home screen</string>
|
||||||
<string name="anime_watched">Anime Watched</string>
|
<string name="anime_watched">Anime\nWatched</string>
|
||||||
<string name="manga_read">Manga Read</string>
|
<string name="manga_read">Manga\nRead</string>
|
||||||
<string name="loading">Loading…</string>
|
<string name="loading">Loading…</string>
|
||||||
<string name="user_stats">%1$s\'s Stats</string>
|
<string name="user_stats">%1$s\'s Stats</string>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:description="@string/upcoming_anime"
|
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:initialKeyguardLayout="@layout/upcoming_widget"
|
||||||
android:initialLayout="@layout/upcoming_widget"
|
android:initialLayout="@layout/upcoming_widget"
|
||||||
android:minWidth="160dp"
|
android:minWidth="160dp"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:description="@string/upcoming_anime"
|
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:initialKeyguardLayout="@layout/upcoming_widget"
|
||||||
android:initialLayout="@layout/upcoming_widget"
|
android:initialLayout="@layout/upcoming_widget"
|
||||||
android:minWidth="160dp"
|
android:minWidth="160dp"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue