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

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

源代码1 项目: commcare-android   文件: ListWidget.java
@Override
protected void addQuestionText() {
    // Add the text view. Textview always exists, regardless of whether there's text.
    TextView questionText = new TextView(getContext());
    setQuestionText(questionText, mPrompt);
    questionText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, TEXTSIZE);
    questionText.setTypeface(null, Typeface.BOLD);
    questionText.setPadding(0, 0, 0, 7);
    questionText.setId(buttonIdBase); // assign random id

    // Wrap to the size of the parent view
    questionText.setHorizontallyScrolling(false);

    if (mPrompt.getLongText() == null) {
        questionText.setVisibility(GONE);
    }

    // Put the question text on the left half of the screen
    LinearLayout.LayoutParams labelParams =
            new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
    labelParams.weight = 1;

    questionLayout = new LinearLayout(getContext());
    questionLayout.setOrientation(LinearLayout.HORIZONTAL);
    questionLayout.addView(questionText, labelParams);
}
 
源代码2 项目: memoir   文件: SpinnerItemAdapter.java
private void updateSpinnerTitle(TextView titleView) {
    if (titleView != null) {
        titleView.setText(mSpinnerTitle);
        titleView.setVisibility((mSpinnerTitle == null) ? View.GONE : View.VISIBLE);
        titleView.setHorizontallyScrolling(true);
    }
}
 
源代码3 项目: memoir   文件: SpinnerItemAdapter.java
private void updateSpinnerTitle(TextView titleView) {
    if (titleView != null) {
        titleView.setText(mSpinnerTitle);
        titleView.setVisibility((mSpinnerTitle == null) ? View.GONE : View.VISIBLE);
        titleView.setHorizontallyScrolling(true);
    }
}
 
源代码4 项目: Android-RTEditor   文件: SpinnerItemAdapter.java
private void updateSpinnerTitle(TextView titleView) {
    if (titleView != null) {
        titleView.setText(mSpinnerTitle);
        titleView.setVisibility((mSpinnerTitle == null) ? View.GONE : View.VISIBLE);
        titleView.setHorizontallyScrolling(true);
    }
}
 
源代码5 项目: commcare-android   文件: QuestionsView.java
private void addHintText(String hintText) {
    if (hintText != null && !hintText.equals("")) {
        TextView mHelpText = new TextView(getContext());
        mHelpText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mQuestionFontsize - 3);
        mHelpText.setPadding(0, -5, 0, 7);
        // wrap to the widget of view
        mHelpText.setHorizontallyScrolling(false);
        mHelpText.setText(hintText);
        mHelpText.setTypeface(null, Typeface.ITALIC);

        mViewBannerCount++;
        mView.addView(mHelpText, mLayout);
    }
}
 
源代码6 项目: commcare-android   文件: LabelWidget.java
@Override
protected void addQuestionText() {
    // Add the text view. Textview always exists, regardless of whether there's text.
    mQuestionText = new TextView(getContext());
    setQuestionText(mQuestionText, mPrompt);
    mQuestionText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, TEXTSIZE);
    mQuestionText.setTypeface(null, Typeface.BOLD);
    mQuestionText.setPadding(0, 0, 0, 7);
    mQuestionText.setId(RANDOM_BUTTON_ID); // assign random id

    // Wrap to the size of the parent view
    mQuestionText.setHorizontallyScrolling(false);

    if (mPrompt.getLongText() == null) {
        mQuestionText.setVisibility(GONE);
    }

    // Put the question text on the left half of the screen
    LinearLayout.LayoutParams labelParams =
            new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
    labelParams.weight = 1;

    questionLayout = new LinearLayout(getContext());
    questionLayout.setOrientation(LinearLayout.HORIZONTAL);

    questionLayout.addView(mQuestionText, labelParams);
}
 
