Reworked about page for translations

This commit is contained in:
str4d
2015-01-08 10:44:14 +00:00
parent df2ee58f85
commit c2a14fdd1e
5 changed files with 45 additions and 25 deletions

View File

@@ -21,15 +21,18 @@ public class HelpAboutFragment extends Fragment {
View view = inflater.inflate(R.layout.fragment_help_about, container, false);
TextView versionText = (TextView) view.findViewById(R.id.help_about_version);
versionText.setText(getString(R.string.help_about_version) + " " + getVersion());
versionText.setText(getString(R.string.version) + " " + getVersion());
HtmlTextView aboutTextView = (HtmlTextView) view.findViewById(R.id.help_about_text);
TextView licenseText = (TextView) view.findViewById(R.id.help_about_license);
licenseText.setText(getString(R.string.license, "GPLv3+"));
HtmlTextView aboutLibsView = (HtmlTextView) view.findViewById(R.id.help_about_libraries);
// load html from raw resource (Parsing handled by HtmlTextView library)
aboutTextView.setHtmlFromRawResource(getActivity(), R.raw.help_about, true);
aboutLibsView.setHtmlFromRawResource(getActivity(), R.raw.help_about_libraries, true);
// no flickering when clicking textview for Android < 4
aboutTextView.setTextColor(getResources().getColor(android.R.color.black));
aboutLibsView.setTextColor(getResources().getColor(android.R.color.black));
return view;
}

View File

@@ -19,18 +19,12 @@
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginRight="10dp"
android:src="@drawable/ic_launcher"/>
</LinearLayout>
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginRight="10dp"
android:src="@drawable/ic_launcher"/>
<LinearLayout
android:layout_width="match_parent"
@@ -47,12 +41,34 @@
android:id="@+id/help_about_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/version"
android:textAppearance="@style/TextAppearance.AppCompat.Secondary"/>
</LinearLayout>
</LinearLayout>
<TextView
style="@style/Help.About.Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:text="@string/help_about_url"/>
<TextView
android:id="@+id/help_about_license"
style="@style/Help.About.Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/license"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/libraries"
android:textAppearance="@style/TextAppearance.AppCompat.Subject"/>
<org.sufficientlysecure.htmltextview.HtmlTextView
android:id="@+id/help_about_text"
android:id="@+id/help_about_libraries"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"/>

View File

@@ -1,15 +1,7 @@
<!-- Maintain structure with headings with h2 tags and content with p tags.
This makes it easy to translate the values with transifex!
And don't add newlines before or after p tags because of transifex -->
<html>
<head>
</head>
<body>
<p><a href="https://github.com/i2p/i2p.i2p-bote.android">https://github.com/i2p/i2p.i2p-bote.android</a></p>
<p>Bote is the Android app for <a href="http://i2pbote.i2p.xyz">I2P-Bote</a>.</p>
<p>License: GPLv3+</p>
<h2>Libraries</h2>
<ul>
<li><a href="http://developer.android.com/tools/support-library/index.html">Android Support Library v4</a> (Apache License v2)</li>
<li><a href="http://developer.android.com/tools/support-library/index.html">Android Support Library v7 'appcompat'</a> (Apache License v2)</li>

View File

@@ -244,6 +244,11 @@
<string name="start">Start</string>
<string name="changelog">Changelog</string>
<string name="about">About</string>
<string name="help_about_version">Version:</string>
<string name="version">Version</string>
<string name="help_about_url" translatable="false">https://github.com/i2p/i2p.i2p-bote.android</string>
<!-- As in software license, e.g. Apache License v2 -->
<string name="license">License: %s</string>
<!-- Software libraries -->
<string name="libraries">Libraries</string>
</resources>

View File

@@ -67,4 +67,8 @@
<item name="android:textColor">@android:color/white</item>
</style>
<style name="Help.About.Text" parent="TextAppearance.AppCompat.Body1">
<item name="android:layout_marginTop">8dp</item>
</style>
</resources>