diff options
author | ByteHamster <info@bytehamster.com> | 2019-11-09 01:07:13 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-11-09 09:56:48 +0100 |
commit | 57900be16e3aac72f4d3854e7b34db0723eb6795 (patch) | |
tree | f1a46759e1f2ff0e4ae3e59facf307bbfa1ba819 /app/src/main | |
parent | d9e122f6d2650eff818478fa40cb32074dce1daa (diff) | |
download | AntennaPod-57900be16e3aac72f4d3854e7b34db0723eb6795.zip |
Cleanup
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/AndroidManifest.xml | 8 | ||||
-rw-r--r-- | app/src/main/assets/translators.csv (renamed from app/src/main/assets/translators.txt) | 2 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java | 158 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/preferences/AboutDevelopersFragment.java | 2 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/preferences/AboutTranslatorsFragment.java | 2 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java | 1 | ||||
-rw-r--r-- | app/src/main/templates/about.html | 183 |
7 files changed, 3 insertions, 353 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ba5f84a14..b6e6e290d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -141,14 +141,6 @@ <activity android:name=".activity.StorageErrorActivity"> </activity> <activity - android:name=".activity.AboutActivity" - android:configChanges="keyboardHidden|orientation|screenSize" - 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.ImportExportActivity" android:label="@string/import_export"> <meta-data diff --git a/app/src/main/assets/translators.txt b/app/src/main/assets/translators.csv index ed03400e8..d3b6ab8b6 100644 --- a/app/src/main/assets/translators.txt +++ b/app/src/main/assets/translators.csv @@ -16,7 +16,7 @@ Estonian;Eraser Finnish;danieloeh, elguitar, Sahtor French;cactux, ChaoticMind, clombion, e2jk, edewaele, lacouture, LouFex, Matth78, mfietz, Poussinou, repat, Sioul, sterylmreep, TacoTheDank, Tilwa, vcariven, whenrow Galician;antiparvos, pikamoku, Raichely -German;112358, altegedanken, barilla, benedikt.g, bitsunited, Buggi, ceving, ChaoticMind, Chaquotay, dab0015, dadosch, DerSilly, die_otto, DJaeger, elkangaroo, enz, fidel, finsterwalder, Foso, GNi33, hightower5, HolgerJeromin, kalei, lohmann, LostInWeb, mfietz, moasda, nilso, repat, SAPlayer, schafia, Schroedingberg, sevenmaster, sucaml, Teaspoon, theonlytruth, weltenwort, Wyrrrd, ypid +German;112358, altegedanken, barilla, benedikt.g, bitsunited, Buggi, ByteHamster, ceving, ChaoticMind, Chaquotay, dab0015, dadosch, DerSilly, die_otto, DJaeger, elkangaroo, enz, fidel, finsterwalder, Foso, GNi33, hightower5, HolgerJeromin, kalei, lohmann, LostInWeb, mfietz, moasda, nilso, repat, SAPlayer, schafia, Schroedingberg, sevenmaster, sucaml, Teaspoon, theonlytruth, weltenwort, Wyrrrd, ypid Modern Greek (1453-);antonist, danieloeh, hua2016s, jack.ath92, MSavoritias, pavlosv Hebrew (he_IL);amir.dafnyman, E1i9, mongoose4004, pinkasey, rellieberman, Yaron, הלוי11 Hindi (hi_IN);ankitiitb1069, Isaasu, nmabhinandan, purple.coder, siddhusengar diff --git a/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java deleted file mode 100644 index ef7ea2b16..000000000 --- a/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java +++ /dev/null @@ -1,158 +0,0 @@ -package de.danoeh.antennapod.activity; - -import android.content.res.TypedArray; -import android.graphics.Color; -import android.os.Build; -import android.os.Bundle; -import androidx.appcompat.app.AppCompatActivity; -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; - -import de.danoeh.antennapod.core.util.IntentUtils; -import org.apache.commons.io.IOUtils; - -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.Charset; - -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.preferences.UserPreferences; -import io.reactivex.Single; -import io.reactivex.android.schedulers.AndroidSchedulers; -import io.reactivex.disposables.Disposable; -import io.reactivex.schedulers.Schedulers; - -/** - * Displays the 'about' screen - */ -public class AboutActivity extends AppCompatActivity { - - private static final String TAG = AboutActivity.class.getSimpleName(); - - private WebView webView; - private LinearLayout webViewContainer; - private Disposable disposable; - - @Override - protected void onCreate(Bundle savedInstanceState) { - setTheme(UserPreferences.getTheme()); - super.onCreate(savedInstanceState); - getSupportActionBar().setDisplayShowHomeEnabled(true); - setContentView(R.layout.about); - webViewContainer = findViewById(R.id.webViewContainer); - webView = findViewById(R.id.webViewAbout); - webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE); - if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { - webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); - } - webView.setBackgroundColor(Color.TRANSPARENT); - webView.setWebViewClient(new WebViewClient() { - - @Override - public boolean shouldOverrideUrlLoading(WebView view, String url) { - if (url.startsWith("http")) { - IntentUtils.openInBrowser(AboutActivity.this, url); - return true; - } else { - url = url.replace("file:///android_asset/", ""); - loadAsset(url); - return true; - } - } - - }); - loadAsset("about.html"); - } - - private void loadAsset(String filename) { - disposable = Single.create(subscriber -> { - InputStream input = null; - try { - TypedArray res = AboutActivity.this.getTheme().obtainStyledAttributes( - new int[] { R.attr.about_screen_font_color, R.attr.about_screen_background, - R.attr.about_screen_card_background, R.attr.about_screen_card_border}); - String fontColor = String.format("#%06X", 0xFFFFFF & res.getColor(0, 0)); - String backgroundColor = String.format("#%06X", 0xFFFFFF & res.getColor(1, 0)); - String cardBackground = String.format("#%06X", 0xFFFFFF & res.getColor(2, 0)); - String cardBorder = String.format("#%06X", 0xFFFFFF & res.getColor(3, 0)); - res.recycle(); - input = getAssets().open(filename); - String webViewData = IOUtils.toString(input, Charset.defaultCharset()); - if (!webViewData.startsWith("<!DOCTYPE html>")) { - webViewData = webViewData.replace("%", "%"); - webViewData = - "<!DOCTYPE html>" + - "<html>" + - "<head>" + - " <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">" + - " <style type=\"text/css\">" + - " @font-face {" + - " font-family: 'Roboto-Light';" + - " src: url('file:///android_asset/Roboto-Light.ttf');" + - " }" + - " * {" + - " color: @fontcolor@;" + - " font-family: roboto-Light;" + - " font-size: 8pt;" + - " }" + - " </style>" + - "</head><body><p>" + webViewData + "</p></body></html>"; - webViewData = webViewData.replace("\n", "<br/>"); - } - webViewData = webViewData.replace("@fontcolor@", fontColor); - webViewData = webViewData.replace("@background@", backgroundColor); - webViewData = webViewData.replace("@card_background@", cardBackground); - webViewData = webViewData.replace("@card_border@", cardBorder); - subscriber.onSuccess(webViewData); - } catch (IOException e) { - Log.e(TAG, Log.getStackTraceString(e)); - subscriber.onError(e); - } finally { - IOUtils.closeQuietly(input); - } - }) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe( - webViewData -> - webView.loadDataWithBaseURL("file:///android_asset/", webViewData.toString(), "text/html", "utf-8", "file:///android_asset/" + filename.toString()), - error -> Log.e(TAG, Log.getStackTraceString(error)) - ); - } - - @Override - public void onBackPressed() { - if (webView.canGoBack()) { - 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(); - if (disposable != null) { - disposable.dispose(); - } - if (webViewContainer != null && webView != null) { - webViewContainer.removeAllViews(); - webView.destroy(); - } - } -} diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/AboutDevelopersFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/AboutDevelopersFragment.java index 239215a17..62a5eb306 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/AboutDevelopersFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/AboutDevelopersFragment.java @@ -31,7 +31,7 @@ public class AboutDevelopersFragment extends ListFragment { developersLoader = Single.create((SingleOnSubscribe<ArrayList<SimpleIconListAdapter.ListItem>>) emitter -> { ArrayList<SimpleIconListAdapter.ListItem> developers = new ArrayList<>(); BufferedReader reader = new BufferedReader(new InputStreamReader( - getContext().getAssets().open("developers.txt"))); + getContext().getAssets().open("developers.csv"))); String line; while ((line = reader.readLine()) != null) { String[] info = line.split(";"); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/AboutTranslatorsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/AboutTranslatorsFragment.java index 5bf714bf9..914dbb9a2 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/AboutTranslatorsFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/AboutTranslatorsFragment.java @@ -31,7 +31,7 @@ public class AboutTranslatorsFragment extends ListFragment { translatorsLoader = Single.create((SingleOnSubscribe<ArrayList<SimpleIconListAdapter.ListItem>>) emitter -> { ArrayList<SimpleIconListAdapter.ListItem> translators = new ArrayList<>(); BufferedReader reader = new BufferedReader(new InputStreamReader( - getContext().getAssets().open("translators.txt"))); + getContext().getAssets().open("translators.csv"))); String line; while ((line = reader.readLine()) != null) { String[] info = line.split(";"); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java index 30d792286..5fd38d663 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java @@ -7,7 +7,6 @@ import androidx.preference.PreferenceFragmentCompat; import com.bytehamster.lib.preferencesearch.SearchConfiguration; import com.bytehamster.lib.preferencesearch.SearchPreference; import de.danoeh.antennapod.R; -import de.danoeh.antennapod.activity.AboutActivity; import de.danoeh.antennapod.activity.BugReportActivity; import de.danoeh.antennapod.activity.PreferenceActivity; import de.danoeh.antennapod.core.util.IntentUtils; diff --git a/app/src/main/templates/about.html b/app/src/main/templates/about.html deleted file mode 100644 index c419609af..000000000 --- a/app/src/main/templates/about.html +++ /dev/null @@ -1,183 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> - <style type="text/css"> - - @font-face { - font-family: 'Roboto-Light'; - src: url('file:///android_asset/Roboto-Light.ttf'); - } - - html, body { - background: @background@; - margin: 0; - padding: 0; - } - - * { - color: @fontcolor@; - font-family: roboto-Light; - font-size: 12pt; - } - - img#logo { - display: block; - margin-left: auto; - margin-right: auto; - max-height: 200px; - max-height: 50vh; - max-width: 100%; - height: auto; - width: auto; - } - - div#logobackground{ - width: 100%; - background: #42a5f5; - } - - .card { - background: @card_background@; - margin: 10px; - padding: 10px; - border: 1px solid @card_border@; - border-top-width: 0; - border-bottom-width: 2px; - } - - h1 { - font-size: 15pt; - margin-left: 20px; - } - - h2 { - font-size: 13pt; - margin-top: 0px; - } - - a { - font-size: 14px; - color: #00A8DF; - text-decoration: none; - } - - </style> - <title>About AntennaPod</title> -</head> -<body> -<div id="logobackground"> -<img id="logo" src="file:///android_res/drawable/teaser.png" alt="Logo"/> -</div> - -<h1>AntennaPod</h1> - -<div class="card"> -<table> -<tr><td>Version:</td><td><b>@versionname@</b></td></tr> -<tr><td>Commit:</td><td><b>@commit@</b></td></tr> -</table> -</div> - -<div class="card"> -Created by Daniel Oeh<br /> -Copyright © 2012-@year@<br /> -AntennaPod Contributors <a href="CONTRIBUTORS.txt">(View)</a><br /> -Licensed under the MIT License <a href="LICENSE.txt">(View)</a><br /> -Privacy Policy <a href="https://antennapod.org/privacy.html">(View)</a> -</div> - -<h1>Used libraries</h1> - -<div class="card"> -<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-2.0.txt">(View)</a> -</div> - -<div class="card"> -<h2>EventBus <a href="https://github.com/greenrobot/EventBus">(Link)</a></h2> -by greenrobot, licensed under the Apache 2.0 license <a href="LICENSE_APACHE-2.0.txt">(View)</a> -</div> - -<div class="card"> -<h2>ExoPlayer <a href="https://github.com/google/ExoPlayer">(Link)</a></h2> -by Google, licensed under the Apache 2.0 license <a href="LICENSE_APACHE-2.0.txt">(View)</a> -</div> - -<div class="card"> - <h2>Floating Action Button Speed Dial <a href="https://github.com/leinardi/FloatingActionButtonSpeedDial">(Link)</a></h2> - by Roberto Leinardi, licensed under the Apache 2.0 license <a href="LICENSE_APACHE-2.0.txt">(View)</a> -</div> - -<div class="card"> -<h2>Glide <a href="https://github.com/bumptech/glide/">(Link)</a></h2> -licensed under the Simplified BSD license <a href="LICENSE_GLIDE.txt">(View)</a> -</div> - -<div class="card"> -<h2>Iconify <a href="https://github.com/JoanZapata/android-iconify">(Link)</a></h2> -by Joan Zapata, licensed under the Apache 2.0 license <a href="LICENSE_ANDROID_ICONIFY.txt">(View)</a> -</div> - -<div class="card"> -<h2>jsoup <a href="http://jsoup.org/">(Link)</a></h2> -licensed under the MIT license <a href="LICENSE_JSOUP.txt">(View)</a> -</div> - -<div class="card"> -<h2>Material Design Icons <a href="https://github.com/google/material-design-icons">(Link)</a></h2> -by Google, licensed under an Attribution-ShareAlike 4.0 International license <a href="LICENSE_MATERIAL_DESIGN_ICONS.txt">(View)</a> -</div> - -<div class="card"> -<h2>Material Design Icons <a href="https://github.com/Templarian/MaterialDesign">(Link)</a></h2> -by Templarian, licensed under the SIL Open Font License, Version 1.1 <a href="LICENSE_SIL.txt">(View)</a> -</div> - -<div class="card"> -<h2>Material Dialogs <a href="https://github.com/afollestad/material-dialogs">(Link)</a></h2> -by Aidan Michael Follestad, licensed under the MIT License <a href="LICENSE_MATERIAL_DIALOGS.txt">(View)</a> -</div> - -<div class="card"> -<h2>OkHttp <a href="https://github.com/square/okhttp">(Link)</a></h2> -by Square, licensed under the Apache 2.0 license <a href="LICENSE_OKHTTP.txt">(View)</a> -</div> - -<div class="card"> -<h2>Okio <a href="https://github.com/square/okio">(Link)</a></h2> -by Square, licensed under the Apache 2.0 license <a href="LICENSE_APACHE-2.0.txt">(View)</a> -</div> - -<div class="card"> -<h2>Presto Client <a href="http://www.aocate.com/presto/">(Link)</a></h2> -licensed under the Apache 2.0 license <a href="LICENSE_PRESTO.txt">(View)</a> -</div> - -<div class="card"> -<h2>RecyclerView-FlexibleDivider <a href="https://github.com/yqritc/RecyclerView-FlexibleDivider">(Link)</a></h2> -licensed under the Apache 2.0 license <a href="LICENSE_APACHE-2.0.txt">(View)</a> -</div> - -<div class="card"> -<h2>RxAndroid <a href="https://github.com/ReactiveX/RxAndroid">(Link)</a></h2> -licensed under the Apache 2.0 license <a href="LICENSE_APACHE-2.0.txt">(View)</a> -</div> - -<div class="card"> -<h2>StackBlur <a href="https://github.com/kikoso/android-stackblur">(Link)</a></h2> -by Enrique López Mañas, licensed under the Apache 2.0 license <a href="LICENSE_APACHE-2.0.txt">(View)</a> -</div> - -<div class="card"> -<h2>Triangle Label View <a href="https://github.com/shts/TriangleLabelView">(Link)</a></h2> -by Shota Saito, licensed under the Apache 2.0 license <a href="LICENSE_TRIANGLE_LABEL_VIEW.txt">(View)</a> -</div> - -<div class="card"> -<h2>AntennaPod-AudioPlayer <a href="https://github.com/AntennaPod/AntennaPod-AudioPlayer/">(Link)</a></h2> -by the AntennaPod team, licensed under the Apache 2.0 license <a href="LICENSE_APACHE-2.0.txt">(View)</a> -</div> - -</body> -</html> |