Merge pull request #1362 from mfietz/issue/1360-about

About
This commit is contained in:
Tom Hennen 2015-11-08 08:22:00 -05:00
commit c16cd623e3
8 changed files with 42 additions and 48 deletions

View File

@ -72,8 +72,8 @@ Danish: CasperHN
Dutch: e2jk, glotzbach
English: mfietz, sterylmreep
Finnish: danieloeh
French: cactux, ChaoticMind, clombion, e2jk, lacouture, mfietz, repat, sterylmreep, vcariven
German: altegedanken, ChaoticMind, Chaquotay, DJaeger, HolgerJeromin, kalei, lohmann, mfietz, nilso, picsel2, repat, SAPlayer, ypid
French: cactux, ChaoticMind, clombion, e2jk, lacouture, Matth78, mfietz, repat, sterylmreep, vcariven
German: altegedanken, bitsunited, ChaoticMind, Chaquotay, DJaeger, HolgerJeromin, kalei, lohmann, mfietz, nilso, picsel2, repat, SAPlayer, ypid
Greek: AlexanderKanetakis
Hebrew (Israel): amir.dafnyman
Hindi (India): purple.coder, siddhusengar
@ -83,7 +83,8 @@ Italian: aalex70, Guybrush88, theloca95
Italian (Italy): aalex70, Guybrush88, m.chinni, theloca95
Japanese: Naofumi, sh3llc4t, TranslatorG
Kannada (India): thejeshgn
Korean: changwoo, skcha
Korean: changwoo, seungrye, skcha
Korean (South Korea): seungrye
Norwegian: timbast
Norwegian Bokmål (Norway): kongk, swordfighter, timbast
Polish: maniexx, thedead4fun

View File

@ -139,4 +139,13 @@ task filterAbout {
}
}
preBuild.dependsOn filterAbout
task copyTextFiles(type: Copy) {
from "../CONTRIBUTORS"
from "../LICENSE"
into "src/main/assets/"
rename { String fileName ->
fileName + ".txt"
}
}
preBuild.dependsOn filterAbout, copyTextFiles

View File

@ -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"

View File

@ -1,2 +1,4 @@
# this file is generated automatically
about.html
LICENSE.txt
CONTRIBUTORS.txt

View File

@ -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>

View File

@ -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.

View File

@ -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,15 +134,26 @@ 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();
}
}
@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();

View File

@ -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>