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

Unverified Commit 43a95177 authored by Marten Gajda's avatar Marten Gajda Committed by GitHub
Browse files

Rework task description/checklist. (#950)

This will make long checklists on marginally faster. So solve the issue properly we'll have to switch to a `RecyclerView`.
parent bcc8a326
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -5,12 +5,18 @@ if (project.hasProperty('PLAY_STORE_SERVICE_ACCOUNT_CREDENTIALS')) {
// commit number is only relevant to the application project
def gitCommitNo = { ref ->
    def stdout = new ByteArrayOutputStream()
    try {
        exec {
            commandLine 'git', 'rev-list', '--count', ref
            standardOutput = stdout
        }

        return Integer.parseInt(stdout.toString().trim())
    }
    catch (Exception e) {
        return 0
    }
}

android {
    compileSdkVersion COMPILE_SDK_VERSION.toInteger()
+2.68 MiB

File added.

No diff preview for this file type.

+1 −0
Original line number Diff line number Diff line
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":78000,"versionName":"1.2.3-4-g8431d4a0-dirty","enabled":true,"outputFile":"opentasks-release.apk","fullName":"release","baseName":"release"},"path":"opentasks-release.apk","properties":{}}]
 No newline at end of file
+21 −1
Original line number Diff line number Diff line
@@ -16,12 +16,15 @@

package org.dmfs.tasks.model;

import androidx.annotation.Nullable;


/**
 * A bloody POJO o_O to store a description/check list item
 */
public final class DescriptionItem
{
    public final boolean checkbox;
    public boolean checkbox;
    public boolean checked;
    public String text;

@@ -32,4 +35,21 @@ public final class DescriptionItem
        this.checked = checked;
        this.text = text;
    }


    @Override
    public boolean equals(@Nullable Object obj)
    {
        return obj instanceof DescriptionItem
                && ((DescriptionItem) obj).checkbox == checkbox
                && ((DescriptionItem) obj).checked == checked
                && ((DescriptionItem) obj).text.equals(text);
    }


    @Override
    public int hashCode()
    {
        return text.hashCode() * 31 + (checkbox ? 1 : 0) + (checked ? 2 : 0);
    }
}
+2 −4
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ package org.dmfs.tasks.model.adapters;

import android.content.ContentValues;
import android.database.Cursor;
import android.text.TextUtils;
import android.util.Log;

import org.dmfs.tasks.model.ContentSet;
import org.dmfs.tasks.model.DescriptionItem;
@@ -140,7 +138,7 @@ public final class DescriptionFieldAdapter extends FieldAdapter<List<Description
        }
        else
        {
            values.put(mFieldName, "");
            values.putNull(mFieldName);
        }

    }
@@ -163,7 +161,7 @@ public final class DescriptionFieldAdapter extends FieldAdapter<List<Description
    private static List<DescriptionItem> parseDescription(String description)
    {
        List<DescriptionItem> result = new ArrayList<DescriptionItem>(16);
        if (TextUtils.isEmpty(description))
        if (description == null)
        {
            return result;
        }
Loading