当前位置: 首页>>代码示例>>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;未经允许,请勿转载。