Redesigned the About fragment - removed WebView

This commit is contained in:
Nite 2022-02-13 19:42:34 +01:00
parent a9ee09bc2f
commit f210a6e363
No known key found for this signature in database
GPG Key ID: 1D1AD59B1C6386C1
22 changed files with 120 additions and 373 deletions

View File

@ -1,48 +0,0 @@
<html>
<head>
<title>About Ultrasonic</title>
<link rel="stylesheet" href="../style.css" type="text/css">
</head>
<body>
<h3><img src="../img/ultrasonic.png" alt="">Ultrasonic</h3>
<p>
Mit <b>Ultrasonic</b> können Sie mit dem Subsonic Media Streamer ganz einfach Musik von Ihrem Heimcomputer auf Ihr Android-Handy streamen oder
herunterladen. Die Subsonic-Server-Software erfordert eine zusätzliche, von Ultrasonic getrennte Konfiguration. Für weitere Informationen oder
zur Installation der Subsonic-Server-Software auf Ihrem Computer besuchen Sie bitte <a href="http://subsonic.org">subsonic.org</a>. Die Basisversion
von Subsonic ist kostenlos. Wenn Sie Subsonic zum ersten Mal installieren, sind die Premium-Funktionen 30 Tage lang verfügbar, so dass Sie sie
ausprobieren können, bevor Sie sich für ein Upgrade entscheiden. Klicken Sie <a href="http://www.subsonic.org/pages/premium.jsp">hier</a>, um
ein Upgrade auf Subsonic Premium durchzuführen.
</p>
<p>
Standardmäßig ist Ultrasonic nicht konfiguriert. Wenn Sie Ihren eigenen Server eingerichtet haben, gehen Sie bitte zu <b>Einstellungen</b> und
ändern Sie die Konfiguration so, dass er mit Ihrem eigenen Computer verbunden wird.
</p>
<p>
</p>
<p>
Wenn Sie mit Ultrasonic zufrieden sind, klicken Sie bitte auf "Spenden", um die weitere Entwicklung zu unterstützen. Diese Spende ist von der
Subsonic-Server-Software getrennt und gewährt Ihnen keinen Zugang zu den Premium-Funktionen von Subsonic.
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="DQXEZRDRAGCA8">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
<p>
Um Feature-Anfragen oder Fehlerberichte einzureichen, besuchen Sie bitte das Ultrasonic für Android <a href="http://forum.subsonic.org/forum/viewforum.php?f=17">Forum</a>.
Der Quellcode von Ultrasonic ist unter <a href="https://github.com/ogarcia/ultrasonic">github.com</a> verfügbar und unter den Bedingungen der GNU General Public License Version 3 (GPLv3) lizenziert.
</p>
</body>
</html>

View File

@ -1,52 +0,0 @@
<html>
<head>
<title>About Ultrasonic</title>
<link rel="stylesheet" href="../style.css" type="text/css">
</head>
<body>
<h3><img src="../img/ultrasonic.png" alt="">Ultrasonic</h3>
<p>
With <b>Ultrasonic</b> you can easily stream or download music from your
home computer to your Android phone using the Subsonic media streamer.
The Subsonic server software requires additional configuration separate
from Ultrasonic. For more information or to install the Subsonic server
software on your computer, please visit
<a href="http://subsonic.org">subsonic.org</a>. The basic version of
Subsonic is free. When you first install Subsonic, the premium features
are available for 30 days so you can try them out before deciding to
upgrade. Click
<a href="http://www.subsonic.org/pages/premium.jsp">here</a> to upgrade
to Subsonic Premium.
</p>
<p>
By default, Ultrasonic is not configured. Once you've set up your own
server, please go to <b>Settings</b> and change the configuration so
that it connects to your own computer.
</p>
<p>
If you are pleased with Ultrasonic, please click "Donate" to help
further development. This donation is separate from the Subsonic server
software and does not grant you access to the premium features of
Subsonic.
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="DQXEZRDRAGCA8">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
<p>
To submit feature requests or file bug reports, please visit the
Ultrasonic for Android
<a href="http://forum.subsonic.org/forum/viewforum.php?f=17">forum</a>.
Source code for Ultrasonic is available at
<a href="https://github.com/ogarcia/ultrasonic">github.com</a>.
</p>
</body>
</html>

