Skip to content

Commit

Permalink
Improve layout on AppDetailFragment (#341)
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin Falière <[email protected]>
  • Loading branch information
Jean-BaptisteC and Benjamin Falière authored Dec 8, 2023
1 parent 71efb01 commit 4cdbca5
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 @@ -69,9 +69,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 @@ -120,23 +118,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 @@ -114,6 +116,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 @@ -148,6 +151,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 @@ -180,8 +184,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 @@ -210,6 +215,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 4cdbca5

Please sign in to comment.