aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-07-08 12:49:38 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-07-08 12:49:38 +0000
commit1352a8268ec4e54a8d4845ecfec3823864c750ee (patch)
tree1ab93a36b7dfdb0f96dec0aeb5f9f640abded0b2
parent2bf561c31e5173f55019de865e77ebb52151854e (diff)
downloadinfinity-for-reddit-1352a8268ec4e54a8d4845ecfec3823864c750ee.tar
infinity-for-reddit-1352a8268ec4e54a8d4845ecfec3823864c750ee.tar.gz
infinity-for-reddit-1352a8268ec4e54a8d4845ecfec3823864c750ee.tar.bz2
infinity-for-reddit-1352a8268ec4e54a8d4845ecfec3823864c750ee.tar.lz
infinity-for-reddit-1352a8268ec4e54a8d4845ecfec3823864c750ee.tar.xz
infinity-for-reddit-1352a8268ec4e54a8d4845ecfec3823864c750ee.tar.zst
infinity-for-reddit-1352a8268ec4e54a8d4845ecfec3823864c750ee.zip
Start adding support for searching in posts.
Diffstat (limited to '')
-rw-r--r--app/build.gradle2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/RPANActivity.java8
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java4
-rw-r--r--app/src/main/res/menu/view_post_detail_fragment.xml39
4 files changed, 26 insertions, 27 deletions
diff --git a/app/build.gradle b/app/build.gradle
index fab2da39..b817d23f 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -177,8 +177,6 @@ dependencies {
implementation 'androidx.palette:palette:1.0.0'
- implementation 'com.tinder.scarlet:scarlet:0.1.12'
-
/**** Builds and flavors ****/
// debugImplementation because LeakCanary should only run in debug builds.
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RPANActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RPANActivity.java
index 54b3bcaf..38dd995f 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RPANActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/RPANActivity.java
@@ -75,14 +75,9 @@ public class RPANActivity extends AppCompatActivity {
@Named("default")
SharedPreferences mSharedPreferences;
@Inject
- @Named("current_account")
- SharedPreferences mCurrentAccountSharedPreferences;
- @Inject
CustomThemeWrapper mCustomThemeWrapper;
@Inject
Executor mExecutor;
- private String mAccessToken;
- private String mAccountName;
@State
ArrayList<RPANBroadcast> rpanBroadcasts;
@State
@@ -119,9 +114,6 @@ public class RPANActivity extends AppCompatActivity {
actionBar.setHomeAsUpIndicator(upArrow);
actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#00000000")));
- mAccessToken = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCESS_TOKEN, null);
- mAccountName = mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_NAME, null);
-
if (rpanBroadcasts == null) {
loadRPANVideos();
} else {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
index 40d2ff9f..589326ee 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java
@@ -779,7 +779,9 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
int itemId = item.getItemId();
- if (itemId == R.id.action_refresh_view_post_detail_fragment) {
+ if (itemId == R.id.action_search_view_post_detail_fragment) {
+
+ } else if (itemId == R.id.action_refresh_view_post_detail_fragment) {
refresh(true, true);
return true;
} else if (itemId == R.id.action_comment_view_post_detail_fragment) {
diff --git a/app/src/main/res/menu/view_post_detail_fragment.xml b/app/src/main/res/menu/view_post_detail_fragment.xml
index 437355e0..5f732534 100644
--- a/app/src/main/res/menu/view_post_detail_fragment.xml
+++ b/app/src/main/res/menu/view_post_detail_fragment.xml
@@ -2,8 +2,15 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
- android:id="@+id/action_comment_view_post_detail_fragment"
+ android:id="@+id/action_search_view_post_detail_fragment"
android:orderInCategory="1"
+ android:title="@string/action_search"
+ android:icon="@drawable/ic_search_toolbar_24dp"
+ app:showAsAction="ifRoom" />
+
+ <item
+ android:id="@+id/action_comment_view_post_detail_fragment"
+ android:orderInCategory="2"
android:title="@string/action_add_comment"
android:icon="@drawable/ic_comment_toolbar_24dp"
app:showAsAction="ifRoom"
@@ -11,98 +18,98 @@
<item
android:id="@+id/action_save_view_post_detail_fragment"
- android:orderInCategory="2"
+ android:orderInCategory="3"
android:title="@string/action_save_post"
app:showAsAction="ifRoom"
android:visible="false" />
<item
android:id="@+id/action_sort_view_post_detail_fragment"
- android:orderInCategory="3"
+ android:orderInCategory="4"
android:title="@string/action_sort"
app:showAsAction="never"
android:visible="false" />
<item
android:id="@+id/action_refresh_view_post_detail_fragment"
- android:orderInCategory="4"
+ android:orderInCategory="5"
android:title="@string/action_refresh"
app:showAsAction="never" />
<item
android:id="@+id/action_view_crosspost_parent_view_post_detail_fragment"
- android:orderInCategory="5"
+ android:orderInCategory="6"
android:title="@string/action_view_crosspost_parent"
app:showAsAction="never"
android:visible="false" />
<item
android:id="@+id/action_hide_view_post_detail_fragment"
- android:orderInCategory="6"
+ android:orderInCategory="7"
app:showAsAction="never"
android:visible="false" />
<item
android:id="@+id/action_edit_view_post_detail_fragment"
- android:orderInCategory="7"
+ android:orderInCategory="8"
android:title="@string/action_edit_post"
app:showAsAction="never"
android:visible="false" />
<item
android:id="@+id/action_delete_view_post_detail_fragment"
- android:orderInCategory="8"
+ android:orderInCategory="9"
android:title="@string/action_delete_post"
app:showAsAction="never"
android:visible="false" />
<item
android:id="@+id/action_nsfw_view_post_detail_fragment"
- android:orderInCategory="9"
+ android:orderInCategory="10"
app:showAsAction="never"
android:visible="false" />
<item
android:id="@+id/action_spoiler_view_post_detail_fragment"
- android:orderInCategory="10"
+ android:orderInCategory="11"
app:showAsAction="never"
android:visible="false" />
<item
android:id="@+id/action_edit_flair_view_post_detail_fragment"
- android:orderInCategory="11"
+ android:orderInCategory="12"
android:title="@string/action_edit_flair"
app:showAsAction="never"
android:visible="false" />
<item
android:id="@+id/action_give_award_view_post_detail_fragment"
- android:orderInCategory="12"
+ android:orderInCategory="13"
android:title="@string/action_give_award"
app:showAsAction="never" />
<item
android:id="@+id/action_report_view_post_detail_fragment"
- android:orderInCategory="13"
+ android:orderInCategory="14"
android:title="@string/action_report"
app:showAsAction="never" />
<item
android:id="@+id/action_see_removed_view_post_detail_fragment"
- android:orderInCategory="14"
+ android:orderInCategory="15"
android:title="@string/action_see_removed"
app:showAsAction="never"
android:visible="false" />
<item
android:id="@+id/action_crosspost_view_post_detail_fragment"
- android:orderInCategory="15"
+ android:orderInCategory="16"
android:title="@string/action_crosspost"
app:showAsAction="never" />
<item
android:id="@+id/action_add_to_post_filter_view_post_detail_fragment"
- android:orderInCategory="16"
+ android:orderInCategory="17"
android:title="@string/action_add_to_post_filter"
app:showAsAction="never" />
</menu>