display summary text on app details activity

This commit is contained in:
Michael Pöhn 2019-12-08 03:37:13 +01:00
parent dca8023d7d
commit e42718b11f
2 changed files with 24 additions and 1 deletions

View File

@ -375,6 +375,7 @@ public class AppDetailsRecyclerViewAdapter
final TextView titleView;
final TextView authorView;
final TextView lastUpdateView;
final TextView summaryView;
final TextView whatsNewView;
final TextView descriptionView;
final TextView descriptionMoreView;
@ -397,6 +398,7 @@ public class AppDetailsRecyclerViewAdapter
titleView = (TextView) view.findViewById(R.id.title);
authorView = (TextView) view.findViewById(R.id.author);
lastUpdateView = (TextView) view.findViewById(R.id.text_last_update);
summaryView = (TextView) view.findViewById(R.id.summary);
whatsNewView = (TextView) view.findViewById(R.id.whats_new);
descriptionView = (TextView) view.findViewById(R.id.description);
descriptionMoreView = (TextView) view.findViewById(R.id.description_more);
@ -494,9 +496,13 @@ public class AppDetailsRecyclerViewAdapter
lastUpdateView.setVisibility(View.GONE);
}
if (!TextUtils.isEmpty(app.summary)) {
summaryView.setText(app.summary);
}
Apk suggestedApk = getSuggestedApk();
if (suggestedApk == null || TextUtils.isEmpty(app.whatsNew)) {
whatsNewView.setVisibility(View.GONE);
summaryView.setBackgroundResource(0); // make background of summary transparent
} else {
//noinspection deprecation Ignore deprecation because the suggested way is only available in API 24.
Locale locale = context.getResources().getConfiguration().locale;

View File

@ -164,7 +164,7 @@
</RelativeLayout>
<TextView
android:id="@+id/whats_new"
android:id="@+id/summary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
@ -172,6 +172,23 @@
android:paddingLeft="8dp"
android:paddingEnd="8dp"
android:paddingRight="8dp"
android:padding="8dp"
android:scrollbars="none"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textIsSelectable="true"
android:textStyle="bold"
android:background="?attr/detailPanel"
tools:text="App summary, one line - outlining what this app does" />
<TextView
android:id="@+id/whats_new"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:paddingStart="8dp"
android:paddingLeft="8dp"
android:paddingEnd="8dp"
android:paddingRight="8dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"