类android.text.method.SingleLineTransformationMethod源码实例Demo

下面列出了怎么用android.text.method.SingleLineTransformationMethod的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: stynico   文件: AutofitHelper.java
private static int getMaxLines(AppCompatTextView view)
{
       int maxLines = -1; // No limit (Integer.MAX_VALUE also means no limit)

       TransformationMethod method = view.getTransformationMethod();
       if (method != null && method instanceof SingleLineTransformationMethod)
	{
           maxLines = 1;
       }
       else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
	{
           // setMaxLines() and getMaxLines() are only available on android-16+
           maxLines = view.getMaxLines();
       }

       return maxLines;
   }
 
源代码2 项目: Passbook   文件: DetailFragment.java
void changeDisplay(View view, int pos) {
    if(mShowPwd) {
        return;
    }
    Account.Entry entry = mItems.get(pos);
    if(entry.mType == AccountManager.EntryType.PASSWORD ||
            entry.mType == AccountManager.EntryType.PIN) {
        boolean showed = mPwdShowed.get(pos);
        ViewHolder holder = (ViewHolder)view.getTag();
        if(showed) {
            holder.mValue.setTransformationMethod(
                    PasswordTransformationMethod.getInstance());
        } else {
            holder.mValue.setTransformationMethod(
                    SingleLineTransformationMethod.getInstance());
        }
        mPwdShowed.set(pos, !showed);
    }
}
 
源代码3 项目: kAndroid   文件: AutofitHelper.java
private static int getMaxLines(TextView view) {
    int maxLines = -1; // No limit (Integer.MAX_VALUE also means no limit)

    TransformationMethod method = view.getTransformationMethod();
    if (method != null && method instanceof SingleLineTransformationMethod) {
        maxLines = 1;
    }
    else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        // setMaxLines() and getMaxLines() are only available on android-16+
        maxLines = view.getMaxLines();
    }

    return maxLines;
}
 
源代码4 项目: VideoOS-Android-SDK   文件: TextUtil.java
static int getMaxLines(TextView view) {
    int maxLines = -1; // No limit (Integer.MAX_VALUE also means no limit)

    TransformationMethod method = view.getTransformationMethod();
    if (method != null && method instanceof SingleLineTransformationMethod) {
        maxLines = 1;
    } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        // setMaxLines() and getMaxLines() are only available on android-16+
        maxLines = view.getMaxLines();
    }

    return maxLines;
}
 
源代码5 项目: DarkCalculator   文件: AutofitHelper.java
private static int getMaxLines(TextView view) {
    int maxLines = -1; // No limit (Integer.MAX_VALUE also means no limit)

    TransformationMethod method = view.getTransformationMethod();
    if (method != null && method instanceof SingleLineTransformationMethod) {
        maxLines = 1;
    } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        // setMaxLines() and getMaxLines() are only available on android-16+
        maxLines = view.getMaxLines();
    }

    return maxLines;
}
 
 类所在包
 同包方法