當前位置: 首頁>>代碼示例>>Java>>正文


Java TextView.setHorizontallyScrolling方法代碼示例

本文整理匯總了Java中android.widget.TextView.setHorizontallyScrolling方法的典型用法代碼示例。如果您正苦於以下問題:Java TextView.setHorizontallyScrolling方法的具體用法?Java TextView.setHorizontallyScrolling怎麽用?Java TextView.setHorizontallyScrolling使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.TextView的用法示例。


在下文中一共展示了TextView.setHorizontallyScrolling方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createTextView

import android.widget.TextView; //導入方法依賴的package包/類
private TextView createTextView() {
    TextView textView = new TextView(mContext);
    textView.setTypeface(Typeface.MONOSPACE);
    textView.setTextColor(Color.WHITE);
    textView.setHorizontallyScrolling(true);
    if (mTextSize > 0) textView.setTextSize(mTextSize);
    //textView.setEllipsize(TextUtils.TruncateAt.MARQUEE);
    //textView.setPadding(0, 0, 2, 0);
    return textView;
}
 
開發者ID:dftec-es,項目名稱:planetcon,代碼行數:11,代碼來源:TextAdapter.java

示例2: getView

import android.widget.TextView; //導入方法依賴的package包/類
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    final View view = super.getView(position, convertView, parent);

    final TextView textView = (TextView) view.findViewById(R.id.text);
    // Set here, it doesn't  work when set in xml due to a bug
    textView.setHorizontallyScrolling(true);

    final String dataItem = data[position];
    textView.setText(Html.fromHtml(dataItem));

    return view;
}
 
開發者ID:ABTSoftware,項目名稱:SciChart.Android.Examples,代碼行數:14,代碼來源:ShowCodeActivity.java

示例3: getView

import android.widget.TextView; //導入方法依賴的package包/類
@Override
public View getView(int index, View contextView, ViewGroup parent) {
    final String floorName = (String) getItem(index);

    if (contextView == null) {
        LayoutInflater inflater = (LayoutInflater) parent.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        contextView = inflater.inflate(m_itemViewId, null);
    }

    TextView nameLabel = (TextView) contextView.findViewById(R.id.floor_name);

    nameLabel.setText(floorName);
    nameLabel.setHorizontallyScrolling(false);
    nameLabel.setSingleLine();

    View upperLine = (View) contextView.findViewById(R.id.interiors_explorer_floor_list_item_topline);
    if (upperLine != null) {
        upperLine.setVisibility(index == 0 ? View.INVISIBLE : View.VISIBLE);
    }

    View bottomLine = (View) contextView.findViewById(R.id.interiors_explorer_floor_list_item_bottomline);
    if (bottomLine != null) {
        bottomLine.setVisibility(index == m_nameData.size() - 1 ? View.INVISIBLE : View.VISIBLE);
    }

    return contextView;
}
 
開發者ID:wrld3d,項目名稱:android-api,代碼行數:28,代碼來源:IndoorFloorListAdapter.java

示例4: setText

import android.widget.TextView; //導入方法依賴的package包/類
private void setText(TextView v, Spanned text, boolean scrolling){
    if (v == null){
        return;
    }
    if (Utils.isEmpty(text)){
        v.setVisibility(View.GONE);
    }else{
        v.setText(text);
    }
    v.setMovementMethod(LinkMovementMethod.getInstance());
    v.setHorizontallyScrolling(scrolling);
}
 
開發者ID:GitaiQAQ,項目名稱:AboutView,代碼行數:13,代碼來源:AboutView.java

示例5: onInsertImageUrlClicked

import android.widget.TextView; //導入方法依賴的package包/類
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);
    });
}
 
開發者ID:TryGhost,項目名稱:Ghost-Android,代碼行數:42,代碼來源:PostEditFragment.java

示例6: fixedTextViewEllipsizeEnd

import android.widget.TextView; //導入方法依賴的package包/類
/**
 * Android4.0.4,解決:設置了android:ellipsize="end",但“...”不顯示的問題;
 * Android4.4,解決:文本兩邊不能貼邊的問題;
 *
 * @param textView
 */
public static void fixedTextViewEllipsizeEnd(TextView textView) {
    if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
        textView.setHorizontallyScrolling(true);
    }
}
 
開發者ID:miLLlulei,項目名稱:Accessibility,代碼行數:12,代碼來源:AndroidUtilsCompat.java


注:本文中的android.widget.TextView.setHorizontallyScrolling方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。