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


Java Pages.addNewPage方法代码示例

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


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

示例1: getPageData

import at.favre.lib.hood.interfaces.Pages; //导入方法依赖的package包/类
@NonNull
@Override
public Pages getPageData(@NonNull Pages pages) {
    final Random random = new Random();

    for (int i = 0; i < 10; i++) {
        Page page = pages.addNewPage("Page " + i);

        for (int j = 0; j < 1000; j++) {
            int rand = random.nextInt(15);

            if (rand == 0) {
                page.add(Hood.get().createSwitchEntry(
                        DefaultConfigActions.getBoolSharedPreferencesConfigAction(
                                getPreferences(MODE_PRIVATE), "KEY_TEST", "switch " + j, false)));
            } else if (rand == 1) {
                page.add(Hood.get().createHeaderEntry("header" + j));
            } else if (rand == 2) {
                PageUtil.addAction(page, DefaultButtonDefinitions.getGlobalSettingsAction(),
                        DefaultButtonDefinitions.getNfcSettingsAction());
            } else if (rand == 3) {
                PageUtil.addAction(page, DefaultButtonDefinitions.getBatterySaverSettingsAction());
            } else if (rand == 4) {
                page.add(Hood.get().createSpinnerEntry(DefaultConfigActions.getDefaultSharedPrefBackedSpinnerAction("Backend", getPreferences(MODE_PRIVATE), "BACKEND_ID", null, getBackendElements())));
            } else {
                page.add(Hood.get().createPropertyEntry("key " + j, "value " + j));
            }
        }
    }

    return pages;
}
 
开发者ID:patrickfav,项目名称:under-the-hood,代码行数:33,代码来源:DebugPerformanceTestActivity.java

示例2: getPageData

import at.favre.lib.hood.interfaces.Pages; //导入方法依赖的package包/类
@NonNull
@Override
public Pages getPageData(@NonNull Pages pages) {
    final Random random = new Random(getIntent().getLongExtra(KEY_SEED, 0));

    for (int i = 0; i < getIntent().getIntExtra(KEY_PAGES_COUNT, 0); i++) {
        Page page = pages.addNewPage("Page " + i);

        for (int j = 0; j < getIntent().getIntExtra(KEY_PAGE_COUNT, 0); j++) {
            int rand = random.nextInt(15);

            if (rand == 0) {
                page.add(Hood.get().createSwitchEntry(
                        DefaultConfigActions.getBoolSharedPreferencesConfigAction(
                                getPreferences(MODE_PRIVATE), "KEY_TEST", "switch " + j, false)));
            } else if (rand == 1) {
                page.add(Hood.get().createHeaderEntry("header" + j));
            } else if (rand == 2) {
                PageUtil.addAction(page, DefaultButtonDefinitions.getGlobalSettingsAction(),
                        DefaultButtonDefinitions.getNfcSettingsAction());
            } else if (rand == 3) {
                PageUtil.addAction(page, DefaultButtonDefinitions.getBatterySaverSettingsAction());
            } else {
                page.add(Hood.get().createPropertyEntry("key " + j, "value " + j));
            }
        }
    }
    return pages;
}
 
开发者ID:patrickfav,项目名称:under-the-hood,代码行数:30,代码来源:TestActivity.java

示例3: setup

import at.favre.lib.hood.interfaces.Pages; //导入方法依赖的package包/类
@Before
public void setup() {
    Pages pages = DebugPages.Factory.create(Config.newBuilder().build());
    original = pages.addNewPage("empty");
    unmodifiablePages = new UnmodifiablePageDelegate(original);
    checkEqual(original, unmodifiablePages);
}
 
开发者ID:patrickfav,项目名称:under-the-hood,代码行数:8,代码来源:UnmodifiablePageTest.java

示例4: getPageData

import at.favre.lib.hood.interfaces.Pages; //导入方法依赖的package包/类
@NonNull
@Override
public Pages getPageData(@NonNull Pages pages) {
    Page page = pages.addNewPage();
    page.add(DefaultProperties.createSectionSourceControlAndCI(BuildConfig.GIT_REV, BuildConfig.GIT_BRANCH, BuildConfig.GIT_DATE, BuildConfig.BUILD_NUMBER, null, BuildConfig.BUILD_DATE));
    page.add(DefaultProperties.createSectionBasicDeviceInfo());
    page.add(DefaultProperties.createDetailedDeviceInfo(this));
    page.add(DefaultProperties.createSectionAppVersionInfoFromBuildConfig(BuildConfig.class));
    page.add(new PackageInfoAssembler(PackageInfoAssembler.Type.PERMISSIONS,
            PackageInfoAssembler.Type.SIGNATURE,
            PackageInfoAssembler.Type.USES_FEATURE).createSection(this));

    return pages;
}
 
