From 1352a8268ec4e54a8d4845ecfec3823864c750ee Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Thu, 8 Jul 2021 20:49:38 +0800 Subject: [PATCH] Start adding support for searching in posts. --- app/build.gradle | 2 - .../activities/RPANActivity.java | 8 ---- .../fragments/ViewPostDetailFragment.java | 4 +- .../res/menu/view_post_detail_fragment.xml | 47 +++++++++++-------- 4 files changed, 30 insertions(+), 31 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 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 @@ + + - - + +