fix: not meant to be quoted (#300)
* fix not meant to be quoted * fix: thought he was slick hiding in plain sight * fix: it's not THAT important * fix: flexible day / night borders
This commit is contained in:
parent
7951c2cf37
commit
6b868fa824
4 changed files with 36 additions and 11 deletions
|
@ -113,10 +113,8 @@ class ProfileStatsWidget : AppWidgetProvider() {
|
|||
|
||||
launchIO {
|
||||
val userPref = PrefManager.getVal(PrefName.AnilistUserId, "")
|
||||
val userId = if (userPref.isNotEmpty()) userPref.toInt() else Anilist.userid
|
||||
?: if (Anilist.query.getUserData()) Anilist.userid else null
|
||||
userId?.let {
|
||||
val respond = Anilist.query.getUserProfile(it)
|
||||
if (userPref.isNotEmpty()) {
|
||||
val respond = Anilist.query.getUserProfile(userPref.toInt())
|
||||
respond?.data?.user?.let { user ->
|
||||
withContext(Dispatchers.Main) {
|
||||
val views = RemoteViews(context.packageName, R.layout.statistics_widget).apply {
|
||||
|
@ -195,7 +193,7 @@ class ProfileStatsWidget : AppWidgetProvider() {
|
|||
)
|
||||
|
||||
val intent = Intent(context, ProfileActivity::class.java)
|
||||
.putExtra("userId", it)
|
||||
.putExtra("userId", userPref.toInt())
|
||||
val pendingIntent = PendingIntent.getActivity(
|
||||
context, 0, intent, PendingIntent.FLAG_IMMUTABLE
|
||||
)
|
||||
|
@ -205,7 +203,7 @@ class ProfileStatsWidget : AppWidgetProvider() {
|
|||
appWidgetManager.updateAppWidget(appWidgetId, views)
|
||||
}
|
||||
} ?: showLoginCascade(context, appWidgetManager, appWidgetId)
|
||||
} ?: showLoginCascade(context, appWidgetManager, appWidgetId)
|
||||
} else showLoginCascade(context, appWidgetManager, appWidgetId)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
27
app/src/main/res/drawable-night/widget_stats_rounded.xml
Normal file
27
app/src/main/res/drawable-night/widget_stats_rounded.xml
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners
|
||||
android:topLeftRadius="28dp"
|
||||
android:topRightRadius="28dp"
|
||||
android:bottomLeftRadius="0dp"
|
||||
android:bottomRightRadius="0dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item
|
||||
android:left="-3dp"
|
||||
android:right="-3dp"
|
||||
android:bottom="-50dp">
|
||||
<shape>
|
||||
<stroke android:width="2dp" android:color="@color/bg_white" />
|
||||
<corners
|
||||
android:topLeftRadius="28dp"
|
||||
android:topRightRadius="28dp"
|
||||
android:bottomLeftRadius="0dp"
|
||||
android:bottomRightRadius="0dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
android:right="-3dp"
|
||||
android:bottom="-50dp">
|
||||
<shape>
|
||||
<stroke android:width="2dp" android:color="@color/bg_white" />
|
||||
<stroke android:width="2dp" android:color="@color/bg_black" />
|
||||
<corners
|
||||
android:topLeftRadius="28dp"
|
||||
android:topRightRadius="28dp"
|
||||
|
|
|
@ -49,10 +49,10 @@
|
|||
<string name="popular_manga">Popular Manga</string>
|
||||
|
||||
<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="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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue