Skip to content

Commit

Permalink
Merge pull request #27 from ObjectiveTruth/aws
Browse files Browse the repository at this point in the history
Proper Back Navigation
  • Loading branch information
ObjectiveTruth authored Jul 21, 2016
2 parents 7944420 + 1feacd1 commit 6922edd
Show file tree
Hide file tree
Showing 372 changed files with 182 additions and 185 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ cache:

before_install:
# Decrypt the release keystore
- echo ${CI_RELEASE_KEYSTORE_GPG_PASSPHRASE} | gpg --batch --passphrase-fd 0 --decrypt "UoitDCLibraryBooking/release_key.keystore.gpg" > UoitDCLibraryBooking/release_key.keystore
- echo ${CI_RELEASE_KEYSTORE_GPG_PASSPHRASE} | gpg --batch --passphrase-fd 0 --decrypt "app/release_key.keystore.gpg" > app/release_key.keystore
# Decrypt the google play api key
- echo ${CI_GOOGLE_PLAY_API_KEY_GPG_PASSPHRASE} | gpg --batch --passphrase-fd 0 --decrypt "UoitDCLibraryBooking/google_play_android_developer_api_keys.json.gpg" > UoitDCLibraryBooking/google_play_android_developer_api_keys.json
- echo ${CI_GOOGLE_PLAY_API_KEY_GPG_PASSPHRASE} | gpg --batch --passphrase-fd 0 --decrypt "app/google_play_android_developer_api_keys.json.gpg" > app/google_play_android_developer_api_keys.json

script:
- ./scripts/set_release_track_env_variable_based_on_ci_branch.sh
Expand All @@ -55,17 +55,17 @@ after_success:
- git commit -m "Set build VERSION number" version.txt
- export GIT_TAG=v1.$(expr 20020 + ${TRAVIS_BUILD_NUMBER})-${ANDROID_APK_RELEASE_TRACK}
- echo ${GIT_TAG}
- git tag -a --file="UoitDCLibraryBooking/src/main/assets/whatsnew_thisversion.txt" $GIT_TAG
- git tag -a --file="app/src/main/assets/whatsnew_thisversion.txt" $GIT_TAG
- git push --quiet https://[email protected]/ObjectiveTruth/UoitDCLibraryBooking.git $GIT_TAG > /dev/null 2>&1
# Rename release apk file
- mv UoitDCLibraryBooking/build/outputs/apk/UoitDCLibraryBooking-release.apk
UoitDCLibraryBooking/build/outputs/apk/UoitDCLibraryBooking_${GIT_TAG}.apk
- mv app/build/outputs/apk/app-release.apk
app/build/outputs/apk/app_${GIT_TAG}.apk

deploy:
provider: releases
api_key:
secure: goZT2pPYFPu2+vYafTqPwXeTd6TDOd2TzRv4c5zdh8Z6hS2G45Fr0ACAOApLNeB0eCur9qthbWQPNF1rQRGg0ghlRHJCkruFi0wg0CwzSFBkdXAEYjptbcpP7hYcVWq4bRb9v53ISA0+cbhOIAWvexhHuJq/d1s68aA1llLLWWJhdVXo8i1VWMBSbAHMBmzyIKmoiX1QYKBgMNP8tpG1cxpG6MdEwHKVd+KFsSYYECv25Ak5pJCe2zcORej+PeuXs3FT6+jp/zc86qrx/LiiAdKJS7o7ZBoFYKtP6w2qq56CUDW3EdzdwBMwTFZalP3zQHR04cwatBgDscAzsEqapRiOXv6KL9yh6vB65T7uwyVMrX7BvXdG1vcCDzSAaFjBkSGcXcTOoDscvSuz7+q68XgFU9m2zZQZMjydArY6mxXV5rgdgDtyOvvBwu1kqswH4qJgiOyUbIpt9Tuvki2LcZYaEN67LriYx7QYf1Bqt6bg9ACuuzY5MRxX772abBMlrdJZwmg8aGMrb/Rr19VSsymxwX08fe5YvMCjSoDmZ//kFdPkEmw7milFlO0WkCLHW34z3W5XgcpkIlSK1oFBmtO0sHxeys8cXpUKtR8Nnf70Vgh4Qr5EUd6bAnq/zdDwtLkf5R6KjZN0VZjRgWKbwv3KE1sFT40YRQkYvlGctR8=
file: "UoitDCLibraryBooking/build/outputs/apk/UoitDCLibraryBooking_v*.apk"
file: "app/build/outputs/apk/app_v*.apk"
file_glob: true
skip_cleanup: true
on:
Expand Down
129 changes: 0 additions & 129 deletions UoitDCLibraryBooking/UoitDCLibraryBooking-UoitDCLibraryBooking.iml

This file was deleted.

3 changes: 0 additions & 3 deletions UoitDCLibraryBooking/fabric.properties

This file was deleted.

3 changes: 0 additions & 3 deletions UoitDCLibraryBooking/src/main/assets/whatsnew_thisversion.txt

This file was deleted.

