Details : Add short description of apps

This commit is contained in:
Mr. Dragon
2019-03-25 04:59:06 +05:30
parent 2ee1a97d64
commit 6f3586f2a4
4 changed files with 26 additions and 0 deletions

View File

@@ -124,10 +124,12 @@ public class GeneralDetails extends AbstractHelper {
txtRating.setText(app.getLabeledRating());
txtInstalls.setText(app.getInstalls() == 0 ? "N/A" : Util.addDiPrefix(app.getInstalls()));
txtSize.setText(app.getSize() == 0 ? "N/A" : Formatter.formatShortFileSize(context, app.getSize()));
setText(view, R.id.app_desc_short, TextUtil.emptyIfNull(app.getShortDescription()));
drawOfferDetails();
drawChanges();
show(view, R.id.app_desc_short);
show(view, R.id.layout_main);
//show(view, R.id.app_detail);
show(view, R.id.related_links);

View File

@@ -55,6 +55,7 @@ public class App implements Comparable<App> {
private String changes;
private String developerName;
private String description;
private String shortDescription;
private Set<String> permissions = new HashSet<>();
private boolean isInstalled;
private boolean isFree;
@@ -242,6 +243,14 @@ public class App implements Comparable<App> {
this.description = description;
}
public String getShortDescription() {
return shortDescription;
}
public void setShortDescription(String shortDescription) {
this.shortDescription = shortDescription;
}
public Set<String> getPermissions() {
return permissions;
}

View File

@@ -58,6 +58,7 @@ public class AppBuilder {
App app = new App();
app.setDisplayName(details.getTitle());
app.setDescription(details.getDescriptionHtml());
app.setShortDescription(details.getDescriptionShort());
app.setCategoryId(details.getRelatedLinks().getCategoryInfo().getAppCategory());
app.setRestriction(details.getAvailability().getRestriction());
if (details.getOfferCount() > 0) {

View File

@@ -51,6 +51,20 @@
<!-- App Details -->
<include layout="@layout/include_details_subinfo" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/app_desc_short"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_normal"
android:layout_marginBottom="@dimen/margin_normal"
android:background="@color/colorScrim"
android:minHeight="40dp"
android:padding="@dimen/margin_small"
android:textAlignment="center"
android:textColor="?android:attr/textColorPrimary"
android:textSize="16sp"
android:visibility="gone" />
<!-- Changelog -->
<include layout="@layout/include_details_changelog" />