开发者ID:patrickfav,项目名称:BlurTestAndroid,代码行数:15,代码来源:DebugActivity.java

示例5: getPageData

import at.favre.lib.hood.interfaces.Pages; //导入方法依赖的package包/类
@NonNull
@Override
public Pages getPageData(@NonNull Pages emptyPages) {
    Page page = emptyPages.addNewPage();
    page.add(DefaultProperties.createSectionSourceControlAndCI(BuildConfig.GIT_REV, BuildConfig.GIT_BRANCH, BuildConfig.GIT_DATE, BuildConfig.BUILD_NUMBER, null, BuildConfig.BUILD_DATE));
    page.add(DefaultProperties.createSectionBasicDeviceInfo());
    page.add(DefaultProperties.createDetailedDeviceInfo(this));
    page.add(DefaultProperties.createSectionAppVersionInfoFromBuildConfig(BuildConfig.class));
    page.add(DefaultProperties.createSectionAppVersionInfoFromBuildConfig(at.favre.lib.dali.BuildConfig.class).removeHeader());

    return emptyPages;
}
 
开发者ID:patrickfav,项目名称:Dali,代码行数:13,代码来源:DebugActivity.java

示例6: getPageData

import at.favre.lib.hood.interfaces.Pages; //导入方法依赖的package包/类
@NonNull
@Override
public Pages getPageData(@NonNull Pages pages) {
    Page firstPage = pages.addNewPage();

    firstPage.add(DefaultProperties.createSectionSourceControlAndCI(BuildConfig.GIT_REV, BuildConfig.GIT_BRANCH, BuildConfig.GIT_DATE, BuildConfig.BUILD_NUMBER, null, BuildConfig.BUILD_DATE));
    firstPage.add(DefaultProperties.createSectionAppVersionInfoFromBuildConfig(at.favre.lib.hood.BuildConfig.class));

    firstPage.add(DefaultProperties.createSectionBasicDeviceInfo());
    firstPage.add(DefaultProperties.createDetailedDeviceInfo(this));

    firstPage.add(Hood.get().createSwitchEntry(DefaultConfigActions.getBoolSharedPreferencesConfigAction(getPreferences(MODE_PRIVATE), "KEY_TEST", false)));
    firstPage.add(Hood.get().createSwitchEntry(DefaultConfigActions.getBoolSharedPreferencesConfigAction(getPreferences(MODE_PRIVATE), "KEY_TEST2", false)));
    firstPage.add(Hood.get().createSwitchEntry(DefaultConfigActions.getBoolSharedPreferencesConfigAction(getPreferences(MODE_PRIVATE), "KEY_TEST3", "a debug feature", false)));

    firstPage.add(Hood.get().createSpinnerEntry(DefaultConfigActions.getDefaultSharedPrefBackedSpinnerAction(null, getPreferences(MODE_PRIVATE), "W_BACKEND_KEY", null, getBackendElements())));

    firstPage.add(DefaultProperties.createSectionTelephonyManger(this));
    firstPage.add(DefaultProperties.createSectionBatteryInfo(this));

    PageUtil.addHeader(firstPage, "Misc Actions");
    PageUtil.addAction(firstPage, DefaultButtonDefinitions.getAppInfoAction());
    PageUtil.addAction(firstPage, DefaultButtonDefinitions.getCrashAction(), DefaultButtonDefinitions.getUninstallAction());
    PageUtil.addAction(firstPage, DefaultButtonDefinitions.getKillProcessAction(this), DefaultButtonDefinitions.getClearAppDataAction());
    PageUtil.addAction(firstPage, HoodUtil.getConditionally(DefaultButtonDefinitions.getKillProcessAction(this), at.favre.lib.hood.BuildConfig.DEBUG));

    PageUtil.addHeader(firstPage, "System Features");
    Map<CharSequence, String> systemFeatureMap = new HashMap<>();
    systemFeatureMap.put("hasHce", "android.hardware.nfc.hce");
    systemFeatureMap.put("hasCamera", "android.hardware.camera");
    systemFeatureMap.put("hasWebview", "android.software.webview");

    PageUtil.addAction(firstPage, new ButtonDefinition("Test Loading", new OnClickAction() {
        @Override
        public void onClick(final View view, Map.Entry<CharSequence, String> value) {
            view.setEnabled(false);
            getDebugView().setProgressBarVisible(true);
            view.postDelayed(new Runnable() {
                @Override
                public void run() {
                    view.setEnabled(true);
                    getDebugView().setProgressBarVisible(false);
                }
            }, 3000);
        }
    }));

    firstPage.add(DefaultProperties.createSystemFeatureInfo(this, systemFeatureMap));

    firstPage.add(DefaultProperties.createSectionConnectivityStatusInfo(this));

    logDataMap(pages);
    return pages;
}
 
