本文整理汇总了Java中com.jakewharton.threetenabp.AndroidThreeTen类的典型用法代码示例。如果您正苦于以下问题:Java AndroidThreeTen类的具体用法?Java AndroidThreeTen怎么用?Java AndroidThreeTen使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AndroidThreeTen类属于com.jakewharton.threetenabp包,在下文中一共展示了AndroidThreeTen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
@Override public void onCreate() {
super.onCreate();
if (LeakCanary.isInAnalyzerProcess(this) || ProcessPhoenix.isPhoenixProcess(this)) {
return;
}
LeakCanary.install(this);
AndroidThreeTen.init(this);
component = DaggerInitializer.init(this);
component.inject(this);
appInitializer.init(this);
lumberYard.cleanUp();
Timber.plant(lumberYard.tree());
registerActivityLifecycleCallbacks(activityHierarchyServer);
}
示例2: onCreate
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidThreeTen.init(this);
start_date = LocalDate.now();
end_date = LocalDate.now();
seed = DEFAULT_SEED;
setContentView(R.layout.activity_main);
// Load an ad into the AdMob banner view.
AdView adView = (AdView) findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().setRequestAgent("android_studio:ad_template").build();
adView.loadAd(adRequest);
potd_list_view = (ListView) findViewById(R.id.potd_list);
generate_potd_list();
}
示例3: onCreate
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
@Override public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics());
DeployGate.install(this);
AndroidThreeTen.init(this);
Timber.plant(BuildConfig.DEBUG ? new Timber.DebugTree() : new Timber.Tree() {
@Override protected void log(int priority, String tag, String message, Throwable t) {
if (priority == Log.ASSERT || priority == Log.DEBUG || priority == Log.VERBOSE) {
return;
}
Log.println(priority, tag, message + Log.getStackTraceString(t));
}
});
mDaggerGraph = DaggerGithubComponent.builder()
.githubModule(new GithubModule(this))
.build();
}
示例4: onCreate
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics());
LeakCanary.install(this);
AndroidThreeTen.init(this);
Stetho.initializeWithDefaults(this);
installTimber();
this.registerApplicationComponent();
this.registerApiKeyComponent();
this.registerNetworkComponent();
this.registerDashboardComponent();
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
.setDefaultFontPath("fonts/Lato-Regular.ttf")
.setFontAttrId(R.attr.fontPath)
.build()
);
}
示例5: onCreate
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics());
FirebaseApp.initializeApp(this);
AndroidThreeTen.init(this); //java 8 time api backport
appComponent = DaggerAppComponent.create();
injector = new ComponentInjector<>(AppComponent.class, appComponent);
//register notification channels
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationUtil.createNotificationChannels(this);
}
//remove shortcuts on app restart
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
ShortcutUtil.removeAllShortcuts(this);
}
}
示例6: onCreate
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
if (LeakCanary.isInAnalyzerProcess(this)) {
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return;
}
// https://github.com/square/leakcanary/issues/322
// https://medium.com/@amitshekhar/android-memory-leaks-inputmethodmanager-solved-a6f2fe1d1348#.i060weodr
LeakCanary.install(this);
initializeStetho(this);
initLogger();
AndroidThreeTen.init(this);
}
示例7: onCreate
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
@Override public void onCreate() {
super.onCreate();
mInstance = this;
if (BuildConfig.USE_CRASHLYTICS) {
Fabric.with(this, new Crashlytics());
}
if (BuildConfig.DEBUG) {
Stetho.initializeWithDefaults(this);
}
mComponent = DaggerLocativeComponent.builder()
.appModule(new AppModule(this))
.networkingModule(new NetworkingModule())
.persistencyModule(new PersistencyModule(this))
.build();
AndroidThreeTen.init(this);
}
示例8: onCreate
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
@Override public void onCreate() {
super.onCreate();
AndroidThreeTen.init(this);
DaggerApp_Component.builder()
.application(this)
.debug(BuildConfig.DEBUG)
.bsuirUrl("https://students.bsuir.by/api/v1/")
.build()
.inject(this);
Timber.plant(mTree);
if (!BuildConfig.DEBUG) {
Fabric.with(this, new Crashlytics());
}
mNightModePreference.asObservable()
.map(Integer::valueOf)
.onErrorReturn(throwable -> AppCompatDelegate.MODE_NIGHT_NO)
.subscribe(AppCompatDelegate::setDefaultNightMode);
}
示例9: onCreate
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
s_this = this;
try {
updatePrefs();
} catch (TembaException e) {
resetPrefs();
}
m_realmConfig = new RealmConfiguration.Builder(this).build();
// Testing: nuke our db on every start until the schema is ironed out
// Realm.deleteRealm(config);
// set our default database config
Realm.setDefaultConfiguration(m_realmConfig);
AndroidThreeTen.init(this);
}
示例10: onCreate
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
AndroidThreeTen.init(this);
LeakCanary.install(this);
if (BuildConfig.DEBUG) {
Timber.plant(new DebugTree());
} else {
// TODO Crashlytics.start(this);
// TODO Timber.plant(new CrashlyticsTree());
}
buildComponentAndInject();
registerActivityLifecycleCallbacks(activityHierarchyServer);
}
示例11: onCreate
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
@Override public void onCreate() {
super.onCreate();
if (LeakCanary.isInAnalyzerProcess(this)) {
return;
}
AndroidThreeTen.init(this);
LeakCanary.install(this);
if (BuildConfig.DEBUG) {
Timber.plant(new DebugTree());
} else {
// TODO Crashlytics.start(this);
// TODO Timber.plant(new CrashlyticsTree());
}
objectGraph = ObjectGraph.create(Modules.list(this));
objectGraph.inject(this);
lumberYard.cleanUp();
Timber.plant(lumberYard.tree());
}
示例12: onCreate
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
AndroidThreeTen.init(this);//ThreeTenABP的使用初始化
install();//用于第一次安装,建立设置表
instance = this;
//读入设置
_task_manager = new TaskManager();
_habit_manager = new HabitManager();
_time_left_manager = new TimeLeftManager();
taskRepo = new TaskRepo(this);
habitRepo = new HabitRepo(this);
timeLeftRepo = new TimeLeftRepo(this);
mysetting = new Setting();
_task_manager.addAll(taskRepo.getTaskList());
_time_left_manager.addAll(timeLeftRepo.getTimeLeftList());
_habit_manager.addAll(habitRepo.getHabitList());
_task_manager.order();
_habit_manager.order();
_time_left_manager.order();
mysetting.readSetting(this);
//Log.d("ringtone",mysetting.Ringtone);
//Log.d("CallTime",mysetting.callTime.toString());
if (!isServiceRunning(this, "io.github.celestialphineas.imer.MyService"))
{
//开启第一次service,设置闹钟
Intent i = new Intent(this, MyService.class);
i.putExtra("source", "Application");
this.startService(i);
}
}
示例13: buildObjectGraphAndInject
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
private void buildObjectGraphAndInject() {
applicationComponent = DaggerApplicationComponent.builder()
.applicationModule(new ApplicationModule(this))
.build();
AndroidThreeTen.init(this);
if (BuildConfig.DEBUG) {
Stetho.initializeWithDefaults(this);
Timber.plant(new Timber.DebugTree());
}
}
示例14: onCreate
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
CalligraphyConfig.initDefault(
new CalligraphyConfig.Builder().setDefaultFontPath("minyna.ttf").setFontAttrId(R.attr.fontPath)
.build());
AndroidThreeTen.init(this);
FirebaseApp.initializeApp(this);
FirebaseMessaging.getInstance().subscribeToTopic("Power_Notifications");
}
示例15: onCreate
import com.jakewharton.threetenabp.AndroidThreeTen; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
AndroidThreeTen.init(this);
initGraph();
initLogger();
}