From 2113d4a902de2dcc6a0347834118ffc877c865a8 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Thu, 19 Dec 2019 21:09:58 +0800 Subject: [PATCH] Fixed UI in ViewMultiRedditDetailActivity. Add a share option in Settings -> About to let you easily share this app to other people. Version 2.0.0. --- app/build.gradle | 4 ++-- app/src/main/AndroidManifest.xml | 2 +- .../Activity/FilteredThingActivity.java | 19 ++++++++++++------- .../ViewMultiRedditDetailActivity.java | 3 --- .../Settings/AboutPreferenceFragment.java | 15 +++++++++++++++ .../Utils/SharedPreferencesUtils.java | 1 + .../activity_view_multi_reddit_detail.xml | 3 +-- app/src/main/res/values/strings.xml | 5 +++++ app/src/main/res/xml/about_preferences.xml | 5 +++++ 9 files changed, 42 insertions(+), 15 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index faaee51b..d52412a8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "ml.docilealligator.infinityforreddit" minSdkVersion 21 targetSdkVersion 29 - versionCode 24 - versionName "1.6.2" + versionCode 25 + versionName "2.0.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 97125e7d..4d96a7e8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -23,7 +23,7 @@ tools:replace="android:label"> + android:theme="@style/AppTheme.NoActionBar" /> { + Intent intent = new Intent(Intent.ACTION_SEND); + intent.setType("text/plain"); + intent.putExtra(Intent.EXTRA_TEXT, getString(R.string.share_this_app)); + if (intent.resolveActivity(activity.getPackageManager()) != null) { + startActivity(intent); + } else { + Toast.makeText(activity, R.string.no_app, Toast.LENGTH_SHORT).show(); + } + return true; + }); + } } } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java index f4cc86fc..6fe83045 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java @@ -24,6 +24,7 @@ public class SharedPreferencesUtils { public static final String EMAIL_KEY = "email"; public static final String REDDIT_ACCOUNT_KEY = "reddit_account"; public static final String SUBREDDIT_KEY = "subreddit"; + public static final String SHARE_KEY = "share"; public static final String FONT_SIZE_KEY = "font_size"; public static final String TITLE_FONT_SIZE_KEY = "title_font_size"; public static final String CONTENT_FONT_SIZE_KEY = "content_font_size"; diff --git a/app/src/main/res/layout/activity_view_multi_reddit_detail.xml b/app/src/main/res/layout/activity_view_multi_reddit_detail.xml index 42567cc4..a0ec7c23 100644 --- a/app/src/main/res/layout/activity_view_multi_reddit_detail.xml +++ b/app/src/main/res/layout/activity_view_multi_reddit_detail.xml @@ -4,7 +4,6 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:id="@+id/coordinator_layout_view_multi_reddit_detail_activity" android:background="?attr/backgroundColor" tools:context=".Activity.ViewMultiRedditDetailActivity"> @@ -37,7 +36,7 @@ \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 366a6980..072c1b1e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -330,6 +330,8 @@ u/Hostilenemy Subreddit r/Infinity_For_Reddit + Share + Share this app to other people if you enjoy it Cannot get the link @@ -350,6 +352,7 @@ Share No Email client found + No app available Comment saved Unable to save comment @@ -377,4 +380,6 @@ Error getting multireddit data Cannot sync multireddits Cannot sync subscriptions + + Check out Infinity for Reddit, an awesome Reddit client!\nhttps://play.google.com/store/apps/details?id=ml.docilealligator.infinityforreddit diff --git a/app/src/main/res/xml/about_preferences.xml b/app/src/main/res/xml/about_preferences.xml index fca988af..82898326 100644 --- a/app/src/main/res/xml/about_preferences.xml +++ b/app/src/main/res/xml/about_preferences.xml @@ -35,4 +35,9 @@ app:title="@string/settings_subreddit_title" app:summary="@string/settings_subreddit_summary" /> + + \ No newline at end of file