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

Commit dd31344a authored by Narinder Rana's avatar Narinder Rana
Browse files

Accent color TABs, New task, Expandable List title

parent 24e42436
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@ import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.core.app.NavUtils;
import androidx.appcompat.app.ActionBar;

import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

+6 −4
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ public class QuickAddDialogFragment extends SupportDialogFragment
    private View mConfirmation;
    private View mContent;

    private View mSaveButton;
    private TextView mSaveButton;
    private View mSaveAndNextButton;

    private TasksListCursorSpinnerAdapter mTaskListAdapter;
@@ -221,7 +221,8 @@ public class QuickAddDialogFragment extends SupportDialogFragment
        }

        mColorBackground = view.findViewById(R.id.color_background);
        mColorBackground.setBackgroundColor(mLastColor);
        mColorBackground.setBackgroundColor(TaskListActivity.ACCENT_COLOR);


        mListSpinner = (Spinner) view.findViewById(R.id.task_list_spinner);
        mTaskListAdapter = new TasksListCursorSpinnerAdapter(getActivity(), R.layout.list_spinner_item_selected_quick_add, R.layout.list_spinner_item_dropdown);
@@ -237,7 +238,8 @@ public class QuickAddDialogFragment extends SupportDialogFragment
        mConfirmation = view.findViewById(R.id.created_confirmation);
        mContent = view.findViewById(R.id.content);

        mSaveButton = view.findViewById(android.R.id.button1);
        mSaveButton = (TextView)view.findViewById(android.R.id.button1);
        mSaveButton.setTextColor(TaskListActivity.ACCENT_COLOR);
        mSaveButton.setOnClickListener(this);
        mSaveAndNextButton = view.findViewById(android.R.id.button2);
        mSaveAndNextButton.setOnClickListener(this);
@@ -326,7 +328,7 @@ public class QuickAddDialogFragment extends SupportDialogFragment
    {
        Cursor c = (Cursor) parent.getItemAtPosition(position);
        mLastColor = TaskFieldAdapters.LIST_COLOR.get(c);
        mColorBackground.setBackgroundColor(mLastColor);
        mColorBackground.setBackgroundColor(TaskListActivity.ACCENT_COLOR);
        mSelectedListId = id;
    }

+4 −1
Original line number Diff line number Diff line
@@ -187,6 +187,7 @@ public class TaskListActivity extends BaseActivity implements TaskListFragment.C
    private AppBarLayout mAppBarLayout;

    private FloatingActionButton mFloatingActionButton;
    public static int ACCENT_COLOR;


    @Override
@@ -270,6 +271,7 @@ public class TaskListActivity extends BaseActivity implements TaskListFragment.C
        mTabs.setupWithViewPager(mViewPager);
        setupTabIcons();


        mViewPager.addOnPageChangeListener(new OnPageChangeListener() {

            @Override
@@ -328,7 +330,8 @@ public class TaskListActivity extends BaseActivity implements TaskListFragment.C
            });
        }

        fetchAccentColor(this);
       ACCENT_COLOR=fetchAccentColor(this);
        mTabs.setBackgroundColor(ACCENT_COLOR);
    }


+16 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.content.SharedPreferences;
import android.database.Cursor;
import android.preference.PreferenceManager;
import android.text.format.Time;
import android.util.Log;

import com.google.android.apps.dashclock.api.DashClockExtension;
import com.google.android.apps.dashclock.api.ExtensionData;
@@ -277,6 +278,7 @@ public class TasksExtension extends DashClockExtension

    private boolean isDueEvent(Cursor c, boolean isAllDay)
    {
        Log.e("TAG", ".......isDueEvent");
        if (c.isNull(c.getColumnIndex(Instances.DUE)))
        {
            return false;
@@ -291,6 +293,7 @@ public class TasksExtension extends DashClockExtension

        if (isAllDay)
        {
            Log.e("TAG", "...........1");
            // get start of today in UTC
            Calendar calendar = Calendar.getInstance();
            calendar.set(Calendar.HOUR_OF_DAY, 0); // clear would not reset the hour of day
@@ -322,6 +325,7 @@ public class TasksExtension extends DashClockExtension

    private Cursor loadPinnedTaskCursor()
    {

        return getContentResolver().query(Instances.getContentUri(mAuthority), INSTANCE_PROJECTION, INSTANCE_PINNED_SELECTION, null,
                Tasks.PRIORITY + " is not null, " + Tasks.PRIORITY + " DESC");
    }
@@ -329,6 +333,8 @@ public class TasksExtension extends DashClockExtension

    private Cursor loadRecentDueTaskCursor()
    {
        Log.e("TAG", ".......loadRecentDueTaskCursor");
        Log.e("TAG", "...........2");
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.HOUR_OF_DAY, RECENT_HOURS); // clear would not reset the hour of day
        long later = calendar.getTimeInMillis();
@@ -340,6 +346,8 @@ public class TasksExtension extends DashClockExtension

    private Cursor loadRecentStartTaskCursor()
    {
        Log.e("TAG", ".......loadRecentStartTaskCursor");
        Log.e("TAG", "...........3");
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.HOUR_OF_DAY, RECENT_HOURS); // clear would not reset the hour of day
        long later = calendar.getTimeInMillis();
@@ -351,6 +359,8 @@ public class TasksExtension extends DashClockExtension

    private Cursor loadRecentStartDueTaskCursor()
    {
        Log.e("TAG", ".......loadRecentStartDueTaskCursor");
        Log.e("TAG", "...........4");
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.HOUR_OF_DAY, RECENT_HOURS); // clear would not reset the hour of day
        long later = calendar.getTimeInMillis();
@@ -363,6 +373,8 @@ public class TasksExtension extends DashClockExtension

    private Cursor loadAllDayTasksDueTodayCursor()
    {
        Log.e("TAG", ".......loadAllDayTasksDueTodayCursor");
        Log.e("TAG", "...........5");
        // get start of today in UTC
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, 0); // clear would not reset the hour of day
@@ -379,6 +391,8 @@ public class TasksExtension extends DashClockExtension

    private Cursor loadAllDayTasksStartTodayCursor()
    {
        Log.e("TAG", ".......loadAllDayTasksStartTodayCursor");
        Log.e("TAG", "...........6");
        // get start of today in UTC
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, 0); // clear would not reset the hour of day
@@ -395,6 +409,8 @@ public class TasksExtension extends DashClockExtension

    private Cursor loadAllDayTasksStartDueTodayCursor()
    {
        Log.e("TAG", ".......loadAllDayTasksStartDueTodayCursor");
        Log.e("TAG", "...........7");
        // get start of today in UTC
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, 0); // clear would not reset the hour of day
+2 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.widget.TextView;
import org.dmfs.jems.optional.elementary.NullSafe;
import org.dmfs.jems.single.combined.Backed;
import org.dmfs.tasks.R;
import org.dmfs.tasks.TaskListActivity;
import org.dmfs.tasks.contract.TaskContract.Instances;
import org.dmfs.tasks.groupings.cursorloaders.TimeRangeCursorFactory;
import org.dmfs.tasks.groupings.cursorloaders.TimeRangeCursorLoaderFactory;
@@ -179,6 +180,7 @@ public class ByDueDate extends AbstractGroupingFactory
            if (title != null)
            {
                title.setText(getTitle(cursor, view.getContext()));
                title.setTextColor(TaskListActivity.ACCENT_COLOR);
            }

            // set list elements
Loading