Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to version 1.3.2 #45

Merged
merged 13 commits into from
Apr 8, 2024
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 {
Expand All @@ -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 ->
Expand All @@ -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()
Expand Down
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
Expand All @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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>

Expand All @@ -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>

Expand All @@ -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
Expand Up @@ -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
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand All @@ -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) {
Expand All @@ -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);
Expand Down Expand Up @@ -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:
Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}

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


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