android.widget.TextView#BufferType ( )源码实例Demo

下面列出了android.widget.TextView#BufferType ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: Markwon   文件: MarkwonImpl.java
MarkwonImpl(
        @NonNull TextView.BufferType bufferType,
        @Nullable TextSetter textSetter,
        @NonNull Parser parser,
        @NonNull MarkwonVisitorFactory visitorFactory,
        @NonNull MarkwonConfiguration configuration,
        @NonNull List<MarkwonPlugin> plugins,
        boolean fallbackToRawInputWhenEmpty
) {
    this.bufferType = bufferType;
    this.textSetter = textSetter;
    this.parser = parser;
    this.visitorFactory = visitorFactory;
    this.configuration = configuration;
    this.plugins = plugins;
    this.fallbackToRawInputWhenEmpty = fallbackToRawInputWhenEmpty;
}
 
源代码2 项目: android-oauth-client   文件: BottomButtonBar.java
public void setText(int resId, TextView.BufferType type, int... ids) {
    for (int id : ids) {
        Button button = getButton(id);
        if (button != null) {
            button.setText(resId, type);
        }
    }
}
 
源代码3 项目: EmoticonGIFKeyboard   文件: EmoticonTextView.java
@Override
@CallSuper
public void setText(CharSequence rawText, TextView.BufferType type) {
    final CharSequence text = rawText == null ? "" : rawText;
    final SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(text);
    if (mEmoticonProvider != null)
        EmoticonUtils.replaceWithImages(getContext(), spannableStringBuilder, mEmoticonProvider, mEmoticonSize);
    super.setText(spannableStringBuilder, type);
}
 
源代码4 项目: Markwon   文件: PrecomputedTextSetterCompat.java
@Override
public void setText(
        @NonNull TextView textView,
        @NonNull final Spanned markdown,
        @NonNull final TextView.BufferType bufferType,
        @NonNull final Runnable onComplete) {

    // insert version check and do not execute on a device < 21
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
        // it's still no-op, so there is no need to start background execution
        applyText(textView, markdown, bufferType, onComplete);
        return;
    }

    final WeakReference<TextView> reference = new WeakReference<>(textView);
    executor.execute(new Runnable() {
        @Override
        public void run() {
            try {
                final PrecomputedTextCompat precomputedTextCompat = precomputedText(reference.get(), markdown);
                if (precomputedTextCompat != null) {
                    applyText(reference.get(), precomputedTextCompat, bufferType, onComplete);
                }
            } catch (Throwable t) {
                Log.e("PrecomputdTxtSetterCmpt", "Exception during pre-computing text", t);
                // apply initial markdown
                applyText(reference.get(), markdown, bufferType, onComplete);
            }
        }
    });
}
 
源代码5 项目: Markwon   文件: PrecomputedTextSetterCompat.java
private static void applyText(
        @Nullable final TextView textView,
        @NonNull final Spanned text,
        @NonNull final TextView.BufferType bufferType,
        @NonNull final Runnable onComplete) {
    if (textView != null) {
        textView.post(new Runnable() {
            @Override
            public void run() {
                textView.setText(text, bufferType);
                onComplete.run();
            }
        });
    }
}
 
源代码6 项目: android-oauth-client   文件: BottomButtonBar.java
public void setText(CharSequence text, TextView.BufferType type, int... ids) {
    for (int id : ids) {
        Button button = getButton(id);
        if (button != null) {
            button.setText(text, type);
        }
    }
}
 
@NonNull
@Override
public ViewFinder setText(final int ID, final CharSequence text, final TextView.BufferType type) {
	((TextView) find(ID)).setText(text, type);
	return this;
}
 
源代码8 项目: RendererRecyclerViewAdapter   文件: ViewFinder.java
@NonNull
ViewFinder setText(@IdRes int ID, CharSequence text, TextView.BufferType type);
 