View File

@ -1,61 +0,0 @@
<html>
<head>
<title>Aide de Ultrasonic</title>
<link rel="stylesheet" href="../style.css" type="text/css">
</head>
<body>
<h3><img src="../img/ultrasonic.png" alt=""> Bienvenue dans Ultrasonic</h3>
<p>
Avec <b>Ultrasonic</b>, vous pouvez facilement &eacute;couter ou t&eacute;l&eacute;charger de la musique &agrave; partir de votre ordinateur personnel sur votre appareil Android
(et bien d'autres choses sont possibles).
</p>
<p>
Pour installer le serveur Subsonic sur votre ordinateur, visitez <a href="http://subsonic.org">subsonic.org</a>.
Celui-ci est disponible pour Windows, Mac, Linux et Unix.
</p>
<p>
Par d&eacute;faut, cette application n'est pas configur&eacutee. Apr&egrave;s avoir configur&eacute; votre
serveur personnel, veuillez acc&eacute;der aux <b>Param&egrave;tres</b> et modifier la configuration afin de vous connecter &agrave; votre propre ordinateur ou vos appareils mobiles.
</p>
<p>
Vous pouvez utiliser cette application gratuitement pendant 30 jours.
Ensuite, vous devrez effectuer un don au projet Subsonic.
En tant que donateur, vous obtiendrez les b&eacute;n&eacute;fices suivants:
</p>
<ul>
<li>&Eacute;coute et t&eacute;l&eacute;chargement illimit&eacute;s vers autant de iPhones et d'appareils Android que souhait&eacute;.</li>
<li>Lecture de vid&eacute;os.</li>
<li>Une adresse web personnalis&eacute;e pour votre serveur Subsonic (<em>votrenom</em>.subsonic.org).</li>
<li>Aucunes publicit&eacute;s dans l'interface web de Subsonic.</li>
<li>Acc&egrave;s gratuit aux nouvelles fonctionnalit&eacute;s avanc&eacute;es.</li>
</ul>
<p>
Le montant sugg&eacute;r&eacute; pour le don est de <b>20&euro;</b>, mais n'importe quel montant est trait&eacute; et accept&eacute;.
</p>
<p>
Cliquez sur le bouton suivants pour acc&eacute;der &agrave; PayPal, d'o&ugrave; vous pourrez payer soit par carte de cr&eacute;dit, soit en utilisant votre compte PayPal.
Une fois le don re&ccedil;u et trait&eacute;, vous recevrez votre cl&eacute; d'activation par e-mail.
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="DQXEZRDRAGCA8">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
<p>
Pour plus d'information, veuiller visitez <a href="http://subsonic.org/">subsonic.org</a>. Le code source de Ultrasonic est disponible &agrave l'adresse suivante : <a href="https://github.com/ogarcia/ultrasonic">github.com</a>.
</p>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,11 +0,0 @@
/*
* Taken from http://yui.yahooapis.com/2.8.0r4/build/fonts/fonts.css
*/
body {
font: 13px / 1.231 arial, helvetica, clean, sans-serif;
}
table {
font-size:inherit;
font:100%;
}

View File

@ -1,149 +0,0 @@
package org.moire.ultrasonic.fragment;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import org.jetbrains.annotations.NotNull;
import org.moire.ultrasonic.R;
import org.moire.ultrasonic.util.Util;
/**
* Displays online help and about information in a WebView
*/
public class AboutFragment extends Fragment {
private WebView webView;
private ImageView backButton;
private ImageView forwardButton;
private SwipeRefreshLayout swipeRefresh;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
Util.applyTheme(this.getContext());
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.help, container, false);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
swipeRefresh = view.findViewById(R.id.help_refresh);
swipeRefresh.setEnabled(false);
webView = view.findViewById(R.id.help_contents);
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new HelpClient());
if (savedInstanceState != null)
{
webView.restoreState(savedInstanceState);
}
else
{
webView.loadUrl(getResources().getString(R.string.help_url));
}
backButton = view.findViewById(R.id.help_back);
backButton.setOnClickListener(new Button.OnClickListener()
{
@Override
public void onClick(View view)
{
webView.goBack();
}
});
ImageView stopButton = view.findViewById(R.id.help_stop);
stopButton.setOnClickListener(new Button.OnClickListener()
{
@Override
public void onClick(View view)
{
webView.stopLoading();
swipeRefresh.setRefreshing(false);
}
});
forwardButton = view.findViewById(R.id.help_forward);
forwardButton.setOnClickListener(new Button.OnClickListener()
{
@Override
public void onClick(View view)
{
webView.goForward();
}
});
// TODO: Nicer Back key handling?
webView.setFocusableInTouchMode(true);
webView.requestFocus();
webView.setOnKeyListener( new View.OnKeyListener()
{
@Override
public boolean onKey( View v, int keyCode, KeyEvent event )
{
if (keyCode == KeyEvent.KEYCODE_BACK)
{
if (webView.canGoBack())
{
webView.goBack();
return true;
}
}
return false;
}
} );
}
@Override
public void onSaveInstanceState(@NotNull Bundle state)
{
webView.saveState(state);
super.onSaveInstanceState(state);
}
private final class HelpClient extends WebViewClient
{
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
swipeRefresh.setRefreshing(true);
super.onPageStarted(view, url, favicon);
}
@Override
public void onPageFinished(WebView view, String url)
{
swipeRefresh.setRefreshing(false);
String versionName = Util.getVersionName(getContext());
String title = String.format("%s (%s)", view.getTitle(), versionName);
FragmentTitle.Companion.setTitle(AboutFragment.this, title);
backButton.setEnabled(view.canGoBack());
forwardButton.setEnabled(view.canGoForward());
}
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)
{
Util.toast(getContext(), description);
}
}
}