源代码7 项目: commcare-android   文件: ListMultiWidget.java
@Override
protected void addQuestionText() {
    // Add the text view. Textview always exists, regardless of whether there's text.
    TextView questionText = new TextView(getContext());
    setQuestionText(questionText, mPrompt);
    questionText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, TEXTSIZE);
    questionText.setTypeface(null, Typeface.BOLD);
    questionText.setPadding(0, 0, 0, 7);
    questionText.setId(buttonIdBase); // assign random id

    // Wrap to the size of the parent view
    questionText.setHorizontallyScrolling(false);

    if (mPrompt.getLongText() == null) {
        questionText.setVisibility(GONE);
    }

    // Put the question text on the left half of the screen
    LinearLayout.LayoutParams labelParams =
            new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
    labelParams.weight = 1;

    questionLayout = new LinearLayout(getContext());
    questionLayout.setOrientation(LinearLayout.HORIZONTAL);

    questionLayout.addView(questionText, labelParams);
}
 
源代码8 项目: commcare-android   文件: QuestionWidget.java
public void setQuestionText(TextView textView, FormEntryPrompt prompt) {
    textView.setText(getTextFromPrompt(prompt));
    if (prompt.getMarkdownText() != null) {
        textView.setMovementMethod(LinkMovementMethod.getInstance());
        // Wrap to the size of the parent view
        textView.setHorizontallyScrolling(false);
    }
}
 
源代码9 项目: memoir   文件: SpinnerItem.java
void formatNameView(TextView view) {
    if (view != null) {
        view.setText(getName());
        view.setHorizontallyScrolling(true);
    }
}
 
源代码10 项目: memoir   文件: SpinnerItem.java
void formatNameView(TextView view) {
    if (view != null) {
        view.setText(getName());
        view.setHorizontallyScrolling(true);
    }
}
 
源代码11 项目: Android-RTEditor   文件: SpinnerItem.java
void formatNameView(TextView view) {
    if (view != null) {
        view.setText(getName());
        view.setHorizontallyScrolling(true);
    }
}
 
源代码12 项目: quill   文件: PostEditFragment.java
public void onInsertImageUrlClicked(Action1<String> resultAction) {
    // ok to pass null here: https://possiblemobile.com/2013/05/layout-inflation-as-intended/
    @SuppressLint("InflateParams")
    final View dialogView = mActivity.getLayoutInflater().inflate(R.layout.dialog_image_insert,
            null, false);
    final TextView imageUrlView = (TextView) dialogView.findViewById(R.id.image_url);

    // hack for word wrap with "Done" IME action! see http://stackoverflow.com/a/13563946/504611
    imageUrlView.setHorizontallyScrolling(false);
    imageUrlView.setMaxLines(20);

    Observable<String> imageUrlObservable = Observables.getDialog(emitter -> {
        AlertDialog dialog = new AlertDialog.Builder(mActivity)
                .setTitle(mActivity.getString(R.string.insert_image))
                .setView(dialogView)
                .setCancelable(true)
                .setPositiveButton(R.string.insert, (d, which) -> {
                    emitter.onNext(imageUrlView.getText().toString());
                    emitter.onComplete();
                })
                .setNegativeButton(android.R.string.cancel, (d, which) -> {
                    d.dismiss();
                    emitter.onComplete();
                })
                .create();
        imageUrlView.setOnEditorActionListener((view, actionId, event) -> {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                dialog.getButton(DialogInterface.BUTTON_POSITIVE).performClick();
                return true;
            }
            return false;
        });
        return dialog;
    });

    imageUrlObservable.subscribe((imageUrl) -> {
        resultAction.call(imageUrl);
        mMarkdownEditSelectionState = null;
        KeyboardUtils.focusAndShowKeyboard(mActivity, mPostEditView);
    });
}
 
源代码13 项目: Onosendai   文件: ExecutorStatus.java
public ExecutorStatus (final TextView textView) {
	this.textView = textView;
	textView.setHorizontallyScrolling(true);
	textView.setEllipsize(null);
	this.refreshUiHandler = new RefreshUiHandler(this);
}
 
 方法所在类
 同类方法