add Video to Links section of App Details

This commit is contained in:
Hans-Christoph Steiner 2017-04-17 12:12:27 +02:00
parent 6fae74b36d
commit 4bb7050725
4 changed files with 18 additions and 2 deletions

View File

@ -396,11 +396,14 @@ public class App extends ValueObject implements Comparable<App>, Parcelable {
}
}
// if key starts with Upper case, its set by humans
video = getLocalizedEntry(localized, localesToUse, "Video");
String value = getLocalizedEntry(localized, localesToUse, "Video");
if (!TextUtils.isEmpty(value)) {
video = value.split("\n", 1)[0];
}
whatsNew = getLocalizedEntry(localized, localesToUse, "WhatsNew");
// Name, Summary, Description existed before localization so they shouldn't replace
// non-localized old data format with a null or blank string
String value = getLocalizedEntry(localized, localesToUse, "Name");
value = getLocalizedEntry(localized, localesToUse, "Name");
if (!TextUtils.isEmpty(value)) {
name = value;
}

View File

@ -740,6 +740,11 @@ public class AppDetailsRecyclerViewAdapter
updateExpandableItem(false);
contentView.removeAllViews();
// Video link
if (uriIsSetAndCanBeOpened(app.video)) {
addLinkItemView(contentView, R.string.menu_video, R.drawable.ic_video, app.video);
}
// Source button
if (uriIsSetAndCanBeOpened(app.sourceCode)) {
addLinkItemView(contentView, R.string.menu_source, R.drawable.ic_source_code, app.sourceCode);

View File

@ -0,0 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#666666" android:pathData="M10,16.5V7.5L16,12M20,4.4C19.4,4.2 15.7,4 12,4C8.3,4 4.6,4.19 4,4.38C2.44,4.9 2,8.4 2,12C2,15.59 2.44,19.1 4,19.61C4.6,19.81 8.3,20 12,20C15.7,20 19.4,19.81 20,19.61C21.56,19.1 22,15.59 22,12C22,8.4 21.56,4.91 20,4.4Z" />
</vector>

View File

@ -159,6 +159,7 @@
<string name="menu_email">E-Mail Author</string>
<string name="menu_issues">Issues</string>
<string name="menu_changelog">Changelog</string>
<string name="menu_video">Video</string>
<string name="menu_source">Source Code</string>
<string name="menu_upgrade">Upgrade</string>
<string name="menu_donate">Donate</string>