View File

@ -0,0 +1,74 @@
/*
* AboutFragment.kt
* Copyright (C) 2009-2021 Ultrasonic developers
*
* Distributed under terms of the GNU GPLv3 license.
*/
package org.moire.ultrasonic.fragment
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import androidx.fragment.app.Fragment
import java.util.Locale
import org.moire.ultrasonic.R
import org.moire.ultrasonic.fragment.FragmentTitle.Companion.setTitle
import org.moire.ultrasonic.util.Util.applyTheme
import org.moire.ultrasonic.util.Util.getVersionName
/**
* Displays the About page
*/
class AboutFragment : Fragment() {
private var titleText: TextView? = null
private var webPageButton: Button? = null
private var reportBugButton: Button? = null
override fun onCreate(savedInstanceState: Bundle?) {
applyTheme(this.context)
super.onCreate(savedInstanceState)
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.help, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
titleText = view.findViewById(R.id.help_title)
webPageButton = view.findViewById(R.id.help_webpage)
reportBugButton = view.findViewById(R.id.help_report)
val versionName = getVersionName(requireContext())
val title = String.format(
Locale.getDefault(),
"%s (%s)",
getString(R.string.common_appname),
versionName
)
setTitle(this@AboutFragment, title)
titleText?.text = title
webPageButton?.setOnClickListener {
startActivity(
Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.about_webpage_url)))
)
}
reportBugButton?.setOnClickListener {
startActivity(
Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.about_report_url)))
)
}
}
}

View File

