aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ThemePreviewActivity.java9
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSidebarActivity.java6
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SidebarFragment.java6
4 files changed, 9 insertions, 14 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ThemePreviewActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ThemePreviewActivity.java
index f7139075..83478a2f 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ThemePreviewActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ThemePreviewActivity.java
@@ -4,9 +4,6 @@ import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Resources;
-import android.graphics.Color;
-import android.graphics.PorterDuff;
-import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.util.TypedValue;
@@ -375,12 +372,6 @@ public class ThemePreviewActivity extends AppCompatActivity {
protected void applyFABTheme(FloatingActionButton fab) {
fab.setBackgroundTintList(ColorStateList.valueOf(customTheme.colorPrimaryLightTheme));
fab.setImageTintList(ColorStateList.valueOf(customTheme.fabIconColor));
- Drawable myFabSrc = getResources().getDrawable(R.drawable.ic_add_day_night_24dp);
- if (myFabSrc.getConstantState() != null) {
- Drawable willBeWhite = myFabSrc.getConstantState().newDrawable();
- willBeWhite.mutate().setColorFilter(Color.WHITE, PorterDuff.Mode.SRC_IN);
- fab.setImageDrawable(willBeWhite);
- }
}
public CustomTheme getCustomTheme() {
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSidebarActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSidebarActivity.java
index d0607455..5dfdad77 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSidebarActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewSidebarActivity.java
@@ -169,8 +169,10 @@ public class ViewSidebarActivity extends BaseActivity {
.get(SubredditViewModel.class);
mSubredditViewModel.getSubredditLiveData().observe(this, subredditData -> {
if (subredditData != null) {
- markwonAdapter.setMarkdown(markwon, subredditData.getSidebarDescription());
- markwonAdapter.notifyDataSetChanged();
+ if (subredditData.getSidebarDescription() != null && !subredditData.getSidebarDescription().equals("")) {
+ markwonAdapter.setMarkdown(markwon, subredditData.getSidebarDescription());
+ markwonAdapter.notifyDataSetChanged();
+ }
} else {
fetchSubredditData();
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java
index 4027b699..f9b4e22b 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java
@@ -701,7 +701,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
case Post.TEXT_TYPE:
((PostDetailViewHolder) holder).mTypeTextView.setText("TEXT");
- if (!mPost.getSelfText().equals("")) {
+ if (mPost.getSelfText() != null && !mPost.getSelfText().equals("")) {
((PostDetailViewHolder) holder).mContentMarkdownView.setVisibility(View.VISIBLE);
LinearLayoutManager linearLayoutManager = new MarkwonLinearLayoutManager(mActivity, new MarkwonLinearLayoutManager.HorizontalScrollViewScrolledListener() {
@Override
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SidebarFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SidebarFragment.java
index cb87a956..2d819696 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SidebarFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Fragment/SidebarFragment.java
@@ -152,8 +152,10 @@ public class SidebarFragment extends Fragment {
.get(SubredditViewModel.class);
mSubredditViewModel.getSubredditLiveData().observe(this, subredditData -> {
if (subredditData != null) {
- markwonAdapter.setMarkdown(markwon, subredditData.getSidebarDescription());
- markwonAdapter.notifyDataSetChanged();
+ if (subredditData.getSidebarDescription() != null && !subredditData.getSidebarDescription().equals("")) {
+ markwonAdapter.setMarkdown(markwon, subredditData.getSidebarDescription());
+ markwonAdapter.notifyDataSetChanged();
+ }
} else {
fetchSubredditData();
}