Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9fc9ffb0 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Merge branch '3833-master-upgrade_fixes' into 'master'

Miscellaneous fixes for tasks app

See merge request !34
parents 77839532 c90674b7
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ cache:
build:
  stage: build
  script:
    - ./gradlew assemble
    - ./gradlew assemble lint
  artifacts:
    paths:
      - opentasks/build/outputs/apk/
+2 −2
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ public class RelationHandler extends PropertyHandler {
        if (values.containsKey(Relation.RELATED_TYPE)) {
            type = values.getAsInteger(Relation.RELATED_TYPE);
        } else {
            type = oldValues.getInt(oldValues.getColumnIndex(Relation.RELATED_TYPE));
            type = oldValues.getInt(oldValues.getColumnIndexOrThrow(Relation.RELATED_TYPE));
        }

        if (type == Relation.RELTYPE_PARENT) {
@@ -194,7 +194,7 @@ public class RelationHandler extends PropertyHandler {
     * @param oldValues
     */
    private void clearParentId(SQLiteDatabase db, long taskId, Cursor oldValues) {
        int type = oldValues.getInt(oldValues.getColumnIndex(Relation.RELATED_TYPE));
        int type = oldValues.getInt(oldValues.getColumnIndexOrThrow(Relation.RELATED_TYPE));

        /*
         * This is more complicated than it may sound. We don't know the order in which
+6 −2
Original line number Diff line number Diff line
@@ -14,8 +14,8 @@ android {
        applicationId "foundation.e.tasks"
        minSdkVersion 21
        targetSdkVersion 36
        versionCode 7000
        versionName '1.4.2'
        versionCode 7001
        versionName '1.4.3'
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
@@ -54,6 +54,10 @@ android {
        exclude 'META-INF/LICENSE'
    }

    lint {
        disable 'MissingTranslation'
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_21
        targetCompatibility JavaVersion.VERSION_21
+5 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@
    <uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
    <uses-permission
        android:name="android.permission.USE_EXACT_ALARM"
        tools:ignore="ExactAlarm" />

    <application
        android:name=".TasksApplication"
@@ -23,6 +27,7 @@
        android:label="@string/app_name"
        android:supportsRtl="false"
        android:taskAffinity="org.dmfs.tasks.TaskListActivity"
        android:enableOnBackInvokedCallback="false"
        android:theme="@style/OpenTasks_Theme.Default">

        <!-- TaskListActivity listens for MAIN intents -->
+14 −9
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.view.Menu;
import android.view.MenuItem;

import androidx.activity.OnBackPressedCallback;
import androidx.appcompat.app.ActionBar;
import androidx.core.app.NavUtils;
import androidx.core.content.ContextCompat;
@@ -58,6 +60,18 @@ public class EditTaskActivity extends BaseActivity {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_task_editor);

        getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(true) {
            @Override
            public void handleOnBackPressed() {
                if (mEditFragment != null) {
                    mEditFragment.saveAndExit();
                }

                setEnabled(false);
                getOnBackPressedDispatcher().onBackPressed();
            }
        });

        mAuthority = AuthorityUtil.taskAuthority(this);

        // hide up button in action bar
@@ -159,15 +173,6 @@ public class EditTaskActivity extends BaseActivity {
        return true;
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();

        if (mEditFragment != null) {
            mEditFragment.saveAndExit();
        }
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
Loading