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

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

源代码1 项目: AndroidFrame   文件: GridPasswordView.java
private void setCustomAttr(TextView view) {
    if (mTextColor != null)
        view.setTextColor(mTextColor);
    view.setTextSize(mTextSize);

    int inputType = InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_VARIATION_PASSWORD;
    switch (mPasswordType) {

        case 1:
            inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD;
            break;

        case 2:
            inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
            break;

        case 3:
            inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD;
            break;
    }
    view.setInputType(inputType);
    view.setTransformationMethod(mTransformationMethod);
}
 
源代码2 项目: Android-Shortify   文件: Views.java
public static $ pwd(boolean option){
    try{
        if(mView instanceof TextView){
            TextView textView = (TextView) mView;
            if(option)
                textView.setTransformationMethod(new PasswordTransformationMethod());
            else
                textView.setTransformationMethod(null);
        }
        else if(mView instanceof EditText){
            EditText editText = (EditText) mView;
            if(option)
                editText.setTransformationMethod(new PasswordTransformationMethod());
            else
                editText.setTransformationMethod(null);
        }
    }catch (Exception e){
        Log.d(TAG, e.getMessage());
    }
    return  $.getInstance();
}
 
/**
 * Create a link from the text on the view
 *
 * @param v    TextView
 * @param text id of text to add to the field
 */
protected void createLink(TextView v, int text) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
        v.setText(Html.fromHtml(getString(text), Html.FROM_HTML_MODE_LEGACY));
    } else {
        v.setText(Html.fromHtml(getString(text)));
    }
    v.setTransformationMethod(new LinkTransformationMethod());
    v.setMovementMethod(LinkMovementMethod.getInstance());
}
 
源代码4 项目: natrium-android-wallet   文件: BaseFragment.java
/**
 * Create a link from the text on the view
 *
 * @param v    TextView
 * @param text id of text to add to the field
 */
protected void createLink(TextView v, int text) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
        v.setText(Html.fromHtml(getString(text), Html.FROM_HTML_MODE_LEGACY));
    } else {
        v.setText(Html.fromHtml(getString(text)));
    }
    v.setTransformationMethod(new LinkTransformationMethod());
    v.setMovementMethod(LinkMovementMethod.getInstance());
}
 
源代码5 项目: AndroidFrame   文件: GridPasswordView.java
/**
 * Set the enabled state of this view.
 */
@Override
public void setPasswordVisibility(boolean visible) {
    for (TextView textView : mViewArr) {
        textView.setTransformationMethod(visible ? null : mTransformationMethod);
        if (textView instanceof EditText) {
            EditText et = (EditText) textView;
            et.setSelection(et.getText().length());
        }
    }
}
 
源代码6 项目: nano-wallet-android   文件: BaseDialogFragment.java
/**
 * Create a link from the text on the view
 * @param v TextView
 * @param text id of text to add to the field
 */
protected void createLink(TextView v, int text) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
        v.setText(Html.fromHtml(getString(text), Html.FROM_HTML_MODE_LEGACY));
    } else {
        v.setText(Html.fromHtml(getString(text)));
    }
    v.setTransformationMethod(new LinkTransformationMethod());
    v.setMovementMethod(LinkMovementMethod.getInstance());
}
 
源代码7 项目: nano-wallet-android   文件: BaseFragment.java
/**
 * Create a link from the text on the view
 *
 * @param v    TextView
 * @param text id of text to add to the field
 */
protected void createLink(TextView v, int text) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
        v.setText(Html.fromHtml(getString(text), Html.FROM_HTML_MODE_LEGACY));
    } else {
        v.setText(Html.fromHtml(getString(text)));
    }
    v.setTransformationMethod(new LinkTransformationMethod());
    v.setMovementMethod(LinkMovementMethod.getInstance());
}
 
源代码8 项目: ToDay   文件: ToDayAdapter.java
public GroupViewHolder(View itemView) {
    super(itemView);
    textView = (TextView) itemView.findViewById(R.id.text_view_title);
    textView.setTransformationMethod(
            new AllCapsTransformationMethod(textView.getContext()));
    weather = itemView.findViewById(R.id.weather);
    textViewMorning = (TextView) itemView.findViewById(R.id.text_view_morning);
    textViewAfternoon = (TextView) itemView.findViewById(R.id.text_view_afternoon);
    textViewNight = (TextView) itemView.findViewById(R.id.text_view_night);
}
 
