summaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorTom Hennen <TomHennen@users.noreply.github.com>2015-11-08 08:22:00 -0500
committerTom Hennen <TomHennen@users.noreply.github.com>2015-11-08 08:22:00 -0500
commitc16cd623e3d40acb0306fd179ec5f5d9f1da1c18 (patch)
treec70fb431e12cc5d16afaa7f761d2283526372fc3 /app/src
parent02a7bf1d8a20138a24efa4ba880f98a8f11f6c65 (diff)
parentf4d1fea87e475782111afd0bab83ac1109829f0f (diff)
downloadAntennaPod-c16cd623e3d40acb0306fd179ec5f5d9f1da1c18.zip
Merge pull request #1362 from mfietz/issue/1360-about
About
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/AndroidManifest.xml3
-rw-r--r--app/src/main/assets/.gitignore2
-rw-r--r--app/src/main/assets/LICENSE.html17
-rw-r--r--app/src/main/assets/LICENSE_DSLV.txt16
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java27
-rw-r--r--app/src/main/templates/about.html7
6 files changed, 28 insertions, 44 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index cd4e45493..32856af8e 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -140,6 +140,9 @@
<activity
android:name=".activity.AboutActivity"
android:label="@string/about_pref">
+ <meta-data
+ android:name="android.support.PARENT_ACTIVITY"
+ android:value="de.danoeh.antennapod.activity.PreferenceActivity"/>
</activity>
<activity
android:name=".activity.OpmlImportFromPathActivity"
diff --git a/app/src/main/assets/.gitignore b/app/src/main/assets/.gitignore
index 328840cfc..f4de63f77 100644
--- a/app/src/main/assets/.gitignore
+++ b/app/src/main/assets/.gitignore
@@ -1,2 +1,4 @@
# this file is generated automatically
about.html
+LICENSE.txt
+CONTRIBUTORS.txt
diff --git a/app/src/main/assets/LICENSE.html b/app/src/main/assets/LICENSE.html
deleted file mode 100644
index d38547791..000000000
--- a/app/src/main/assets/LICENSE.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
- <title>MIT License</title>
- </head>
- <body>
-<p>Copyright (c) 2012 Daniel Oeh</p>
-
-<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
-
-<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
-
-</p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
-
- </body>
-</html> \ No newline at end of file
diff --git a/app/src/main/assets/LICENSE_DSLV.txt b/app/src/main/assets/LICENSE_DSLV.txt
deleted file mode 100644
index 2a2de04a3..000000000
--- a/app/src/main/assets/LICENSE_DSLV.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-A subclass of the Android ListView component that enables drag
-and drop re-ordering of list items.
-
-Copyright 2012 Carl Bauer
-
-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.
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java
index fe31ccda8..c835f8073 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java
@@ -6,7 +6,9 @@ import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
+import android.view.MenuItem;
import android.view.View;
+import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;
@@ -34,7 +36,7 @@ public class AboutActivity extends ActionBarActivity {
private WebView webview;
private LinearLayout webviewContainer;
- private boolean showingLicense = false;
+ private int depth = 0;
private Subscription subscription;
@@ -42,10 +44,11 @@ public class AboutActivity extends ActionBarActivity {
protected void onCreate(Bundle savedInstanceState) {
setTheme(UserPreferences.getTheme());
super.onCreate(savedInstanceState);
- getSupportActionBar().hide();
+ getSupportActionBar().setDisplayShowHomeEnabled(true);
setContentView(R.layout.about);
webviewContainer = (LinearLayout) findViewById(R.id.webvContainer);
webview = (WebView) findViewById(R.id.webvAbout);
+ webview.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
if (UserPreferences.getTheme() == R.style.Theme_AntennaPod_Dark) {
if (Build.VERSION.SDK_INT >= 11
&& Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
@@ -58,6 +61,7 @@ public class AboutActivity extends ActionBarActivity {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if(url.startsWith("http")) {
+ depth++;
return false;
} else {
url = url.replace("file:///android_asset/", "");
@@ -104,9 +108,9 @@ public class AboutActivity extends ActionBarActivity {
" </style>" +
"</head><body><p>" + webViewData + "</p></body></html>";
webViewData = webViewData.replace("\n", "<br/>");
- showingLicense = true;
+ depth++;
} else {
- showingLicense = false;
+ depth = 0;
}
webViewData = String.format(webViewData, colorString);
subscriber.onNext(webViewData);
@@ -130,9 +134,10 @@ public class AboutActivity extends ActionBarActivity {
@Override
public void onBackPressed() {
- if(showingLicense || webview.canGoBack()) {
+ Log.d(TAG, "depth: " + depth);
+ if(depth == 1) {
loadAsset("about.html");
- } else if(webview.canGoBack()) {
+ } else if(depth > 1) {
webview.goBack();
} else {
super.onBackPressed();
@@ -140,6 +145,16 @@ public class AboutActivity extends ActionBarActivity {
}
@Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == android.R.id.home) {
+ onBackPressed();
+ return true;
+ } else {
+ return super.onOptionsItemSelected(item);
+ }
+ }
+
+ @Override
protected void onDestroy() {
super.onDestroy();
if(subscription != null) {
diff --git a/app/src/main/templates/about.html b/app/src/main/templates/about.html
index a21ab4d33..21599bdb8 100644
--- a/app/src/main/templates/about.html
+++ b/app/src/main/templates/about.html
@@ -52,18 +52,15 @@
<p>Created by Daniel Oeh</p>
- <p>Copyright &copy; 2015 AntennaPod Contributors <a href="https://github.com/AntennaPod/AntennaPod/blob/master/CONTRIBUTORS">(View)</a></p>
+ <p>Copyright &copy; 2015 AntennaPod Contributors <a href="CONTRIBUTORS.txt">(View)</a></p>
- <p>Licensed under the MIT License <a href="LICENSE.html">(View)</a></p>
+ <p>Licensed under the MIT License <a href="LICENSE.txt">(View)</a></p>
</div>
<h1>Used libraries</h1>
<h2>Apache Commons <a href="http://commons.apache.org/">(Link)</a></h2>
by The Apache Software Foundation, licensed under the Apache 2.0 license <a href="LICENSE_APACHE_COMMONS.txt">(View)</a>
-<h2>DragSortListView <a href="https://github.com/bauerca/drag-sort-listview">(Link)</a></h2>
-by Carl Bauer, licensed under the Apache 2.0 license <a href="LICENSE_DSLV.txt">(View)</a>
-
<h2>EventBus <a href="https://github.com/greenrobot/EventBus">(Link)</a></h2>
by greenrobot, licensed under the Apache 2.0 license <a href="LICENSE_EVENTBUS.txt">(View)</a>