1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-06-23 03:54:56 +02:00

Added some more features and information to the AboutActivity

This commit is contained in:
vanitasvitae 2016-08-26 17:08:57 +02:00
parent c62f38e693
commit f26f1539ec
9 changed files with 69 additions and 61 deletions

View file

@ -4,7 +4,6 @@ apply plugin: 'android-apt'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.github.dfa.diaspora_android"

View file

@ -63,13 +63,11 @@ public class AboutActivity extends AppCompatActivity {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_about, container, false);
TextView packageName = (TextView) rootView.findViewById(R.id.fragment_about__package_name);
TextView appVersion = (TextView) rootView.findViewById(R.id.fragment_about__app_version);
if(isAdded()) {
try {
PackageInfo pInfo = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0);
packageName.setText(pInfo.packageName);
appVersion.setText(getString(R.string.fragment_debug__app_version, pInfo.versionName+ " ("+pInfo.versionCode+")"));
} catch (PackageManager.NameNotFoundException e) {

View file

@ -49,10 +49,6 @@ import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.ActionMenuView;
import android.support.v7.widget.Toolbar;
import android.text.Html;
import android.text.SpannableString;
import android.text.method.LinkMovementMethod;
import android.text.util.Linkify;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
@ -768,9 +764,6 @@ public class MainActivity extends AppCompatActivity
}
return true;
}
case R.id.debug: {
startActivity(new Intent(this, AboutActivity.class));
}
}
return super.onOptionsItemSelected(item);
@ -1052,27 +1045,7 @@ public class MainActivity extends AppCompatActivity
break;
case R.id.nav_help_license: {
final CharSequence[] options = {getString(R.string.about_activity__title_about_license), getString(R.string.help_markdown__name)};
new AlertDialog.Builder(MainActivity.this)
.setItems(options, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int item) {
if (options[item].equals(getString(R.string.about_activity__title_about_license))) {
final SpannableString s = new SpannableString(Html.fromHtml(getString(R.string.fragment_license__license_content)));
Linkify.addLinks(s, Linkify.WEB_URLS);
final AlertDialog d = new AlertDialog.Builder(MainActivity.this)
.setTitle(R.string.help_license__years)
.setMessage(s)
.setPositiveButton(android.R.string.yes, null).show();
d.show();
((TextView) d.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
}
if (options[item].equals(getString(R.string.help_markdown__name))) {
Helpers.loadUrlInExternalBrowser(MainActivity.this, getString(R.string.help_markdown__weblink));
}
}
}).show();
startActivity(new Intent(MainActivity.this, AboutActivity.class));
}
break;
}

View file

@ -25,11 +25,6 @@
android:text="@string/diaspora_for_android"
style="@android:style/TextAppearance.DeviceDefault.Large"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/fragment_about__package_name"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -37,13 +32,14 @@
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="32dp" />
android:layout_height="16dp" />
<TextView
<com.github.dfa.diaspora_android.ui.HtmlTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"
android:text="@string/lorem_ipsum"/>
android:text="@string/fragment_about__about_content"
style="@android:style/TextAppearance.DeviceDefault.Small"
android:linksClickable="true"
android:autoLink="web"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>

View file

@ -40,6 +40,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_debug__section_pod"
android:paddingTop="@dimen/activity_vertical_margin"
style="@android:style/TextAppearance.DeviceDefault.Large"/>
<TextView

View file

@ -16,12 +16,32 @@
<android.support.v4.widget.Space
android:layout_width="match_parent"
android:layout_height="@dimen/activity_vertical_margin" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_license__copyright_years"
style="@android:style/TextAppearance.DeviceDefault.Large"/>
<com.github.dfa.diaspora_android.ui.HtmlTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_license__license_content"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
android:linksClickable="true"
android:autoLink="web"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_license__3rd_party_libs_title"
android:paddingTop="@dimen/activity_vertical_margin"
style="@android:style/TextAppearance.DeviceDefault.Large"/>
<com.github.dfa.diaspora_android.ui.HtmlTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_license__3rd_party_libs_content"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
android:linksClickable="true"
android:autoLink="web"/>
</LinearLayout>

