本文整理汇总了Java中com.zzhoujay.richtext.RichTextConfig类的典型用法代码示例。如果您正苦于以下问题:Java RichTextConfig类的具体用法?Java RichTextConfig怎么用?Java RichTextConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RichTextConfig类属于com.zzhoujay.richtext包,在下文中一共展示了RichTextConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toggleModes
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
private void toggleModes() {
if(!isPreviewMode) {
Toast.makeText(this, R.string.text_edit_mode, Toast.LENGTH_SHORT).show();
editText.setText(original);
} else {
ImeAction.hideSoftKeyboard(this);
Toast.makeText(this, R.string.text_preview_mode, Toast.LENGTH_SHORT).show();
original = editText.getText().toString();
RichTextConfig.RichTextConfigBuild builder = RichText
.from(PatternMatcher.convertToStandardMarkdownEditor(original))
.imageGetter(new DefaultImageGetter())
.type(RichType.MARKDOWN);
richText = builder.into(editText);
}
setIcon();
isPreviewMode = !isPreviewMode;
}
示例2: resetLinkSpan
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
private void resetLinkSpan(SpannableStringBuilder ssb, RichTextConfig config, URLSpan urlSpan) {
int start = ssb.getSpanStart(urlSpan);
int end = ssb.getSpanEnd(urlSpan);
ssb.removeSpan(urlSpan);
LinkHolder linkHolder = new LinkHolder(urlSpan.getURL(), accentColor);
if (config.linkFixCallback != null) {
config.linkFixCallback.fix(linkHolder);
}
LongClickableURLSpan longClickableURLSpan = new LongClickableURLSpan(linkHolder, config.onUrlClickListener, config.onUrlLongClickListener);
ssb.setSpan(longClickableURLSpan, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
示例3: errorHandle
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
private void errorHandle(ImageHolder holder, RichTextConfig config, TextView textView, DrawableWrapper drawableWrapper,
BitmapWrapper.SizeCacheHolder sizeCacheHolder, Exception e) {
AbstractImageLoader imageLoader = new AbstractImageLoader<Object>(holder, config, textView, drawableWrapper, this, null, sizeCacheHolder) {
};
imageLoader.onFailure(e);
}
示例4: loadFromLocalDisk
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
private Drawable loadFromLocalDisk(ImageHolder holder, RichTextConfig config, TextView textView, DrawableWrapper drawableWrapper) {
Cancelable cancelable;
AbstractImageLoader imageLoader;
LocalDiskCachedImageLoader localDiskCachedImageLoader = new LocalDiskCachedImageLoader(holder, config, textView, drawableWrapper, this);
Future<?> future = getExecutorService().submit(localDiskCachedImageLoader);
cancelable = new FutureCancelableWrapper(future);
imageLoader = localDiskCachedImageLoader;
checkTarget(textView);
addTask(cancelable, imageLoader);
return drawableWrapper;
}
示例5: AbstractImageLoader
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
AbstractImageLoader(ImageHolder holder, RichTextConfig config, TextView textView, DrawableWrapper drawableWrapper, ImageLoadNotify iln, SourceDecode<T> sourceDecode, BitmapWrapper.SizeCacheHolder sizeCacheHolder) {
this.holder = holder;
this.config = config;
this.sourceDecode = sourceDecode;
this.textViewWeakReference = new WeakReference<>(textView);
this.drawableWrapperWeakReference = new WeakReference<>(drawableWrapper);
this.notifyWeakReference = new WeakReference<>(iln);
this.sizeCacheHolder = sizeCacheHolder;
onLoading();
}
示例6: updateUI
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
@Override
protected void updateUI() {
mToolbar.setTitle(getString(R.string.text_reviewed_by, mReview.getUser().getDisplay_name()));
RichTextConfig.RichTextConfigBuild builder = RichText
.from(PatternMatcher.convertToStandardMarkdown(mReview.getTextRaw()))
.imageGetter(new DefaultImageGetter())
.type(RichType.MARKDOWN);
mRichText = builder.into(reviewText);
Glide.with(this).load(mReview.getUser()
.getImage_url_med()).centerCrop()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(avatar);
SeriesSmall anime = mReview.getAnime();
SeriesSmall manga = mReview.getManga();
boolean isAnime = anime != null;
switch (mPresenter.getApiPrefs().getTitleLanguage()) {
case "romaji":
reviewHeading.setText(isAnime? anime.getTitle_romaji() : manga.getTitle_romaji());
break;
case "english":
reviewHeading.setText(isAnime? anime.getTitle_english() : manga.getTitle_english());
break;
case "japanese":
reviewHeading.setText(isAnime? anime.getTitle_japanese() : manga.getTitle_japanese());
break;
}
Glide.with(this).load(isAnime?anime.getImage_url_lge():manga.getImage_url_lge()).centerCrop()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(reviewSeries);
mPresenter.createSuperToast(this, getString(R.string.text_processing), R.drawable.ic_info_outline_white_18dp,
Style.TYPE_PROGRESS_BAR, Style.DURATION_VERY_LONG,
ContextCompat.getColor(this, R.color.colorStateBlue));
}
示例7: ImageTarget
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
ImageTarget(TextView textView, DrawableWrapper drawableWrapper, ImageHolder holder, RichTextConfig config, ImageLoadNotify imageLoadNotify, Rect rect) {
this.textViewWeakReference = new WeakReference<>(textView);
this.urlDrawableWeakReference = new WeakReference<>(drawableWrapper);
this.holder = holder;
this.config = config;
this.imageLoadNotifyWeakReference = new WeakReference<>(imageLoadNotify);
this.rect = rect;
}
示例8: resetLinkSpan
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
private void resetLinkSpan(SpannableStringBuilder ssb, RichTextConfig config, URLSpan urlSpan) {
int start = ssb.getSpanStart(urlSpan);
int end = ssb.getSpanEnd(urlSpan);
ssb.removeSpan(urlSpan);
LinkHolder linkHolder = new LinkHolder(urlSpan.getURL());
if (config.linkFixCallback != null) {
config.linkFixCallback.fix(linkHolder);
}
LongClickableURLSpan longClickableURLSpan = new LongClickableURLSpan(linkHolder, config.onUrlClickListener, config.onUrlLongClickListener);
ssb.setSpan(longClickableURLSpan, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
示例9: AbstractImageLoader
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
AbstractImageLoader(ImageHolder holder, RichTextConfig config, TextView textView, DrawableWrapper drawableWrapper, ImageLoadNotify iln, SourceDecode<T> sourceDecode) {
this.holder = holder;
this.config = config;
this.sourceDecode = sourceDecode;
this.textViewWeakReference = new WeakReference<>(textView);
this.drawableWrapperWeakReference = new WeakReference<>(drawableWrapper);
this.notifyWeakReference = new WeakReference<>(iln);
onLoading();
}
示例10: parse
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
public int parse(SpannableStringBuilder ssb, ImageGetterWrapper imageGetter, RichTextConfig config) {
boolean cached = isCached(ssb);
handleHyperLink(ssb, config, cached);
return handleImage(ssb, imageGetter, config, cached);
}
示例11: LocalDiskCachedImageLoader
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
LocalDiskCachedImageLoader(ImageHolder holder, RichTextConfig config, TextView textView, DrawableWrapper drawableWrapper, ImageLoadNotify iln) {
//noinspection unchecked
super(holder, config, textView, drawableWrapper, iln, null, null);
}
示例12: AssetsImageLoader
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
AssetsImageLoader(ImageHolder holder, RichTextConfig config, TextView textView, DrawableWrapper drawableWrapper, ImageLoadNotify iln, BitmapWrapper.SizeCacheHolder sizeCacheHolder) {
super(holder, config, textView, drawableWrapper, iln, SourceDecode.REMOTE_SOURCE_DECODE, sizeCacheHolder);
}
示例13: LocalFileImageLoader
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
LocalFileImageLoader(ImageHolder holder, RichTextConfig config, TextView textView, DrawableWrapper drawableWrapper, ImageLoadNotify iln, BitmapWrapper.SizeCacheHolder sizeCacheHolder) {
super(holder, config, textView, drawableWrapper, iln, SourceDecode.LOCAL_FILE_SOURCE_DECODE, sizeCacheHolder);
}
示例14: CallbackImageLoader
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
CallbackImageLoader(ImageHolder holder, RichTextConfig config, TextView textView, DrawableWrapper drawableWrapper, ImageLoadNotify iln, BitmapWrapper.SizeCacheHolder sizeCacheHolder) {
super(holder, config, textView, drawableWrapper, iln, SourceDecode.REMOTE_SOURCE_DECODE, sizeCacheHolder);
onLoading();
}
示例15: ImageTargetBitmap
import com.zzhoujay.richtext.RichTextConfig; //导入依赖的package包/类
ImageTargetBitmap(TextView textView, DrawableWrapper drawableWrapper, ImageHolder holder, RichTextConfig config, ImageLoadNotify imageLoadNotify, Rect rect) {
super(textView, drawableWrapper, holder, config, imageLoadNotify, rect);
}