mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-01 05:47:10 +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);
|
builder.linkColor(linkColor);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Markwon postBodyMarkwon = MarkdownUtils.createFullRedditMarkwon(getApplication(),
|
Markwon postBodyMarkwon = MarkdownUtils.createFullRedditMarkwon(this,
|
||||||
miscPlugin, parentTextColor, parentSpoilerBackgroundColor, null);
|
miscPlugin, parentTextColor, parentSpoilerBackgroundColor, null);
|
||||||
MarkwonAdapter markwonAdapter = MarkdownUtils.createTablesAdapter();
|
MarkwonAdapter markwonAdapter = MarkdownUtils.createTablesAdapter();
|
||||||
binding.commentContentMarkdownView.setLayoutManager(new LinearLayoutManagerBugFixed(this));
|
binding.commentContentMarkdownView.setLayoutManager(new LinearLayoutManagerBugFixed(this));
|
||||||
|
@ -138,7 +138,7 @@ public class FullMarkdownActivity extends BaseActivity {
|
|||||||
builder.linkColor(linkColor);
|
builder.linkColor(linkColor);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Markwon markwon = MarkdownUtils.createFullRedditMarkwon(getApplication(),
|
Markwon markwon = MarkdownUtils.createFullRedditMarkwon(this,
|
||||||
miscPlugin, markdownColor, spoilerBackgroundColor, null);
|
miscPlugin, markdownColor, spoilerBackgroundColor, null);
|
||||||
|
|
||||||
MarkwonAdapter markwonAdapter = MarkdownUtils.createTablesAdapter();
|
MarkwonAdapter markwonAdapter = MarkdownUtils.createTablesAdapter();
|
||||||
|
@ -538,7 +538,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
Markwon markwon = MarkdownUtils.createDescriptionMarkwon(getApplication(), miscPlugin, onLinkLongClickListener);
|
Markwon markwon = MarkdownUtils.createDescriptionMarkwon(this, miscPlugin, onLinkLongClickListener);
|
||||||
|
|
||||||
descriptionTextView.setOnLongClickListener(view -> {
|
descriptionTextView.setOnLongClickListener(view -> {
|
||||||
if (description != null && !description.equals("") && descriptionTextView.getSelectionStart() == -1 && descriptionTextView.getSelectionEnd() == -1) {
|
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);
|
urlMenuBottomSheetFragment.show(getSupportFragmentManager(), null);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
Markwon markwon = MarkdownUtils.createDescriptionMarkwon(getApplication(), miscPlugin, onLinkLongClickListener);
|
Markwon markwon = MarkdownUtils.createDescriptionMarkwon(this, miscPlugin, onLinkLongClickListener);
|
||||||
|
|
||||||
descriptionTextView.setOnLongClickListener(view -> {
|
descriptionTextView.setOnLongClickListener(view -> {
|
||||||
if (description != null && !description.equals("") && descriptionTextView.getSelectionStart() == -1 && descriptionTextView.getSelectionEnd() == -1) {
|
if (description != null && !description.equals("") && descriptionTextView.getSelectionStart() == -1 && descriptionTextView.getSelectionEnd() == -1) {
|
||||||
|
@ -175,7 +175,7 @@ public class WikiActivity extends BaseActivity {
|
|||||||
urlMenuBottomSheetFragment.show(getSupportFragmentManager(), null);
|
urlMenuBottomSheetFragment.show(getSupportFragmentManager(), null);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
markwon = MarkdownUtils.createFullRedditMarkwon(getApplication(),
|
markwon = MarkdownUtils.createFullRedditMarkwon(this,
|
||||||
miscPlugin, markdownColor, spoilerBackgroundColor, onLinkLongClickListener);
|
miscPlugin, markdownColor, spoilerBackgroundColor, onLinkLongClickListener);
|
||||||
|
|
||||||
markwonAdapter = MarkdownUtils.createTablesAdapter();
|
markwonAdapter = MarkdownUtils.createTablesAdapter();
|
||||||
|
@ -168,7 +168,7 @@ public class CommentsListingRecyclerViewAdapter extends PagedListAdapter<Comment
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
mMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity.getApplication(),
|
mMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity,
|
||||||
miscPlugin, mCommentColor, commentSpoilerBackgroundColor, onLinkLongClickListener);
|
miscPlugin, mCommentColor, commentSpoilerBackgroundColor, onLinkLongClickListener);
|
||||||
recycledViewPool = new RecyclerView.RecycledViewPool();
|
recycledViewPool = new RecyclerView.RecycledViewPool();
|
||||||
}
|
}
|
||||||
|
@ -214,7 +214,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
mCommentMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity.getApplication(),
|
mCommentMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity,
|
||||||
miscPlugin, mCommentTextColor, commentSpoilerBackgroundColor, onLinkLongClickListener);
|
miscPlugin, mCommentTextColor, commentSpoilerBackgroundColor, onLinkLongClickListener);
|
||||||
recycledViewPool = new RecyclerView.RecycledViewPool();
|
recycledViewPool = new RecyclerView.RecycledViewPool();
|
||||||
mAccessToken = accessToken;
|
mAccessToken = accessToken;
|
||||||
|
@ -294,7 +294,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
mPostDetailMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity.getApplication(),
|
mPostDetailMarkwon = MarkdownUtils.createFullRedditMarkwon(mActivity,
|
||||||
miscPlugin, markdownColor, postSpoilerBackgroundColor, onLinkLongClickListener);
|
miscPlugin, markdownColor, postSpoilerBackgroundColor, onLinkLongClickListener);
|
||||||
mMarkwonAdapter = MarkdownUtils.createTablesAdapter();
|
mMarkwonAdapter = MarkdownUtils.createTablesAdapter();
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ public class RulesRecyclerViewAdapter extends RecyclerView.Adapter<RulesRecycler
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
markwon = MarkdownUtils.createFullRedditMarkwon(activity.getApplication(),
|
markwon = MarkdownUtils.createFullRedditMarkwon(activity,
|
||||||
miscPlugin, mPrimaryTextColor, spoilerBackgroundColor, onLinkLongClickListener);
|
miscPlugin, mPrimaryTextColor, spoilerBackgroundColor, onLinkLongClickListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ public class SidebarFragment extends Fragment {
|
|||||||
urlMenuBottomSheetFragment.show(getChildFragmentManager(), null);
|
urlMenuBottomSheetFragment.show(getChildFragmentManager(), null);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
Markwon markwon = MarkdownUtils.createFullRedditMarkwon(activity.getApplication(),
|
Markwon markwon = MarkdownUtils.createFullRedditMarkwon(activity,
|
||||||
miscPlugin, markdownColor, spoilerBackgroundColor, onLinkLongClickListener);
|
miscPlugin, markdownColor, spoilerBackgroundColor, onLinkLongClickListener);
|
||||||
MarkwonAdapter markwonAdapter = MarkdownUtils.createTablesAdapter();
|
MarkwonAdapter markwonAdapter = MarkdownUtils.createTablesAdapter();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package eu.toldi.infinityforlemmy.markdown;
|
package eu.toldi.infinityforlemmy.markdown;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.text.util.Linkify;
|
import android.text.util.Linkify;
|
||||||
|
|
||||||
@ -34,13 +34,13 @@ public class MarkdownUtils {
|
|||||||
* @return configured Markwon instance
|
* @return configured Markwon instance
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public static Markwon createFullRedditMarkwon(@NonNull Application context,
|
public static Markwon createFullRedditMarkwon(@NonNull Activity context,
|
||||||
@NonNull MarkwonPlugin miscPlugin,
|
@NonNull MarkwonPlugin miscPlugin,
|
||||||
int markdownColor,
|
int markdownColor,
|
||||||
int spoilerBackgroundColor,
|
int spoilerBackgroundColor,
|
||||||
@Nullable BetterLinkMovementMethod.OnLinkLongClickListener onLinkLongClickListener) {
|
@Nullable BetterLinkMovementMethod.OnLinkLongClickListener onLinkLongClickListener) {
|
||||||
return Markwon.builder(context)
|
return Markwon.builder(context)
|
||||||
.usePlugin(GlideImagesPlugin.create(context))
|
.usePlugin(GlideImagesPlugin.create(context.getApplicationContext()))
|
||||||
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
plugin.excludeInlineProcessor(HtmlInlineProcessor.class);
|
||||||
}))
|
}))
|
||||||
@ -59,7 +59,7 @@ public class MarkdownUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public static Markwon createDescriptionMarkwon(Application context, MarkwonPlugin miscPlugin,
|
public static Markwon createDescriptionMarkwon(Activity context, MarkwonPlugin miscPlugin,
|
||||||
BetterLinkMovementMethod.OnLinkLongClickListener onLinkLongClickListener) {
|
BetterLinkMovementMethod.OnLinkLongClickListener onLinkLongClickListener) {
|
||||||
return Markwon.builder(context)
|
return Markwon.builder(context)
|
||||||
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
.usePlugin(MarkwonInlineParserPlugin.create(plugin -> {
|
||||||
@ -73,7 +73,7 @@ public class MarkdownUtils {
|
|||||||
.setOnLinkLongClickListener(onLinkLongClickListener)))
|
.setOnLinkLongClickListener(onLinkLongClickListener)))
|
||||||
.usePlugin(LinkifyPlugin.create(Linkify.WEB_URLS))
|
.usePlugin(LinkifyPlugin.create(Linkify.WEB_URLS))
|
||||||
.usePlugin(TableEntryPlugin.create(context))
|
.usePlugin(TableEntryPlugin.create(context))
|
||||||
.usePlugin(GlideImagesPlugin.create(context))
|
.usePlugin(GlideImagesPlugin.create(context.getApplicationContext()))
|
||||||
.usePlugin(new MarkwonLemmyLinkPlugin())
|
.usePlugin(new MarkwonLemmyLinkPlugin())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user