diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml
new file mode 100644
index 0000000..6e50db1
--- /dev/null
+++ b/.github/workflows/changelog.yml
@@ -0,0 +1,24 @@
+name: Changelog Generation
+
+on:
+ release:
+ types: [published]
+ workflow_dispatch:
+
+jobs:
+ changelog:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ submodules: 'recursive'
+ ref: master
+ - uses: rhysd/changelog-from-release/action@v3
+ with:
+ file: CHANGELOG.md
+ pull_request: true
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ commit_summary_template: 'update changelog for %s changes'
+ args: -l 2
+ header: |
+ # Changelog
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..d2bce09
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,67 @@
+name: Continuous Integration
+on: [push, pull_request]
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ submodules: "recursive"
+
+ - name: Set up JDK environment
+ uses: actions/setup-java@v3
+ with:
+ distribution: "zulu"
+ java-version: 17
+
+ - name: Make gradlew executable
+ run: chmod +x ./gradlew
+
+ - name: Setup Gradle
+ uses: gradle/gradle-build-action@v2
+
+ - name: Run local unit tests
+ run: bash ./gradlew test --stacktrace
+
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ submodules: "recursive"
+
+ - name: Set up JDK environment
+ uses: actions/setup-java@v3
+ with:
+ distribution: "zulu"
+ java-version: 17
+
+ - name: Make gradlew executable
+ run: chmod +x ./gradlew
+
+ - name: Setup Gradle
+ uses: gradle/gradle-build-action@v2
+
+ - name: Run lint check
+ run: bash ./gradlew lint
+
+ - name: Upload lint result
+ uses: actions/upload-artifact@v4
+ with:
+ name: lint-results-debug
+ path: app/build/reports/lint-results-debug.html
+
+ - name: Build the app
+ run: bash ./gradlew build --stacktrace
+
+ - name: Build debug apk
+ run: bash ./gradlew assembleDebug
+
+ - name: Upload debug apk
+ uses: actions/upload-artifact@v4
+ with:
+ name: debug-apk
+ path: app/build/outputs/apk/debug/*.apk
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index c6cbe56..5f94008 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,7 @@
*.iml
.gradle
/local.properties
-/.idea/workspace.xml
-/.idea/libraries
+/.idea
.DS_Store
/build
/captures
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
deleted file mode 100644
index 0c51a83..0000000
--- a/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- xmlns:android
-
- ^$
-
-
-
-
-
-
-
-
- xmlns:.*
-
- ^$
-
-
- BY_NAME
-
-
-
-
-
-
- .*:id
-
- http://schemas.android.com/apk/res/android
-
-
-
-
-
-
-
-
- .*:name
-
- http://schemas.android.com/apk/res/android
-
-
-
-
-
-
-
-
- name
-
- ^$
-
-
-
-
-
-
-
-
- style
-
- ^$
-
-
-
-
-
-
-
-
- .*
-
- ^$
-
-
- BY_NAME
-
-
-
-
-
-
- .*
-
- http://schemas.android.com/apk/res/android
-
-
- ANDROID_ATTRIBUTE_ORDER
-
-
-
-
-
-
- .*
-
- .*
-
-
- BY_NAME
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
deleted file mode 100644
index fb7f4a8..0000000
--- a/.idea/compiler.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
deleted file mode 100644
index 7d3c403..0000000
--- a/.idea/gradle.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
deleted file mode 100644
index f2eacce..0000000
--- a/.idea/jarRepositories.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
deleted file mode 100644
index e1eea1d..0000000
--- a/.idea/kotlinc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index e9a58ca..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 7df27e1..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..843cdfb
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,108 @@
+# Changelog
+
+
+## [Aktivpause to Go v1.2.6](https://github.com/SecUSo/Aktivpause/releases/tag/v1.2.6) - 2025-08-22
+
+Fixes missing canScheduleExactAlarm check.
+**Full Changelog**: https://github.com/SecUSo/Aktivpause/compare/v1.2.5...v1.2.6
+
+[Changes][v1.2.6]
+
+
+
+## [Aktivpause to Go v1.2.5](https://github.com/SecUSo/Aktivpause/releases/tag/v1.2.5) - 2025-08-22
+
+Fixes crashes due to missing receiver flags.
+**Full Changelog**: https://github.com/SecUSo/Aktivpause/compare/v1.2.4...v1.2.5
+
+[Changes][v1.2.5]
+
+
+
+## [Aktivpause to Go v1.2.3](https://github.com/SecUSo/Aktivpause/releases/tag/v1.2.3) - 2025-08-03
+
+## What's Changed
+* Change versionCode to differentiate from last Google Play version by [@coderPaddyS](https://github.com/coderPaddyS) in [#28](https://github.com/SecUSo/Aktivpause/pull/28)
+
+
+**Full Changelog**: https://github.com/SecUSo/Aktivpause/compare/v1.2.2...v1.2.3
+
+[Changes][v1.2.3]
+
+
+
+## [Aktivpause to Go v1.2.2](https://github.com/SecUSo/Aktivpause/releases/tag/v1.2.2) - 2025-07-23
+
+## What's Changed
+* documentation: Added info re: Privacy Friendly Backup by [@jahway603](https://github.com/jahway603) in [#16](https://github.com/SecUSo/Aktivpause/pull/16)
+* Updates Copyright by [@coderPaddyS](https://github.com/coderPaddyS) in [#17](https://github.com/SecUSo/Aktivpause/pull/17)
+* Update to SDK 34; Fixes a bug hindering the training to start. by [@coderPaddyS](https://github.com/coderPaddyS) in [#21](https://github.com/SecUSo/Aktivpause/pull/21)
+* Adds ci and changelog workflows. by [@coderPaddyS](https://github.com/coderPaddyS) in [#24](https://github.com/SecUSo/Aktivpause/pull/24)
+* Updates App-Info by [@coderPaddyS](https://github.com/coderPaddyS) in [#22](https://github.com/SecUSo/Aktivpause/pull/22)
+
+## New Contributors
+* [@jahway603](https://github.com/jahway603) made their first contribution in [#16](https://github.com/SecUSo/Aktivpause/pull/16)
+
+**Full Changelog**: https://github.com/SecUSo/Aktivpause/compare/v1.2...v1.2.2
+
+[Changes][v1.2.2]
+
+
+
+## [v1.2](https://github.com/SecUSo/Aktivpause/releases/tag/v1.2) - 2023-05-28
+
+## What's Changed
+* Backup integration by [@coderPaddyS](https://github.com/coderPaddyS) in [#14](https://github.com/SecUSo/Aktivpause/pull/14)
+
+## New Contributors
+* [@coderPaddyS](https://github.com/coderPaddyS) made their first contribution in [#14](https://github.com/SecUSo/Aktivpause/pull/14)
+
+**Full Changelog**: https://github.com/SecUSo/Aktivpause/compare/v1.1.2...v1.2
+
+[Changes][v1.2]
+
+
+
+## [Aktivpause to Go v1.1.2](https://github.com/SecUSo/Aktivpause/releases/tag/v1.1.2) - 2020-07-09
+
+- Evaluation is done. Thank you for participating.
+- Removed evaluation link
+
+[Changes][v1.1.2]
+
+
+
+## [Aktivpause to Go v1.1.1](https://github.com/SecUSo/Aktivpause/releases/tag/v1.1.1) - 2020-04-02
+
+- Release für PlayStore
+
+[Changes][v1.1.1]
+
+
+
+## [Aktivpause to Go v1.1](https://github.com/SecUSo/Aktivpause/releases/tag/v1.1) - 2020-04-02
+
+- Online-Umfrage Link hinzugefügt
+
+[Changes][v1.1]
+
+
+
+## [Aktivpause to Go (v1.0)](https://github.com/SecUSo/Aktivpause/releases/tag/v1.0) - 2019-10-28
+
+- Initial release
+
+[Changes][v1.0]
+
+
+[v1.2.6]: https://github.com/SecUSo/Aktivpause/compare/v1.2.5...v1.2.6
+[v1.2.5]: https://github.com/SecUSo/Aktivpause/compare/v1.2.3...v1.2.5
+[v1.2.3]: https://github.com/SecUSo/Aktivpause/compare/v1.2.2...v1.2.3
+[v1.2.2]: https://github.com/SecUSo/Aktivpause/compare/v1.2...v1.2.2
+[v1.2]: https://github.com/SecUSo/Aktivpause/compare/v1.1.2...v1.2
+[v1.1.2]: https://github.com/SecUSo/Aktivpause/compare/v1.1.1...v1.1.2
+[v1.1.1]: https://github.com/SecUSo/Aktivpause/compare/v1.1...v1.1.1
+[v1.1]: https://github.com/SecUSo/Aktivpause/compare/v1.0...v1.1
+[v1.0]: https://github.com/SecUSo/Aktivpause/tree/v1.0
+
+
diff --git a/README.md b/README.md
index d8077ee..5d50b79 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,22 @@
+[][PFA]
+[][Bluesky]
+[][Mastodon]
+
+[PFA]: https://secuso.org/pfa
+[Mastodon]: https://xn--baw-joa.social/@SECUSO_Research
+[Bluesky]: https://bsky.app/profile/secusoresearch.bsky.social
+
+
+
## Aktivpause
-The Aktivpause to Go App allows you to integrate planned breaks into your daily work. You can decide when, where and for how long you want to take breaks and this app will help shape your break in a healthy way. It offers a wide variety of exercises from the well-established Aktivpause program at KIT and was developed by Scientists at the Institute of Sports and Sports Science (IfSS) of KIT. Exercises are currently only provided in german.
+[
](https://f-droid.org/repository/browse/?fdid=org.secuso.aktivpause)
-[
](https://play.google.com/store/apps/details?id=org.secuso.aktivpause)
+The Aktivpause to Go App allows you to integrate planned breaks into your daily work. You can decide when, where and for how long you want to take breaks and this app will help shape your break in a healthy way. It offers a wide variety of exercises from the well-established Aktivpause program at KIT and was developed by Scientists at the Institute of Sports and Sports Science (IfSS) of KIT. Exercises are currently only provided in german.
## Download and more Information
@@ -15,6 +27,10 @@ Further development requires Android Studio, we recommend to use the latest vers
Mininum SDK: 21
Target SDK: 28
+## Data Backup
+
+You can use the [Privacy Friendly Backup app](https://github.com/SecUSo/privacy-friendly-backup) to backup and restore this application's data. This can also be used to migrate your data to a new phone.
+
## License
Aktivpause is licensed under the GPLv3.
@@ -33,7 +49,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
-The app uses icons from [Google Design Material Icons](https://design.google.com/icons/index.html) licensed under Apache License Version 2.0. All other images (the logo of Privacy Friendly Apps, the SECUSO logo, the App icon and the exercise Images) copyright [Karlsruhe Institute of Technology (KIT)](https://www.kit.edu) (2019).
+The app uses icons from [Google Design Material Icons](https://design.google.com/icons/index.html) licensed under Apache License Version 2.0. All other images (the logo of Privacy Friendly Apps, the SECUSO logo, the App icon and the exercise Images) copyright [SECUSO](www.secuso.org) (2019).
## Contributors
@@ -43,8 +59,6 @@ App Icon:
Exercise Icons:
- KIT - Institut für Sport und Sportwissenschaft
-Authors (Github-Users):
-- Christopher Beckmann (Kamuno)
-- Jonathan Diener
-- (Badric)
-- (Lechendary)
+
+
+
diff --git a/app/build.gradle b/app/build.gradle
index af10d90..c9c2eec 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -3,14 +3,15 @@ apply plugin: 'kotlin-android'
android {
- compileSdkVersion 33
+ compileSdk 34
+ namespace 'org.secuso.aktivpause'
defaultConfig {
applicationId "org.secuso.aktivpause"
minSdkVersion 21
- targetSdkVersion 33
- versionCode 10
- versionName "1.2.0"
+ targetSdkVersion 34
+ versionCode 102
+ versionName "1.2.6"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
@@ -19,12 +20,21 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
+ buildFeatures {
+ buildConfig true
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
+ }
+ kotlinOptions {
+ jvmTarget = JavaVersion.VERSION_17.toString()
+ }
+ kotlin {
+ jvmToolchain(17)
}
- namespace 'org.secuso.aktivpause'
lint {
+ lintConfig = file("lint.xml")
abortOnError false
checkReleaseBuilds false
}
@@ -49,7 +59,7 @@ dependencies {
implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
testImplementation 'junit:junit:4.12'
// https://github.com/ShawnLin013/NumberPicker
- implementation 'com.shawnlin:number-picker:2.4.4'
+ implementation 'io.github.ShawnLin013:number-picker:2.4.13'
// Backup
implementation project(path: ':backup-api')
diff --git a/app/lint.xml b/app/lint.xml
new file mode 100644
index 0000000..1da88bd
--- /dev/null
+++ b/app/lint.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 9707c46..3c5e177 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -10,7 +10,6 @@
-
loader, ExerciseSet set) {
if (set != null) {
diff --git a/app/src/main/java/org/secuso/aktivpause/activities/TimerActivity.java b/app/src/main/java/org/secuso/aktivpause/activities/TimerActivity.java
index 6d28457..b92aac0 100644
--- a/app/src/main/java/org/secuso/aktivpause/activities/TimerActivity.java
+++ b/app/src/main/java/org/secuso/aktivpause/activities/TimerActivity.java
@@ -12,10 +12,10 @@ import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.IBinder;
import android.preference.PreferenceManager;
-import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.ConstraintSet;
import androidx.core.app.ActivityCompat;
+import androidx.core.content.ContextCompat;
import androidx.loader.app.LoaderManager;
import androidx.loader.content.AsyncTaskLoader;
import androidx.loader.content.Loader;
@@ -117,12 +117,9 @@ public class TimerActivity extends BaseActivity implements LoaderManager.LoaderC
boolean isRunning = intent.getBooleanExtra("isRunning", false);
boolean isPaused = intent.getBooleanExtra("isPaused", false);
- //if(intent.getBooleanExtra("done" ,false)) {
- // TODO: show a dialog here to start the exercise?
- //}
-
- //Log.d(TAG, millisUntilDone + "/" + initialDuration + " (" + (isRunning ? "Running" : "") + (isPaused ? "Paused" : "") + (!isRunning && !isPaused ? "Stopped" : "") + ")");
-
+ if (millisUntilDone <= 0) {
+ startActivity(new Intent(TimerActivity.this, ExerciseActivity.class));
+ }
updateUI(isRunning, isPaused, initialDuration, millisUntilDone);
}
};
@@ -235,7 +232,7 @@ public class TimerActivity extends BaseActivity implements LoaderManager.LoaderC
isActivityVisible = true;
- registerReceiver(timerReceiver, new IntentFilter(TimerService.TIMER_BROADCAST));
+ ContextCompat.registerReceiver(this, timerReceiver, new IntentFilter(TimerService.TIMER_BROADCAST), ContextCompat.RECEIVER_NOT_EXPORTED);
if(mTimerService != null && !mTimerService.isRunning()) {
updateProgress(mTimerService.getInitialDuration());
diff --git a/app/src/main/java/org/secuso/aktivpause/receivers/TimerSchedulerReceiver.java b/app/src/main/java/org/secuso/aktivpause/receivers/TimerSchedulerReceiver.java
index 8138054..6ebfc46 100644
--- a/app/src/main/java/org/secuso/aktivpause/receivers/TimerSchedulerReceiver.java
+++ b/app/src/main/java/org/secuso/aktivpause/receivers/TimerSchedulerReceiver.java
@@ -11,6 +11,7 @@ import android.os.Build;
import android.os.IBinder;
import android.preference.PreferenceManager;
import androidx.annotation.NonNull;
+import androidx.core.app.AlarmManagerCompat;
import androidx.legacy.content.WakefulBroadcastReceiver;
import org.secuso.aktivpause.service.TimerService;
@@ -79,7 +80,7 @@ public class TimerSchedulerReceiver extends WakefulBroadcastReceiver {
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
Intent automaticTimerIntent = new Intent(context, TimerSchedulerReceiver.class);
- PendingIntent automaticTimerPending = PendingIntent.getBroadcast(context, 0, automaticTimerIntent, PendingIntent.FLAG_UPDATE_CURRENT);
+ PendingIntent automaticTimerPending = PendingIntent.getBroadcast(context, 0, automaticTimerIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(timestamp);
@@ -143,12 +144,8 @@ public class TimerSchedulerReceiver extends WakefulBroadcastReceiver {
}
}
- if(done || !scheduleExerciseDaysEnabled) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
- alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), automaticTimerPending);
- } else {
- alarmManager.setExact(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), automaticTimerPending);
- }
+ if((done || !scheduleExerciseDaysEnabled) && (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) || alarmManager.canScheduleExactAlarms()) {
+ AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), automaticTimerPending);
}
}
diff --git a/app/src/main/java/org/secuso/aktivpause/service/TimerService.java b/app/src/main/java/org/secuso/aktivpause/service/TimerService.java
index f42aa08..09f2966 100644
--- a/app/src/main/java/org/secuso/aktivpause/service/TimerService.java
+++ b/app/src/main/java/org/secuso/aktivpause/service/TimerService.java
@@ -9,12 +9,15 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
+import android.content.pm.ServiceInfo;
import android.os.Binder;
import android.os.CountDownTimer;
+import android.os.Handler;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.provider.Settings;
import androidx.core.app.NotificationCompat;
+import androidx.core.app.ServiceCompat;
import androidx.core.content.ContextCompat;
import org.secuso.aktivpause.R;
@@ -33,6 +36,7 @@ import static org.secuso.aktivpause.activities.tutorial.FirstLaunchManager.WORK_
import static org.secuso.aktivpause.receivers.NotificationCancelReceiver.ACTION_NOTIFICATION_CANCELED;
import static org.secuso.aktivpause.receivers.NotificationDeletedReceiver.ACTION_NOTIFICATION_DELETED;
+import kotlin.Unit;
/**
* The main timer service. It handles the work timer and sends updates to the notification and the {@link TimerActivity}.
* When the work time is up, an alarm will fire to start the exercises.
@@ -53,6 +57,9 @@ public class TimerService extends Service {
private static final int UPDATE_INTERVAL = 125;
public static final int NOTIFICATION_ID = 31337;
+ private NotificationCompat.Builder notiBuilder = null;
+ private NotificationManager notiManager = null;
+ private boolean isAppInBackground = false;
private TimerServiceBinder mBinder = new TimerServiceBinder();
private CountDownTimer mTimer;
@@ -139,9 +146,10 @@ public class TimerService extends Service {
public void onCreate() {
super.onCreate();
- registerReceiver(timerReceiver, new IntentFilter(TIMER_BROADCAST));
- registerReceiver(notificationDeletedReceiver, new IntentFilter(ACTION_NOTIFICATION_DELETED));
- registerReceiver(notificationPreferenceChangedReceiver, new IntentFilter(ACTION_NOTIFICATION_CANCELED));
+
+ ContextCompat.registerReceiver(this, timerReceiver, new IntentFilter(TIMER_BROADCAST), ContextCompat.RECEIVER_NOT_EXPORTED);
+ ContextCompat.registerReceiver(this, notificationDeletedReceiver, new IntentFilter(ACTION_NOTIFICATION_DELETED), ContextCompat.RECEIVER_NOT_EXPORTED);
+ ContextCompat.registerReceiver(this, notificationPreferenceChangedReceiver, new IntentFilter(ACTION_NOTIFICATION_CANCELED), ContextCompat.RECEIVER_NOT_EXPORTED);
}
@Override
@@ -362,13 +370,50 @@ public class TimerService extends Service {
}
private void updateNotification() {
- if(isRunning() || isPaused()) {
- startForeground(NOTIFICATION_ID, buildNotification());
- } else {
- stopForeground(true);
+ if(isAppInBackground) {
+ Notification notification = buildNotification();
+ notiManager.notify(NOTIFICATION_ID, notification);
+ }
+ else if(notiManager != null) {
+ notiManager.cancel(NOTIFICATION_ID);
}
}
+ /**
+ * Check if the app is in the background.
+ * If so, start a notification showing the current timer.
+ *
+ * @param isInBackground Sets global flag to determine whether the app is in the background
+ */
+ public void setIsAppInBackground(boolean isInBackground){
+ this.isAppInBackground = isInBackground;
+
+ //Execute after short delay to prevent short notification popup if workoutActivity is closed
+ final Handler handler = new Handler();
+ handler.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ updateNotification();
+ }
+ }, 700);
+ }
+
+ /**
+ * Cancel the notification when workout activity is destroyed
+ */
+ public void workoutClosed(){
+ this.isAppInBackground = false;
+ notiManager.cancel(NOTIFICATION_ID);
+ }
+
+// private void updateNotification() {
+// if(isRunning() || isPaused()) {
+// ServiceCompat.startForeground(this, NOTIFICATION_ID, buildNotification(), ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE);
+// } else {
+// stopForeground(true);
+// }
+// }
+
@Override
public IBinder onBind(Intent intent) {
return mBinder;
diff --git a/app/src/main/res/drawable/secuso_logo_black.xml b/app/src/main/res/drawable/secuso_logo_black.xml
new file mode 100644
index 0000000..8a84e65
--- /dev/null
+++ b/app/src/main/res/drawable/secuso_logo_black.xml
@@ -0,0 +1,264 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/secuso_logo_white.xml b/app/src/main/res/drawable/secuso_logo_white.xml
new file mode 100644
index 0000000..41d391a
--- /dev/null
+++ b/app/src/main/res/drawable/secuso_logo_white.xml
@@ -0,0 +1,256 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml
index df87f10..a575210 100644
--- a/app/src/main/res/layout/activity_about.xml
+++ b/app/src/main/res/layout/activity_about.xml
@@ -116,7 +116,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
- android:src="@drawable/secuso_logo_gruen" />
+ android:src="?attr/secusoLogoDrawable" />
+
+
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 483ff70..02fdf03 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -2,6 +2,7 @@