Skip to content

Commit

Permalink
Improve layout on AppDetailFragment
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-BaptisteC committed Oct 18, 2023
1 parent 82d1aa7 commit b3ffb91
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ class AppDetailFragment : Fragment(R.layout.fragment_app_detail) {
inflateMenu(R.menu.app_detail_menu)
if (app.exodusVersionCode == 0L) {
menu.findItem(R.id.openExodusPage)?.isVisible = false
} else {
menu.findItem(R.id.submitApp)?.isVisible = false
}
} else menu.findItem(R.id.submitApp)?.isVisible = app.exodusVersionCode != app.versionCode
setOnMenuItemClickListener {
when (it.itemId) {
R.id.openExodusPage -> {
Expand Down Expand Up @@ -121,23 +119,29 @@ class AppDetailFragment : Fragment(R.layout.fragment_app_detail) {
appVersionTV.text = app.versionName
}
else -> {
appVTV.visibility = View.GONE
appVersionTV.visibility = View.GONE

appIVTV.visibility = View.VISIBLE
appInstalledVersionTV.apply {
visibility = View.VISIBLE
text = app.versionName
}

appAVTV.visibility = View.VISIBLE
appAnalyzedVersionTV.apply {
visibility = View.VISIBLE
text = app.exodusVersionName
}
if (app.versionName != app.exodusVersionName) {
appSameVersionTV.visibility = View.GONE
appIVTV.visibility = View.VISIBLE
appInstalledVersionTV.apply {
text = app.versionName
visibility = View.VISIBLE
}
appAVTV.visibility = View.VISIBLE
appAnalyzedVersionTV.apply {
text = app.exodusVersionName
visibility = View.VISIBLE
}
appVTV.visibility = View.GONE
appVersionTV.visibility = View.GONE
} else {
appIVTV.visibility = View.GONE
appInstalledVersionTV.visibility = View.GONE
appAVTV.visibility = View.GONE
appAnalyzedVersionTV.visibility = View.GONE
appVTV.visibility = View.VISIBLE
appVersionTV.apply {
text = app.versionName
visibility = View.VISIBLE
}
appSameVersionTV.visibility = View.VISIBLE
}
}
Expand Down
8 changes: 7 additions & 1 deletion app/src/main/res/layout/fragment_app_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/appIconIV"
android:layout_marginTop="10dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:ellipsize="end"
android:maxLines="2"
android:textAlignment="center"
Expand Down Expand Up @@ -127,6 +129,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/appIVTV"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:ellipsize="end"
android:maxLines="2"
android:paddingHorizontal="5dp"
Expand Down Expand Up @@ -161,6 +164,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/appAVTV"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:ellipsize="end"
android:maxLines="2"
android:paddingHorizontal="5dp"
Expand Down Expand Up @@ -193,8 +197,9 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/appVTV"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:ellipsize="end"
android:maxLines="1"
android:maxLines="2"
android:paddingHorizontal="5dp"
android:textColor="?android:textColorPrimary"
android:textSize="17sp"
Expand Down Expand Up @@ -223,6 +228,7 @@
app:layout_constraintTop_toBottomOf="@id/appSameVersionTV"
android:layout_marginStart="30dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="30dp"
android:ellipsize="end"
android:maxLines="2"
android:text="@string/report_date"
Expand Down

0 comments on commit b3ffb91

Please sign in to comment.