This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # First install homebrew | |
| ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" | |
| # Choose the name of the virtualenv as simplecv | |
| virtualenv simplecv --no-site-packages | |
| source simplecv/bin/activate | |
| # This activates the virtualenv; your command prompt should change from `$` to `(simplecv)$` | |
| # Next the dependencies | |
| sudo easy_install pip # Can be ignored, if pip already present |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MainActivity extends AppCompatActivity { | |
| @Bind(R.id.tvFlat) | |
| TextView tvFlat; | |
| @Bind(R.id.tvJson) | |
| TextView tvJson; | |
| private RawDataReader rawDataReader; | |
| private ReposListJson reposListJson; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package rx.util; | |
| import rx.schedulers.*; | |
| import rx.Observable; | |
| import rx.android.schedulers.*; | |
| import rx.android.observables.*; | |
| import rx.functions.*; | |
| import rx.observables.*; | |
| import rx.util.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //fetchDataFromNetwork() - там у нас код загрузки картинки | |
| // fetchDataTask - это наш асинхтакс типа=), он не запущен ниче, просто ссылка. | |
| Observable<String> fetchDataTask = fetchDataFromNetwork(url); | |
| // он выполняется когда на него подписываются | |
| fetchDataTask | |
| //выполнять на новом треде |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AccountAuthenticator extends AbstractAccountAuthenticator { | |
| private final Context context; | |
| @Inject @ClientId String clientId; | |
| @Inject @ClientSecret String clientSecret; | |
| @Inject ApiService apiService; | |
| public AccountAuthenticator(Context context) { | |
| super(context); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.android.handsfree.data.error_handling; | |
| import retrofit2.Response; | |
| import retrofit2.adapter.rxjava.HttpException; | |
| import rx.Observable; | |
| import rx.Subscriber; | |
| /** | |
| * @author Denis_Zinkovskiy at 8/5/16. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * here we implement GoogleMap.OnMapClickListener, otherwise we will have maaany indents. | |
| * FragmentActivity was automatic, may change later. | |
| public class MapsActivity extends FragmentActivity implements GoogleMap.OnMapClickListener { | |
| private EditText destAddressContainer; | |
| //Grouping! | |
| private LocationHelper locationHelper; | |
| private GoogleMap map; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mAddToCartSubscription = Factory.getCartService().addToCart(mContext, mId, mQty * mSellingUnit) | |
| .observeOn(AndroidSchedulers.mainThread()) | |
| .subscribe(new Subscriber<HashMap<String, SKU>>() | |
| { | |
| @Override | |
| public void onCompleted() | |
| { | |
| Log.i("RxJava", "Completed"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.dgorod.tourbag.presentation.rx; | |
| import android.support.annotation.Nullable; | |
| import rx.Observable; | |
| import rx.Observable.Transformer; | |
| import rx.android.schedulers.AndroidSchedulers; | |
| import rx.schedulers.Schedulers; | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @GET("/data/2.5/weather?q=Yogyakarta,id&appid=2de143494c0b295cca9337e1e96b00e0") | |
| Observable<CurrentCity> getCurrentCityCallRx(); | |
| private void getWithRx() { | |
| StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); | |
| StrictMode.setThreadPolicy(policy); | |
| Retrofit retrofit = new Retrofit.Builder() | |
| .baseUrl(API_URL) |