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


Java TextElement类代码示例

本文整理汇总了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) { }
}
 
开发者ID:williamwebb,项目名称:debugdrawer,代码行数:21,代码来源:BuildModule.java

示例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);
}
 
开发者ID:williamwebb,项目名称:divide,代码行数:29,代码来源:DivideDrawer.java

示例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)));
}
 
开发者ID:williamwebb,项目名称:debugdrawer,代码行数:13,代码来源:DeviceInfoModule.java


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