From 0648e5765ceb5f0552288b11e41797b6b6f5d9ef Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sun, 27 May 2018 23:56:01 +0200 Subject: [PATCH 1/2] fix: Back press button behaviors --- .../java/science/apolline/view/activity/MainActivity.kt | 3 +++ .../java/science/apolline/view/activity/SplashScreen.kt | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/app/src/main/java/science/apolline/view/activity/MainActivity.kt b/app/src/main/java/science/apolline/view/activity/MainActivity.kt index 81646e9..58ab821 100644 --- a/app/src/main/java/science/apolline/view/activity/MainActivity.kt +++ b/app/src/main/java/science/apolline/view/activity/MainActivity.kt @@ -116,6 +116,9 @@ class MainActivity : RootActivity(), NavigationView.OnNavigationItemSelectedList } else { val backStackEntryCount = supportFragmentManager.backStackEntryCount if (backStackEntryCount == 1) { + if (IOIOService.getServiceStatus()){ + stopService(Intent(applicationContext, IOIOService::class.java)) + } val intent = Intent(this, SplashScreen::class.java) startActivity(intent) finish() diff --git a/app/src/main/java/science/apolline/view/activity/SplashScreen.kt b/app/src/main/java/science/apolline/view/activity/SplashScreen.kt index e5e4e83..0655669 100644 --- a/app/src/main/java/science/apolline/view/activity/SplashScreen.kt +++ b/app/src/main/java/science/apolline/view/activity/SplashScreen.kt @@ -32,7 +32,9 @@ import science.apolline.root.RootActivity import com.github.ivbaranov.rxbluetooth.predicates.BtPredicate import com.fondesa.kpermissions.extension.permissionsBuilder import com.fondesa.kpermissions.request.PermissionRequest +import ioio.lib.util.android.IOIOService import org.jetbrains.anko.* +import science.apolline.service.sensor.IOIOService.Companion.getServiceStatus import science.apolline.utils.CheckUtility @@ -56,6 +58,11 @@ class SplashScreen : RootActivity(), AnkoLogger { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + if (getServiceStatus()){ + val intent = Intent(this, MainActivity::class.java) + startActivity(intent) + finish() + } mPrefs = PreferenceManager.getDefaultSharedPreferences(applicationContext) EXTRA_DEVICE_ADDRESS = mPrefs.getString("device_uuid", "ffffffff-ffff-ffff-ffff-ffffffffffff") SENSOR_MAC_ADDRESS = mPrefs.getString("sensor_mac_address", "ff-ff-ff-ff-ff-ff") From 5b841bf71eeba2cad7071b88971df7e6b58d4c9b Mon Sep 17 00:00:00 2001 From: Aoudia Date: Mon, 28 May 2018 00:01:17 +0200 Subject: [PATCH 2/2] build: Bump Apolline version to v2.4.5 --- app/build.gradle | 4 ++-- fastlane/metadata/android/en-US/changelogs/22.txt | 1 + fastlane/metadata/android/fr-FR/changelogs/22.txt | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/22.txt create mode 100644 fastlane/metadata/android/fr-FR/changelogs/22.txt diff --git a/app/build.gradle b/app/build.gradle index d741207..8b60bb9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,8 +26,8 @@ android { minSdkVersion 21 targetSdkVersion 27 - versionCode 21 - versionName "2.4.4" + versionCode 22 + versionName "2.4.5" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" javaCompileOptions { diff --git a/fastlane/metadata/android/en-US/changelogs/22.txt b/fastlane/metadata/android/en-US/changelogs/22.txt new file mode 100644 index 0000000..9e4ccfa --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/22.txt @@ -0,0 +1 @@ +- Fix some bugs. \ No newline at end of file diff --git a/fastlane/metadata/android/fr-FR/changelogs/22.txt b/fastlane/metadata/android/fr-FR/changelogs/22.txt new file mode 100644 index 0000000..cf727e8 --- /dev/null +++ b/fastlane/metadata/android/fr-FR/changelogs/22.txt @@ -0,0 +1 @@ +- Correction de quelques bugs. \ No newline at end of file