@ -1,46 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_width="fill_parent"
a:layout_height="fill_parent">
a:layout_width="fill_parent"
a:layout_height="fill_parent">
<LinearLayout a:id="@+id/help_buttons"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:padding="4dip"
a:gravity="center_horizontal" >
<TextView
a:id="@+id/help_title"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:gravity="center"
a:padding="18dp"
a:text="@string/common.appname"
a:textSize="25sp" />
<ImageView a:id="@+id/help_back"
a:layout_width="wrap_content"
a:layout_height="fill_parent"
a:src="?attr/backward"
a:layout_weight="1" />
<ImageView a:id="@+id/help_stop"
a:layout_width="wrap_content"
a:layout_height="fill_parent"
a:src="?attr/stop"
a:layout_weight="1" />
<TextView
a:id="@+id/help_text"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:layout_below="@+id/help_title"
a:layout_marginTop="0dp"
a:padding="20dp"
a:textSize="16sp"
a:text="@string/about.text"
/>
<ImageView a:id="@+id/help_forward"
a:layout_width="wrap_content"
a:layout_height="fill_parent"
a:src="?attr/forward"
a:layout_weight="1" />
</LinearLayout>
<Button
a:id="@+id/help_webpage"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:layout_above="@+id/help_report"
a:layout_marginLeft="10dp"
a:layout_marginRight="10dp"
a:text="@string/about.webpage"
/>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
a:id="@+id/help_refresh"
a:layout_width="fill_parent"
a:layout_height="match_parent"
a:layout_below="@id/help_buttons">
<Button
a:id="@+id/help_report"
a:layout_width="match_parent"
a:layout_height="wrap_content"
a:layout_alignParentBottom="true"
a:layout_marginLeft="10dp"
a:layout_marginRight="10dp"
a:layout_marginBottom="20dp"
a:text="@string/about.report"
/>
<WebView
a:id="@+id/help_contents"
a:layout_width="fill_parent"
a:layout_height="match_parent"
a:fadingEdge="vertical"
a:fadingEdgeLength="12dip" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</RelativeLayout>
</RelativeLayout>

View File

@ -78,7 +78,6 @@
<string name="equalizer.label">Ekvalizér</string>
<string name="equalizer.preset">Vybrat předvolbu</string>
<string name="error.label">Chyba</string>
<string name="help.url">file:///android_asset/html/en/index.html</string>
<string name="jukebox.is_default">Jukebox jako výchozí</string>
<string name="lyrics.nomatch">Text skladby nenalezen</string>
<string name="main.albums_alphaByArtist">Podle umělce</string>

View File

@ -90,7 +90,6 @@
<string name="equalizer.label">Equalizer</string>
<string name="equalizer.preset">Voreinstellung wählen</string>
<string name="error.label">Fehler</string>
<string name="help.url">file:///android_asset/html/de/index.html</string>
<string name="jukebox.is_default">Jukebox als Standard</string>
<string name="lyrics.nomatch">Keine Liedtexte gefunden</string>
<string name="main.albums_alphaByArtist">Nach Künstler</string>

View File

@ -94,7 +94,6 @@
<string name="equalizer.label">Ecualizador</string>
<string name="equalizer.preset">Seleccionar preajuste</string>
<string name="error.label">Error</string>
<string name="help.url">file:///android_asset/html/en/index.html</string>
<string name="jukebox.is_default">Jukebox por defecto</string>
<string name="lyrics.nomatch">No se encontraron letras</string>
<string name="main.albums_alphaByArtist">Por artista</string>

View File

@ -91,7 +91,6 @@
<string name="equalizer.label">Égaliseur</string>
<string name="equalizer.preset">Sélection prédéfinie</string>
<string name="error.label">Erreur</string>
<string name="help.url">file:///android_asset/html/en/index.html</string>
<string name="jukebox.is_default">Jukebox actif par défaut</string>
<string name="lyrics.nomatch">Aucunes paroles trouvées</string>
<string name="main.albums_alphaByArtist">Alphabétique par artiste</string>

View File

@ -88,7 +88,6 @@
<string name="equalizer.label">Equalizer</string>
<string name="equalizer.preset">Profil kiválasztása</string>
<string name="error.label">Hiba!</string>
<string name="help.url">file:///android_asset/html/en/index.html</string>
<string name="jukebox.is_default">Jukebox alapértelmezésként</string>
<string name="lyrics.nomatch">Dalszöveg nem található!</string>
<string name="main.albums_alphaByArtist">Előadónév szerint</string>

View File

@ -75,7 +75,6 @@
<string name="equalizer.label">Equalizzatore</string>
<string name="equalizer.preset">Selezione Preset</string>
<string name="error.label">Errore</string>
<string name="help.url">file:///android_asset/html/en/index.html</string>
<string name="jukebox.is_default">Jukebox per impostazione predefinita</string>
<string name="lyrics.nomatch">Nessun testo trovato</string>
<string name="main.albums_alphaByArtist">Per Artista</string>

View File

