本文整理汇总了Java中io.paperdb.Paper.init方法的典型用法代码示例。如果您正苦于以下问题:Java Paper.init方法的具体用法?Java Paper.init怎么用?Java Paper.init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.paperdb.Paper
的用法示例。
在下文中一共展示了Paper.init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import io.paperdb.Paper; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
CustomActivityOnCrash.install(this);
EventBus.getDefault().register(this);
EasyImage.configuration(this)
.saveInRootPicturesDirectory()
.setImagesFolderName(getString(R.string.app_name));
Nammu.init(this);
Paper.init(this);
Typekit.getInstance()
.addNormal(Typekit.createFromAsset(this, "fonts/LatoLatin-Regular.ttf"))
.addBold(Typekit.createFromAsset(this, "fonts/LatoLatin-Bold.ttf"))
.addItalic(Typekit.createFromAsset(this, "fonts/LatoLatin-Italic.ttf"))
.addBoldItalic(Typekit.createFromAsset(this, "fonts/LatoLatin-BoldItalic.ttf"))
.addCustom1(Typekit.createFromAsset(this, "fonts/Geomanist-Regular.otf"))
.addCustom2(Typekit.createFromAsset(this, "fonts/Handlee-Regular.ttf"));
initFabric();
initParse();
}
示例2: onCreate
import io.paperdb.Paper; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Paper.init(this);
CrashHandler.getInstance().init(this);
ImageUtil.init(this);
NetworkUtil.init(this);
ConfigUtil.init(this);
TextToast.init(this);
//Facebook分享初始化
FacebookSdk.sdkInitialize(getApplicationContext());
//友盟意见反馈初始化
FeedbackPush.getInstance(this).init(false);
}
示例3: testReadWrite500Contacts
import io.paperdb.Paper; //导入方法依赖的package包/类
@Test
public void testReadWrite500Contacts() throws Exception {
final List<Person> contacts = TestDataGenerator.genPersonList(500);
Paper.init(getTargetContext());
Paper.book().destroy();
long paperTime = runTest(new PaperReadWriteContactsTest(), contacts, REPEAT_COUNT);
Hawk.init(getTargetContext());
Hawk.clear();
long hawkTime = runTest(new HawkReadWriteContactsTest(), contacts, REPEAT_COUNT);
final List<PersonArg> contactsArg = TestDataGenerator.genPersonArgList(500);
Paper.init(getTargetContext());
Paper.book().destroy();
long paperArg = runTest(new PaperReadWriteContactsArgTest(), contactsArg, REPEAT_COUNT);
printResults("Read/write 500 contacts", paperTime, hawkTime, paperArg);
}
示例4: onCreate
import io.paperdb.Paper; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_manga_item);
Paper.init(this);
findViewById(R.id.manga_item_pager).setVisibility(View.GONE);
initToolBar();
String mangaId = getIntent().getStringExtra("mangaId");
manga = Paper.book(UserLibraryHelper.USER_LIBRARY_DB).read(mangaId);
// if (manga != null && manga.chaptersList != null) {
// initViewPager();
// initMarqueeTitle();
// }
fetchMangaDetailFromMangaEden(mangaId);
}
示例5: DatabaseController
import io.paperdb.Paper; //导入方法依赖的package包/类
public DatabaseController(Context context, EventBus eventBus) {
this.mEventBus = eventBus;
//mEventBus.register(this);
Paper.init(context);
Paper.addSerializer(Bundle.class, new BundleSerializer());
Paper.addSerializer(Media.class, new MediaSerializer());
mBundleDao = new BundleDaoImpl();
mMediaDao = new MediaDaoImpl();
}
示例6: onCreate
import io.paperdb.Paper; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
if (!BuildConfig.DEBUG) {
Fabric.with(this, new Crashlytics());
}
appComponent = DaggerAppComponent.builder()
.appModule(new AppModule(this))
.build();
vkAccessTokenTracker.startTracking();
VKSdk.initialize(this);
Paper.init(this);
Dexter.initialize(this);
DrawerImageLoader.init(new AbstractDrawerImageLoader() {
@Override
public void set(ImageView imageView, Uri uri, Drawable placeholder, String tag) {
Glide.with(imageView.getContext())
.load(uri)
.into(imageView);
}
});
}
示例7: testWrite500Contacts
import io.paperdb.Paper; //导入方法依赖的package包/类
@Test
public void testWrite500Contacts() throws Exception {
final List<Person> contacts = TestDataGenerator.genPersonList(500);
Paper.init(getTargetContext());
Paper.book().destroy();
long paperTime = runTest(new PaperWriteContactsTest(), contacts, REPEAT_COUNT);
Hawk.init(getTargetContext());
Hawk.clear();
long hawkTime = runTest(new HawkWriteContactsTest(), contacts, REPEAT_COUNT);
printResults("Write 500 contacts", paperTime, hawkTime);
}
示例8: testRead500Contacts
import io.paperdb.Paper; //导入方法依赖的package包/类
@Test
public void testRead500Contacts() throws Exception {
final List<Person> contacts = TestDataGenerator.genPersonList(500);
Paper.init(getTargetContext());
Paper.book().destroy();
runTest(new PaperWriteContactsTest(), contacts, REPEAT_COUNT); //Prepare
long paperTime = runTest(new PaperReadContactsTest(), contacts, REPEAT_COUNT);
Hawk.init(getTargetContext());
Hawk.clear();
runTest(new HawkWriteContactsTest(), contacts, REPEAT_COUNT); //Prepare
long hawkTime = runTest(new HawkReadContactsTest(), contacts, REPEAT_COUNT);
printResults("Read 500 contacts", paperTime, hawkTime);
}
示例9: testPutGetNormalAfterReinit
import io.paperdb.Paper; //导入方法依赖的package包/类
@Test
public void testPutGetNormalAfterReinit() {
Paper.put("city", "Lund");
String val = Paper.get("city", "default");
Paper.init(getTargetContext());// Reinit Paper instance
assertThat(val).isEqualTo("Lund");
}
示例10: onCreate
import io.paperdb.Paper; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_manga_browse);
Paper.init(this);
initToolbar();
initTabLayout();
}
示例11: onCreate
import io.paperdb.Paper; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Utils.init(getApplicationContext(), (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0);
Paper.init(this);
}
示例12: startBootupRestoration
import io.paperdb.Paper; //导入方法依赖的package包/类
private void startBootupRestoration() {
Paper.init(this);
final DeviceConfig configuration = DeviceConfig.get();
if (configuration.dcFirstStart) {
Timber.i("First start not completed, exiting");
return;
}
//========================================================================================================================
// No Root, No Friends, That's Life ...
//========================================================================================================================
if (!RootCheck.isRooted()) {
Timber.e("No Root, No Friends, That's Life ...");
return;
}
// patch sepolicy
Utils.patchSEPolicy(this);
final BootupConfig bootupConfig = BootupConfig.get();
final int delay = bootupConfig.automatedRestorationDelay;
if (delay > 0) {
Timber.v("Delaying bootup restoration by %s seconds", delay);
}
new Handler().postDelayed(new BootupRunnable(getApplicationContext(), bootupConfig), delay);
}
示例13: onCreate
import io.paperdb.Paper; //导入方法依赖的package包/类
@Override public void onCreate() {
super.onCreate();
if (App.sInstance != null) {
return;
}
App.sInstance = this;
final UniversalDebug universalDebug = new UniversalDebug(this)
.withDebug(BuildConfig.DEBUG)
.withTimber(true)
.withDebugTree(buildDebugTree())
.withProductionTree(buildProductionTree());
if (!enableDebug) {
final FabricConfig fabricConfig = new FabricConfig(universalDebug)
.withAnswers()
.withCrashlytics();
universalDebug.withExtension(fabricConfig);
}
universalDebug.install();
ShellManager.enableDebug(App.enableDebug);
Paper.init(this);
setupThemeMode();
AsyncTask.execute(new Runnable() {
@Override public void run() {
setupEverythingAsync();
}
});
}
示例14: PaperDataSaver
import io.paperdb.Paper; //导入方法依赖的package包/类
public PaperDataSaver(Context context){
Paper.init(context);
}
示例15: PaperDiskCache
import io.paperdb.Paper; //导入方法依赖的package包/类
public PaperDiskCache(@NonNull Context context, @NonNull Class<T> clazz, @NonNull SizePolicy sizePolicy) {
Paper.init(context);
this.cacheBook = Paper.book(clazz.getName());
this.cacheDirectory = new File(context.getFilesDir() + File.separator + clazz.getName());
this.sizePolicy = sizePolicy;
}