This test rule is now in the 'test-rules' support repository. Use that one!
https://developer.android.com/reference/android/support/test/rule/ActivityTestRule.html
| @Layout(R.layout.view_login) | |
| @WithComponent(LoginScreen.Component.class) | |
| public class LoginScreen extends Path { | |
| @dagger.Component(dependencies = RootActivity.Component.class) | |
| @PerScreenScope(Component.class) | |
| public static interface Component extends RootActivity.Component { | |
| void inject(LoginView view); | |
| } |
| /** | |
| * Takes a bytes source and streams it to parallel sources. I.E Streaming bytes to two server in parallel. | |
| */ | |
| public final class MirroredSource { | |
| private final Buffer buffer = new Buffer(); | |
| private final Source source; | |
| private final AtomicBoolean sourceExhausted = new AtomicBoolean(); | |
| private boolean closed = false; |
| package kotterknife | |
| import android.app.Activity | |
| import android.app.Dialog | |
| import android.app.DialogFragment | |
| import android.app.Fragment | |
| import android.arch.lifecycle.Lifecycle | |
| import android.arch.lifecycle.LifecycleObserver | |
| import android.arch.lifecycle.LifecycleOwner | |
| import android.arch.lifecycle.OnLifecycleEvent |
| public static Observable<List<String>> paginatedThings(final Observable<Void> onNextObservable) { | |
| return Observable.create(new Observable.OnSubscribe<List<String>>() { | |
| @Override | |
| public void call(final Subscriber<? super List<String>> subscriber) { | |
| onNextObservable.subscribe(new Observer<Void>() { | |
| int latestPage = -1; | |
| @Override | |
| public void onCompleted() { | |
| subscriber.onCompleted(); |
| /* | |
| * The MIT License | |
| * | |
| * Copyright (c) 2016 Andreas Ahlenstorf | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
| package com.webile.upload; | |
| import java.io.BufferedReader; | |
| import java.io.ByteArrayOutputStream; | |
| import java.io.InputStreamReader; | |
| import java.util.Date; | |
| import org.apache.http.HttpResponse; | |
| import org.apache.http.client.HttpClient; | |
| import org.apache.http.client.methods.HttpPost; |
| /* | |
| * Copyright 2018 Google LLC | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| @OnClick(R.id.fabupload) | |
| public void upload(){ | |
| Toast.makeText(MainActivity.this, "click", Toast.LENGTH_SHORT).show(); | |
| MultipartBody.Builder builder = new MultipartBody.Builder() | |
| .setType(MultipartBody.FORM); | |
| for(int i = 0 ; i < images_path.size() ; i++) { |
| /** | |
| * Show the activity over the lockscreen and wake up the device. If you launched the app manually | |
| * both of these conditions are already true. If you deployed from the IDE, however, this will | |
| * save you from hundreds of power button presses and pattern swiping per day! | |
| */ | |
| public static void riseAndShine(Activity activity) { | |
| activity.getWindow().addFlags(FLAG_SHOW_WHEN_LOCKED); | |
| PowerManager power = (PowerManager) activity.getSystemService(POWER_SERVICE); | |
| PowerManager.WakeLock lock = |
This test rule is now in the 'test-rules' support repository. Use that one!
https://developer.android.com/reference/android/support/test/rule/ActivityTestRule.html