本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}