下面列出了android.text.style.SubscriptSpan#android.app.Application 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Provides
@FirebaseAppScope
Picasso providesFiamController(
Application application, PicassoErrorListener picassoErrorListener) {
okhttp3.OkHttpClient client =
new OkHttpClient.Builder()
.addInterceptor(
new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
return chain.proceed(
chain.request().newBuilder().addHeader("Accept", "image/*").build());
}
})
.build();
Picasso.Builder builder = new Picasso.Builder(application);
builder.listener(picassoErrorListener).downloader(new OkHttp3Downloader(client));
return builder.build();
}
@Test
public void weaveSendAppView() throws Exception {
// Process classes.
processClass("com.uphyca.galette.GAletteInstrumentationTest$TestClassForSendAppView");
// Load instrumented classes.
TestClassForSendAppView instrumentedObject = new TestClassForSendAppView();
Application app = new Application();
instrumentedObject.attach(app);
// Invoke method.
instrumentedObject.show();
// Verify interactions.
Method method = instrumentedObject.getClass().getDeclaredMethod("show", new Class[]{});
verify(galette).sendAppView(eq(instrumentedObject), eq(app), eq(method), eq(new Object[]{}));
}
private static void initializeAppliveryConstants(Application app, String appToken,
boolean isStoreRelease) {
//region validate some requirements
Context applicationContext = Validate.notNull(app, "Application").getApplicationContext();
Validate.notNull(applicationContext, "applicationContext");
Validate.hasInternetPermissions(applicationContext, false);
//endregion
AppliverySdk.appToken = appToken;
AppliveryDataManager.INSTANCE.setAppToken(appToken);
AppliverySdk.isStoreRelease = isStoreRelease;
AppliverySdk.fileProviderAuthority = composeFileProviderAuthority(app);
AppliverySdk.applicationContext = applicationContext;
AppliverySdk.appliveryApiService = AppliveryApiServiceBuilder.getAppliveryApiInstance();
AppliverySdk.activityLifecycle = new AppliveryActivityLifecycleCallbacks(applicationContext);
AppliverySdk.permissionRequestManager =
new AndroidPermissionCheckerImpl(AppliverySdk.activityLifecycle);
}
public static boolean buildBundle(Application application){
boolean is_ok = false;
try {
ReactInstanceManagerBuilder builder = ReactInstanceManager.builder()
.setApplication(application)
.setJSMainModulePath("index")
.addPackage(new MainReactPackage())
.addPackage(new SearchReactPackage())
.addPackage( new SvgPackage())
.addPackage(new RNI18nPackage())
.setUseDeveloperSupport(CommonConfig.isDebug)
.setInitialLifecycleState(LifecycleState.RESUMED);
String localBundleFile = getLocalBundleFilePath(application);
File file = new File(localBundleFile);
if (file.exists()) {
// load from cache
builder.setJSBundleFile(localBundleFile);
} else {
// load from asset
builder.setBundleAssetName(JS_BUNDLE_NAME);
}
mReactInstanceManager = builder.build();
is_ok = true;
}catch (Exception e){
}
return is_ok;
}
public MyViewModel(@NonNull Application application) {
super(application);
Observable.interval(1, 1, TimeUnit.SECONDS)
.as(RxLife.asOnMain(this))
.subscribe(aLong -> {
Log.e("LJX", "MyViewModel aLong=" + aLong);
});
}
public ApplicationTest() {
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
NotifyDeveloperHandler(Application context, Iterable<String> emailAddress, ActivityStateListener activityState) {
this(context, emailAddress, LogLevel.ERROR, activityState);
}
public static Application getCurrent() {
return CURRENT;
}
public ApplicationTest() {
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
public static void init(Application app){
setApplication(app);
setDebug(true);
}
public ApplicationTest()
{
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
@AnyThread
@Override
protected void scheduleAlarm(@NonNull Application application, long delay) {
setAlarm(application, delay, ViewOnceAlarm.class);
}
public ApplicationTest() {
super(Application.class);
}
ApplicationModule(Application application) {
this.application = application;
}
public static Foreground get(Application application){
if (instance == null) {
init(application);
}
return instance;
}
public ApplicationTest() {
super(Application.class);
}
@SuppressWarnings("WeakerAccess")
public NavigationReactNativeHost(Application application) {
super(application);
}
public ApplicationTest() {
super(Application.class);
}