mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 12:47:26 +01:00
Fix app crashes on ViewSubredditDetailActivity. Fix some themeing issues.
This commit is contained in:
parent
cd4cf40236
commit
2c36d46cd0
@ -66,11 +66,11 @@ dependencies {
|
||||
implementation 'com.github.santalu:aspect-ratio-imageview:1.0.6'
|
||||
implementation 'androidx.paging:paging-runtime:2.1.2'
|
||||
implementation 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE'
|
||||
implementation 'io.noties.markwon:core:4.2.0'
|
||||
implementation 'io.noties.markwon:linkify:4.2.0'
|
||||
implementation 'io.noties.markwon:ext-strikethrough:4.2.0'
|
||||
implementation "io.noties.markwon:simple-ext:4.2.0"
|
||||
implementation "io.noties.markwon:recycler-table:4.2.0"
|
||||
implementation 'io.noties.markwon:core:4.3.1'
|
||||
implementation 'io.noties.markwon:linkify:4.3.1'
|
||||
implementation 'io.noties.markwon:ext-strikethrough:4.3.1'
|
||||
implementation "io.noties.markwon:simple-ext:4.3.1"
|
||||
implementation "io.noties.markwon:recycler-table:4.3.1"
|
||||
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
|
||||
implementation 'com.github.Ferfalk:SimpleSearchView:0.1.4'
|
||||
implementation 'org.greenrobot:eventbus:3.1.1'
|
||||
|
@ -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() {
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user