Add FAQ link to About
This commit is contained in:
parent
ba4e1584ca
commit
157dee9ede
4 changed files with 57 additions and 2 deletions
|
@ -29,6 +29,7 @@ public class BaseAboutFragment extends Fragment {
|
||||||
private static final String GITHUB_URI = "https://github.com/andOTP/andOTP";
|
private static final String GITHUB_URI = "https://github.com/andOTP/andOTP";
|
||||||
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 FAQ_URI = GITHUB_URI + "/wiki/Frequently-Asked-Questions";
|
||||||
|
|
||||||
private static final String AUTHOR1_GITHUB = "https://github.com/flocke";
|
private static final String AUTHOR1_GITHUB = "https://github.com/flocke";
|
||||||
private static final String AUTHOR2_GITHUB = "https://github.com/richyhbm";
|
private static final String AUTHOR2_GITHUB = "https://github.com/richyhbm";
|
||||||
|
@ -44,8 +45,8 @@ public class BaseAboutFragment extends Fragment {
|
||||||
|
|
||||||
static final int[] imageResources = {
|
static final int[] imageResources = {
|
||||||
R.id.aboutImgVersion, R.id.aboutImgLicense, R.id.aboutImgChangelog, R.id.aboutImgSource,
|
R.id.aboutImgVersion, R.id.aboutImgLicense, R.id.aboutImgChangelog, R.id.aboutImgSource,
|
||||||
R.id.aboutImgAuthor2, R.id.aboutImgAuthorOriginal, R.id.aboutImgContributors,
|
R.id.aboutImgFaq, R.id.aboutImgAuthor2, R.id.aboutImgAuthorOriginal,
|
||||||
R.id.aboutImgSupport
|
R.id.aboutImgContributors, R.id.aboutImgSupport
|
||||||
};
|
};
|
||||||
|
|
||||||
static long lastTap = 0;
|
static long lastTap = 0;
|
||||||
|
@ -112,6 +113,7 @@ public class BaseAboutFragment extends Fragment {
|
||||||
LinearLayout license = v.findViewById(R.id.about_layout_license);
|
LinearLayout license = v.findViewById(R.id.about_layout_license);
|
||||||
LinearLayout changelog = v.findViewById(R.id.about_layout_changelog);
|
LinearLayout changelog = v.findViewById(R.id.about_layout_changelog);
|
||||||
LinearLayout source = v.findViewById(R.id.about_layout_source);
|
LinearLayout source = v.findViewById(R.id.about_layout_source);
|
||||||
|
LinearLayout faq = v.findViewById(R.id.about_layout_faq);
|
||||||
|
|
||||||
license.setOnClickListener(new View.OnClickListener() {
|
license.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -131,6 +133,7 @@ public class BaseAboutFragment extends Fragment {
|
||||||
openURI(GITHUB_URI);
|
openURI(GITHUB_URI);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
faq.setOnClickListener((View view) -> openURI(FAQ_URI));
|
||||||
|
|
||||||
LinearLayout author1Layout = v.findViewById(R.id.aboutLayoutAuthor1);
|
LinearLayout author1Layout = v.findViewById(R.id.aboutLayoutAuthor1);
|
||||||
author1Layout.setOnClickListener(new View.OnClickListener() {
|
author1Layout.setOnClickListener(new View.OnClickListener() {
|
||||||
|
|
9
app/src/main/res/drawable/ic_help_gray.xml
Normal file
9
app/src/main/res/drawable/ic_help_gray.xml
Normal 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="M11,18h2v-2h-2v2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM12,6c-2.21,0 -4,1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5 0,-2.21 -1.79,-4 -4,-4z"/>
|
||||||
|
</vector>
|
|
@ -208,6 +208,47 @@
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- faq -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/about_layout_faq"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?android:attr/listPreferredItemHeight"
|
||||||
|
android:paddingTop="@dimen/activity_margin_small"
|
||||||
|
android:paddingBottom="@dimen/activity_margin_small"
|
||||||
|
android:background="?android:attr/selectableItemBackground"
|
||||||
|
android:gravity="center_vertical" >
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/aboutImgFaq"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/activity_margin"
|
||||||
|
android:layout_marginEnd="@dimen/activity_margin_large"
|
||||||
|
app:srcCompat="@drawable/ic_help_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:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="@string/about_label_faq" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:text="@string/about_label_faq_long" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
<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>
|
||||||
|
<string name="about_label_faq">FAQ</string>
|
||||||
|
<string name="about_label_faq_long">Frequently asked questions</string>
|
||||||
|
|
||||||
<!-- Authors -->
|
<!-- Authors -->
|
||||||
<string name="about_title_authors">Authors</string>
|
<string name="about_title_authors">Authors</string>
|
||||||
|
|
Loading…
Reference in a new issue