mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-29 12:27:11 +01:00
Fix opening Image view activity from embedded images
This commit is contained in:
parent
76fee50cd5
commit
d4fe5235e2
@ -204,7 +204,7 @@ public class CommentActivity extends BaseActivity implements UploadImageEnabledA
|
||||
builder.linkColor(linkColor);
|
||||
}
|
||||
};
|
||||
Markwon postBodyMarkwon = MarkdownUtils.createFullRedditMarkwon(getApplication(),
|
||||
Markwon postBodyMarkwon = MarkdownUtils.createFullRedditMarkwon(this,
|
||||
miscPlugin, parentTextColor, parentSpoilerBackgroundColor, null);
|
||||
MarkwonAdapter markwonAdapter = MarkdownUtils.createTablesAdapter();
|
||||
binding.commentContentMarkdownView.setLayoutManager(new LinearLayoutManagerBugFixed(this));
|
||||
|
@ -138,7 +138,7 @@ public class FullMarkdownActivity extends BaseActivity {
|
||||
builder.linkColor(linkColor);
|
||||
}
|
||||
};
|
||||
Markwon markwon = MarkdownUtils.createFullRedditMarkwon(getApplication(),
|
||||
Markwon markwon = MarkdownUtils.createFullRedditMarkwon(this,
|
||||
miscPlugin, markdownColor, spoilerBackgroundColor, null);
|
||||
|
||||
MarkwonAdapter markwonAdapter = MarkdownUtils.createTablesAdapter();
|
||||
|
@ -538,7 +538,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
||||
return true;
|
||||
};
|
||||
|
||||
Markwon markwon = MarkdownUtils.createDescriptionMarkwon(getApplication(), miscPlugin, onLinkLongClickListener);
|
||||
Markwon markwon = MarkdownUtils.createDescriptionMarkwon(this, miscPlugin, onLinkLongClickListener);
|
||||
|
||||
descriptionTextView.setOnLongClickListener(view -> {
|
||||
if (description != null && !description.equals("") && descriptionTextView.getSelectionStart() == -1 && descriptionTextView.getSelectionEnd() == -1) {
|
||||
|
@ -472,7 +472,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
|
||||
urlMenuBottomSheetFragment.show(getSupportFragmentManager(), null);
|
||||
return true;
|
||||
};
|
||||
Markwon markwon = MarkdownUtils.createDescriptionMarkwon(getApplication(), miscPlugin, onLinkLongClickListener);
|
||||
Markwon markwon = MarkdownUtils.createDescriptionMarkwon(this, miscPlugin, onLinkLongClickListener);
|
||||
|
||||
descriptionTextView.setOnLongClickListener(view -> {
|
||||
if (description != null && !description.equals("") && descriptionTextView.getSelectionStart() == -1 && descriptionTextView.getSelectionEnd() == -1) {
|
||||
|
@ -175,7 +175,7 @@ public class WikiActivity extends BaseActivity {
|
||||
urlMenuBottomSheetFragment.show(getSupportFragmentManager(), null);
|
||||
return true;
|
||||
};
|
||||
markwon = MarkdownUtils.createFullRedditMarkwon(getApplication(),
|
||||
markwon = MarkdownUtils.createFullRedditMarkwon(this,
|
||||
miscPlugin, markdownColor, spoilerBackgroundColor, onLinkLongClickListener);
|
||||
|
||||
markwonAdapter = MarkdownUtils.createTablesAdapter();
|
||||
|
@ -168,7 +168,7 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
|
||||
}
|
||||
return true;
|
||||
};
|
||||
mMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity.getApplication(),
|
||||
mMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity,
|
||||
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.getApplication(),
|
||||
mCommentMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity,
|
||||
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.getApplication(),
|
||||
mPostDetailMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity,
|
||||
miscPlugin, markdownColor, postSpoilerBackgroundColor, onLinkLongClickListener);
|
||||
mMarkwonAdapter = MarkdownUtils.createTablesAdapter();
|
||||
|
||||
|
@ -81,7 +81,7 @@ public class RulesRecyclerViewAdapter extends RecyclerView.Adapter<RulesRecycler
|
||||
}
|
||||
return true;
|
||||
};
|
||||
markwon = MarkdownUtils.createFullRedditMarkwon(activity.getApplication(),
|
||||
markwon = MarkdownUtils.createFullRedditMarkwon(activity,
|
||||
miscPlugin, mPrimaryTextColor, spoilerBackgroundColor, onLinkLongClickListener);
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ public class SidebarFragment extends Fragment {
|
||||
urlMenuBottomSheetFragment.show(getChildFragmentManager(), null);
|
||||
return true;
|
||||
};
|
||||
Markwon markwon = MarkdownUtils.createFullRedditMarkwon(activity.getApplication(),
|
||||
Markwon markwon = MarkdownUtils.createFullRedditMarkwon(activity,
|
||||
miscPlugin, markdownColor, spoilerBackgroundColor, onLinkLongClickListener);
|
||||
MarkwonAdapter markwonAdapter = MarkdownUtils.createTablesAdapter();
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package eu.toldi.infinityforlemmy.markdown;
|
||||
|
||||
import android.app.Application;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.text.util.Linkify;
|
||||
|
||||
@ -34,13 +34,13 @@ public class MarkdownUtils {
|
||||
* @return configured Markwon instance
|
||||
*/
|
||||
@NonNull
|
||||
public static Markwon createFullRedditMarkwon(@NonNull Application context,
|
||||
public static Markwon createFullRedditMarkwon(@NonNull Activity context,
|
||||
@NonNull MarkwonPlugin miscPlugin,
|
||||
int markdownColor,
|
||||
int spoilerBackgroundColor,
|
||||
@Nullable BetterLinkMovementMethod.OnLinkLongClickListener onLinkLongClickListener) {
|
||||
return Markwon.builder(context)
|
||||
.usePlugin(GlideImagesPlugin.create(context))
|
||||
.usePlugin(GlideImagesPlugin.create(context.getApplicationContext()))
|
||||
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||
}))
|
||||
@ -59,7 +59,7 @@ public class MarkdownUtils {
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Markwon createDescriptionMarkwon(Application context, MarkwonPlugin miscPlugin,
|
||||
public static Markwon createDescriptionMarkwon(Activity context, MarkwonPlugin miscPlugin,
|
||||
BetterLinkMovementMethod.OnLinkLongClickListener onLinkLongClickListener) {
|
||||
return Markwon.builder(context)
|
||||
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||
@ -73,7 +73,7 @@ public class MarkdownUtils {
|
||||
.setOnLinkLongClickListener(onLinkLongClickListener)))
|
||||
.usePlugin(LinkifyPlugin.create(Linkify.WEB_URLS))
|
||||
.usePlugin(TableEntryPlugin.create(context))
|
||||
.usePlugin(GlideImagesPlugin.create(context))
|
||||
.usePlugin(GlideImagesPlugin.create(context.getApplicationContext()))
|
||||
.usePlugin(new MarkwonLemmyLinkPlugin())
|
||||
.build();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user