mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 12:47:26 +01:00
Use application context for MarkdownUtils
This commit is contained in:
parent
0f3197d7e4
commit
116deebf87
@ -168,7 +168,7 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
|
||||
}
|
||||
return true;
|
||||
};
|
||||
mMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity,
|
||||
mMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity.getApplication(),
|
||||
miscPlugin, mCommentColor, commentSpoilerBackgroundColor, onLinkLongClickListener);
|
||||
recycledViewPool = new RecyclerView.RecycledViewPool();
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
||||
}
|
||||
return true;
|
||||
};
|
||||
mCommentMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity,
|
||||
mCommentMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity.getApplication(),
|
||||
miscPlugin, mCommentTextColor, commentSpoilerBackgroundColor, onLinkLongClickListener);
|
||||
recycledViewPool = new RecyclerView.RecycledViewPool();
|
||||
mAccessToken = accessToken;
|
||||
|
@ -294,7 +294,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
||||
}
|
||||
return true;
|
||||
};
|
||||
mPostDetailMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity,
|
||||
mPostDetailMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity.getApplication(),
|
||||
miscPlugin, markdownColor, postSpoilerBackgroundColor, onLinkLongClickListener);
|
||||
mMarkwonAdapter = MarkdownUtils.createTablesAdapter();
|
||||
|
||||
|
@ -16,13 +16,6 @@ import java.util.ArrayList;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.noties.markwon.AbstractMarkwonPlugin;
|
||||
import io.noties.markwon.Markwon;
|
||||
import io.noties.markwon.MarkwonConfiguration;
|
||||
import io.noties.markwon.MarkwonPlugin;
|
||||
import io.noties.markwon.core.MarkwonTheme;
|
||||
import io.noties.markwon.recycler.MarkwonAdapter;
|
||||
import me.saket.bettermovementmethod.BetterLinkMovementMethod;
|
||||
import eu.toldi.infinityforlemmy.R;
|
||||
import eu.toldi.infinityforlemmy.Rule;
|
||||
import eu.toldi.infinityforlemmy.activities.BaseActivity;
|
||||
@ -33,6 +26,13 @@ import eu.toldi.infinityforlemmy.customviews.SwipeLockInterface;
|
||||
import eu.toldi.infinityforlemmy.customviews.SwipeLockLinearLayoutManager;
|
||||
import eu.toldi.infinityforlemmy.customviews.slidr.widget.SliderPanel;
|
||||
import eu.toldi.infinityforlemmy.markdown.MarkdownUtils;
|
||||
import io.noties.markwon.AbstractMarkwonPlugin;
|
||||
import io.noties.markwon.Markwon;
|
||||
import io.noties.markwon.MarkwonConfiguration;
|
||||
import io.noties.markwon.MarkwonPlugin;
|
||||
import io.noties.markwon.core.MarkwonTheme;
|
||||
import io.noties.markwon.recycler.MarkwonAdapter;
|
||||
import me.saket.bettermovementmethod.BetterLinkMovementMethod;
|
||||
|
||||
public class RulesRecyclerViewAdapter extends RecyclerView.Adapter<RulesRecyclerViewAdapter.RuleViewHolder> {
|
||||
private BaseActivity activity;
|
||||
@ -81,7 +81,7 @@ public class RulesRecyclerViewAdapter extends RecyclerView.Adapter<RulesRecycler
|
||||
}
|
||||
return true;
|
||||
};
|
||||
markwon = MarkdownUtils.createFullRedditMarkwon(activity,
|
||||
markwon = MarkdownUtils.createFullRedditMarkwon(activity.getApplication(),
|
||||
miscPlugin, mPrimaryTextColor, spoilerBackgroundColor, onLinkLongClickListener);
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ public class SidebarFragment extends Fragment {
|
||||
urlMenuBottomSheetFragment.show(getChildFragmentManager(), null);
|
||||
return true;
|
||||
};
|
||||
Markwon markwon = MarkdownUtils.createFullRedditMarkwon(activity,
|
||||
Markwon markwon = MarkdownUtils.createFullRedditMarkwon(activity.getApplication(),
|
||||
miscPlugin, markdownColor, spoilerBackgroundColor, onLinkLongClickListener);
|
||||
MarkwonAdapter markwonAdapter = MarkdownUtils.createTablesAdapter();
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package eu.toldi.infinityforlemmy.markdown;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.text.util.Linkify;
|
||||
|
||||
@ -29,10 +30,11 @@ import me.saket.bettermovementmethod.BetterLinkMovementMethod;
|
||||
public class MarkdownUtils {
|
||||
/**
|
||||
* Creates a Markwon instance with all the plugins required for processing Reddit's markdown.
|
||||
*
|
||||
* @return configured Markwon instance
|
||||
*/
|
||||
@NonNull
|
||||
public static Markwon createFullRedditMarkwon(@NonNull Context context,
|
||||
public static Markwon createFullRedditMarkwon(@NonNull Application context,
|
||||
@NonNull MarkwonPlugin miscPlugin,
|
||||
int markdownColor,
|
||||
int spoilerBackgroundColor,
|
||||
|
Loading…
Reference in New Issue
Block a user