Skip to content

Instantly share code, notes, and snippets.

View nrohmen's full-sized avatar

Nur Rohman nrohmen

View GitHub Profile
@nrohmen
nrohmen / build.gradle
Created July 2, 2016 02:24
A Simple Android Apps with MVP, Dagger, RxJava, and Retrofit
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
@nrohmen
nrohmen / activity_home.xml
Last active July 2, 2016 02:29
A Simple Android Apps with MVP, Dagger, RxJava, and Retrofit
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".home.HomeActivity">
<android.support.v7.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
@nrohmen
nrohmen / item_home.xml
Last active April 29, 2017 03:50
A Simple Android Apps with MVP, Dagger, RxJava, and Retrofit
?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#EEEEEEEE">
<LinearLayout
@nrohmen
nrohmen / CityListResponse.java
Last active July 2, 2016 02:53
A Simple Android Apps with MVP, Dagger, RxJava, and Retrofit
package com.plaps.androidcleancode.models;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
@nrohmen
nrohmen / CityListDataResponse.java
Created July 2, 2016 02:53
A Simple Android Apps with MVP, Dagger, RxJava, and Retrofit
package com.plaps.androidcleancode.models;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import javax.annotation.Generated;
@Generated("org.jsonschema2pojo")
public class CityListData {
@nrohmen
nrohmen / NetworkService.java
Created July 2, 2016 02:56
A Simple Android Apps with MVP, Dagger, RxJava, and Retrofit
package com.plaps.androidcleancode.networking;
import com.plaps.androidcleancode.models.CityListResponse;
import retrofit2.http.GET;
import rx.Observable;
public interface NetworkService {
@GET("v1/city")
@nrohmen
nrohmen / Service.java
Created July 2, 2016 02:59
A Simple Android Apps with MVP, Dagger, RxJava, and Retrofit
package com.plaps.androidcleancode.networking;
import com.plaps.androidcleancode.models.CityListResponse;
import rx.Observable;
import rx.Subscriber;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Func1;
import rx.schedulers.Schedulers;
@nrohmen
nrohmen / NetworkModule.java
Created July 2, 2016 03:01
A Simple Android Apps with MVP, Dagger, RxJava, and Retrofit
package com.plaps.androidcleancode.networking;
import com.plaps.androidcleancode.BuildConfig;
import java.io.File;
import java.io.IOException;
import javax.inject.Singleton;
import dagger.Module;
@nrohmen
nrohmen / Deps.java
Created July 2, 2016 03:02
A Simple Android Apps with MVP, Dagger, RxJava, and Retrofit
package com.plaps.androidcleancode.deps;
import com.plaps.androidcleancode.home.HomeActivity;
import com.plaps.androidcleancode.networking.NetworkModule;
import javax.inject.Singleton;
import dagger.Component;
@Singleton
@nrohmen
nrohmen / BaseApp.java
Created July 2, 2016 03:03
A Simple Android Apps with MVP, Dagger, RxJava, and Retrofit
package com.plaps.androidcleancode;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.plaps.androidcleancode.deps.DaggerDeps;
import com.plaps.androidcleancode.deps.Deps;
import com.plaps.androidcleancode.networking.NetworkModule;
import java.io.File;