Skip to content

Commit

Permalink
Merge pull request #16 from skedgo/thuy/release-v1.0-rc2
Browse files Browse the repository at this point in the history
Release TripKit v1.0-rc2
  • Loading branch information
Thuy Trinh committed Jan 25, 2016
2 parents c67616b + 1fbfc13 commit 77b4f19
Show file tree
Hide file tree
Showing 34 changed files with 111 additions and 42 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:2.0.0-alpha7'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true

org.gradle.parallel=true
org.gradle.daemon=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jul 20 11:43:53 GMT+07:00 2015
#Mon Jan 25 15:52:01 ICT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
2 changes: 1 addition & 1 deletion samples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ android {
dependencies {
compile 'com.facebook.stetho:stetho:1.2.0'
compile 'com.facebook.stetho:stetho-okhttp:1.2.0'
compile('com.skedgo.sdk:trip-kit:1.0-rc1@aar') {
compile('com.skedgo.sdk:trip-kit:1.0-rc2@aar') {
transitive = true
}
}
12 changes: 10 additions & 2 deletions samples/src/main/java/com/skedgo/android/samples/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@
import com.skedgo.android.tripkit.TripKit;

public final class App extends Application {
protected static TripKit tripKit;

public static TripKit tripKit() {
return tripKit;
}

@Override public void onCreate() {
super.onCreate();
Stetho.initializeWithDefaults(this);
TripKit.with(this)
.getOkHttpClient()

tripKit = TripKit.with(this);
TripKit.setLoggingEnabled(BuildConfig.DEBUG);
tripKit.getOkHttpClient()
.networkInterceptors().add(new StethoInterceptor());
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
package com.skedgo.android.samples;

import android.app.AlertDialog;
import android.app.ListActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import com.skedgo.android.common.model.Location;
import com.skedgo.android.tripkit.TripKit;
import com.skedgo.android.common.model.Region;
import com.skedgo.android.tripkit.Paratransit;
import com.skedgo.android.tripkit.RegionService;

import java.util.List;
import java.util.Locale;

import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.functions.Func1;

public class CitiesActivity extends ListActivity {
private ArrayAdapter<Location> citiesAdapter;
private RegionService regionService;

@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -35,8 +43,8 @@ public class CitiesActivity extends ListActivity {
};
setListAdapter(citiesAdapter);

TripKit.with(getApplicationContext())
.getRegionService()
regionService = App.tripKit().getRegionService();
regionService
.getCitiesAsync()
.toList()
.observeOn(AndroidSchedulers.mainThread())
Expand All @@ -51,4 +59,33 @@ public class CitiesActivity extends ListActivity {
}
});
}

@Override protected void onListItemClick(ListView l, View v, int position, long id) {
final Location city = citiesAdapter.getItem(position);
regionService
.getRegionByLocationAsync(city)
.flatMap(new Func1<Region, Observable<Paratransit>>() {
@Override public Observable<Paratransit> call(Region region) {
return regionService.fetchParatransitByRegionAsync(region);
}
})
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Action1<Paratransit>() {
@Override public void call(Paratransit paratransit) {
showParatransit(paratransit);
}
});
}

private void showParatransit(Paratransit paratransit) {
new AlertDialog.Builder(this)
.setMessage(String.format(
Locale.US, "URL: %s\nname: %s\nnumber: %s",
paratransit.url(),
paratransit.name(),
paratransit.number()
))
.create()
.show();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import com.skedgo.android.common.model.Trip;
import com.skedgo.android.common.model.TripGroup;
import com.skedgo.android.tripkit.RouteOptions;
import com.skedgo.android.tripkit.TripKit;

import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action0;
Expand Down Expand Up @@ -53,7 +52,7 @@ public class RoutesActivity extends ListActivity {
.walkingSpeed(RouteOptions.WALKING_SPEED_AVERAGE)
.build();

TripKit.with(getApplicationContext())
App.tripKit()
.getRouteService()
.routeAsync(routeOptions)
.observeOn(AndroidSchedulers.mainThread())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.skedgo.android.tripkit.TripKit;

public class SamplesActivity extends ListActivity {
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -18,8 +16,6 @@ public class SamplesActivity extends ListActivity {
android.R.layout.simple_list_item_1,
new String[] {"Cities", "Transport in Los Angeles, CA, USA", "Routes"}
));

TripKit.setLoggingEnabled(BuildConfig.DEBUG);
}

@Override protected void onListItemClick(ListView l, View v, int position, long id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import com.skedgo.android.common.model.Location;
import com.skedgo.android.common.model.TransportMode;
import com.skedgo.android.tripkit.TripKit;

import java.util.List;

Expand All @@ -36,7 +35,7 @@ public class TransportModesActivity extends ListActivity {
};
setListAdapter(transportModesAdapter);

TripKit.with(getApplicationContext())
App.tripKit()
.getRegionService()
.getTransportModesByLocationAsync(new Location(34.044, -118.248))
.observeOn(AndroidSchedulers.mainThread())
Expand Down
3 changes: 1 addition & 2 deletions samples/src/main/res/layout/activity_list.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ListView
android:id="@android:id/list"
<ListView android:id="@android:id/list"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
49787937beeb3152a9d8a37dbe3d657e
917f6639819e0d8a5a16e597f94290cc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0c1fde6b0595471024a8a1cb6ed5ef7bc42ae02b
0b2f216caf4f579422201d4734057a2e9247ef61
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
<version>0.24.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.skedgo.goservices</groupId>
<artifactId>transport-icons</artifactId>
<version>0.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>support-annotations</artifactId>
Expand Down Expand Up @@ -55,12 +61,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.skedgo.goservices</groupId>
<artifactId>transport-icons</artifactId>
<version>0.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.android.gms</groupId>
<artifactId>play-services-maps</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a167e6d2ce15e57ceb5b53b3d7950d29
bb32384fc4456516c814cc98fa7876fb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
36316ddee59fb09c8cd58f3d298f488c29425078
2c7c36872da021eda9ac0097ff5493db9040ca13
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<versions>
<version>0.0.1</version>
</versions>
<lastUpdated>20160120154122</lastUpdated>
<lastUpdated>20160125091841</lastUpdated>
</versioning>
</metadata>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
97d12b9627765fb61c00581c3695236f
c9f0fb1733760332f139d4e8cc158cc2
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7923a71534eaf2ae13a886f84272bc180e5790ed
318a9a7ef0f111f49b0f45b9be11b8a8841512b3
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
41e5bce124490f1f3c49b6d895f062da
fb5459655c8b9a91895357f2238005cf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f0e9c01c19385204eaccc0a5007110074209212b
7fccb87ef44f57059743c15cdce30631313b1ab2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<versions>
<version>0.0.1</version>
</versions>
<lastUpdated>20160120154140</lastUpdated>
<lastUpdated>20160125091827</lastUpdated>
</versioning>
</metadata>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cfa00b74ac85bec2073ba97a008c8fb1
fc712092eddf495ffab5317f7e9714a7
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3d938b789ccb2182fc1ae6cfc2882a95454873ee
8ec0dd1384d44d37df553e0f24b48e85431557dc
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4ce000d986c5942a89591529b9e13eea
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e4828a0367f287219d79d0b3f6f4a12a2c5ffa9c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.skedgo.sdk</groupId>
<artifactId>trip-kit</artifactId>
<version>1.0-rc2</version>
<packaging>aar</packaging>
<dependencies>
<dependency>
<groupId>com.google.android.gms</groupId>
<artifactId>play-services-gcm</artifactId>
<version>8.4.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.skedgo.goservices</groupId>
<artifactId>android-shared-lib</artifactId>
<version>0.0.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ce0770f78c6b6f910a665699b7fa7c97
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6baab22bb7dfa9ae2ee81f074a698e1c83b4bed9
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
<groupId>com.skedgo.sdk</groupId>
<artifactId>trip-kit</artifactId>
<versioning>
<release>1.0-rc1</release>
<release>1.0-rc2</release>
<versions>
<version>0.9-SNAPSHOT</version>
<version>1.0-beta1</version>
<version>1.0-beta2</version>
<version>1.0-rc1</version>
<version>1.0-rc2</version>
</versions>
<lastUpdated>20160120154145</lastUpdated>
<lastUpdated>20160125091900</lastUpdated>
</versioning>
</metadata>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
59ba9f3aa1827d8e578a280659364c71
710b2c79af5b730ccdc56139e6d0f928
Original file line number Diff line number Diff line change
@@ -1 +1 @@
936517dc6bfdbcb6d4f7696fb4a7e17734c62a87
0e013631a727682479f24e371aee8ca3a1d1251c

0 comments on commit 77b4f19

Please sign in to comment.