Skip to content

Commit 9969d9b

Browse files
committed
fix
1 parent 188e039 commit 9969d9b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

app/src/main/java/com/wirelessalien/android/moviedb/activity/DetailActivity.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,9 +2348,14 @@ class DetailActivity : BaseActivity(), ListTmdbBottomSheetFragment.OnListCreated
23482348
if (cursor.count > 0) {
23492349
cursor.moveToFirst()
23502350
// Set the rating to the personal rating of the user.
2351-
val localizedTen = String.format(Locale.getDefault(), "%d", 10)
2352-
binding.movieRating.text = getString(R.string.rating_format, cursor.getFloat(cursor.getColumnIndexOrThrow(MovieDatabaseHelper.COLUMN_PERSONAL_RATING)), localizedTen)
2353-
binding.movieRating.visibility = View.VISIBLE
2351+
val personalRating = cursor.getFloat(cursor.getColumnIndexOrThrow(MovieDatabaseHelper.COLUMN_PERSONAL_RATING))
2352+
if (personalRating > 0) {
2353+
val localizedTen = String.format(Locale.getDefault(), "%d", 10)
2354+
binding.movieRating.text = getString(R.string.rating_format, personalRating, localizedTen)
2355+
binding.movieRating.visibility = View.VISIBLE
2356+
} else {
2357+
binding.movieRating.visibility = View.GONE
2358+
}
23542359

23552360
var dbDateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
23562361

app/src/main/res/layout/activity_detail.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@
340340
app:boxCornerRadiusBottomEnd="10dp"
341341
app:boxCornerRadiusBottomStart="10dp"
342342
app:boxCornerRadiusTopEnd="10dp"
343+
app:endIconMode="clear_text"
343344
style="@style/Widget.Material3.TextInputLayout.OutlinedBox.Dense"
344345
android:layout_marginTop="5dp"
345346
android:hint="@string/review">

0 commit comments

Comments
 (0)