Skip to content

Instantly share code, notes, and snippets.

View poemsk's full-sized avatar

Poe poemsk

View GitHub Profile
@poemsk
poemsk / mmaug_RxSunshine_WeatherItem.java
Last active August 29, 2015 14:25
mmaug_RxSunshine_WeatherItem
package org.mmaug.rxsunshine;
/**
* Created by poepoe on 17/7/15.
*/
public class WeatherItem {
public String imageUrl;
public String text;
}
@poemsk
poemsk / mmaug_RxSunshine_fragment_main.xml
Last active August 29, 2015 14:25
mmaug_RxSunshine_fragment_main.xml
<FrameLayout 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=".MainActivityFragment">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
@poemsk
poemsk / mmaug_RxSunshine_row_weather.xml
Last active August 29, 2015 14:25
mmaug_RxSunshine_row_weather.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="8dp"
@poemsk
poemsk / mmaug_RxSunshine_retrofit.java
Last active August 29, 2015 14:25
mmaug_RxSunshine_retrofit
@GET("/?" + PARAM_MODE + "=" + JSON + "&" + PARAM_UNITS + "=" + METRIC)
void getWeather(@Query(PARAM_QUERY) String cityName,
@Query(PARAM_DAYS) int numOfDays, Callback<JsonObject> callback);
@poemsk
poemsk / mmaug_RxSunshine_Config.java
Last active August 29, 2015 14:25
mmaug_RxSunshine_Config.class
package org.mmaug.rxsunshine;
/**
* Created by poepoe on 16/7/15.
* This is the class that store static values which we will use across the projects
*/
public class Config {
//Base Url
public static final String BASE_URL = "http://api.openweathermap.org/data/2.5/forecast/daily";
@poemsk
poemsk / mmaug_WeatherApi.java
Last active August 29, 2015 14:25
mmaug_weather_api
package org.mmaug.rxsunshine;
import com.google.gson.JsonObject;
import retrofit.RestAdapter;
import retrofit.http.GET;
import retrofit.http.Query;
import rx.Observable;
import static org.mmaug.rxsunshine.Config.BASE_URL;
import static org.mmaug.rxsunshine.Config.JSON;
@poemsk
poemsk / mmaug_RxSunshine_build.gradle
Last active August 29, 2015 14:25
mmaug_RxSunshine_build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'io.reactivex:rxandroid:0.24.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.squareup.picasso:picasso:2.5.2'
}