当前位置: 首页>>代码示例>>Java>>正文


Java TextDirectionHeuristicsCompat类代码示例

本文整理汇总了Java中android.support.v4.text.TextDirectionHeuristicsCompat的典型用法代码示例。如果您正苦于以下问题:Java TextDirectionHeuristicsCompat类的具体用法?Java TextDirectionHeuristicsCompat怎么用?Java TextDirectionHeuristicsCompat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TextDirectionHeuristicsCompat类属于android.support.v4.text包,在下文中一共展示了TextDirectionHeuristicsCompat类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: calculateIsRtl

import android.support.v4.text.TextDirectionHeuristicsCompat; //导入依赖的package包/类
private boolean calculateIsRtl(CharSequence text) {
    final boolean defaultIsRtl = ViewCompat.getLayoutDirection(mView)
            == ViewCompat.LAYOUT_DIRECTION_RTL;
    return (defaultIsRtl
            ? TextDirectionHeuristicsCompat.FIRSTSTRONG_RTL
            : TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR).isRtl(text, 0, text.length());
}
 
开发者ID:coopese,项目名称:qmui,代码行数:8,代码来源:QMUICollapsingTextHelper.java

示例2: calculateIsRtl

import android.support.v4.text.TextDirectionHeuristicsCompat; //导入依赖的package包/类
private boolean calculateIsRtl(CharSequence text) {
      final boolean defaultIsRtl = ViewCompat.getLayoutDirection(mView)
              == ViewCompat.LAYOUT_DIRECTION_RTL;
  return (defaultIsRtl
          ? TextDirectionHeuristicsCompat.FIRSTSTRONG_RTL
              : TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR).isRtl(text, 0, text.length());
}
 
开发者ID:commonsguy,项目名称:cwac-crossport,代码行数:8,代码来源:CollapsingTextHelper.java

示例3: calculateIsRtl

import android.support.v4.text.TextDirectionHeuristicsCompat; //导入依赖的package包/类
private boolean calculateIsRtl(CharSequence text) {
    boolean defaultIsRtl = true;
    if (ViewCompat.getLayoutDirection(this.mView) != 1) {
        defaultIsRtl = false;
    }
    return (defaultIsRtl ? TextDirectionHeuristicsCompat.FIRSTSTRONG_RTL : TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR).isRtl(text, 0, text.length());
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:CollapsingTextHelper.java

示例4: getTextDirectionHeuristic

import android.support.v4.text.TextDirectionHeuristicsCompat; //导入依赖的package包/类
private TextDirectionHeuristicCompat getTextDirectionHeuristic() {

        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {

            return TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR;

        } else {

            // Always need to resolve layout direction first
            final boolean defaultIsRtl = (getLayoutDirection() == LAYOUT_DIRECTION_RTL);

            switch (getTextDirection()) {
                default:
                case TEXT_DIRECTION_FIRST_STRONG:
                    return (defaultIsRtl ? TextDirectionHeuristicsCompat.FIRSTSTRONG_RTL :
                            TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR);
                case TEXT_DIRECTION_ANY_RTL:
                    return TextDirectionHeuristicsCompat.ANYRTL_LTR;
                case TEXT_DIRECTION_LTR:
                    return TextDirectionHeuristicsCompat.LTR;
                case TEXT_DIRECTION_RTL:
                    return TextDirectionHeuristicsCompat.RTL;
                case TEXT_DIRECTION_LOCALE:
                    return TextDirectionHeuristicsCompat.LOCALE;
            }
        }
    }
 
开发者ID:blazsolar,项目名称:WeekDatePicker,代码行数:28,代码来源:WeekDatePicker.java

示例5: calculateIsRtl

import android.support.v4.text.TextDirectionHeuristicsCompat; //导入依赖的package包/类
private boolean calculateIsRtl(CharSequence text) {
  final boolean defaultIsRtl =
      ViewCompat.getLayoutDirection(view) == ViewCompat.LAYOUT_DIRECTION_RTL;
  return (defaultIsRtl
          ? TextDirectionHeuristicsCompat.FIRSTSTRONG_RTL
          : TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR)
      .isRtl(text, 0, text.length());
}
 
开发者ID:material-components,项目名称:material-components-android,代码行数:9,代码来源:CollapsingTextHelper.java

示例6: calculateIsRtl

import android.support.v4.text.TextDirectionHeuristicsCompat; //导入依赖的package包/类
private boolean calculateIsRtl(CharSequence text) {
  final boolean defaultIsRtl =
      ViewCompat.getLayoutDirection(mView) == ViewCompat.LAYOUT_DIRECTION_RTL;
  return (defaultIsRtl
          ? TextDirectionHeuristicsCompat.FIRSTSTRONG_RTL
          : TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR)
      .isRtl(text, 0, text.length());
}
 
开发者ID:google,项目名称:iosched,代码行数:9,代码来源:CollapsingTextHelper.java

示例7: createTextLayout

import android.support.v4.text.TextDirectionHeuristicsCompat; //导入依赖的package包/类
private static Layout createTextLayout(
    int width,
    YogaMeasureMode widthMode,
    TextUtils.TruncateAt ellipsize,
    boolean shouldIncludeFontPadding,
    int maxLines,
    boolean isSingleLine,
    CharSequence text,
    int textSize,
    float extraSpacing,
    float spacingMultiplier,
    int textStyle,
    Layout.Alignment textAlignment) {
  Layout newLayout;

  final @TextLayoutBuilder.MeasureMode int textMeasureMode;
  switch (widthMode) {
    case UNDEFINED:
      textMeasureMode = TextLayoutBuilder.MEASURE_MODE_UNSPECIFIED;
      break;
    case EXACTLY:
      textMeasureMode = TextLayoutBuilder.MEASURE_MODE_EXACTLY;
      break;
    case AT_MOST:
      textMeasureMode = TextLayoutBuilder.MEASURE_MODE_AT_MOST;
      break;
    default:
      throw new IllegalStateException("Unexpected size mode: " + widthMode);
  }

  sTextLayoutBuilder
      .setEllipsize(ellipsize)
      .setMaxLines(maxLines)
      .setSingleLine(isSingleLine)
      .setText(text)
      .setTextSize(textSize)
      .setWidth(width, textMeasureMode);

  sTextLayoutBuilder.setTextStyle(textStyle);

  sTextLayoutBuilder.setTextDirection(TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR);
  sTextLayoutBuilder.setIncludeFontPadding(shouldIncludeFontPadding);
  sTextLayoutBuilder.setTextSpacingExtra(extraSpacing);
  sTextLayoutBuilder.setTextSpacingMultiplier(spacingMultiplier);
  sTextLayoutBuilder.setAlignment(textAlignment);

  newLayout = sTextLayoutBuilder.build();

  sTextLayoutBuilder.setText(null);

  return newLayout;
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:53,代码来源:RCTText.java

示例8: isTextRtl

import android.support.v4.text.TextDirectionHeuristicsCompat; //导入依赖的package包/类
static
boolean isTextRtl(CharSequence c)
{
    return TextDirectionHeuristicsCompat.FIRSTSTRONG_LTR.isRtl(c, 0, c.length() - 1);
}
 
开发者ID:DarkangelKid,项目名称:rss,代码行数:6,代码来源:Utilities.java


注:本文中的android.support.v4.text.TextDirectionHeuristicsCompat类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。