diff --git a/README.md b/README.md
index f40f2bc0..e34acdf2 100644
--- a/README.md
+++ b/README.md
@@ -146,10 +146,10 @@ So make sure you have a **current backup** before switching!
## Acknowledgments:
#### Open-source components used:
+ * [AboutLibraries](https://github.com/mikepenz/AboutLibraries)
* [Apache Commons Codec](https://commons.apache.org/proper/commons-codec/)
* [Expandable Layout](https://github.com/AAkira/ExpandableLayout)
* [FABsMenu](https://github.com/jahirfiquitiva/FABsMenu)
- * [LicensesDialog](https://github.com/PSDev/LicensesDialog)
* [material-intro](https://github.com/heinrichreimer/material-intro)
* [MaterialProgressBar](https://github.com/DreaminginCodeZH/MaterialProgressBar)
* [OpenPGP API library](https://github.com/open-keychain/openpgp-api)
@@ -163,6 +163,10 @@ So make sure you have a **current backup** before switching!
* [LetterBitmap](http://stackoverflow.com/questions/23122088/colored-boxed-with-letters-a-la-gmail)
* [DimensionConverter](https://stackoverflow.com/questions/8343971/how-to-parse-a-dimension-string-and-convert-it-to-a-dimension-value)
+#### Previously used open-source components:
+
+ * [LicensesDialog](https://github.com/PSDev/LicensesDialog)
+
#### Previously used code examples:
* [FloatingActionMenuAndroid](https://github.com/pmahsky/FloatingActionMenuAndroid)
diff --git a/app/build.gradle b/app/build.gradle
index e48e34cc..f0f46217 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -31,11 +31,9 @@ android {
}
}
-ext {
- supportLibVersion = "27.1.0"
-}
-
dependencies {
+ ext.supportLibVersion = "27.1.0"
+
implementation "commons-codec:commons-codec:1.11"
implementation "com.android.support:appcompat-v7:$supportLibVersion"
implementation "com.android.support:cardview-v7:$supportLibVersion"
@@ -46,8 +44,8 @@ dependencies {
implementation "com.heinrichreimersoftware:material-intro:1.6.2"
implementation "com.journeyapps:zxing-android-embedded:3.6.0"
implementation "com.vanniktech:vntnumberpickerpreference:1.0.0"
- implementation "de.psdev.licensesdialog:licensesdialog:1.8.3"
implementation "me.zhanghai.android.materialprogressbar:library:1.4.2"
implementation "org.sufficientlysecure:openpgp-api:12.0"
implementation "me.jahirfiquitiva:FABsMenu:1.1.2"
+ implementation "com.mikepenz:aboutlibraries:6.0.6"
}
diff --git a/app/src/main/java/org/shadowice/flocke/andotp/Activities/AboutActivity.java b/app/src/main/java/org/shadowice/flocke/andotp/Activities/AboutActivity.java
index 900ede82..8e45ccb9 100644
--- a/app/src/main/java/org/shadowice/flocke/andotp/Activities/AboutActivity.java
+++ b/app/src/main/java/org/shadowice/flocke/andotp/Activities/AboutActivity.java
@@ -22,60 +22,22 @@
package org.shadowice.flocke.andotp.Activities;
-import android.app.AlertDialog;
-import android.content.ClipData;
-import android.content.ClipboardManager;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
-import android.graphics.ColorFilter;
-import android.net.Uri;
import android.os.Bundle;
+import android.support.design.widget.TabLayout;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentPagerAdapter;
+import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.ViewStub;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-import android.widget.Toast;
+import com.mikepenz.aboutlibraries.LibsBuilder;
+
+import org.shadowice.flocke.andotp.Fragments.AboutFragment;
import org.shadowice.flocke.andotp.R;
-import org.shadowice.flocke.andotp.Utilities.Tools;
-
-import de.psdev.licensesdialog.LicensesDialog;
public class AboutActivity extends BaseActivity {
- 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 MIT_URI = GITHUB_URI + "/blob/master/LICENSE.txt";
-
- private static final String AUTHOR1_GITHUB = "https://github.com/flocke";
- private static final String AUTHOR1_EXTRA = "https://paypal.me/flocke000";
-
- private static final String AUTHOR2_GITHUB = "https://github.com/richyhbm";
- private static final String AUTHOR2_EXTRA = "bitcoin:1KyLwnxXR577gYUtwRMSMhkpsJVoK2bTLN";
-
- private static final String AUTHOR_ORIGINAL_GITHUB = "https://github.com/0xbb";
- private static final String AUTHOR_ORIGINAL_EXTRA = AUTHOR_ORIGINAL_GITHUB + "/otp-authenticator";
-
- private static final String CONTRIBUTORS_URI = GITHUB_URI + "/blob/master/README.md#contributors";
- private static final String TRANSLATORS_URI = GITHUB_URI + "/blob/master/README.md#translators";
-
- private static final String BUGREPORT_URI = GITHUB_URI + "/issues";
- private static final String TRANSLATE_URI = "https://crowdin.com/project/andotp";
-
- static final int[] imageResources = {
- R.id.aboutImgVersion, R.id.aboutImgLicense, R.id.aboutImgChangelog, R.id.aboutImgSource,
- R.id.aboutImgOpenSource, R.id.aboutImgAuthor1, R.id.aboutImgAuthorOriginal, R.id.aboutImgContributors,
- R.id.aboutImgTranslators, R.id.aboutImgBugs, R.id.aboutImgTranslate
- };
-
- static long lastTap = 0;
- static int taps = 0;
- static Toast currentToast = null;
-
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -87,194 +49,16 @@ public class AboutActivity extends BaseActivity {
setSupportActionBar(toolbar);
ViewStub stub = findViewById(R.id.container_stub);
- stub.setLayoutResource(R.layout.content_about);
+ stub.setLayoutResource(R.layout.component_about);
+
View v = stub.inflate();
- ColorFilter filter = Tools.getThemeColorFilter(this, android.R.attr.textColorSecondary);
- for (int i : imageResources) {
- ImageView imgView = v.findViewById(i);
- imgView.getDrawable().setColorFilter(filter);
- }
+ ViewPager viewPager = v.findViewById(R.id.viewPager);
+ TabLayout tabLayout = v.findViewById(R.id.tabLayout);
+ AboutPageAdapter aboutPageAdapter = new AboutPageAdapter(getSupportFragmentManager());
- String versionName = "";
- try {
- PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
- versionName = packageInfo.versionName;
- } catch (PackageManager.NameNotFoundException e) {
- e.printStackTrace();
- }
-
- LinearLayout versionLayout = v.findViewById(R.id.about_layout_version);
-
- versionLayout.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- long thisTap = System.currentTimeMillis();
-
- if (thisTap - lastTap < 500) {
- taps = taps + 1;
-
- if (currentToast != null && taps <= 7)
- currentToast.cancel();
-
- if (taps >= 3 && taps <= 7)
- currentToast = Toast.makeText(getBaseContext(), String.valueOf(taps), Toast.LENGTH_SHORT);
-
- if (taps == 7) {
- if (settings.getSpecialFeatures())
- currentToast = Toast.makeText(getBaseContext(), R.string.about_toast_special_features_enabled, Toast.LENGTH_LONG);
- else
- enableSpecialFeatures();
- }
-
- if (currentToast != null)
- currentToast.show();
- } else {
- taps = 0;
- }
-
- lastTap = thisTap;
- }
- });
-
- TextView version = v.findViewById(R.id.about_text_version);
- version.setText(versionName);
-
- LinearLayout license = v.findViewById(R.id.about_layout_license);
- LinearLayout changelog = v.findViewById(R.id.about_layout_changelog);
- LinearLayout source = v.findViewById(R.id.about_layout_source);
- LinearLayout licenses = v.findViewById(R.id.about_layout_licenses);
- license.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- openURI(MIT_URI);
- }
- });
- changelog.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- openURI(CHANGELOG_URI);
- }
- });
- source.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- openURI(GITHUB_URI);
- }
- });
- licenses.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- showLicenses();
- }
- });
-
- TextView author1GitHub = v.findViewById(R.id.about_author1_github);
- TextView author1Paypal = v.findViewById(R.id.about_author1_extra);
- 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) {
- try {
- openURI(AUTHOR1_EXTRA);
- } catch(Exception ignored) {
- copyToClipboard(AUTHOR1_EXTRA);
- }
- }
- });
-
-
- TextView author2GitHub = v.findViewById(R.id.about_author2_github);
- TextView author2Paypal = v.findViewById(R.id.about_author2_extra);
- author2GitHub.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- openURI(AUTHOR2_GITHUB);
- }
- });
- author2Paypal.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- try {
- openURI(AUTHOR2_EXTRA);
- } catch(Exception ignored) {
- copyToClipboard(AUTHOR2_EXTRA);
- }
- }
- });
-
- TextView authorOriginalGitHub = v.findViewById(R.id.about_author_original_github);
- TextView authorOriginalApp = v.findViewById(R.id.about_author_original_extra);
- authorOriginalGitHub.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- openURI(AUTHOR_ORIGINAL_GITHUB);
- }
- });
- authorOriginalApp.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- try {
- openURI(AUTHOR_ORIGINAL_EXTRA);
- } catch(Exception ignored) {
- copyToClipboard(AUTHOR_ORIGINAL_EXTRA);
- }
- }
- });
-
- LinearLayout contributors = v.findViewById(R.id.about_layout_contributors);
- LinearLayout translators = v.findViewById(R.id.about_layout_translators);
- contributors.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- openURI(CONTRIBUTORS_URI);
- }
- });
- translators.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- openURI(TRANSLATORS_URI);
- }
- });
-
- LinearLayout bugReport = v.findViewById(R.id.about_layout_bugs);
- LinearLayout translate = v.findViewById(R.id.about_layout_translate);
- bugReport.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- openURI(BUGREPORT_URI);
- }
- });
- translate.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- openURI(TRANSLATE_URI);
- }
- });
- }
-
- private void enableSpecialFeatures() {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setTitle(R.string.about_title_special_features)
- .setMessage(R.string.about_dialog_special_features)
- .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialogInterface, int i) {
- settings.setSpecialFeatures(true);
- Toast.makeText(getBaseContext(), R.string.about_toast_special_features, Toast.LENGTH_LONG).show();
- }
- })
- .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialogInterface, int i) {}
- })
- .create()
- .show();
+ viewPager.setAdapter(aboutPageAdapter);
+ tabLayout.setupWithViewPager(viewPager);
}
// Go back to the main activity
@@ -290,35 +74,40 @@ public class AboutActivity extends BaseActivity {
super.onBackPressed();
}
- public void openURI(String uri) {
- Intent openURI = new Intent(Intent.ACTION_VIEW);
- openURI.setData(Uri.parse(uri));
- startActivity(openURI);
- }
-
- public void copyToClipboard(String uri) {
- ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
- ClipData clip = ClipData.newPlainText("andOTP", uri);
- clipboard.setPrimaryClip(clip);
- Toast.makeText(this, getString(R.string.about_toast_copied_to_clipboard), Toast.LENGTH_SHORT).show();
- }
+ private class AboutPageAdapter extends FragmentPagerAdapter {
+ AboutPageAdapter(FragmentManager fm) {
+ super(fm);
+ }
+ @Override
+ public Fragment getItem(int pos) {
+ switch(pos) {
+ case 0:
+ return new AboutFragment();
+ case 1:
+ return new LibsBuilder()
+ .withFields(R.string.class.getFields())
+ .supportFragment();
+ default:
+ return null;
+ }
+ }
- public void showLicenses() {
- String backgroundColor = Tools.getCSSRGBAString(Tools.getThemeColor(this, R.attr.colorBackgroundFloating));
- String textColor = Tools.getCSSRGBAString(Tools.getThemeColor(this, android.R.attr.textColorPrimary));
- String textColorSecondary = Tools.getCSSRGBAString(Tools.getThemeColor(this, android.R.attr.textColorSecondary));
+ @Override
+ public int getCount() {
+ return 2;
+ }
- String cssFormat = getString(R.string.custom_notices_style, backgroundColor, textColor, textColorSecondary);
-
- LicensesDialog dialog = new LicensesDialog.Builder(this)
- .setNotices(R.raw.licenses)
- .setTitle(R.string.about_label_licenses)
- .setShowFullLicenseText(false)
- .setIncludeOwnLicense(true)
- .setNoticesCssStyle(cssFormat)
- .build();
-
- dialog.show();
+ @Override
+ public String getPageTitle(int pos) {
+ switch(pos) {
+ case 0:
+ return getString(R.string.about_tab_about);
+ case 1:
+ return getString(R.string.about_tab_libraries);
+ default:
+ return null;
+ }
+ }
}
}
diff --git a/app/src/main/java/org/shadowice/flocke/andotp/Fragments/AboutFragment.java b/app/src/main/java/org/shadowice/flocke/andotp/Fragments/AboutFragment.java
new file mode 100644
index 00000000..2114a734
--- /dev/null
+++ b/app/src/main/java/org/shadowice/flocke/andotp/Fragments/AboutFragment.java
@@ -0,0 +1,263 @@
+package org.shadowice.flocke.andotp.Fragments;
+
+import android.app.AlertDialog;
+import android.content.ClipData;
+import android.content.ClipboardManager;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.graphics.ColorFilter;
+import android.net.Uri;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import org.shadowice.flocke.andotp.R;
+import org.shadowice.flocke.andotp.Utilities.Settings;
+import org.shadowice.flocke.andotp.Utilities.Tools;
+
+public class AboutFragment extends Fragment {
+ 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 MIT_URI = GITHUB_URI + "/blob/master/LICENSE.txt";
+
+ private static final String AUTHOR1_GITHUB = "https://github.com/flocke";
+ private static final String AUTHOR1_EXTRA = "https://paypal.me/flocke000";
+
+ private static final String AUTHOR2_GITHUB = "https://github.com/richyhbm";
+ private static final String AUTHOR2_EXTRA = "bitcoin:1KyLwnxXR577gYUtwRMSMhkpsJVoK2bTLN";
+
+ private static final String AUTHOR_ORIGINAL_GITHUB = "https://github.com/0xbb";
+ private static final String AUTHOR_ORIGINAL_EXTRA = AUTHOR_ORIGINAL_GITHUB + "/otp-authenticator";
+
+ private static final String CONTRIBUTORS_URI = GITHUB_URI + "/blob/master/README.md#contributors";
+ private static final String TRANSLATORS_URI = GITHUB_URI + "/blob/master/README.md#translators";
+
+ private static final String BUGREPORT_URI = GITHUB_URI + "/issues";
+ private static final String TRANSLATE_URI = "https://crowdin.com/project/andotp";
+
+ private Settings settings;
+
+ static final int[] imageResources = {
+ R.id.aboutImgVersion, R.id.aboutImgLicense, R.id.aboutImgChangelog, R.id.aboutImgSource,
+ R.id.aboutImgAuthor1, R.id.aboutImgAuthorOriginal, R.id.aboutImgContributors,
+ R.id.aboutImgTranslators, R.id.aboutImgBugs, R.id.aboutImgTranslate
+ };
+
+ static long lastTap = 0;
+ static int taps = 0;
+ static Toast currentToast = null;
+
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ View v = inflater.inflate(R.layout.fragment_about, container, false);
+
+ settings = new Settings(getActivity());
+
+ ColorFilter filter = Tools.getThemeColorFilter(getActivity(), android.R.attr.textColorSecondary);
+ for (int i : imageResources) {
+ ImageView imgView = v.findViewById(i);
+ imgView.getDrawable().setColorFilter(filter);
+ }
+
+ String versionName = "";
+ try {
+ PackageInfo packageInfo = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0);
+ versionName = packageInfo.versionName;
+ } catch (PackageManager.NameNotFoundException e) {
+ e.printStackTrace();
+ }
+
+ LinearLayout versionLayout = v.findViewById(R.id.about_layout_version);
+
+ versionLayout.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ long thisTap = System.currentTimeMillis();
+
+ if (thisTap - lastTap < 500) {
+ taps = taps + 1;
+
+ if (currentToast != null && taps <= 7)
+ currentToast.cancel();
+
+ if (taps >= 3 && taps <= 7)
+ currentToast = Toast.makeText(getActivity(), String.valueOf(taps), Toast.LENGTH_SHORT);
+
+ if (taps == 7) {
+ if (settings.getSpecialFeatures())
+ currentToast = Toast.makeText(getActivity(), R.string.about_toast_special_features_enabled, Toast.LENGTH_LONG);
+ else
+ enableSpecialFeatures();
+ }
+
+ if (currentToast != null)
+ currentToast.show();
+ } else {
+ taps = 0;
+ }
+
+ lastTap = thisTap;
+ }
+ });
+
+ TextView version = v.findViewById(R.id.about_text_version);
+ version.setText(versionName);
+
+ LinearLayout license = v.findViewById(R.id.about_layout_license);
+ LinearLayout changelog = v.findViewById(R.id.about_layout_changelog);
+ LinearLayout source = v.findViewById(R.id.about_layout_source);
+
+ license.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ openURI(MIT_URI);
+ }
+ });
+ changelog.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ openURI(CHANGELOG_URI);
+ }
+ });
+ source.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ openURI(GITHUB_URI);
+ }
+ });
+
+ TextView author1GitHub = v.findViewById(R.id.about_author1_github);
+ TextView author1Paypal = v.findViewById(R.id.about_author1_extra);
+ 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) {
+ try {
+ openURI(AUTHOR1_EXTRA);
+ } catch(Exception ignored) {
+ copyToClipboard(AUTHOR1_EXTRA);
+ }
+ }
+ });
+
+
+ TextView author2GitHub = v.findViewById(R.id.about_author2_github);
+ TextView author2Paypal = v.findViewById(R.id.about_author2_extra);
+ author2GitHub.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ openURI(AUTHOR2_GITHUB);
+ }
+ });
+ author2Paypal.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ try {
+ openURI(AUTHOR2_EXTRA);
+ } catch(Exception ignored) {
+ copyToClipboard(AUTHOR2_EXTRA);
+ }
+ }
+ });
+
+ TextView authorOriginalGitHub = v.findViewById(R.id.about_author_original_github);
+ TextView authorOriginalApp = v.findViewById(R.id.about_author_original_extra);
+ authorOriginalGitHub.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ openURI(AUTHOR_ORIGINAL_GITHUB);
+ }
+ });
+ authorOriginalApp.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ try {
+ openURI(AUTHOR_ORIGINAL_EXTRA);
+ } catch(Exception ignored) {
+ copyToClipboard(AUTHOR_ORIGINAL_EXTRA);
+ }
+ }
+ });
+
+ LinearLayout contributors = v.findViewById(R.id.about_layout_contributors);
+ LinearLayout translators = v.findViewById(R.id.about_layout_translators);
+ contributors.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ openURI(CONTRIBUTORS_URI);
+ }
+ });
+ translators.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ openURI(TRANSLATORS_URI);
+ }
+ });
+
+ LinearLayout bugReport = v.findViewById(R.id.about_layout_bugs);
+ LinearLayout translate = v.findViewById(R.id.about_layout_translate);
+ bugReport.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ openURI(BUGREPORT_URI);
+ }
+ });
+ translate.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ openURI(TRANSLATE_URI);
+ }
+ });
+
+ return v;
+ }
+
+ private void enableSpecialFeatures() {
+ AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+ builder.setTitle(R.string.about_title_special_features)
+ .setMessage(R.string.about_dialog_special_features)
+ .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialogInterface, int i) {
+ settings.setSpecialFeatures(true);
+ Toast.makeText(getActivity(), R.string.about_toast_special_features, Toast.LENGTH_LONG).show();
+ }
+ })
+ .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialogInterface, int i) {}
+ })
+ .create()
+ .show();
+ }
+
+ public void openURI(String uri) {
+ Intent openURI = new Intent(Intent.ACTION_VIEW);
+ openURI.setData(Uri.parse(uri));
+ startActivity(openURI);
+ }
+
+ public void copyToClipboard(String uri) {
+ ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
+ ClipData clip = ClipData.newPlainText("andOTP", uri);
+ clipboard.setPrimaryClip(clip);
+ Toast.makeText(getActivity(), getString(R.string.about_toast_copied_to_clipboard), Toast.LENGTH_SHORT).show();
+ }
+
+}
diff --git a/app/src/main/java/org/shadowice/flocke/andotp/Utilities/Tools.java b/app/src/main/java/org/shadowice/flocke/andotp/Utilities/Tools.java
index 75275852..e011aa5f 100644
--- a/app/src/main/java/org/shadowice/flocke/andotp/Utilities/Tools.java
+++ b/app/src/main/java/org/shadowice/flocke/andotp/Utilities/Tools.java
@@ -67,14 +67,6 @@ public class Tools {
return colorValue;
}
- public static String getCSSRGBAString(@ColorInt int color) {
- int red = Color.red(color);
- int green = Color.green(color);
- int blue = Color.blue(color);
- float alpha = ((float) Color.alpha(color) / 255);
- return String.format(Locale.ENGLISH, CSS_RGBA_FORMAT, red, green, blue, alpha);
- }
-
/* Create a ColorFilter based on the current theme */
public static ColorFilter getThemeColorFilter(Context context, int colorAttr) {
return new PorterDuffColorFilter(getThemeColor(context, colorAttr), PorterDuff.Mode.SRC_IN);
diff --git a/app/src/main/res/layout/component_about.xml b/app/src/main/res/layout/component_about.xml
new file mode 100644
index 00000000..e79c9ff4
--- /dev/null
+++ b/app/src/main/res/layout/component_about.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/content_about.xml b/app/src/main/res/layout/fragment_about.xml
similarity index 95%
rename from app/src/main/res/layout/content_about.xml
rename to app/src/main/res/layout/fragment_about.xml
index 68b91334..454484bb 100644
--- a/app/src/main/res/layout/content_about.xml
+++ b/app/src/main/res/layout/fragment_about.xml
@@ -205,34 +205,6 @@
android:textAppearance="?android:attr/textAppearanceMedium" />
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/raw/licenses.xml b/app/src/main/res/raw/licenses.xml
deleted file mode 100644
index 9f365e8c..00000000
--- a/app/src/main/res/raw/licenses.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
- Apache Commons Codec
- https://commons.apache.org/proper/commons-codec
- Copyright 2002-2014 The Apache Software Foundation
- Apache Software License 2.0
-
-
- Expandable Layout
- https://github.com/AAkira/ExpandableLayout
- Copyright (C) 2015 A.Akira
- Apache Software License 2.0
-
-
- FABsMenu
- https://github.com/jahirfiquitiva/FABsMenu
- Copyright (c) 2018 Jahir Fiquitiva
- Apache Software License 2.0
-
-
- material-intro
- https://github.com/heinrichreimer/material-intro
- Copyright (c) 2017 Jan Heinrich Reimer
- MIT License
-
-
- MaterialProgressBar
- https://github.com/DreaminginCodeZH/MaterialProgressBar
- Copyright 2015 Zhang Hai
- Apache Software License 2.0
-
-
- OpenPGP API library
- https://github.com/open-keychain/openpgp-api
- Copyright (C) 2015 Dominik Schürmann
- Apache Software License 2.0
-
-
- VNTNumberPickerPreference
- https://github.com/vanniktech/VNTNumberPickerPreference
- Copyright (C) 2014-2016 Vanniktech - Niklas Baudy
- Apache Software License 2.0
-
-
- ZXing Android Embedded
- https://github.com/journeyapps/zxing-android-embedded
- Copyright (C) 2012-2017 ZXing authors, Journey Mobile
- Apache Software License 2.0
-
-
\ No newline at end of file
diff --git a/app/src/main/res/values/licenses_css.xml b/app/src/main/res/values/licenses_css.xml
deleted file mode 100644
index 67eb97d3..00000000
--- a/app/src/main/res/values/licenses_css.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
- body {
- background-color: %1$s;
- color: %2$s;
- font-family: sans-serif;
- overflow-wrap: break-word;
- }
- pre {
- background-color: %1$s;
- color: %3$s;
- white-space: pre-wrap;
- padding: 1em;
- }
-
-
\ No newline at end of file
diff --git a/app/src/main/res/values/strings_about.xml b/app/src/main/res/values/strings_about.xml
index 150755a2..289e31a1 100644
--- a/app/src/main/res/values/strings_about.xml
+++ b/app/src/main/res/values/strings_about.xml
@@ -4,10 +4,12 @@
Open source two-factor authentication for Android
+ About
+ Libraries
+
Changelog
License
- Open source licenses
MIT License
Source code
Version