本文整理汇总了Java中com.jug6ernaut.debugdrawer.views.TextElement类的典型用法代码示例。如果您正苦于以下问题:Java TextElement类的具体用法?Java TextElement怎么用?Java TextElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextElement类属于com.jug6ernaut.debugdrawer.views包,在下文中一共展示了TextElement类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onAttach
import com.jug6ernaut.debugdrawer.views.TextElement; //导入依赖的package包/类
@Override
protected void onAttach(Activity activity, DebugView parent, ViewGroup content) {
String packageName = activity.getPackageName();
String buildConfigPackage = packageName+".BuildConfig";
addElement(new TextElement("Name:", getViaReflection(String.class,buildConfigPackage,"VERSION_NAME")));
addElement(new TextElement("Code:", getViaReflection(Integer.class,buildConfigPackage,"VERSION_CODE")+""));
addElement(new TextElement("SHA:", getViaReflection(String.class,buildConfigPackage,"GIT_SHA")));
try {
String buildTimeString = getViaReflection(String.class,buildConfigPackage,"BUILD_TIME");
// Parse ISO8601-format time into local time.
DateFormat inFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'");
inFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
String buildTime = DATE_DISPLAY_FORMAT.format(inFormat.parseObject(buildTimeString));
addElement(new TextElement("Date:", buildTime));
} catch (Exception e) { }
}
示例2: DrawerHolder
import com.jug6ernaut.debugdrawer.views.TextElement; //导入依赖的package包/类
@Inject
public DrawerHolder(final Activity activity) {
super(activity,false);
AndroidBackend.inject(this);
urlList = Arrays.asList(
config.getProdUrl(),
config.getDevUrl(),
"Mock");
DebugGroup endpoints = new DebugGroup("Network",activity);
url = new TextElement(activity,"URL: ");
spinner = new SpinnerElement(
activity,
"Endpoints",
endpointList.toArray(new String[endpointList.size()])) {
@Override
public void onAction(String s) {
logger.debug("Changing endpoint: " + s);
showAlert(activity,s);
}
};
endpoints.addElement(url);
endpoints.addElement(spinner);
this.addDebugGroup(endpoints);
}
示例3: onAttach
import com.jug6ernaut.debugdrawer.views.TextElement; //导入依赖的package包/类
@Override
protected void onAttach(Activity activity, DebugView parent, ViewGroup content) {
DisplayMetrics dm = activity.getResources().getDisplayMetrics();
String densityBucket = getDensityString(dm);
addElement(new TextElement("Make", Strings.truncateAt(Build.MANUFACTURER, 20)));
addElement(new TextElement("Model", Strings.truncateAt(Build.MODEL, 20)));
addElement(new TextElement("Resolution", dm.heightPixels + "x" + dm.widthPixels));
addElement(new TextElement("Density", dm.densityDpi + "dpi (" + densityBucket + ")"));
addElement(new TextElement("Release", Build.VERSION.RELEASE));
addElement(new TextElement("API", String.valueOf(Build.VERSION.SDK_INT)));
}