From 61595530b06d13e05738c75fbdda88dda93d1cbe Mon Sep 17 00:00:00 2001 From: Fahim Masud Choudhury Date: Mon, 21 Mar 2016 17:19:53 +0600 Subject: [PATCH 1/9] GFETCH-79 .travis.yml file added into project, need to check whether it is working or not --- .travis.yml | 11 +++++++++++ .../gobd/gofetch/activity/RideActivity.java | 5 +++++ .../gofetch/fragment/RoutePlanFragment.java | 19 ++++++++++++++++--- 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..767ef19 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: android +android: + components: + - platform-tools + - build-tools-23.0.2 + - android-23 + - extra-android-m2repository + - extra-google-m2repository + +script: + - ./gradlew build connectedCheck \ No newline at end of file diff --git a/app/src/main/java/co/gobd/gofetch/activity/RideActivity.java b/app/src/main/java/co/gobd/gofetch/activity/RideActivity.java index 6386385..1fb9689 100644 --- a/app/src/main/java/co/gobd/gofetch/activity/RideActivity.java +++ b/app/src/main/java/co/gobd/gofetch/activity/RideActivity.java @@ -20,6 +20,11 @@ protected void onCreate(Bundle savedInstanceState) { startRoutePlanFragment(); } + @Override + protected void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + } + // Fragment callback implementation @Override public void loadConfirmationFragment(Bundle bundle) { diff --git a/app/src/main/java/co/gobd/gofetch/fragment/RoutePlanFragment.java b/app/src/main/java/co/gobd/gofetch/fragment/RoutePlanFragment.java index caa7f59..683fdf7 100644 --- a/app/src/main/java/co/gobd/gofetch/fragment/RoutePlanFragment.java +++ b/app/src/main/java/co/gobd/gofetch/fragment/RoutePlanFragment.java @@ -3,11 +3,11 @@ import android.app.Activity; import android.content.Context; import android.content.Intent; +import android.os.Bundle; import android.support.v4.app.Fragment; -import android.view.View; import android.view.LayoutInflater; +import android.view.View; import android.view.ViewGroup; -import android.os.Bundle; import com.google.android.gms.common.GooglePlayServicesNotAvailableException; import com.google.android.gms.common.GooglePlayServicesRepairableException; @@ -25,7 +25,8 @@ import co.gobd.gofetch.presenter.RoutePlanPresenter; import co.gobd.gofetch.view.RoutePlanView; -import static co.gobd.gofetch.utility.Constant.*; +import static co.gobd.gofetch.utility.Constant.REQUEST_CODE_DESTINATION_POINT; +import static co.gobd.gofetch.utility.Constant.REQUEST_CODE_STARTING_POINT; public class RoutePlanFragment extends Fragment implements RoutePlanView { @@ -49,22 +50,34 @@ public class RoutePlanFragment extends Fragment implements RoutePlanView { @Bind(R.id.et_destination_note) MaterialEditText etNoteDestination; + /* Flag to determine whether GooglePlacePicker is already opened or not */ boolean isGooglePlacePickerAlreadyOpen; + /* Initialize Google Place Picker*/ private PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder(); + /* Presenter */ private RoutePlanPresenter routePlanPresenter; + /* Starting point and destination positions */ private LatLng startingPoint; private LatLng destinationPoint; + + /* Callback to update activity */ private RideFragmentCallback callback; + public RoutePlanFragment() { //Empty constructor for fragment initialization } + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + } + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); From ec929dea327a3d128b2d74f5dd610774f95a04a2 Mon Sep 17 00:00:00 2001 From: Fahim Masud Choudhury Date: Mon, 21 Mar 2016 17:31:09 +0600 Subject: [PATCH 2/9] GFETCH-79 .travis.yml updated with sudo permission --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 767ef19..835c0f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,5 +7,7 @@ android: - extra-android-m2repository - extra-google-m2repository +sudo: required + script: - ./gradlew build connectedCheck \ No newline at end of file From 678e76de9bd5fe256eb235f2b2f3eb4a7ff3c505 Mon Sep 17 00:00:00 2001 From: Fahim Masud Choudhury Date: Mon, 21 Mar 2016 17:38:45 +0600 Subject: [PATCH 3/9] GFETCH-79 before_install: - chmod +x gradlew added in .travis.yml --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 835c0f7..7168675 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,5 +9,8 @@ android: sudo: required +before_install: + - chmod +x gradlew + script: - ./gradlew build connectedCheck \ No newline at end of file From 14fe47fa702f25005b014bfad9621f4beb52f588 Mon Sep 17 00:00:00 2001 From: Fahim Masud Choudhury Date: Mon, 21 Mar 2016 17:45:09 +0600 Subject: [PATCH 4/9] GFETCH-79 build-tools version degraded to 23.0.1 in .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7168675..04835de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: android android: components: - platform-tools - - build-tools-23.0.2 + - build-tools-23.0.1 - android-23 - extra-android-m2repository - extra-google-m2repository From 19fef60f9fce1186f03543c96d0921fb5925d528 Mon Sep 17 00:00:00 2001 From: Fahim Masud Choudhury Date: Mon, 21 Mar 2016 17:50:49 +0600 Subject: [PATCH 5/9] GFETCH-79 tools componenet added in .travis.yml --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 04835de..88dd820 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,9 @@ language: android android: components: + - tools - platform-tools - - build-tools-23.0.1 + - build-tools-23.0.2 - android-23 - extra-android-m2repository - extra-google-m2repository From fe8c993faf530cc3fe9d7f2f182de0eb643e3f5d Mon Sep 17 00:00:00 2001 From: Fahim Masud Choudhury Date: Mon, 21 Mar 2016 18:01:32 +0600 Subject: [PATCH 6/9] GFETCH-79 build.gradle updated with lintOptions --- .idea/misc.xml | 2 +- app/build.gradle | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 5d19981..fbb6828 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/app/build.gradle b/app/build.gradle index ca593ab..d26480a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,6 +17,10 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + + lintOptions { + abortOnError false + } } dependencies { From 9a7455e33734b105f6573d3f38ac07626574afee Mon Sep 17 00:00:00 2001 From: Fahim Masud Choudhury Date: Mon, 21 Mar 2016 18:15:05 +0600 Subject: [PATCH 7/9] GFETCH-79 Mock destination address is returned when showErrorWhenStartingPointEmpty() method is invoked in RoutePlanPresenterTest --- .idea/misc.xml | 2 +- .../java/co/gobd/gofetch/presenter/RoutePlanPresenterTest.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index fbb6828..5d19981 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/app/src/test/java/co/gobd/gofetch/presenter/RoutePlanPresenterTest.java b/app/src/test/java/co/gobd/gofetch/presenter/RoutePlanPresenterTest.java index cd1bbe3..04139a9 100644 --- a/app/src/test/java/co/gobd/gofetch/presenter/RoutePlanPresenterTest.java +++ b/app/src/test/java/co/gobd/gofetch/presenter/RoutePlanPresenterTest.java @@ -31,6 +31,7 @@ public void setUp() throws Exception { @Test public void showErrorWhenStartingPointEmpty() throws Exception { when(view.getStartingPointAddress()).thenReturn(""); + when(view.getDestinationAddress()).thenReturn("Shyamoli"); presenter.onButtonClick(); verify(view).showErrorOnEmptyAddress(LocationTypeEnum.STARTING_POINT); From cabea24092a3f76e832ab57145cd5d24cc80ced3 Mon Sep 17 00:00:00 2001 From: Fahim Masud Choudhury Date: Tue, 22 Mar 2016 00:30:01 +0600 Subject: [PATCH 8/9] GFETCH-79 .travis.yml updated --- .travis.yml | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88dd820..b1df35c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,44 @@ +sudo: false language: android android: components: - tools - platform-tools + + # The BuildTools version used by your project - build-tools-23.0.2 + + # The SDK version used to compile your project - android-23 + + # Additional components + - extra-google-google_play_services - extra-android-m2repository - extra-google-m2repository -sudo: required + # Specify at least one system image, + # if you need to run emulator(s) during your tests + # - sys-img-armeabi-v7a-android-21 + - sys-img-armeabi-v7a-android-23 + +env: + global: + # install timeout in minutes (2 minutes by default) + - ADB_INSTALL_TIMEOUT=8 + + +# Emulator Management: Create, Start and Wait +before_script: + - echo no | android create avd --force --name test --target android-23 --abi armeabi-v7a + - emulator -avd test -no-skin -no-audio -no-window -gpu off -no-boot-anim & + - android-wait-for-emulator + - adb devices + - adb shell input keyevent 82 & before_install: - chmod +x gradlew script: - - ./gradlew build connectedCheck \ No newline at end of file + - echo $ADB_INSTALL_TIMEOUT + - android list target + - ./gradlew build connectedCheck \ No newline at end of file From 7e8cf40443c11fe92bd3dbdba2b7317606ff3441 Mon Sep 17 00:00:00 2001 From: Fahim Masud Choudhury Date: Thu, 21 Apr 2016 17:11:01 +0600 Subject: [PATCH 9/9] GFETCH-79 android support repository added in .travis.yml" --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b1df35c..cc284c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ android: - platform-tools # The BuildTools version used by your project - - build-tools-23.0.2 + - build-tools-23.0.3 # The SDK version used to compile your project - android-23 @@ -15,6 +15,8 @@ android: - extra-google-google_play_services - extra-android-m2repository - extra-google-m2repository + - extra-android-support + # Specify at least one system image, # if you need to run emulator(s) during your tests