From 862716406e3635dfa2377eb905cbc52acded6add Mon Sep 17 00:00:00 2001
From: m2049r <30435443+m2049r@users.noreply.github.com>
Date: Tue, 12 Sep 2017 21:32:05 +0200
Subject: [PATCH] Show Licenses (#63)
and upgrade to support library 25.4.0
resolves #59
---
.../animated_vector_drawable_25_3_1.xml | 12 -
.idea/libraries/appcompat_v7_25_3_1.xml | 12 -
.idea/libraries/cardview_v7_25_3_1.xml | 12 -
.idea/libraries/design_25_3_1.xml | 12 -
.idea/libraries/recyclerview_v7_25_3_1.xml | 12 -
.../libraries/support_annotations_25_3_1.xml | 11 -
.idea/libraries/support_compat_25_3_1.xml | 12 -
.idea/libraries/support_core_ui_25_3_1.xml | 12 -
.idea/libraries/support_core_utils_25_3_1.xml | 12 -
.idea/libraries/support_fragment_25_3_1.xml | 12 -
.../libraries/support_media_compat_25_3_1.xml | 12 -
.idea/libraries/support_v4_25_3_1.xml | 10 -
.../support_vector_drawable_25_3_1.xml | 12 -
.idea/libraries/transition_25_3_1.xml | 12 -
app/build.gradle | 44 +--
.../com/m2049r/xmrwallet/LoginActivity.java | 14 +
.../com/m2049r/xmrwallet/LoginFragment.java | 17 +-
.../xmrwallet/license/LicensesFragment.java | 223 ++++++++++++++++
app/src/main/res/layout/licenses_fragment.xml | 38 +++
app/src/main/res/menu/list_context_menu.xml | 26 ++
app/src/main/res/menu/list_menu.xml | 26 +-
app/src/main/res/raw/licenses.html | 252 ++++++++++++++++++
app/src/main/res/values/about.xml | 6 +
app/src/main/res/values/strings.xml | 2 +
build.gradle | 3 +
25 files changed, 609 insertions(+), 207 deletions(-)
delete mode 100644 .idea/libraries/animated_vector_drawable_25_3_1.xml
delete mode 100644 .idea/libraries/appcompat_v7_25_3_1.xml
delete mode 100644 .idea/libraries/cardview_v7_25_3_1.xml
delete mode 100644 .idea/libraries/design_25_3_1.xml
delete mode 100644 .idea/libraries/recyclerview_v7_25_3_1.xml
delete mode 100644 .idea/libraries/support_annotations_25_3_1.xml
delete mode 100644 .idea/libraries/support_compat_25_3_1.xml
delete mode 100644 .idea/libraries/support_core_ui_25_3_1.xml
delete mode 100644 .idea/libraries/support_core_utils_25_3_1.xml
delete mode 100644 .idea/libraries/support_fragment_25_3_1.xml
delete mode 100644 .idea/libraries/support_media_compat_25_3_1.xml
delete mode 100644 .idea/libraries/support_v4_25_3_1.xml
delete mode 100644 .idea/libraries/support_vector_drawable_25_3_1.xml
delete mode 100644 .idea/libraries/transition_25_3_1.xml
create mode 100644 app/src/main/java/com/m2049r/xmrwallet/license/LicensesFragment.java
create mode 100644 app/src/main/res/layout/licenses_fragment.xml
create mode 100644 app/src/main/res/menu/list_context_menu.xml
create mode 100644 app/src/main/res/raw/licenses.html
create mode 100644 app/src/main/res/values/about.xml
diff --git a/.idea/libraries/animated_vector_drawable_25_3_1.xml b/.idea/libraries/animated_vector_drawable_25_3_1.xml
deleted file mode 100644
index 78eeffc..0000000
--- a/.idea/libraries/animated_vector_drawable_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/appcompat_v7_25_3_1.xml b/.idea/libraries/appcompat_v7_25_3_1.xml
deleted file mode 100644
index f1d4de5..0000000
--- a/.idea/libraries/appcompat_v7_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/cardview_v7_25_3_1.xml b/.idea/libraries/cardview_v7_25_3_1.xml
deleted file mode 100644
index beadd4a..0000000
--- a/.idea/libraries/cardview_v7_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/design_25_3_1.xml b/.idea/libraries/design_25_3_1.xml
deleted file mode 100644
index 90e013a..0000000
--- a/.idea/libraries/design_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/recyclerview_v7_25_3_1.xml b/.idea/libraries/recyclerview_v7_25_3_1.xml
deleted file mode 100644
index 6b856b3..0000000
--- a/.idea/libraries/recyclerview_v7_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/support_annotations_25_3_1.xml b/.idea/libraries/support_annotations_25_3_1.xml
deleted file mode 100644
index beb3941..0000000
--- a/.idea/libraries/support_annotations_25_3_1.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/support_compat_25_3_1.xml b/.idea/libraries/support_compat_25_3_1.xml
deleted file mode 100644
index 92ae674..0000000
--- a/.idea/libraries/support_compat_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/support_core_ui_25_3_1.xml b/.idea/libraries/support_core_ui_25_3_1.xml
deleted file mode 100644
index 46bcc7f..0000000
--- a/.idea/libraries/support_core_ui_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/support_core_utils_25_3_1.xml b/.idea/libraries/support_core_utils_25_3_1.xml
deleted file mode 100644
index a54f87f..0000000
--- a/.idea/libraries/support_core_utils_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/support_fragment_25_3_1.xml b/.idea/libraries/support_fragment_25_3_1.xml
deleted file mode 100644
index 1c87b7a..0000000
--- a/.idea/libraries/support_fragment_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/support_media_compat_25_3_1.xml b/.idea/libraries/support_media_compat_25_3_1.xml
deleted file mode 100644
index 03ab57b..0000000
--- a/.idea/libraries/support_media_compat_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/support_v4_25_3_1.xml b/.idea/libraries/support_v4_25_3_1.xml
deleted file mode 100644
index 194e0c4..0000000
--- a/.idea/libraries/support_v4_25_3_1.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/support_vector_drawable_25_3_1.xml b/.idea/libraries/support_vector_drawable_25_3_1.xml
deleted file mode 100644
index c4a86f4..0000000
--- a/.idea/libraries/support_vector_drawable_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/libraries/transition_25_3_1.xml b/.idea/libraries/transition_25_3_1.xml
deleted file mode 100644
index 0cf2b5a..0000000
--- a/.idea/libraries/transition_25_3_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 650134c..a5ca324 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -36,36 +36,38 @@ android {
}
dependencies {
- compile 'com.android.support:appcompat-v7:25.3.1'
- compile 'com.android.support:design:25.3.1'
+ compile 'com.android.support:appcompat-v7:25.4.0'
+ compile 'com.android.support:design:25.4.0'
+ compile 'com.android.support:support-v4:25.4.0'
+ compile 'com.android.support:recyclerview-v7:25.4.0'
+ compile 'com.android.support:cardview-v7:25.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
- compile 'com.android.support:support-v4:25.3.1'
- compile 'com.android.support:recyclerview-v7:25.3.1'
- compile 'com.android.support:cardview-v7:25.3.1'
compile 'me.dm7.barcodescanner:zxing:1.9.8'
+ compile('de.psdev.licensesdialog:licensesdialog:1.8.3')
}
dependencyVerification {
verify = [
- 'com.android.support:design:a3e83064fe99d0a4369f9b46d8bfbe77d0c3022fffdee4be3ac3857b87cc89e3',
- 'com.android.support:appcompat-v7:ac1ebbc46589195dda3e0b1becfe410bafd75bdf3edd1cd9acf04850f3895830',
+ 'com.android.support:appcompat-v7:70551e62660db15b790c5275f56b9de4dd9407d1494d07c8f3dd5698f3638677',
+ 'com.android.support:design:3f409bf2019967ffc344cfaf11e52131fac982468a1707aaeb25bf3c52838966',
+ 'com.android.support:support-v4:ee44c481a1f4d6978568e223e8125379b52b2ececdd53450e09ebae144bd377d',
+ 'com.android.support:recyclerview-v7:a2fe121f9d01ed8980e97095b4a3fe9700a0aa0a7d4b0f8c594f765ad8455a0d',
+ 'com.android.support:cardview-v7:f3fbbe1fcfdbec7333c6a2c516c5fd511a909d1975271818e268d6fe297d8c70',
'com.android.support.constraint:constraint-layout:b0c688cc2b7172608f8153a689d746da40f71e52d7e2fe2bfd9df2f92db77085',
- 'com.android.support:transition:36c688825a8c0e6e879e18886de83dc90673322822d5b606ee302f70fb558e16',
'me.dm7.barcodescanner:zxing:d43973c9527c23fa8e6d338c6a2c458e373ce1ac6bcaa3bc41d11ae49116000d',
- 'me.dm7.barcodescanner:core:a5c8a704089b58029db166172ed8e55d756877d010a85a0b1c94fdc96ffb8f9a',
- 'com.android.support:support-v4:07d389154bcf73b47e514964df1578136b26cba78257b8a577a3ccb54beff0ae',
- 'com.android.support:recyclerview-v7:375974a8724e359d97d77fa8522c614f813a3ac4583c1807f154a3f9a054b0a1',
- 'com.android.support:cardview-v7:defc17032ffa600a82e1c7d96bb574aa5ed64e2b57e28414a245da7d6db0c666',
- 'com.android.support:animated-vector-drawable:4bc46edf1946b32d518b41416d1734e915e0cbb28021de3b340527419b070691',
- 'com.android.support:support-vector-drawable:13728f337f36d1c02d52198a6c20724edb447a0875454d829f95cb9eb4aa293b',
- 'com.android.support:support-fragment:541d6393c1e024453aca2a14f31bea0c7270ff4e2a02783f3528aa426367444d',
- 'com.android.support:support-media-compat:cbed07d07e0e84fdb4b75712f5fd946229a8af155933c9a92e41db64d00791e0',
- 'com.android.support:support-core-utils:32fac02eb2c20a77fa3e3bc3ede62392a19613f72b8f8e10f5dfa84bb4c89ea1',
- 'com.android.support:support-core-ui:6182278a6653e6c111c888963626cbb16f2d0022571cb239760475119e0b92a8',
- 'com.android.support:support-compat:e02d781268dc60aab6638d8dc20156ea11ca20b962d294b85e6f1e8418cabfa7',
- 'com.android.support:support-annotations:aedf76962584adfaed2bd3fcaa22406461c4310237fc27e301128edaa2dba2fa',
+ 'de.psdev.licensesdialog:licensesdialog:ac6e0be89323b993eb7c732a882278f2cb08c4e525062affa1bc4a1344e4ecf3',
+ 'com.android.support:support-annotations:a774272036941b4e912eb426d70c848bde7f06a3bf5fb491f75a427dc6595270',
+ 'com.android.support:support-vector-drawable:077009d13882ee96f061e4bc2dbe7cce7ae1762d8297592a787ff741afbfb1f2',
+ 'com.android.support:animated-vector-drawable:628ab1d56a6ee4cbedf32617af8b2a1fe02964ed0628e8f898cc09ddba6e1835',
+ 'com.android.support:transition:848270144fb180efd2bf928a00ed176dbbc5290badfd638390ffba90088df8b3',
+ 'com.android.support:support-compat:54019c63614ce08b02d7b9605490cd2b29ba5b2505f394a9517450b5f72b30ca',
+ 'com.android.support:support-media-compat:566a161d9cb0083ef62a53e46b71ce5b3d455b8635b1a0a4ae28d96d4b583de8',
+ 'com.android.support:support-core-utils:34b8437dfa95ff28d29cf57ffa3b1354a9fa9bfe4059f0fd5ce2f5e4326a1748',
+ 'com.android.support:support-core-ui:e72ae29b823889686cff6fcb948d6745c2baf6d4c2af4fdffa1ec1e42e3833a3',
+ 'com.android.support:support-fragment:316d35d4d2d2902057efad104a73e4bdb50bee260a7075678185b8cd71170945',
'com.android.support.constraint:constraint-layout-solver:8c62525a9bc5cff5633a96cb9b32fffeccaf41b8841aa87fc22607070dea9b8d',
+ 'me.dm7.barcodescanner:core:a5c8a704089b58029db166172ed8e55d756877d010a85a0b1c94fdc96ffb8f9a',
'com.google.zxing:core:bba7724e02a997cec38213af77133ee8e24b0d5cf5fa7ecbc16a4fa93f11ee0d',
+ 'com.google.code.findbugs:jsr305:c885ce34249682bc0236b4a7d56efcc12048e6135a5baf7a9cde8ad8cda13fcd',
]
}
-
diff --git a/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java b/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java
index 16868e7..ffbf415 100644
--- a/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java
+++ b/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java
@@ -36,12 +36,14 @@ import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
+import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
+import com.m2049r.xmrwallet.license.LicensesFragment;
import com.m2049r.xmrwallet.model.Wallet;
import com.m2049r.xmrwallet.model.WalletManager;
import com.m2049r.xmrwallet.service.WalletService;
@@ -917,4 +919,16 @@ public class LoginActivity extends AppCompatActivity
super.onBackPressed();
}
}
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.action_lincense_info:
+ LicensesFragment.displayLicensesFragment(getSupportFragmentManager());
+ return true;
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ }
+
}
diff --git a/app/src/main/java/com/m2049r/xmrwallet/LoginFragment.java b/app/src/main/java/com/m2049r/xmrwallet/LoginFragment.java
index 0c3c629..e2e8d92 100644
--- a/app/src/main/java/com/m2049r/xmrwallet/LoginFragment.java
+++ b/app/src/main/java/com/m2049r/xmrwallet/LoginFragment.java
@@ -21,12 +21,14 @@ import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.StrictMode;
import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.ContextMenu;
import android.view.KeyEvent;
import android.view.LayoutInflater;
+import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
@@ -388,7 +390,7 @@ public class LoginFragment extends Fragment {
ContextMenu.ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
MenuInflater inflater = getActivity().getMenuInflater();
- inflater.inflate(R.menu.list_menu, menu);
+ inflater.inflate(R.menu.list_context_menu, menu);
}
@Override
@@ -442,4 +444,17 @@ public class LoginFragment extends Fragment {
}
return wallet;
}
+
+
+ @Override
+ public void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setHasOptionsMenu(true);
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ inflater.inflate(R.menu.list_menu, menu);
+ super.onCreateOptionsMenu(menu, inflater);
+ }
}
diff --git a/app/src/main/java/com/m2049r/xmrwallet/license/LicensesFragment.java b/app/src/main/java/com/m2049r/xmrwallet/license/LicensesFragment.java
new file mode 100644
index 0000000..9cc5869
--- /dev/null
+++ b/app/src/main/java/com/m2049r/xmrwallet/license/LicensesFragment.java
@@ -0,0 +1,223 @@
+/**
+ * Copyright 2013 Adam Speakman, m2049r
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.m2049r.xmrwallet.license;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import android.annotation.SuppressLint;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.graphics.Color;
+import android.os.AsyncTask;
+import android.os.Bundle;
+//TODO If you don't support Android 2.x, you should use the non-support version!
+import android.support.v4.app.DialogFragment;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentTransaction;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.webkit.WebView;
+import android.widget.EditText;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+import com.m2049r.xmrwallet.BuildConfig;
+import com.m2049r.xmrwallet.R;
+
+/**
+ * Created by Adam Speakman on 24/09/13.
+ * http://speakman.net.nz
+ */
+public class LicensesFragment extends DialogFragment {
+ int versionCode = BuildConfig.VERSION_CODE;
+ String versionName = BuildConfig.VERSION_NAME;
+
+ private AsyncTask mLicenseLoader;
+
+ private static final String FRAGMENT_TAG = "nz.net.speakman.androidlicensespage.LicensesFragment";
+ private static final String KEY_SHOW_CLOSE_BUTTON = "keyShowCloseButton";
+
+ /**
+ * Creates a new instance of LicensesFragment with no Close button.
+ *
+ * @return A new licenses fragment.
+ */
+ public static LicensesFragment newInstance() {
+ return new LicensesFragment();
+ }
+
+ /**
+ * Creates a new instance of LicensesFragment with an optional Close button.
+ *
+ * @param showCloseButton Whether to show a Close button at the bottom of the dialog.
+ * @return A new licenses fragment.
+ */
+ public static LicensesFragment newInstance(boolean showCloseButton) {
+ LicensesFragment fragment = new LicensesFragment();
+
+ Bundle bundle = new Bundle();
+ bundle.putBoolean(KEY_SHOW_CLOSE_BUTTON, showCloseButton);
+ fragment.setArguments(bundle);
+
+ return fragment;
+ }
+
+ /**
+ * Builds and displays a licenses fragment with no Close button. Requires
+ * "/res/raw/licenses.html" and "/res/layout/licenses_fragment.xml" to be
+ * present.
+ *
+ * @param fm A fragment manager instance used to display this LicensesFragment.
+ */
+ public static void displayLicensesFragment(FragmentManager fm) {
+ FragmentTransaction ft = fm.beginTransaction();
+ Fragment prev = fm.findFragmentByTag(FRAGMENT_TAG);
+ if (prev != null) {
+ ft.remove(prev);
+ }
+ ft.addToBackStack(null);
+
+ // Create and show the dialog.
+ DialogFragment newFragment = LicensesFragment.newInstance();
+ newFragment.show(ft, FRAGMENT_TAG);
+ }
+
+ /**
+ * Builds and displays a licenses fragment with or without a Close button.
+ * Requires "/res/raw/licenses.html" and "/res/layout/licenses_fragment.xml"
+ * to be present.
+ *
+ * @param fm A fragment manager instance used to display this LicensesFragment.
+ * @param showCloseButton Whether to show a Close button at the bottom of the dialog.
+ */
+ public static void displayLicensesFragment(FragmentManager fm, boolean showCloseButton) {
+ FragmentTransaction ft = fm.beginTransaction();
+ Fragment prev = fm.findFragmentByTag(FRAGMENT_TAG);
+ if (prev != null) {
+ ft.remove(prev);
+ }
+ ft.addToBackStack(null);
+
+ // Create and show the dialog.
+ DialogFragment newFragment = LicensesFragment.newInstance(showCloseButton);
+ newFragment.show(ft, FRAGMENT_TAG);
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+ loadLicenses();
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ if (mLicenseLoader != null) {
+ mLicenseLoader.cancel(true);
+ }
+ }
+
+ private WebView mWebView;
+ private ProgressBar mIndeterminateProgress;
+
+ @SuppressLint("InflateParams")
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ View content = LayoutInflater.from(getActivity()).inflate(R.layout.licenses_fragment, null);
+ mWebView = (WebView) content.findViewById(R.id.licensesFragmentWebView);
+ mIndeterminateProgress = (ProgressBar) content.findViewById(R.id.licensesFragmentIndeterminateProgress);
+
+ boolean showCloseButton = false;
+ Bundle arguments = getArguments();
+ if (arguments != null) {
+ showCloseButton = arguments.getBoolean(KEY_SHOW_CLOSE_BUTTON);
+ }
+
+ AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+/*
+ TextView title = new TextView(getContext());
+ title.setText(R.string.about_title);
+ title.setBackgroundColor(Color.DKGRAY);
+ title.setPadding(10, 10, 10, 10);
+ title.setGravity(Gravity.CENTER);
+ title.setTextColor(Color.WHITE);
+ title.setTextSize(20);
+ builder.setCustomTitle(title);
+*/
+ TextView text = (TextView) content.findViewById(R.id.text);
+ text.setText(getString(R.string.about_text, versionName, versionCode));
+
+ builder.setView(content);
+ if (showCloseButton) {
+ builder.setNegativeButton(R.string.about_close,
+ new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int id) {
+ dialog.dismiss();
+ }
+ });
+ }
+
+ return builder.create();
+ }
+
+ private void loadLicenses() {
+ // Load asynchronously in case of a very large file.
+ mLicenseLoader = new AsyncTask() {
+
+ @Override
+ protected String doInBackground(Void... params) {
+ InputStream rawResource = getActivity().getResources().openRawResource(R.raw.licenses);
+ BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(rawResource));
+
+ String line;
+ StringBuilder sb = new StringBuilder();
+
+ try {
+ while ((line = bufferedReader.readLine()) != null) {
+ sb.append(line);
+ sb.append("\n");
+ }
+ bufferedReader.close();
+ } catch (IOException e) {
+ // TODO You may want to include some logging here.
+ }
+
+ return sb.toString();
+ }
+
+ @Override
+ protected void onPostExecute(String licensesBody) {
+ super.onPostExecute(licensesBody);
+ if (getActivity() == null || isCancelled()) {
+ return;
+ }
+ mIndeterminateProgress.setVisibility(View.INVISIBLE);
+ mWebView.setVisibility(View.VISIBLE);
+ mWebView.loadDataWithBaseURL(null, licensesBody, "text/html", "utf-8", null);
+ mLicenseLoader = null;
+ }
+
+ }.execute();
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/layout/licenses_fragment.xml b/app/src/main/res/layout/licenses_fragment.xml
new file mode 100644
index 0000000..7ce76af
--- /dev/null
+++ b/app/src/main/res/layout/licenses_fragment.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/list_context_menu.xml b/app/src/main/res/menu/list_context_menu.xml
new file mode 100644
index 0000000..d52b7a9
--- /dev/null
+++ b/app/src/main/res/menu/list_context_menu.xml
@@ -0,0 +1,26 @@
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/list_menu.xml b/app/src/main/res/menu/list_menu.xml
index d52b7a9..e7fb01f 100644
--- a/app/src/main/res/menu/list_menu.xml
+++ b/app/src/main/res/menu/list_menu.xml
@@ -1,26 +1,12 @@
-
+ - com.android.support:design
+ - com.android.support:support-v4
+ - com.android.support:appcompat-v7
+ - com.android.support:recyclerview-v7
+ - com.android.support:cardview-v7
+ - com.android.support.constraint:constraint-layout
+ - com.android.support:support-annotations
+ - com.android.support:support-vector-drawable
+ - com.android.support:animated-vector-drawable
+ - com.android.support:transition
+ - com.android.support:support-compat
+ - com.android.support:support-media-compat
+ - com.android.support:support-core-utils
+ - com.android.support:support-core-ui
+ - com.android.support:support-fragment
+ - com.android.support.constraint:constraint-layout-solver
+
+Copyright (c) 2012 ZXing authors
+
+ - com.google.zxing:core
+
+Copyright (c) 2014 Dushyanth Maguluru
+
+ - me.dm7.barcodescanner:core
+ - me.dm7.barcodescanner:zxing
+
+Copyright (c) 2013 Adam Speakman
+
+ - de.psdev.licensesdialog:licensesdialog
+
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+Licensed under the 3-Clause BSD License
+Copyright (c) 2007-2009, JSR305 expert group
+
+ - com.google.code.findbugs:jsr305
+
+The 3-Clause BSD License
+SPDX short identifier: BSD-3-Clause
+https://opensource.org/licenses/BSD-3-Clause
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of the JSR305 expert group nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/about.xml b/app/src/main/res/values/about.xml
new file mode 100644
index 0000000..49974af
--- /dev/null
+++ b/app/src/main/res/values/about.xml
@@ -0,0 +1,6 @@
+
+
+ About
+ Close
+ I am Monerujo %1$s (%2$d)
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index aa777ec..230cff6 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -3,6 +3,8 @@
Monerujo
Wallet
+ About …
+
Details
QR Receive
Rename
diff --git a/build.gradle b/build.gradle
index 212a083..9d495e2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -15,6 +15,9 @@ buildscript {
allprojects {
repositories {
jcenter()
+ maven {
+ url "https://maven.google.com"
+ }
}
}