Android: Display game code in list
This commit is contained in:
parent
c1de8c32c1
commit
4701d2480d
|
@ -90,12 +90,22 @@ public class GameListEntry {
|
|||
return mCompatibilityRating;
|
||||
}
|
||||
|
||||
private String getSubTitle() {
|
||||
String sizeString = String.format("%.2f MB", (double) mSize / 1048576.0);
|
||||
String fileName;
|
||||
int lastSlash = mPath.lastIndexOf('/');
|
||||
if (lastSlash > 0 && lastSlash < mPath.length() - 1)
|
||||
fileName = mPath.substring(lastSlash + 1);
|
||||
else
|
||||
fileName = mPath;
|
||||
|
||||
return String.format("%s (%s)", fileName, sizeString);
|
||||
}
|
||||
|
||||
public void fillView(View view) {
|
||||
((TextView) view.findViewById(R.id.game_list_view_entry_title)).setText(mTitle);
|
||||
((TextView) view.findViewById(R.id.game_list_view_entry_path)).setText(mPath);
|
||||
|
||||
String sizeString = String.format("%.2f MB", (double) mSize / 1048576.0);
|
||||
((TextView) view.findViewById(R.id.game_list_view_entry_size)).setText(sizeString);
|
||||
((TextView) view.findViewById(R.id.game_list_view_entry_subtitle)).setText(getSubTitle());
|
||||
((TextView) view.findViewById(R.id.game_list_view_entry_code)).setText(mCode);
|
||||
|
||||
int regionDrawableId;
|
||||
switch (mRegion) {
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/game_list_view_entry_path"
|
||||
android:id="@+id/game_list_view_entry_subtitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
|
@ -47,7 +47,7 @@
|
|||
app:layout_constraintTop_toBottomOf="@+id/game_list_view_entry_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/game_list_view_entry_size"
|
||||
android:id="@+id/game_list_view_entry_code"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
|
@ -70,7 +70,7 @@
|
|||
android:focusableInTouchMode="false"
|
||||
android:paddingBottom="8px"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/game_list_view_entry_size"
|
||||
app:layout_constraintTop_toBottomOf="@+id/game_list_view_entry_code"
|
||||
app:srcCompat="@drawable/flag_jp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in New Issue