源代码9 项目: Markwon   文件: MarkwonImplTest.java
@Test
public void text_setter() {

    final Markwon.TextSetter textSetter = mock(Markwon.TextSetter.class);
    final MarkwonPlugin plugin = mock(MarkwonPlugin.class);

    final MarkwonImpl impl = new MarkwonImpl(
            TextView.BufferType.EDITABLE,
            textSetter,
            mock(Parser.class),
            mock(MarkwonVisitorFactory.class),
            mock(MarkwonConfiguration.class),
            Collections.singletonList(plugin),
            true
    );

    final TextView textView = mock(TextView.class);
    final Spanned spanned = mock(Spanned.class);

    impl.setParsedMarkdown(textView, spanned);

    final ArgumentCaptor<TextView> textViewArgumentCaptor =
            ArgumentCaptor.forClass(TextView.class);
    final ArgumentCaptor<Spanned> spannedArgumentCaptor =
            ArgumentCaptor.forClass(Spanned.class);
    final ArgumentCaptor<TextView.BufferType> bufferTypeArgumentCaptor =
            ArgumentCaptor.forClass(TextView.BufferType.class);
    final ArgumentCaptor<Runnable> runnableArgumentCaptor =
            ArgumentCaptor.forClass(Runnable.class);

    verify(textSetter, times(1)).setText(
            textViewArgumentCaptor.capture(),
            spannedArgumentCaptor.capture(),
            bufferTypeArgumentCaptor.capture(),
            runnableArgumentCaptor.capture());

    assertEquals(textView, textViewArgumentCaptor.getValue());
    assertEquals(spanned, spannedArgumentCaptor.getValue());
    assertEquals(TextView.BufferType.EDITABLE, bufferTypeArgumentCaptor.getValue());
    assertNotNull(runnableArgumentCaptor.getValue());
}
 
源代码10 项目: RichEditText   文件: RichEditText.java
public void setText(CharSequence text, TextView.BufferType type) {
    mEditText.setText(text, type);
}
 
/**
 * Delegate method for the input widget
 */
public void setInputWidgetText(CharSequence text, TextView.BufferType type) {
    getInputWidget().setText(text, type);
}
 
/**
 * Delegate method for the input widget
 */
public void setInputWidgetText(CharSequence text, TextView.BufferType type) {
    getInputWidget().setText(text, type);
}
 
源代码13 项目: SecretTextView   文件: SecretTextView.java
@Override
public void setText(CharSequence text, TextView.BufferType type) {
    super.setText(text, type);
    resetIfNeeded();
}
 
源代码14 项目: AndroidFloatLabel   文件: FloatLabel.java
/**
 * Sets the EditText's text with label animation
 *
 * @param resid int String resource ID
 * @param type TextView.BufferType
 */
public void setText(int resid, TextView.BufferType type) {
    mEditText.setText(resid, type);
}
 
源代码15 项目: AndroidFloatLabel   文件: FloatLabel.java
/**
 * Sets the EditText's text without animating the label
 *
 * @param text CharSequence to set
 * @param type TextView.BufferType
 */
public void setTextWithoutAnimation(CharSequence text, TextView.BufferType type) {
    mSkipAnimation = true;
    mEditText.setText(text, type);
}
 
源代码16 项目: AndroidFloatLabel   文件: FloatLabel.java
/**
 * Sets the EditText's text with label animation
 *
 * @param resid int String resource ID
 * @param type TextView.BufferType
 */
public void setText(int resid, TextView.BufferType type) {
    mEditText.setText(resid, type);
}
 
源代码17 项目: AndroidFloatLabel   文件: FloatLabel.java
/**
 * Sets the EditText's text with label animation
 *
 * @param text CharSequence to set
 * @param type TextView.BufferType
 */
public void setText(CharSequence text, TextView.BufferType type) {
    mEditText.setText(text, type);
}
 
源代码18 项目: AndroidFloatLabel   文件: FloatLabel.java
/**
 * Sets the EditText's text without animating the label
 *
 * @param resid int String resource ID
 * @param type TextView.BufferType
 */
public void setTextWithoutAnimation(int resid, TextView.BufferType type) {
    mSkipAnimation = true;
    mEditText.setText(resid, type);
}
 
源代码19 项目: AndroidFloatLabel   文件: FloatLabel.java
/**
 * Sets the EditText's text without animating the label
 *
 * @param text CharSequence to set
 * @param type TextView.BufferType
 */
public void setTextWithoutAnimation(CharSequence text, TextView.BufferType type) {
    mSkipAnimation = true;
    mEditText.setText(text, type);
}
 
源代码20 项目: RichEditText   文件: IEditText.java
void setText(CharSequence text, TextView.BufferType type); 
 方法所在类
 同类方法