本文整理汇总了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;
}
示例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);
}
示例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;
}
示例4: loadLabel
import com.android.launcher3.Utilities; //导入方法依赖的package包/类
@Override
public String loadLabel(LauncherAppWidgetProviderInfo info) {
return Utilities.trim(info.label);
}
示例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));
}