Skip to content

Commit

Permalink
Merge pull request #45 from SecUSo/development
Browse files Browse the repository at this point in the history
Update to version 1.3.2
udenr authored Apr 8, 2024
2 parents 40574a4 + 8c89293 commit 2dd75a7
Showing 47 changed files with 363 additions and 323 deletions.
63 changes: 35 additions & 28 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'com.google.devtools.ksp'
}

android {
compileSdkVersion 34

defaultConfig {
applicationId "org.secuso.privacyfriendlypaindiary"
minSdkVersion 21
targetSdkVersion 34
versionCode 5
versionName "1.3.1"
compileSdk 34
versionCode 6
versionName "1.3.2"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
@@ -19,8 +21,22 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
namespace 'org.secuso.privacyfriendlypaindiary'
lint {
lintConfig = file("lint.xml")
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}

kotlin {
jvmToolchain(17)
}

android.applicationVariants.configureEach { variant ->
@@ -33,46 +49,37 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation('androidx.test.ext:junit:1.1.1') {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'junit:junit:4.13.2'
androidTestImplementation('androidx.test.ext:junit:1.1.5') {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation('androidx.test:runner:1.5.2')
androidTestImplementation('androidx.test:core:1.5.0')
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'com.google.android.material:material:1.11.0'
implementation 'com.prolificinteractive:material-calendarview:1.4.3'
implementation("com.github.bumptech.glide:glide:4.6.1") {
implementation("com.github.bumptech.glide:glide:4.11.0") {
exclude group: "com.android.support"
}
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
ksp 'com.github.bumptech.glide:compiler:4.9.0'

implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0"

def room_version = "2.6.1"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
kapt "androidx.room:room-compiler:$room_version"
ksp "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version"

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

implementation project(path: ':backup-api')
def work_version = "2.7.1"
def work_version = "2.9.0"
implementation "androidx.work:work-runtime:$work_version"
implementation "androidx.work:work-runtime-ktx:$work_version"
androidTestImplementation "androidx.work:work-testing:$work_version"

constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
}
repositories {
mavenCentral()
10 changes: 10 additions & 0 deletions app/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Disable the NotificationPermission check for glide -->
<issue id="NotificationPermission">
<ignore regexp="com.bumptech.glide.request.target.NotificationTarget" />
</issue>

<!-- Set the severity of missing translations to warning instead of error -->
<issue id="MissingTranslation" severity="warning" />
</lint>
41 changes: 20 additions & 21 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.secuso.privacyfriendlypaindiary">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />

<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true"/>
android:xlargeScreens="true" />

<application
android:name=".PFAPainDiaryApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:name=".PFAPainDiaryApplication"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<provider
@@ -27,17 +31,17 @@

<activity
android:name="org.secuso.privacyfriendlypaindiary.activities.SplashActivity"
android:theme="@style/SplashTheme"
android:exported="true">
android:exported="true"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="org.secuso.privacyfriendlypaindiary.tutorial.TutorialActivity"
android:theme="@style/AppTheme.NoActionBar">
</activity>
<activity
android:name="org.secuso.privacyfriendlypaindiary.tutorial.TutorialActivity"
android:theme="@style/AppTheme.NoActionBar"></activity>
<activity
android:name="org.secuso.privacyfriendlypaindiary.activities.UserDetailsActivity"
android:label="@string/user_details"
@@ -59,8 +63,7 @@
<activity
android:name="org.secuso.privacyfriendlypaindiary.activities.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
</activity>
android:theme="@style/AppTheme.NoActionBar"></activity>
<activity
android:name="org.secuso.privacyfriendlypaindiary.activities.AboutActivity"
android:label="@string/about"
@@ -107,8 +110,7 @@
android:process=":backup"
tools:ignore="ExportedService">
<intent-filter>
<action
android:name="org.secuso.privacyfriendlybackup.api.pfa.PFAAuthService" />
<action android:name="org.secuso.privacyfriendlybackup.api.pfa.PFAAuthService" />
</intent-filter>
</service>

@@ -118,10 +120,11 @@

</service>

<receiver android:name="org.secuso.privacyfriendlypaindiary.helpers.NotificationJobService$NotificationReceiver"
<receiver
android:name="org.secuso.privacyfriendlypaindiary.helpers.NotificationJobService$NotificationReceiver"
android:exported="false">
<intent-filter>
<action android:name="org.secuso.privacyfriendlypaindiary.action.SNOOZE"/>
<action android:name="org.secuso.privacyfriendlypaindiary.action.SNOOZE" />
</intent-filter>
</receiver>

@@ -136,8 +139,4 @@
</provider>

</application>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>


</manifest>
</manifest>
Original file line number Diff line number Diff line change
@@ -16,7 +16,5 @@ class PFAPainDiaryApplication : Application(), Configuration.Provider {
BackupManager.backupRestorer = BackupRestorer()
}

override fun getWorkManagerConfiguration(): Configuration {
return Configuration.Builder().setMinimumLoggingLevel(Log.INFO).build()
}
override val workManagerConfiguration = Configuration.Builder().setMinimumLoggingLevel(Log.INFO).build()
}
Original file line number Diff line number Diff line change
@@ -23,6 +23,8 @@ License, or (at your option) any later version.
import android.os.Handler;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.view.MenuItem;
import android.view.View;

import androidx.appcompat.app.ActionBarDrawerToggle;
import androidx.appcompat.app.AppCompatActivity;
@@ -31,10 +33,6 @@ License, or (at your option) any later version.
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;

import android.view.MenuItem;
import android.view.View;


import com.google.android.material.navigation.NavigationView;

import org.secuso.privacyfriendlypaindiary.R;
@@ -94,7 +92,7 @@ public boolean onNavigationItemSelected(MenuItem item) {

protected boolean goToNavigationItem(final int itemId) {

if(itemId == getNavigationDrawerID()) {
if (itemId == getNavigationDrawerID()) {
// just close drawer because we are already in this activity
mDrawerLayout.closeDrawer(GravityCompat.START);
return true;
@@ -122,7 +120,7 @@ public void run() {

// set active navigation item
private void selectNavigationItem(int itemId) {
for(int i = 0 ; i < mNavigationView.getMenu().size(); i++) {
for (int i = 0; i < mNavigationView.getMenu().size(); i++) {
boolean b = itemId == mNavigationView.getMenu().getItem(i).getItemId();
mNavigationView.getMenu().getItem(i).setChecked(b);
}
@@ -131,6 +129,7 @@ private void selectNavigationItem(int itemId) {
/**
* Enables back navigation for activities that are launched from the NavBar. See
* {@code AndroidManifest.xml} to find out the parent activity names for each activity.
*
* @param intent
*/
private void createBackStack(Intent intent) {
@@ -147,13 +146,14 @@ private void createBackStack(Intent intent) {
/**
* This method manages the behaviour of the navigation drawer
* Add your menu items (ids) to res/menu/activity_main_drawer.xml
*
* @param itemId Item that has been clicked by the user
*/
private void callDrawerItem(final int itemId) {

Intent intent;

switch(itemId) {
switch (itemId) {
case R.id.nav_main:
intent = new Intent(this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
@@ -183,8 +183,8 @@ private void callDrawerItem(final int itemId) {
break;
case R.id.nav_settings:
intent = new Intent(this, SettingsActivity.class);
intent.putExtra( PreferenceActivity.EXTRA_SHOW_FRAGMENT, SettingsActivity.GeneralPreferenceFragment.class.getName() );
intent.putExtra( PreferenceActivity.EXTRA_NO_HEADERS, true );
intent.putExtra(PreferenceActivity.EXTRA_SHOW_FRAGMENT, SettingsActivity.GeneralPreferenceFragment.class.getName());
intent.putExtra(PreferenceActivity.EXTRA_NO_HEADERS, true);
createBackStack(intent);
break;
default:
@@ -196,7 +196,7 @@ protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
if(getSupportActionBar() == null) {
if (getSupportActionBar() == null) {
setSupportActionBar(toolbar);
}

Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ License, or (at your option) any later version.
*/
package org.secuso.privacyfriendlypaindiary.activities;

import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.FragmentManager;
import android.content.DialogInterface;
@@ -60,7 +61,6 @@ License, or (at your option) any later version.
import com.bumptech.glide.request.transition.Transition;

import org.secuso.privacyfriendlypaindiary.R;
import org.secuso.privacyfriendlypaindiary.database.DBServiceInterface;
import org.secuso.privacyfriendlypaindiary.database.entities.enums.BodyRegion;
import org.secuso.privacyfriendlypaindiary.database.entities.enums.Condition;
import org.secuso.privacyfriendlypaindiary.database.entities.enums.PainQuality;
@@ -149,7 +149,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_diaryentry);

if(savedInstanceState != null) {
if (savedInstanceState != null) {
currentPage = savedInstanceState.getInt("current");
}

@@ -1157,6 +1157,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
}


@SuppressLint("MissingSuperCall")
@Override
public void onBackPressed() {
if (changesMade) {
Loading

0 comments on commit 2dd75a7

Please sign in to comment.