Add author information and a link for bug reports to the About activity

This commit is contained in:
Jakob Nixdorf 2017-07-13 13:24:41 +02:00
parent b5dcd2b337
commit 1bcc8ff210
No known key found for this signature in database
GPG key ID: BE99BF86574A7DBC
6 changed files with 313 additions and 1 deletions

View file

@ -19,6 +19,14 @@ public class AboutActivity extends AppCompatActivity {
private static final String CHANGELOG_URI = GITHUB_URI + "/blob/master/CHANGELOG.md"; private static final String CHANGELOG_URI = GITHUB_URI + "/blob/master/CHANGELOG.md";
private static final String MIT_URI = GITHUB_URI + "/blob/master/LICENSE.txt"; private static final String MIT_URI = GITHUB_URI + "/blob/master/LICENSE.txt";
private static final String AUTHOR1_GITHUB = "https://github.com/flocke";
private static final String AUTHOR1_PAYPAL = "https://paypal.me/flocke000";
private static final String AUTHOR2_GITHUB = "https://github.com/0xbb";
private static final String AUTHOR2_APP = AUTHOR2_GITHUB + "/otp-authenticator";
private static final String BUGREPORT_URI = GITHUB_URI + "/issues";
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -75,6 +83,47 @@ public class AboutActivity extends AppCompatActivity {
} }
}); });
TextView author1GitHub = (TextView) v.findViewById(R.id.about_author1_github);
TextView author1Paypal = (TextView) v.findViewById(R.id.about_author1_paypal);
author1GitHub.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
openURI(AUTHOR1_GITHUB);
}
});
author1Paypal.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
openURI(AUTHOR1_PAYPAL);
}
});
TextView author2GitHub = (TextView) v.findViewById(R.id.about_author2_github);
TextView author2App = (TextView) v.findViewById(R.id.about_author2_app);
author2GitHub.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
openURI(AUTHOR2_GITHUB);
}
});
author2App.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
openURI(AUTHOR2_APP);
}
});
LinearLayout bugReport = (LinearLayout) v.findViewById(R.id.about_layout_bugs);
bugReport.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
openURI(BUGREPORT_URI);
}
});
} }
// Go back to the main activity // Go back to the main activity

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF727272"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,5c1.66,0 3,1.34 3,3s-1.34,3 -3,3 -3,-1.34 -3,-3 1.34,-3 3,-3zM12,19.2c-2.5,0 -4.71,-1.28 -6,-3.22 0.03,-1.99 4,-3.08 6,-3.08 1.99,0 5.97,1.09 6,3.08 -1.29,1.94 -3.5,3.22 -6,3.22z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF727272"
android:pathData="M20,8h-2.81c-0.45,-0.78 -1.07,-1.45 -1.82,-1.96L17,4.41 15.59,3l-2.17,2.17C12.96,5.06 12.49,5 12,5c-0.49,0 -0.96,0.06 -1.41,0.17L8.41,3 7,4.41l1.62,1.63C7.88,6.55 7.26,7.22 6.81,8L4,8v2h2.09c-0.05,0.33 -0.09,0.66 -0.09,1v1L4,12v2h2v1c0,0.34 0.04,0.67 0.09,1L4,16v2h2.81c1.04,1.79 2.97,3 5.19,3s4.15,-1.21 5.19,-3L20,18v-2h-2.09c0.05,-0.33 0.09,-0.66 0.09,-1v-1h2v-2h-2v-1c0,-0.34 -0.04,-0.67 -0.09,-1L20,10L20,8zM14,16h-4v-2h4v2zM14,12h-4v-2h4v2z"/>
</vector>

View file

