Instead of the verbose setOnClickListener:
RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));Observable
.just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)| import retrofit.Call; | |
| import retrofit.http.GET; | |
| /** | |
| * Copyright (C) 2016 Mikhael LOPEZ | |
| * Licensed under the Apache License Version 2.0 | |
| * Example Data WebService | |
| * Created by Mikhael LOPEZ on 18/12/2015. | |
| */ | |
| public interface DataWebService { |
| language: android | |
| android: | |
| components: | |
| # Uncomment the lines below if you want to | |
| # use the latest revision of Android SDK Tools | |
| - platform-tools | |
| - tools | |
| # The BuildTools version used by your project | |
| - build-tools-22.0.0 |
| #!/usr/bin/env ruby | |
| #/ Usage: <progname> [options]... | |
| #/ How does this script make my life easier? | |
| # ** Tip: use #/ lines to define the --help usage message. | |
| $stderr.sync = true | |
| require 'optparse' | |
| # default options | |
| flag = false | |
| option = "default value" |
| WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); | |
| WindowManager.LayoutParams windowParams = new WindowManager.LayoutParams( | |
| LayoutParams.MATCH_PARENT, LayoutParams. WRAP_CONTENT, | |
| WindowManager.LayoutParams.TYPE_PHONE, | |
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, | |
| PixelFormat.TRANSLUCENT); | |
| windowManager.addView(listView, windowParams); |
| public class SomeFragment extends Fragment { | |
| MapView mapView; | |
| GoogleMap map; | |
| @Override | |
| public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
| View v = inflater.inflate(R.layout.some_layout, container, false); | |
| dependencies { | |
| compile 'io.reactivex:rxjava:1.1.0' | |
| compile 'io.reactivex:rxandroid:1.1.0' | |
| compile 'com.jakewharton.rxbinding:rxbinding:0.3.0' | |
| } |
| public interface API { | |
| @GET("/user/{username}/dogs") | |
| Observable<Dog> getAllDogsOf(@Path("username") String username); | |
| @GET("/dog/{id}") | |
| Observable<Dog> getDogInfoById(@Path("id") int dogId); | |
| } |
| private final static String TAG_FRAGMENT = "TAG_FRAGMENT"; | |
| private void showFragment() { | |
| final Myfragment fragment = new MyFragment(); | |
| final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); | |
| transaction.replace(R.id.fragment, fragment, TAG_FRAGMENT); | |
| transaction.addToBackStack(null); | |
| transaction.commit(); | |
| } |
| { | |
| "total": 2, | |
| "people": [ | |
| { | |
| "id": 1551, | |
| "full_name": "Jon snow", | |
| "family_name": "Stark", | |
| "password": "iknownothing", | |
| "status": "unknown", | |
| "gender": "male", |