开发者ID:patrickfav,项目名称:under-the-hood,代码行数:55,代码来源:DebugLightActivity.java

示例7: createPages

import at.favre.lib.hood.interfaces.Pages; //导入方法依赖的package包/类
public Pages createPages() {
    Pages pages = Hood.get().createPages(Config.newBuilder().setShowHighlightContent(false).build());
    Page firstPage = pages.addNewPage("Debug Info");
    firstPage.add(DefaultProperties.createSectionAppVersionInfoFromBuildConfig(at.favre.lib.hood.BuildConfig.class));
    firstPage.add(DefaultProperties.createSectionBasicDeviceInfo());
    firstPage.add(DefaultProperties.createSectionConnectivityStatusInfo(this));
    firstPage.add(new PackageInfoAssembler(PackageInfoAssembler.Type.APK_INSTALL_INFO, PackageInfoAssembler.Type.PERMISSIONS, PackageInfoAssembler.Type.SIGNATURE).createSection(this, true));

    Page secondPage = pages.addNewPage("Debug Features");
    PageUtil.addHeader(secondPage, "System Features");
    Map<CharSequence, String> systemFeatureMap = new HashMap<>();
    systemFeatureMap.put("hasHce", "android.hardware.nfc.hce");
    systemFeatureMap.put("hasCamera", "android.hardware.camera");
    systemFeatureMap.put("hasWebview", "android.software.webview");
    secondPage.add(DefaultProperties.createSystemFeatureInfo(this, systemFeatureMap));

    secondPage.add(Hood.get().createHeaderEntry("Debug Config"));
    secondPage.add(Hood.get().createSwitchEntry(DefaultConfigActions.getBoolSharedPreferencesConfigAction(getPreferences(MODE_PRIVATE), "KEY_TEST", "Enable debug feat#1", false)));
    secondPage.add(Hood.get().createSwitchEntry(DefaultConfigActions.getBoolSharedPreferencesConfigAction(getPreferences(MODE_PRIVATE), "KEY_TEST2", "Enable debug feat#2", false)));
    secondPage.add(Hood.get().createSwitchEntry(DefaultConfigActions.getBoolSharedPreferencesConfigAction(getPreferences(MODE_PRIVATE), "KEY_TEST3", "Enable debug feat#3", false)));
    secondPage.add(Hood.get().createSpinnerEntry(DefaultConfigActions.getDefaultSharedPrefBackedSpinnerAction(null, getPreferences(MODE_PRIVATE), "BACKEND_ID", null, getBackendElements())));

    PageUtil.addAction(secondPage, new ButtonDefinition("Test Loading", new OnClickAction() {
        @Override
        public void onClick(final View view, Map.Entry<CharSequence, String> value) {
            view.setEnabled(false);
            binding.debugView.setProgressBarVisible(true);
            view.postDelayed(new Runnable() {
                @Override
                public void run() {
                    view.setEnabled(true);
                    binding.debugView.setProgressBarVisible(false);
                }
            }, 3000);
        }
    }));
    secondPage.add(Hood.get().createActionEntry(DefaultButtonDefinitions.getCrashAction()));
    secondPage.add(Hood.get().createActionEntry(DefaultButtonDefinitions.getKillProcessAction(this), DefaultButtonDefinitions.getClearAppDataAction()));
    secondPage.add(Hood.get().createActionEntry(DefaultButtonDefinitions.getKillProcessAction(this)));

    return pages;
}
 
开发者ID:patrickfav,项目名称:under-the-hood,代码行数:43,代码来源:DebugDrawerActivity.java

示例8: setup

import at.favre.lib.hood.interfaces.Pages; //导入方法依赖的package包/类
@Before
public void setup() {
    Pages pages = DebugPages.Factory.create(Config.newBuilder().build());
    page = pages.addNewPage("empty");
    assertEquals(0, page.getEntries().size());
}
 
开发者ID:patrickfav,项目名称:under-the-hood,代码行数:7,代码来源:DebugPageTest.java


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