aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PrivateMessagesDetailRecyclerViewAdapter.java31
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/NavigationDrawerRecyclerViewMergedAdapter.java8
2 files changed, 20 insertions, 19 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PrivateMessagesDetailRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PrivateMessagesDetailRecyclerViewAdapter.java
index 474ec4d1..a3c883ac 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PrivateMessagesDetailRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PrivateMessagesDetailRecyclerViewAdapter.java
@@ -45,6 +45,7 @@ import ml.docilealligator.infinityforreddit.activities.LinkResolverActivity;
import ml.docilealligator.infinityforreddit.activities.ViewPrivateMessagesActivity;
import ml.docilealligator.infinityforreddit.activities.ViewUserDetailActivity;
import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper;
+import ml.docilealligator.infinityforreddit.markdown.SpoilerParserPlugin;
import ml.docilealligator.infinityforreddit.markdown.SuperscriptInlineProcessor;
import ml.docilealligator.infinityforreddit.message.Message;
import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils;
@@ -76,6 +77,7 @@ public class PrivateMessagesDetailRecyclerViewAdapter extends RecyclerView.Adapt
mGlide = Glide.with(viewPrivateMessagesActivity);
mLocale = locale;
mAccountName = accountName;
+ int commentColor = customThemeWrapper.getCommentColor();
mMarkwon = Markwon.builder(viewPrivateMessagesActivity)
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
plugin.excludeInlineProcessor(AutolinkInlineProcessor.class);
@@ -116,6 +118,7 @@ public class PrivateMessagesDetailRecyclerViewAdapter extends RecyclerView.Adapt
}
})
.usePlugin(StrikethroughPlugin.create())
+ .usePlugin(SpoilerParserPlugin.create(commentColor, commentColor | 0xFF000000))
.usePlugin(LinkifyPlugin.create(Linkify.WEB_URLS))
.build();
mShowElapsedTime = sharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_ELAPSED_TIME_KEY, false);
@@ -163,17 +166,6 @@ public class PrivateMessagesDetailRecyclerViewAdapter extends RecyclerView.Adapt
} else {
((MessageViewHolder) holder).timeTextView.setText(Utils.getFormattedTime(mLocale, message.getTimeUTC(), mTimeFormatPattern));
}
-
- ((MessageViewHolder) holder).messageTextView.setOnClickListener(view -> {
- if (((MessageViewHolder) holder).timeTextView.getVisibility() != View.VISIBLE) {
- ((MessageViewHolder) holder).timeTextView.setVisibility(View.VISIBLE);
- ((MessageViewHolder) holder).copyImageView.setVisibility(View.VISIBLE);
- } else {
- ((MessageViewHolder) holder).timeTextView.setVisibility(View.GONE);
- ((MessageViewHolder) holder).copyImageView.setVisibility(View.GONE);
- }
- mViewPrivateMessagesActivity.delayTransition();
- });
}
if (holder instanceof SentMessageViewHolder) {
@@ -264,6 +256,23 @@ public class PrivateMessagesDetailRecyclerViewAdapter extends RecyclerView.Adapt
messageTextView.setTextColor(Color.WHITE);
timeTextView.setTextColor(mSecondaryTextColor);
+ itemView.setOnClickListener(view -> {
+ if (timeTextView.getVisibility() != View.VISIBLE) {
+ timeTextView.setVisibility(View.VISIBLE);
+ copyImageView.setVisibility(View.VISIBLE);
+ } else {
+ timeTextView.setVisibility(View.GONE);
+ copyImageView.setVisibility(View.GONE);
+ }
+ mViewPrivateMessagesActivity.delayTransition();
+ });
+
+ messageTextView.setOnClickListener(view -> {
+ if (messageTextView.getSelectionStart() == -1 && messageTextView.getSelectionEnd() == -1) {
+ itemView.performClick();
+ }
+ });
+
copyImageView.setColorFilter(mSecondaryTextColor, android.graphics.PorterDuff.Mode.SRC_IN);
copyImageView.setOnClickListener(view -> {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/NavigationDrawerRecyclerViewMergedAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/NavigationDrawerRecyclerViewMergedAdapter.java
index 2eb97d96..f3159f93 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/NavigationDrawerRecyclerViewMergedAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/NavigationDrawerRecyclerViewMergedAdapter.java
@@ -1,14 +1,12 @@
package ml.docilealligator.infinityforreddit.adapters.navigationdrawer;
import android.content.SharedPreferences;
-import android.content.res.Resources;
import androidx.recyclerview.widget.ConcatAdapter;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestManager;
-import java.util.ArrayList;
import java.util.List;
import ml.docilealligator.infinityforreddit.account.Account;
@@ -27,11 +25,6 @@ public class NavigationDrawerRecyclerViewMergedAdapter {
private AccountManagementSectionRecyclerViewAdapter accountManagementSectionRecyclerViewAdapter;
private ConcatAdapter mainPageConcatAdapter;
- private Resources resources;
- private ArrayList<Account> accounts;
- private boolean isLoggedIn;
- private boolean isInMainPage = true;
-
public NavigationDrawerRecyclerViewMergedAdapter(BaseActivity baseActivity, SharedPreferences sharedPreferences,
SharedPreferences nsfwAndSpoilerSharedPreferences,
SharedPreferences navigationDrawerSharedPreferences,
@@ -92,7 +85,6 @@ public class NavigationDrawerRecyclerViewMergedAdapter {
mainPageConcatAdapter.removeAdapter(subscribedSubredditsRecyclerViewAdapter);
mainPageConcatAdapter.addAdapter(accountManagementSectionRecyclerViewAdapter);
- isInMainPage = false;
}
public void closeAccountSectionWithoutChangeIconResource() {