Updated on 2026-08-14
This commit is contained in:
parent
ff22469cde
commit
68917838a4
7 changed files with 84 additions and 25 deletions
46
app/src/main/java/com/tangem/App.java
Normal file
46
app/src/main/java/com/tangem/App.java
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
package com.tangem;
|
||||
|
||||
import android.app.Application;
|
||||
import android.support.v7.app.AppCompatDelegate;
|
||||
|
||||
import com.tangem.di.AppComponent;
|
||||
import com.tangem.di.DaggerAppComponent;
|
||||
|
||||
public class App extends Application {
|
||||
|
||||
/**
|
||||
* A singleton instance of the application class for easy access in other places
|
||||
*/
|
||||
private static App sInstance;
|
||||
|
||||
public App() {
|
||||
super();
|
||||
}
|
||||
|
||||
static {
|
||||
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
|
||||
}
|
||||
|
||||
private static AppComponent component;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
// initialize the singleton
|
||||
sInstance = this;
|
||||
|
||||
component = DaggerAppComponent.create();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return singleton instance
|
||||
*/
|
||||
public static synchronized App getInstance() {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public static AppComponent getComponent() {
|
||||
return component;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue