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


Java Utilities.trim方法代码示例

本文整理汇总了Java中com.android.launcher3.Utilities.trim方法的典型用法代码示例。如果您正苦于以下问题:Java Utilities.trim方法的具体用法?Java Utilities.trim怎么用?Java Utilities.trim使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.launcher3.Utilities的用法示例。


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

示例1: computeSectionName

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
/**
 * Computes the section name for an given string {@param s}.
 */
public String computeSectionName(CharSequence cs) {
    String s = Utilities.trim(cs);
    String sectionName = mBaseIndex.getBucketLabel(mBaseIndex.getBucketIndex(s));
    if (Utilities.trim(sectionName).isEmpty() && s.length() > 0) {
        int c = s.codePointAt(0);
        boolean startsWithDigit = Character.isDigit(c);
        if (startsWithDigit) {
            // Digit section
            return "#";
        } else {
            boolean startsWithLetter = Character.isLetter(c);
            if (startsWithLetter) {
                return mDefaultMiscLabel;
            } else {
                // In languages where these differ, this ensures that we differentiate
                // between the misc section in the native language and a misc section
                // for everything else.
                return MID_DOT;
            }
        }
    }
    return sectionName;
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:27,代码来源:AlphabeticIndexCompat.java

示例2: WidgetItem

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
public WidgetItem(LauncherAppWidgetProviderInfo info, AppWidgetManagerCompat widgetManager) {
    super(info.provider, widgetManager.getUser(info));

    label = Utilities.trim(widgetManager.loadLabel(info));
    widgetInfo = info;
    activityInfo = null;

    InvariantDeviceProfile idv = LauncherAppState.getInstance().getInvariantDeviceProfile();
    spanX = Math.min(info.spanX, idv.numColumns);
    spanY = Math.min(info.spanY, idv.numRows);
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:12,代码来源:WidgetItem.java

示例3: onBackKey

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
@Override
public boolean onBackKey() {
    // Only hide the search field if there is no query
    String query = Utilities.trim(mInput.getEditableText().toString());
    if (query.isEmpty()) {
        reset();
        return true;
    }
    return false;
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:11,代码来源:AllAppsSearchBarController.java

示例4: loadLabel

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
@Override
public String loadLabel(LauncherAppWidgetProviderInfo info) {
    return Utilities.trim(info.label);
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:5,代码来源:AppWidgetManagerCompatV16.java

示例5: getTitle

import com.android.launcher3.Utilities; //导入方法依赖的package包/类
/**
 * Returns the title or empty string
 */
public String getTitle(Cursor c) {
    String title = c.getString(titleIndex);
    return TextUtils.isEmpty(title) ? "" : Utilities.trim(c.getString(titleIndex));
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:8,代码来源:CursorIconInfo.java


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