View file

@ -60,7 +60,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_horizontal_margin"
android:text="@string/app_copyright"
android:text="@string/app_subtitle"
android:textColor="@color/white" />
</LinearLayout>

View file

@ -35,21 +35,15 @@
android:title="@string/action_go_to_top"
app:showAsAction="always"/>
<!-- overflow menu -->
<item
android:id="@+id/action_toggle_desktop_page"
android:icon="@drawable/ic_sync_white_48px"
android:title="@string/action_toggle_desktop_page"
/>
android:title="@string/action_toggle_desktop_page" />
<item
android:id="@+id/action_exit"
android:icon="@drawable/ic_sync_white_48px"
android:title="@string/action_exit_app"
app:showAsAction="never" />
<item
android:id="@+id/debug"
android:title="DEBUG"
app:showAsAction="never" />
</menu>

View file

@ -4,7 +4,7 @@
<string name="diaspora_for_android" translatable="false">Diaspora for Android</string>
<string name="app_name" translatable="false">@string/diaspora</string>
<string name="app_hashtag" translatable="false">#DiasporaForAndroid</string>
<string name="app_copyright" translatable="false">The community-run distributed social network</string>
<string name="app_subtitle" translatable="false">The community-run distributed social network</string>
<string name="shared_by_diaspora_android">*[shared by #DiasporaForAndroid]*</string>
@ -106,13 +106,13 @@
<!-- License & help (large amount of text) -->
<string name="help_markdown__name">Markdown formatting</string>
<string name="help_markdown__weblink" translatable="false">https://wiki.diasporafoundation.org/Markdown_reference_guide</string>
<string name="help_license__years" translatable="false">Copyright © 20152016</string>
<string name="fragment_license__copyright_years" translatable="false">Copyright © 20152016</string>
<string name="fragment_license__license_content" translatable="false">&lt;b>Maintainers:&lt;/b>&lt;br>
&#8226; gsantner https://gsantner.github.io&lt;br>
&#8226; vanitasvitae https://github.com/vanitasvitae&lt;br> &lt;br>
&#8226; gsantner&lt;br>
https://gsantner.github.io&lt;br>
&#8226; Paul Schaub (vanitasvitae)&lt;br>
https://github.com/vanitasvitae&lt;br> &lt;br>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -125,10 +125,11 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses.&lt;br> &lt;br>
along with this program. If not, see&lt;br>
http://www.gnu.org/licenses.&lt;br> &lt;br>
&lt;i>The splashscreen images can be found on flickr:
https://www.flickr.com/photos/129581906@N06/sets/72157651933980136/with/16594947123.
&lt;i>The splashscreen images can be found on flickr: &lt;br>
https://www.flickr.com/photos/129581906@N06/sets/72157651933980136/with/16594947123 &lt;br>
They were published by \"Lydia\" and are licensed under cc by-nc-sa.&lt;/i></string>
<string name="about_activity__title_about_app">About</string>
<string name="about_activity__title_about_license">License</string>
@ -138,7 +139,33 @@
<string name="fragment_debug__app_version">App Version: %1$s</string>
<string name="fragment_debug__package_name">Package Name: %1$s</string>
<string name="fragment_debug__pod_domain">Pod Domain: %1$s</string>
<string name="lorem_ipsum" translatable="false">Auch gibt es niemanden, der den Schmerz an sich liebt, sucht oder wünscht, nur, weil er Schmerz ist, es sei denn, es kommt zu zufälligen Umständen, in denen Mühen und Schmerz ihm große Freude bereiten können. Um ein triviales Beispiel zu nehmen, wer von uns unterzieht sich je anstrengender körperlicher Betätigung, außer um Vorteile daraus zu ziehen? Aber wer hat irgend ein Recht, einen Menschen zu tadeln, der die Entscheidung trifft, eine Freude zu genießen, die keine unangenehmen Folgen hat, oder einen, der Schmerz vermeidet, welcher keine daraus resultierende Freude nach sich zieht? Auch gibt es niemanden, der den Schmerz an sich liebt, sucht oder wünscht, nur, weil er Schmerz ist, es sei denn, es kommt zu zufälligen Umständen, in denen Mühen und Schmerz ihm große Freude bereiten können. Um ein triviales Beispiel zu nehmen, wer von uns unterzieht sich je anstrengender körperlicher Betätigung, außer um Vorteile daraus zu ziehen? Aber wer hat irgend ein Recht, einen Menschen zu tadeln, der die Entscheidung trifft, eine Freude zu genießen, die keine unangenehmen Folgen hat, oder einen, der Schmerz vermeidet, welcher keine daraus resultierende Freude nach sich zieht?</string>
<string name="fragment_about__about_content">
DiasporaForAndroid is your companion app for browsing the Diaspora social network. It adds additional features like useful toolbars and support for proxy servers like the Tor Network to your social experience. &lt;br>&lt;br>
Diaspora uses Markdown to format posts. You can find more information at&lt;br>
https://wiki.diasporafoundation.org/Markdown_reference_guide &lt;br> &lt;br>
DiasporaForAndroid is developed free as in freedom and follows the ideas of the Diaspora project. &lt;br>
You can find the source code on Github: &lt;br>
https://github.com/Diaspora-for-Android/diaspora-android &lt;br> &lt;br>
If you face any problems or if you have suggestions, you can use our bugtracker at the link above.
Alternatively you can post your question with the hashtag #DFAQ on Diaspora. &lt;br> &lt;br>
This app is not available in your language? Check out our project on Crowdin and help to translate it!&lt;br>
https://crowdin.com/project/diaspora-for-android &lt;br> &lt;br>
Also feel free to tell your friends about #DiasporaForAndroid!</string>
<string name="lorem_ipsum" translatable="false">Auch gibt es niemanden, der den Schmerz an sich liebt, sucht oder wünscht, nur, weil er Schmerz ist, es sei denn, es kommt zu zufälligen Umständen, in denen Mühen und Schmerz ihm große Freude bereiten können. Um ein triviales Beispiel zu nehmen, wer von uns unterzieht sich je anstrengender körperlicher Betätigung, außer um Vorteile daraus zu ziehen? Aber wer hat irgend ein Recht, einen Menschen zu tadeln, der die Entscheidung trifft, eine Freude zu genießen, die keine unangenehmen Folgen hat, oder einen, der Schmerz vermeidet, welcher keine daraus resultierende Freude nach sich zieht? Auch gibt es niemanden, der den Schmerz an sich liebt, sucht oder wünscht, nur, weil er Schmerz ist, es sei denn, es kommt zu zufälligen Umständen, in denen Mühen und Schmerz ihm große Freude bereiten können. Um ein triviales Beispiel zu nehmen, wer von uns unterzieht sich je anstrengender körperlicher Betätigung, außer um Vorteile daraus zu ziehen? Aber wer hat irgend ein Recht, einen Menschen zu tadeln, der die Entscheidung trifft, eine Freude zu genießen, die keine unangenehmen Folgen hat, oder einen, der Schmerz vermeidet, welcher keine daraus resultierende Freude nach sich zieht?</string>
<string name="fragment_license__3rd_party_libs_title">Used 3rd Party Libraries</string>
<string name="fragment_license__3rd_party_libs_content" translatable="false">
&#8226;Android Support Library:&lt;br>
https://developer.android.com/topic/libraries/support-library/index.html &lt;br>
&#8226;Anndroid Design Library:&lt;br>
https://android-developers.blogspot.de/2015/05/android-design-support-library.html &lt;br>
&#8226;NetCipher:&lt;br>
https://github.com/guardianproject/NetCipher &lt;br>
&#8226;ButterKnife:&lt;br>
https://jakewharton.github.io/butterknife/ &lt;br>
</string>
</resources>