File renamed without changes.
5 changes: 3 additions & 2 deletions UoitDCLibraryBooking/build.gradle → app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ play {
* Timeout added because of this issue http://stackoverflow.com/questions/34775440/spoon-timeout-getting-device-list
*/
spoon {
failIfNoDeviceConnected = true
adbTimeout = 60 * 3
debug = true
baseOutputDir = file("$buildDir/outputs")
Expand Down Expand Up @@ -81,7 +82,7 @@ task uninstallTestAppFromAllAttachedDevices(type: Exec) {
}

/**
* Ensures the order is respected so uninstalling doens't happen after installing, etc
* Ensures the order is respected so uninstalling doesn't happen after installing, etc
*/
tasks.whenTaskAdded { task ->
if (task.name.startsWith('spoonDebugAndroidTest') ||
Expand Down Expand Up @@ -182,7 +183,7 @@ dependencies {
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.1'
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
androidTestCompile 'com.squareup.spoon:spoon-client:1.5.7'
androidTestCompile 'com.squareup.spoon:spoon-client:1.6.1'
// Excluding these modules fixed Inflation error. Reference http://stackoverflow.com/a/30715011/1293521
androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.2.1') {
exclude group: 'com.android.support', module: 'appcompat'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.objectivetruth.uoitlibrarybooking;
package com.objectivetruth.uoitlibrarybooking.test;

import android.os.IBinder;
import org.junit.rules.TestRule;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.objectivetruth.uoitlibrarybooking.drawertests;
package com.objectivetruth.uoitlibrarybooking.test;

import android.app.Activity;
import android.app.Instrumentation;
Expand All @@ -10,7 +10,6 @@
import android.test.suitebuilder.annotation.LargeTest;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.objectivetruth.uoitlibrarybooking.DisableAnimationsRule;
import com.objectivetruth.uoitlibrarybooking.MainActivity;
import com.objectivetruth.uoitlibrarybooking.R;
import com.objectivetruth.uoitlibrarybooking.app.AppModule;
Expand All @@ -37,10 +36,10 @@ public class DrawerInstrumentationTests {
private Activity mActivity;

@ClassRule
public static DisableAnimationsRule disableAnimationsRule = new DisableAnimationsRule();
//public static DisableAnimationsRule disableAnimationsRule = new DisableAnimationsRule();

@Rule
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(
public static ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(
MainActivity.class,
true, // Initial touch mode
false); // Auto-launch activity
Expand Down Expand Up @@ -68,7 +67,7 @@ protected RequestQueue providesRequestQueue() {
}

@Test
public void drawerGoesToCorrectScreens() {
public void testDrawerGoesToCorrectScreens() {
Spoon.screenshot(mActivity, "initial_screen");

onView(withId(android.R.id.button1)).perform(click());
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
July 20, 2016
===
‣ Fixed major bug when loading app after its been in the background for a while

July 17, 2016
===
‣ MyAccount animation on refresh/switch between fragments
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/assets/whatsnew_thisversion.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
July 21, 2016
===
‣ Added proper backstack navigation (back pressing)
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

public class MainActivity extends ActivityBase {
final static private String ACTIVITY_TITLE = "Calendar";
final static private String HAS_DISMISSED_WHATS_NEW_DIALOG_BUNDLE_KEY = "HAS_DISMISSED_WHATS_NEW_DIALOG";

public static final String MY_ACCOUNT_DIALOGFRAGMENT_TAG = "myAccountDiaFrag";
public static final String GROUP_CODE_DIALOGFRAGMENT_TAG = "groupCodeInfoDiaFrag";
Expand All @@ -30,6 +31,7 @@ public class MainActivity extends ActivityBase {
AppCompatActivity mActivity = this;
public static CookieManager cookieManager;
private boolean isFirstLoadThisSession = false;
private boolean _hasDismissedWhatsNewDialog = false;
@Inject SharedPreferences mDefaultSharedPreferences;
@Inject SharedPreferences.Editor mDefaultSharedPreferencesEditor;
@Inject Tracker googleAnalyticsTracker;
Expand All @@ -39,7 +41,11 @@ public class MainActivity extends ActivityBase {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(savedInstanceState == null) {isFirstLoadThisSession = true; Timber.i("First time opening app this session");}
if(savedInstanceState == null) {
isFirstLoadThisSession = true; Timber.i("First time opening app this session");
}else {
_restorePreviousState(savedInstanceState);
}

((UOITLibraryBookingApp) getApplication()).getComponent().inject(this);

Expand All @@ -64,8 +70,29 @@ protected void onPostCreate(Bundle savedInstanceState) {
_goToScreenByMenuID(getLastMenuItemIDRequested());
}

if(UOITLibraryBookingApp.isFirstTimeLaunchSinceUpgradeOrInstall()) {WhatsNewDialog.show(this);}
if(UOITLibraryBookingApp.isFirstTimeLaunchSinceUpgradeOrInstall() && !_hasDismissedWhatsNewDialog) {
WhatsNewDialog
.show(this)
.setOnDismissListener(new DialogInterface.OnDismissListener() {

@Override
public void onDismiss(DialogInterface dialogInterface) {
_hasDismissedWhatsNewDialog = true;
}
});}

}

private void _restorePreviousState(Bundle inState) {
if(inState != null) {
_hasDismissedWhatsNewDialog = inState.getBoolean(HAS_DISMISSED_WHATS_NEW_DIALOG_BUNDLE_KEY);
}
}

@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putBoolean(HAS_DISMISSED_WHATS_NEW_DIALOG_BUNDLE_KEY, _hasDismissedWhatsNewDialog);
}

@Override
Expand Down
Loading

0 comments on commit 6922edd

Please sign in to comment.