@ -26,7 +26,6 @@
android:paddingTop="@dimen/activity_margin" android:paddingTop="@dimen/activity_margin"
android:paddingBottom="@dimen/activity_margin" > android:paddingBottom="@dimen/activity_margin" >
<!-- version -->
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -231,8 +230,231 @@
android:textAppearance="?android:attr/textAppearanceMedium" /> android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout> </LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/activity_margin"
app:cardElevation="@dimen/card_elevation" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@dimen/activity_margin"
android:paddingBottom="@dimen/activity_margin" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:text="@string/about_title_authors"/>
<!-- 1st author -->
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/activity_margin"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginEnd="@dimen/activity_margin_large"
android:src="@drawable/ic_account_circle_gray" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_name_author1"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/about_label_main_author"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/activity_margin"
android:layout_gravity="center_vertical">
<TextView
android:id="@+id/about_author1_github"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
android:textColor="@color/github_gray"
android:text="@string/about_label_github" />
<TextView
android:id="@+id/about_author1_paypal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin_large"
android:background="?android:attr/selectableItemBackground"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
android:textColor="@color/paypal_blue"
android:text="@string/about_label_donate" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<View
android:id="@+id/view_divider_authors"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/divider"
android:layout_margin="@dimen/activity_margin" />
<!-- 2nd author -->
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginEnd="@dimen/activity_margin_large"
android:src="@drawable/ic_account_circle_gray" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_name_author2"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/about_label_original_author"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/activity_margin"
android:layout_gravity="center_vertical">
<TextView
android:id="@+id/about_author2_github"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
android:textColor="@color/github_gray"
android:text="@string/about_label_github" />
<TextView
android:id="@+id/about_author2_app"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin_large"
android:background="?android:attr/selectableItemBackground"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
android:textColor="@color/github_gray"
android:text="@string/about_label_original_app" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/activity_margin"
app:cardElevation="@dimen/card_elevation" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@dimen/activity_margin"
android:paddingBottom="@dimen/activity_margin" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:text="@string/about_title_support"/>
<!-- bug reports -->
<LinearLayout
android:id="@+id/about_layout_bugs"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_marginTop="@dimen/activity_margin"
android:padding="@dimen/activity_margin_small"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginEnd="@dimen/activity_margin_large"
android:src="@drawable/ic_bug_report_gray" />
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_label_report_bugs"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/about_desc_report_bugs"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout> </LinearLayout>
</android.support.v4.widget.NestedScrollView> </android.support.v4.widget.NestedScrollView>

View file

@ -9,5 +9,8 @@
<color name="icons">#FFFFFF</color> <color name="icons">#FFFFFF</color>
<color name="divider">#B6B6B6</color> <color name="divider">#B6B6B6</color>
<color name="github_gray">#333333</color>
<color name="paypal_blue">#003087</color>
<color name="fab_small_label_background">#212121</color> <color name="fab_small_label_background">#212121</color>
</resources> </resources>

View file

@ -6,10 +6,30 @@
An open-source two-factor authentication App for Android 4.4+. An open-source two-factor authentication App for Android 4.4+.
</string> </string>
<!-- Misc -->
<string name="about_label_changelog">Changelog</string> <string name="about_label_changelog">Changelog</string>
<string name="about_label_license">License</string> <string name="about_label_license">License</string>
<string name="about_label_licenses">Open source licenses</string> <string name="about_label_licenses">Open source licenses</string>
<string name="about_label_MIT">MIT License</string> <string name="about_label_MIT">MIT License</string>
<string name="about_label_source">Source code</string> <string name="about_label_source">Source code</string>
<string name="about_label_version">Version</string> <string name="about_label_version">Version</string>
<!-- Authors -->
<string name="about_title_authors">Authors</string>
<string name="about_label_main_author">Main author</string>
<string name="about_label_original_author">Author of the original app</string>
<string name="about_label_original_app">Original App</string>
<string name="about_label_github">Github</string>
<string name="about_label_donate">Donate</string>
<string name="about_name_author1">Jakob Nixdorf</string>
<string name="about_name_author2">Bruno Bierbaumer</string>
<!-- Support -->
<string name="about_title_support">Support development</string>
<string name="about_label_report_bugs">Report Bugs</string>
<string name="about_desc_report_bugs">Report bugs or request new features</string>
</resources> </resources>