├── app ├── .gitignore ├── gif │ ├── room.gif │ ├── splash.gif │ └── rxjava2.gif ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── activity_splash.xml │ │ │ │ ├── activity_timing.xml │ │ │ │ ├── activity_lastknown_location.xml │ │ │ │ ├── repo_item.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_networking.xml │ │ │ │ ├── activity_rx_downloader.xml │ │ │ │ ├── item.xml │ │ │ │ └── activity_room_playground.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── drawable │ │ │ │ └── ic_launcher_background.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── mahmoud │ │ │ │ ├── networking │ │ │ │ ├── state │ │ │ │ │ ├── RequestState.java │ │ │ │ │ └── ApiRequest.java │ │ │ │ ├── endpoint │ │ │ │ │ └── GithubReposApi.java │ │ │ │ ├── model │ │ │ │ │ └── Repo.java │ │ │ │ ├── ApiClient.java │ │ │ │ ├── adapter │ │ │ │ │ └── RepoAdapter.java │ │ │ │ ├── NetworkingActivity.java │ │ │ │ └── NetworkingRequestState.java │ │ │ │ ├── caching │ │ │ │ ├── datasource │ │ │ │ │ ├── UserDataSource.java │ │ │ │ │ └── LocalUserDataSource.java │ │ │ │ ├── Converters.java │ │ │ │ ├── Injection.java │ │ │ │ ├── dao │ │ │ │ │ └── UserDao.java │ │ │ │ ├── ViewModelFactory.java │ │ │ │ ├── AppDB.java │ │ │ │ ├── entity │ │ │ │ │ ├── Task.java │ │ │ │ │ ├── Reminder.java │ │ │ │ │ └── User.java │ │ │ │ ├── UserViewModel.java │ │ │ │ └── RoomPlayground.java │ │ │ │ ├── samples │ │ │ │ ├── AppInfo.java │ │ │ │ ├── Utils.java │ │ │ │ ├── AppsAdapter.java │ │ │ │ ├── secondexample │ │ │ │ │ └── FormOperatorSample.java │ │ │ │ ├── firstexample │ │ │ │ │ └── MainActivity.java │ │ │ │ ├── thirdexample │ │ │ │ │ └── FilterOPeratorSample.java │ │ │ │ ├── sixthexample │ │ │ │ │ └── FirstOperatorSample.java │ │ │ │ ├── fouthexample │ │ │ │ │ └── TakeOperatorSample.java │ │ │ │ ├── eighthexample │ │ │ │ │ └── MapOPeratorSample.java │ │ │ │ ├── seventhexample │ │ │ │ │ └── SkipOperatorSample.java │ │ │ │ ├── ninthexample │ │ │ │ │ └── ScanOPeratorSample.java │ │ │ │ ├── fivethexample │ │ │ │ │ └── DistinctOperatorSample.java │ │ │ │ └── AppRichInfo.java │ │ │ │ ├── timing │ │ │ │ ├── SplashScreen.java │ │ │ │ └── TimingActivity.java │ │ │ │ └── location │ │ │ │ └── LastKnownLocationActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── mahmoud │ │ │ └── samples │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── example │ │ └── mahmoud │ │ └── samples │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── .idea ├── copyright │ └── profiles_settings.xml ├── vcs.xml ├── modules.xml ├── runConfigurations.xml ├── gradle.xml ├── compiler.xml └── misc.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── contributing.md ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/gif/room.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrabelwahed/RxjavaSamples/HEAD/app/gif/room.gif -------------------------------------------------------------------------------- /app/gif/splash.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrabelwahed/RxjavaSamples/HEAD/app/gif/splash.gif -------------------------------------------------------------------------------- /app/gif/rxjava2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrabelwahed/RxjavaSamples/HEAD/app/gif/rxjava2.gif -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrabelwahed/RxjavaSamples/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrabelwahed/RxjavaSamples/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrabelwahed/RxjavaSamples/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrabelwahed/RxjavaSamples/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrabelwahed/RxjavaSamples/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrabelwahed/RxjavaSamples/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrabelwahed/RxjavaSamples/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrabelwahed/RxjavaSamples/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrabelwahed/RxjavaSamples/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrabelwahed/RxjavaSamples/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mrabelwahed/RxjavaSamples/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/mahmoud/networking/state/RequestState.java: -------------------------------------------------------------------------------- 1 | package com.example.mahmoud.networking.state; 2 | 3 | /** 4 | * Created by mahmoud on 21/03/18. 5 | */ 6 | 7 | public enum RequestState { 8 | IDLE,LOADING,COMPLETED,ERROR; 9 | } 10 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Mar 08 10:57:56 EET 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/mahmoud/caching/datasource/UserDataSource.java: -------------------------------------------------------------------------------- 1 | package com.example.mahmoud.caching.datasource; 2 | 3 | import com.example.mahmoud.caching.entity.User; 4 | 5 | import io.reactivex.Flowable; 6 | 7 | /** 8 | * Created by mahmoud on 04/04/18. 9 | */ 10 | 11 | public interface UserDataSource { 12 | Flowable getUser(); 13 | 14 | void insertOrUpdate(User user); 15 | 16 | void deleteAllUsers(); 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RxSamples 3 | Location Permission 4 | OK 5 | NO Location Detected 6 | App need this permission to get current location 7 | Settings 8 | Update user 9 | 10 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/test/java/com/example/mahmoud/samples/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.example.mahmoud.samples; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/mahmoud/networking/endpoint/GithubReposApi.java: -------------------------------------------------------------------------------- 1 | package com.example.mahmoud.networking.endpoint; 2 | 3 | import com.example.mahmoud.networking.model.Repo; 4 | 5 | import java.util.List; 6 | 7 | import io.reactivex.Observable; 8 | import retrofit2.http.GET; 9 | import retrofit2.http.Path; 10 | 11 | /** 12 | * Created by Mahmoud Ramadan on 12/23/17. 13 | */ 14 | 15 | public interface GithubReposApi { 16 | @GET("users/{user}/repos") 17 | Observable> getUserRepos(@Path("user") String username); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/mahmoud/caching/Converters.java: -------------------------------------------------------------------------------- 1 | package com.example.mahmoud.caching; 2 | 3 | import android.arch.persistence.room.TypeConverter; 4 | 5 | import java.util.Date; 6 | 7 | /** 8 | * Created by mahmoud on 27/03/18. 9 | */ 10 | 11 | public class Converters { 12 | 13 | @TypeConverter 14 | public static Long fromDateToTimeStamp(Date date){ 15 | return date==null? null:date.getTime(); 16 | } 17 | 18 | 19 | @TypeConverter 20 | public static Date fromTimeToDate(Long time){ 21 | return time==null? null: new Date(time); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/mahmoud/networking/model/Repo.java: -------------------------------------------------------------------------------- 1 | package com.example.mahmoud.networking.model; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | /** 6 | * Created by mahmoud on 20/03/18. 7 | */ 8 | 9 | 10 | public class Repo{ 11 | @SerializedName("id") 12 | private String id; 13 | @SerializedName("name") 14 | private String name; 15 | 16 | public String getId() { 17 | return id; 18 | } 19 | 20 | public void setId(String id) { 21 | this.id = id; 22 | } 23 | 24 | public String getName() { 25 | return name; 26 | } 27 | 28 | public void setName(String name) { 29 | this.name = name; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_timing.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 |