源代码9 项目: EdXposedManager   文件: DownloadDetailsFragment.java
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final Module module = mActivity.getModule();
    if (module == null)
        return null;

    final View view = inflater.inflate(R.layout.download_details, container, false);

    TextView title = view.findViewById(R.id.download_title);
    title.setText(module.name);
    title.setTextIsSelectable(true);

    TextView author = view.findViewById(R.id.download_author);
    if (module.author != null && !module.author.isEmpty())
        author.setText(getString(R.string.download_author, module.author));
    else
        author.setText(R.string.download_unknown_author);

    TextView description = view.findViewById(R.id.download_description);
    if (module.description != null) {
        if (module.descriptionIsHtml) {
            description.setText(RepoParser.parseSimpleHtml(getActivity(), module.description, description));
            description.setTransformationMethod(new LinkTransformationMethod(getActivity()));
            description.setMovementMethod(LinkMovementMethod.getInstance());
        } else {
            description.setText(module.description);
        }
        description.setTextIsSelectable(true);
    } else {
        description.setVisibility(View.GONE);
    }

    ViewGroup moreInfoContainer = view.findViewById(R.id.download_moreinfo_container);
    for (Pair<String, String> moreInfoEntry : module.moreInfo) {
        View moreInfoView = inflater.inflate(R.layout.download_moreinfo, moreInfoContainer, false);
        TextView txtTitle = moreInfoView.findViewById(android.R.id.title);
        TextView txtValue = moreInfoView.findViewById(android.R.id.message);

        txtTitle.setText(String.format(moreInfoEntry.first + "%s", ":"));
        txtValue.setText(moreInfoEntry.second);

        final Uri link = NavUtil.parseURL(moreInfoEntry.second);
        if (link != null) {
            txtValue.setTextColor(txtValue.getLinkTextColors());
            moreInfoView.setOnClickListener(v -> NavUtil.startURL(getActivity(), link));
        }

        moreInfoContainer.addView(moreInfoView);
    }

    return view;
}
 
源代码10 项目: AndroidProjects   文件: ShadowCardView.java
public void hideText() {
    final TextView textView = (TextView) findViewById(R.id.text_view);
    textView.setTransformationMethod(PasswordTransformationMethod.getInstance());
}
 
源代码11 项目: AndroidProjects   文件: ShadowCardView.java
public void showText() {
    final TextView textView = (TextView) findViewById(R.id.text_view);
    textView.setTransformationMethod(null);
}
 
源代码12 项目: CodenameOne   文件: PagerTitleStripIcs.java
public static void setSingleLineAllCaps(TextView text) {
    text.setTransformationMethod(new SingleLineAllCapsTransform(text.getContext()));
}
 
源代码13 项目: adt-leanback-support   文件: PagerTitleStripIcs.java
public static void setSingleLineAllCaps(TextView text) {
    text.setTransformationMethod(new SingleLineAllCapsTransform(text.getContext()));
}
 
源代码14 项目: UltimateAndroid   文件: PagerTitleStriplcs.java
public static void setSingleLineAllCaps(TextView text) {
    text.setTransformationMethod(new SingleLineAllCapsTransform(text.getContext()));
}
 
源代码15 项目: UltimateAndroid   文件: PagerTitleStriplcs.java
public static void setSingleLineAllCaps(TextView text) {
    text.setTransformationMethod(new SingleLineAllCapsTransform(text.getContext()));
}
 
源代码16 项目: V.FlyoutTest   文件: PagerTitleStripIcs.java
public static void setSingleLineAllCaps(TextView text) {
    text.setTransformationMethod(new SingleLineAllCapsTransform(text.getContext()));
}
 
源代码17 项目: guideshow   文件: PagerTitleStripIcs.java
public static void setSingleLineAllCaps(TextView text) {
    text.setTransformationMethod(new SingleLineAllCapsTransform(text.getContext()));
}
 
 方法所在类
 同类方法