From f26f1539ec48e14a7ee8f2353e0db6689bb3b107 Mon Sep 17 00:00:00 2001 From: vanitasvitae Date: Fri, 26 Aug 2016 17:08:57 +0200 Subject: [PATCH] Added some more features and information to the AboutActivity --- app/build.gradle | 1 - .../activity/AboutActivity.java | 2 - .../activity/MainActivity.java | 29 +----------- app/src/main/res/layout/fragment_about.xml | 16 +++---- app/src/main/res/layout/fragment_debug.xml | 1 + app/src/main/res/layout/fragment_license.xml | 22 ++++++++- app/src/main/res/layout/main__nav_header.xml | 2 +- app/src/main/res/menu/main__menu_bottom.xml | 10 +--- app/src/main/res/values/strings.xml | 47 +++++++++++++++---- 9 files changed, 69 insertions(+), 61 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1f76d524..abe0374b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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" diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/AboutActivity.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/AboutActivity.java index b221798a..7ffe528d 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/AboutActivity.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/AboutActivity.java @@ -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) { diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java index a26780f6..39e10d50 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java @@ -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; } diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml index f349aebd..165398e1 100644 --- a/app/src/main/res/layout/fragment_about.xml +++ b/app/src/main/res/layout/fragment_about.xml @@ -25,11 +25,6 @@ android:text="@string/diaspora_for_android" style="@android:style/TextAppearance.DeviceDefault.Large"/> - - + android:layout_height="16dp" /> - + android:text="@string/fragment_about__about_content" + style="@android:style/TextAppearance.DeviceDefault.Small" + android:linksClickable="true" + android:autoLink="web"/> diff --git a/app/src/main/res/layout/fragment_debug.xml b/app/src/main/res/layout/fragment_debug.xml index 4e8583af..9b701722 100644 --- a/app/src/main/res/layout/fragment_debug.xml +++ b/app/src/main/res/layout/fragment_debug.xml @@ -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"/> + + + + + diff --git a/app/src/main/res/layout/main__nav_header.xml b/app/src/main/res/layout/main__nav_header.xml index 46506a78..90e5463a 100644 --- a/app/src/main/res/layout/main__nav_header.xml +++ b/app/src/main/res/layout/main__nav_header.xml @@ -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" /> diff --git a/app/src/main/res/menu/main__menu_bottom.xml b/app/src/main/res/menu/main__menu_bottom.xml index c0ed9419..9ed22043 100644 --- a/app/src/main/res/menu/main__menu_bottom.xml +++ b/app/src/main/res/menu/main__menu_bottom.xml @@ -35,21 +35,15 @@ android:title="@string/action_go_to_top" app:showAsAction="always"/> - + android:title="@string/action_toggle_desktop_page" /> + - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 353ec7eb..fa5e7187 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -4,7 +4,7 @@ Diaspora for Android @string/diaspora #DiasporaForAndroid - The community-run distributed social network + The community-run distributed social network *[shared by #DiasporaForAndroid]* @@ -106,13 +106,13 @@ - Markdown formatting - https://wiki.diasporafoundation.org/Markdown_reference_guide - Copyright © 2015–2016 + Copyright © 2015–2016 <b>Maintainers:</b><br> - • gsantner https://gsantner.github.io<br> - • vanitasvitae https://github.com/vanitasvitae<br> <br> + • gsantner<br> + https://gsantner.github.io<br> + • Paul Schaub (vanitasvitae)<br> + https://github.com/vanitasvitae<br> <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.<br> <br> + along with this program. If not, see<br> + http://www.gnu.org/licenses.<br> <br> - <i>The splashscreen images can be found on flickr: - https://www.flickr.com/photos/129581906@N06/sets/72157651933980136/with/16594947123. + <i>The splashscreen images can be found on flickr: <br> + https://www.flickr.com/photos/129581906@N06/sets/72157651933980136/with/16594947123 <br> They were published by \"Lydia\" and are licensed under cc by-nc-sa.</i> About License @@ -138,7 +139,33 @@ App Version: %1$s Package Name: %1$s Pod Domain: %1$s - 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? + + 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. <br><br> + Diaspora uses Markdown to format posts. You can find more information at<br> + https://wiki.diasporafoundation.org/Markdown_reference_guide <br> <br> + + DiasporaForAndroid is developed free as in freedom and follows the ideas of the Diaspora project. <br> + You can find the source code on Github: <br> + https://github.com/Diaspora-for-Android/diaspora-android <br> <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. <br> <br> + This app is not available in your language? Check out our project on Crowdin and help to translate it!<br> + https://crowdin.com/project/diaspora-for-android <br> <br> + + Also feel free to tell your friends about #DiasporaForAndroid! + 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? + Used 3rd Party Libraries + + •Android Support Library:<br> + https://developer.android.com/topic/libraries/support-library/index.html <br> + •Anndroid Design Library:<br> + https://android-developers.blogspot.de/2015/05/android-design-support-library.html <br> + •NetCipher:<br> + https://github.com/guardianproject/NetCipher <br> + •ButterKnife:<br> + https://jakewharton.github.io/butterknife/ <br> +