mirror of
https://github.com/wismna/DoNext.git
synced 2025-10-03 15:40:14 -04:00
First item in recycler view has emphasis
Removed task layout change functionality Moved all informative text to the bottom Priority now shows icons instead of changing text color and weight Corrected bug when editing any item that would replace first item information
This commit is contained in:
@@ -75,22 +75,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
/** Called when the user clicks on the Change Layout button */
|
||||
public void changeLayout(MenuItem item) {
|
||||
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
SharedPreferences.Editor editor = sharedPref.edit();
|
||||
String layoutTypeString = sharedPref.getString("pref_conf_task_layout", "1");
|
||||
int layoutType = Integer.parseInt(layoutTypeString);
|
||||
editor.putString("pref_conf_task_layout", String.valueOf(layoutType % 2 + 1));
|
||||
editor.apply();
|
||||
|
||||
// Update the ViewPagerAdapter to refresh all tabs
|
||||
ViewPager viewPager = getMainFragmentViewPager();
|
||||
if (viewPager != null) {
|
||||
Objects.requireNonNull(viewPager.getAdapter()).notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/** Called when the user clicks the Edit Lists button */
|
||||
public void openTaskLists(MenuItem menuItem) {
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
|
@@ -1,15 +1,12 @@
|
||||
package com.wismna.geoffroy.donext.activities;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -21,6 +18,7 @@ import com.wismna.geoffroy.donext.fragments.TodayFormDialogFragment;
|
||||
import org.joda.time.LocalDate;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
public class TodayActivity extends ToolBarActivityBase
|
||||
implements TodayFormDialogFragment.TodayTaskListener {
|
||||
@@ -66,24 +64,10 @@ public class TodayActivity extends ToolBarActivityBase
|
||||
fab.setEnabled(true);
|
||||
try (TaskDataAccess taskDataAccess = new TaskDataAccess(this)) {
|
||||
RecyclerView recyclerView = findViewById(R.id.task_list_view);
|
||||
((TaskRecyclerViewAdapter)recyclerView.getAdapter()).setItems(taskDataAccess.getTodayTasks());
|
||||
((TaskRecyclerViewAdapter)Objects.requireNonNull(recyclerView.getAdapter())).setItems(taskDataAccess.getTodayTasks());
|
||||
}
|
||||
}
|
||||
|
||||
/** Called when the user clicks on the Change Layout button */
|
||||
public void changeLayout(MenuItem item) {
|
||||
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
SharedPreferences.Editor editor = sharedPref.edit();
|
||||
String layoutTypeString = sharedPref.getString("pref_conf_task_layout", "1");
|
||||
int layoutType = Integer.parseInt(layoutTypeString);
|
||||
editor.putString("pref_conf_task_layout", String.valueOf(layoutType % 2 + 1));
|
||||
editor.apply();
|
||||
|
||||
// TODO: find a less ugly way to refresh the list
|
||||
// Update the ViewPagerAdapter to refresh all tabs
|
||||
this.recreate();
|
||||
}
|
||||
|
||||
public void onNewTaskClick(View view) {
|
||||
TodayFormDialogFragment taskDialogFragment =
|
||||
TodayFormDialogFragment.newInstance(TodayActivity.this);
|
||||
|
@@ -21,48 +21,53 @@ import java.util.List;
|
||||
/**
|
||||
* {@link RecyclerView.Adapter} that can display a {@link Task}.
|
||||
*/
|
||||
public class TaskRecyclerViewAdapter extends RecyclerView.Adapter<TaskRecyclerViewAdapter.SimpleViewHolder> {
|
||||
public class TaskRecyclerViewAdapter extends RecyclerView.Adapter<TaskRecyclerViewAdapter.StandardViewHolder> {
|
||||
|
||||
private List<Task> mValues;
|
||||
private int viewType;
|
||||
private boolean mIsToday;
|
||||
private boolean mIsHistory;
|
||||
|
||||
public TaskRecyclerViewAdapter(List<Task> items, int viewType, boolean isToday) {
|
||||
public TaskRecyclerViewAdapter(List<Task> items, boolean isToday, boolean isHistory) {
|
||||
mValues = items;
|
||||
mIsToday = isToday;
|
||||
this.viewType = viewType;
|
||||
mIsHistory = isHistory;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public SimpleViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view;
|
||||
switch (viewType)
|
||||
{
|
||||
case 2:
|
||||
view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.fragment_task_detailed, parent, false);
|
||||
return new DetailedViewHolder(view);
|
||||
default:
|
||||
view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.fragment_task_simple, parent, false);
|
||||
return new SimpleViewHolder(view);
|
||||
}
|
||||
public StandardViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(viewType, parent, false);
|
||||
return new StandardViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull final SimpleViewHolder holder, int position) {
|
||||
public void onBindViewHolder(@NonNull final StandardViewHolder holder, int position) {
|
||||
// Set basic information
|
||||
holder.mItem = mValues.get(position);
|
||||
holder.mIdView.setText(String.valueOf(holder.mItem.getId()));
|
||||
holder.mCycleView.setText(String.valueOf(holder.mItem.getCycle()));
|
||||
holder.mTitleView.setText(holder.mItem.getName());
|
||||
// Set optional description
|
||||
if (holder instanceof DetailedViewHolder)
|
||||
((DetailedViewHolder)holder).mDescriptionView.setText(holder.mItem.getDescription());
|
||||
holder.mDescriptionView.setText(holder.mItem.getDescription());
|
||||
// Set task rendering
|
||||
holder.mTitleView.setTypeface(Typeface.DEFAULT);
|
||||
holder.mTitleView.setTextColor(Color.BLACK);
|
||||
if (position > 0) {
|
||||
holder.mTitleView.setTypeface(Typeface.DEFAULT);
|
||||
holder.mTitleView.setTextColor(Color.BLACK);
|
||||
}
|
||||
|
||||
// Set priority
|
||||
switch (holder.mItem.getPriority())
|
||||
{
|
||||
case 0:
|
||||
holder.mIconView.setImageResource(R.drawable.ic_low_priority_lightgray_24dp);
|
||||
break;
|
||||
case 2:
|
||||
holder.mIconView.setImageResource(R.drawable.ic_priority_high_red_24dp);
|
||||
break;
|
||||
default:
|
||||
holder.mIconView.setImageDrawable(null);
|
||||
break;
|
||||
}
|
||||
|
||||
// Additional information will not be displayed in Today view
|
||||
if (mIsToday) return;
|
||||
@@ -74,21 +79,7 @@ public class TaskRecyclerViewAdapter extends RecyclerView.Adapter<TaskRecyclerVi
|
||||
holder.mIconView.setImageResource(R.drawable.ic_close_light);
|
||||
else if(dueDate != null && dueDate.isBefore(LocalDate.now()))
|
||||
holder.mIconView.setImageResource(R.drawable.ic_access_alarm);
|
||||
int priority = holder.mItem.getPriority();
|
||||
|
||||
// Set priority
|
||||
switch (priority)
|
||||
{
|
||||
case 0:
|
||||
holder.mTitleView.setTextColor(Color.LTGRAY);
|
||||
break;
|
||||
case 2:
|
||||
holder.mTitleView.setTypeface(holder.mTitleView.getTypeface(), Typeface.BOLD);
|
||||
break;
|
||||
default:
|
||||
// No special styles to apply
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -103,7 +94,8 @@ public class TaskRecyclerViewAdapter extends RecyclerView.Adapter<TaskRecyclerVi
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return viewType;
|
||||
if (position == 0 && !mIsHistory) return R.layout.fragment_task_first;
|
||||
return R.layout.fragment_task_detailed;
|
||||
}
|
||||
|
||||
public void add(Task item, int position) {
|
||||
@@ -138,15 +130,16 @@ public class TaskRecyclerViewAdapter extends RecyclerView.Adapter<TaskRecyclerVi
|
||||
return mValues.get(position);
|
||||
}
|
||||
|
||||
class SimpleViewHolder extends RecyclerView.ViewHolder {
|
||||
class StandardViewHolder extends RecyclerView.ViewHolder {
|
||||
final View mView;
|
||||
final TextView mIdView;
|
||||
final ImageView mIconView;
|
||||
final TextView mCycleView;
|
||||
final TextView mTitleView;
|
||||
final TextView mDescriptionView;
|
||||
Task mItem;
|
||||
|
||||
SimpleViewHolder(View view) {
|
||||
StandardViewHolder(View view) {
|
||||
super(view);
|
||||
mView = view;
|
||||
|
||||
@@ -154,22 +147,10 @@ public class TaskRecyclerViewAdapter extends RecyclerView.Adapter<TaskRecyclerVi
|
||||
mIconView = view.findViewById(R.id.task_icon);
|
||||
mCycleView = view.findViewById(R.id.task_cycle);
|
||||
mTitleView = view.findViewById(R.id.task_name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + " '" + mTitleView.getText() + "'";
|
||||
}
|
||||
}
|
||||
|
||||
private class DetailedViewHolder extends SimpleViewHolder {
|
||||
private final TextView mDescriptionView;
|
||||
|
||||
private DetailedViewHolder(View view) {
|
||||
super(view);
|
||||
mDescriptionView = view.findViewById(R.id.task_description);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + " '" + mTitleView.getText() + "'";
|
||||
|
@@ -38,12 +38,12 @@ import com.wismna.geoffroy.donext.database.TaskDataAccess;
|
||||
import com.wismna.geoffroy.donext.database.TaskListDataAccess;
|
||||
import com.wismna.geoffroy.donext.helpers.TaskTouchHelper;
|
||||
import com.wismna.geoffroy.donext.listeners.RecyclerItemClickListener;
|
||||
import com.wismna.geoffroy.donext.widgets.DividerItemDecoration;
|
||||
import com.wismna.geoffroy.donext.widgets.NoScrollingLayoutManager;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A fragment representing a list of Items.
|
||||
@@ -106,14 +106,10 @@ public class TasksFragment extends Fragment implements
|
||||
recyclerView = view.findViewById(R.id.task_list_view);
|
||||
recyclerView.setLayoutManager(isHistory ? new LinearLayoutManager(context) : new NoScrollingLayoutManager(context));
|
||||
|
||||
// Set RecyclerView Adapter
|
||||
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
|
||||
// Get all tasks
|
||||
try (TaskDataAccess taskDataAccess = new TaskDataAccess(view.getContext())) {
|
||||
taskRecyclerViewAdapter = new TaskRecyclerViewAdapter(
|
||||
isTodayView? taskDataAccess.getTodayTasks() : taskDataAccess.getAllTasksFromList(taskListId, isHistory),
|
||||
Integer.valueOf(sharedPref.getString("pref_conf_task_layout", "1")), isTodayView);
|
||||
isTodayView? taskDataAccess.getTodayTasks() : taskDataAccess.getAllTasksFromList(taskListId, isHistory), isTodayView, isHistory);
|
||||
}
|
||||
recyclerView.setAdapter(taskRecyclerViewAdapter);
|
||||
|
||||
@@ -142,13 +138,14 @@ public class TasksFragment extends Fragment implements
|
||||
args.putString("button_negative",
|
||||
isHistory ? getString(R.string.task_list_ok) : getString(R.string.new_task_cancel));
|
||||
args.putString("button_neutral", getString(R.string.new_task_delete));
|
||||
args.putInt("position", position);
|
||||
|
||||
// Set current tab value to new task dialog
|
||||
ViewPager viewPager = getActivity().findViewById(R.id.container);
|
||||
ViewPager viewPager = Objects.requireNonNull(getActivity()).findViewById(R.id.container);
|
||||
List<TaskList> taskLists;
|
||||
Task task = taskRecyclerViewAdapter.getItem(position);
|
||||
if (viewPager != null) {
|
||||
taskLists = ((SectionsPagerAdapter) viewPager.getAdapter()).getAllItems();
|
||||
taskLists = ((SectionsPagerAdapter) Objects.requireNonNull(viewPager.getAdapter())).getAllItems();
|
||||
args.putInt("list", viewPager.getCurrentItem());
|
||||
}
|
||||
else {
|
||||
@@ -215,7 +212,7 @@ public class TasksFragment extends Fragment implements
|
||||
// Update remaining tasks - only when needed
|
||||
TextView remainingTasksView = view.findViewById(R.id.remaining_task_count);
|
||||
NoScrollingLayoutManager noScrollingLayoutManager = (NoScrollingLayoutManager)layoutManager;
|
||||
int remainingTaskCount = totalTasks - noScrollingLayoutManager.findLastVisibleItemPosition() - 1;
|
||||
int remainingTaskCount = totalTasks - (noScrollingLayoutManager != null ? noScrollingLayoutManager.findLastVisibleItemPosition() : 1) - 1;
|
||||
if (remainingTaskCount == 0) remainingTasksView.setText("");
|
||||
else remainingTasksView.setText(resources.getQuantityString(R.plurals.task_remaining, remainingTaskCount, remainingTaskCount));
|
||||
|
||||
@@ -223,7 +220,7 @@ public class TasksFragment extends Fragment implements
|
||||
}
|
||||
});
|
||||
|
||||
recyclerView.addItemDecoration(new DividerItemDecoration(getActivity()));
|
||||
//recyclerView.addItemDecoration(new DividerItemDecoration(getActivity()));
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -319,8 +316,7 @@ public class TasksFragment extends Fragment implements
|
||||
}
|
||||
// Update the task
|
||||
else {
|
||||
assert args != null;
|
||||
int position = args.getInt("position");
|
||||
int position = args != null ? args.getInt("position") : 0;
|
||||
// Check if task list was changed
|
||||
if ((isTodayView && !isToday) || (!isTodayView && task.getTaskListId() != taskList.getId()))
|
||||
{
|
||||
@@ -356,7 +352,10 @@ public class TasksFragment extends Fragment implements
|
||||
confirmArgs.putInt("ItemPosition", itemPosition);
|
||||
confirmArgs.putInt("Direction", -1);
|
||||
confirmDialogFragment.setArguments(confirmArgs);
|
||||
confirmDialogFragment.show(getFragmentManager(), title);
|
||||
FragmentManager fragmentManager = getFragmentManager();
|
||||
if (fragmentManager != null) {
|
||||
confirmDialogFragment.show(fragmentManager, title);
|
||||
}
|
||||
}
|
||||
else {
|
||||
PerformTaskAction(itemPosition, -1);
|
||||
@@ -394,7 +393,10 @@ public class TasksFragment extends Fragment implements
|
||||
args.putInt("ItemPosition", itemPosition);
|
||||
args.putInt("Direction", direction);
|
||||
confirmDialogFragment.setArguments(args);
|
||||
confirmDialogFragment.show(getFragmentManager(), title);
|
||||
FragmentManager fragmentManager = getFragmentManager();
|
||||
if (fragmentManager != null) {
|
||||
confirmDialogFragment.show(fragmentManager, title);
|
||||
}
|
||||
}
|
||||
else PerformTaskAction(itemPosition, direction);
|
||||
}
|
||||
@@ -430,6 +432,7 @@ public class TasksFragment extends Fragment implements
|
||||
}
|
||||
|
||||
// Setup the snack bar
|
||||
// TODO: use the main activity view instead
|
||||
snackbar = Snackbar.make(view, resources.getString(R.string.snackabar_label, action), Snackbar.LENGTH_LONG)
|
||||
.setAction(resources.getString(R.string.snackabar_button), new View.OnClickListener() {
|
||||
@Override
|
||||
|
@@ -4,6 +4,7 @@ import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Rect;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.helper.ItemTouchHelper;
|
||||
import android.text.Layout;
|
||||
@@ -35,7 +36,7 @@ public class TaskTouchHelper extends ItemTouchHelper.SimpleCallback {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSwipeDirs(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
|
||||
public int getSwipeDirs(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) {
|
||||
// Allow both directions swiping on first item, only left on the others
|
||||
if (viewHolder.getAdapterPosition() == 0)
|
||||
return ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT;
|
||||
@@ -43,17 +44,17 @@ public class TaskTouchHelper extends ItemTouchHelper.SimpleCallback {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
|
||||
public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
|
||||
public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int direction) {
|
||||
mAdapter.onItemSwiped(viewHolder.getAdapterPosition(), direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder,
|
||||
public void onChildDraw(@NonNull Canvas c, @NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder,
|
||||
float dX, float dY, int actionState, boolean isCurrentlyActive) {
|
||||
// Get RecyclerView item from the ViewHolder
|
||||
View itemView = viewHolder.itemView;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.wismna.geoffroy.donext.listeners;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.MotionEvent;
|
||||
@@ -30,7 +31,7 @@ public class RecyclerItemClickListener implements RecyclerView.OnItemTouchListen
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(RecyclerView view, MotionEvent e) {
|
||||
public boolean onInterceptTouchEvent(@NonNull RecyclerView view, @NonNull MotionEvent e) {
|
||||
View childView = view.findChildViewUnder(e.getX(), e.getY());
|
||||
if (childView != null && mListener != null && mGestureDetector.onTouchEvent(e)) {
|
||||
mListener.onItemClick(childView, view.getChildAdapterPosition(childView));
|
||||
@@ -40,7 +41,7 @@ public class RecyclerItemClickListener implements RecyclerView.OnItemTouchListen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouchEvent(RecyclerView view, MotionEvent motionEvent) {
|
||||
public void onTouchEvent(@NonNull RecyclerView view, @NonNull MotionEvent motionEvent) {
|
||||
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
|
||||
@@ -34,7 +35,7 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration {
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
|
||||
public void onDraw(@NonNull Canvas c, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||
int left = parent.getPaddingLeft();
|
||||
int right = parent.getWidth() - parent.getPaddingRight();
|
||||
|
||||
|
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#899AB5"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M14,5h8v2h-8zM14,10.5h8v2h-8zM14,16h8v2h-8zM2,11.5C2,15.08 4.92,18 8.5,18L9,18v2l3,-3 -3,-3v2h-0.5C6.02,16 4,13.98 4,11.5S6.02,7 8.5,7L12,7L12,5L8.5,5C4.92,5 2,7.92 2,11.5z"/>
|
||||
</vector>
|
6
app/src/main/res/drawable/ic_priority_high_red_24dp.xml
Normal file
6
app/src/main/res/drawable/ic_priority_high_red_24dp.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<vector android:height="24dp" android:tint="#B5151A"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M12,19m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"/>
|
||||
<path android:fillColor="#FF000000" android:pathData="M10,3h4v12h-4z"/>
|
||||
</vector>
|
@@ -19,7 +19,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:layout_margin="16dp"
|
||||
android:onClick="onNewTaskClick"
|
||||
android:src="@drawable/ic_add" />
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
android:id="@+id/task_cycle"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_margin="10dp"
|
||||
android:textAppearance="?attr/textAppearanceListItem" />
|
||||
<TextView
|
||||
android:id="@+id/task_id"
|
||||
|
49
app/src/main/res/layout/fragment_task_first.xml
Normal file
49
app/src/main/res/layout/fragment_task_first.xml
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:paddingTop="5dp"
|
||||
android:orientation="horizontal"
|
||||
android:focusable="true"
|
||||
android:background="@color/colorPrimaryLight" >
|
||||
<TextView
|
||||
android:id="@+id/task_cycle"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_gravity="center"
|
||||
android:textAppearance="?attr/textAppearanceListItem" />
|
||||
<TextView
|
||||
android:id="@+id/task_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone" />
|
||||
<ImageView
|
||||
android:id="@+id/task_icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="10dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:contentDescription="@string/task_alarm"/>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/task_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/colorAccent"
|
||||
android:textAppearance="?attr/textAppearanceListItem" />
|
||||
<TextView
|
||||
android:id="@+id/task_description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:maxLines="4"
|
||||
android:textSize="16sp"
|
||||
android:textAppearance="?attr/textAppearanceListItemSmall" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
@@ -6,15 +6,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/task_select" >
|
||||
<TextView
|
||||
android:id="@+id/total_task_cycles"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView
|
||||
android:id="@+id/total_task_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|center"/>
|
||||
<TextView
|
||||
android:id="@+id/no_more_tasks"
|
||||
android:text="@string/task_no_tasks"
|
||||
@@ -42,10 +33,7 @@
|
||||
android:id="@+id/task_list_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:layout_marginBottom="70dp"
|
||||
android:name="com.wismna.geoffroy.donext.activities.TaskFragment"
|
||||
app:layoutManager="LinearLayoutManager"
|
||||
tools:context=".fragments.TasksFragment"
|
||||
@@ -81,9 +69,40 @@
|
||||
android:textColor="@android:color/white"
|
||||
android:visibility="gone"/>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:id="@+id/remaining_task_count"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|center"/>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="70dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/colorPrimaryLight"/>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginTop="5dp"
|
||||
android:paddingTop="15dp"
|
||||
android:orientation="horizontal"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground" >
|
||||
<TextView
|
||||
android:id="@+id/total_task_cycles"
|
||||
android:layout_width="100dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground" >
|
||||
<TextView
|
||||
android:id="@+id/total_task_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView
|
||||
android:id="@+id/remaining_task_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
@@ -2,30 +2,17 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".activities.MainActivity">
|
||||
<!--<item
|
||||
android:id="@+id/action_newTask"
|
||||
android:orderInCategory="10"
|
||||
android:title="@string/action_new_task"
|
||||
android:onClick="openNewTaskDialog"
|
||||
app:showAsAction="never" />-->
|
||||
<item
|
||||
android:id="@+id/action_todayList"
|
||||
android:orderInCategory="15"
|
||||
android:orderInCategory="05"
|
||||
android:title="@string/action_todayList"
|
||||
android:onClick="showTodayList"
|
||||
android:icon="@drawable/ic_today_dark"
|
||||
android:visible="false"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/action_changeLayout"
|
||||
android:orderInCategory="20"
|
||||
android:title="@string/action_changeLayout"
|
||||
android:onClick="changeLayout"
|
||||
android:icon="@drawable/ic_format_size_dark"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/action_editTabs"
|
||||
android:orderInCategory="25"
|
||||
android:orderInCategory="15"
|
||||
android:title="@string/action_editTabs"
|
||||
android:onClick="openTaskLists"
|
||||
android:icon="@drawable/ic_list_white_24dp"
|
||||
|
@@ -1,11 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item
|
||||
android:id="@+id/action_changeLayout"
|
||||
android:orderInCategory="20"
|
||||
android:title="@string/action_changeLayout"
|
||||
android:onClick="changeLayout"
|
||||
android:icon="@drawable/ic_format_size_dark"
|
||||
app:showAsAction="always" />
|
||||
</menu>
|
@@ -2,6 +2,7 @@
|
||||
<resources>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorPrimaryLight">#dde2ff</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
<color name="ic_launcher_background">@color/colorPrimaryDark</color>
|
||||
</resources>
|
||||
|
@@ -74,7 +74,7 @@
|
||||
<string name="donext_description">DoNext is a new kind of task manager, based on the premise that creating too many tasks is counterproductive. Instead, swipe tasks left and right to push them back to the bottom of your backlog to work on them at a later time!</string>
|
||||
<string name="about_version_donext">DoNext version %s</string>
|
||||
<string name="about_version_android">Android version %d</string>
|
||||
<string name="about_link" translatable="false">https://github.com/wismna</string>
|
||||
<string name="about_link" translatable="false">https://wismna.github.io/DoNext/</string>
|
||||
|
||||
<!-- Strings related to Today -->
|
||||
<string name="title_activity_today">Today</string>
|
||||
@@ -84,7 +84,7 @@
|
||||
<string name="action_today_select">Select tasks</string>
|
||||
<string name="task_list_edit_list_hint">List name</string>
|
||||
<string name="incompatible_sdk_version">Sorry, your Android version is not supported.</string>
|
||||
<string name="today_no_tasks">Noting to do today</string>
|
||||
<string name="today_no_tasks">Nothing to do today</string>
|
||||
<string name="today_create_tasks">Add some tasks there</string>
|
||||
|
||||
<!-- String related to History -->
|
||||
|
Reference in New Issue
Block a user