@ -94,7 +94,6 @@
<string name="equalizer.label">Equalizer</string>
<string name="equalizer.preset">Kies een voorinstelling</string>
<string name="error.label">Fout</string>
<string name="help.url">file:///android_asset/html/en/index.html</string>
<string name="jukebox.is_default">Standaard starten in jukebox-modus</string>
<string name="lyrics.nomatch">Geen songtekst gevonden</string>
<string name="main.albums_alphaByArtist">Op artiest</string>

View File

@ -77,7 +77,6 @@
<string name="equalizer.label">Korektor dźwięku</string>
<string name="equalizer.preset">Wybierz preset</string>
<string name="error.label">Błąd</string>
<string name="help.url">file:///android_asset/html/en/index.html</string>
<string name="jukebox.is_default">Jukebox domyślnie</string>
<string name="lyrics.nomatch">Brak tekstu utworu</string>
<string name="main.albums_alphaByArtist">wg artystów</string>

View File

@ -91,7 +91,6 @@
<string name="equalizer.label">Equalizador</string>
<string name="equalizer.preset">Selecionar Configuração Prévia</string>
<string name="error.label">Erro</string>
<string name="help.url">file:///android_asset/html/en/index.html</string>
<string name="jukebox.is_default">Jukebox por padrão</string>
<string name="lyrics.nomatch">Nenhuma letra encontrada</string>
<string name="main.albums_alphaByArtist">Por Artista</string>

View File

@ -77,7 +77,6 @@
<string name="equalizer.label">Equalizador</string>
<string name="equalizer.preset">Selecionar Configuração Prévia</string>
<string name="error.label">Erro</string>
<string name="help.url">file:///android_asset/html/en/index.html</string>
<string name="jukebox.is_default">Jukebox por Padrão</string>
<string name="lyrics.nomatch">Nenhuma letra encontrada</string>
<string name="main.albums_alphaByArtist">Por Artista</string>

View File

@ -88,7 +88,6 @@
<string name="equalizer.label">Эквалайзер</string>
<string name="equalizer.preset">Выберите предустановку</string>
<string name="error.label">Ошибка</string>
<string name="help.url">file:///android_asset/html/en/index.html</string>
<string name="jukebox.is_default">Jukebox по умолчанию</string>
<string name="lyrics.nomatch">Текст не найден</string>
<string name="main.albums_alphaByArtist">По исполнителю</string>

View File

@ -93,7 +93,6 @@
<string name="equalizer.label">均衡器</string>
<string name="equalizer.preset">选择预设</string>
<string name="error.label">错误</string>
<string name="help.url">file:///android_asset/html/en/index.html</string>
<string name="jukebox.is_default">默认自动点唱机</string>
<string name="lyrics.nomatch">找不到歌词</string>
<string name="main.albums_alphaByArtist">按艺术家排序</string>

View File

@ -94,7 +94,6 @@
<string name="equalizer.label">Equalizer</string>
<string name="equalizer.preset">Select Preset</string>
<string name="error.label">Error</string>
<string name="help.url">file:///android_asset/html/en/index.html</string>
<string name="jukebox.is_default">Jukebox By Default</string>
<string name="lyrics.nomatch">No lyrics found</string>
<string name="main.albums_alphaByArtist">By Artist</string>
@ -416,6 +415,12 @@
<string name="server_editor.disabled_feature">One or more features were disabled because the server doesn\'t support them.\nYou can run this test again anytime.</string>
<string name="server_menu.demo">Demo Server</string>
<string name="about.webpage">Visit webpage</string>
<string name="about.report">Report a bug</string>
<string name="about.text"><b>Ultrasonic</b> is a free and open-source music streaming Android client for Subsonic API (version 1.7.0 or higher) compatible servers.\n\nWith <b>Ultrasonic</b> you can easily stream or download music from your home computer to your Android phone using your Subsonic compatible media server. The Subsonic server software requires additional configuration separate from Ultrasonic.\n\nBy default, Ultrasonic is not configured. Once you\'ve set up your own server, please change the server configuration so that it connects to your own computer.</string>
<string name="about.webpage.url">https://ultrasonic.github.io/</string>
<string name="about.report.url">https://github.com/ultrasonic/ultrasonic/issues</string>
<plurals name="select_album_n_songs">
<item quantity="one">%d song</item>
<item quantity="other">%d songs</item>