mirror of
https://github.com/wismna/DoNext.git
synced 2025-10-03 15:40:14 -04:00
New and Edit tasks is now full screen fragment like on phones, dialog like on tablets
Code cleanup
This commit is contained in:
@@ -174,7 +174,6 @@ public class MainActivity extends AppCompatActivity implements TasksFragment.Tas
|
|||||||
int id = item.getItemId();
|
int id = item.getItemId();
|
||||||
|
|
||||||
return id == R.id.action_settings || super.onOptionsItemSelected(item);
|
return id == R.id.action_settings || super.onOptionsItemSelected(item);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -194,6 +193,7 @@ public class MainActivity extends AppCompatActivity implements TasksFragment.Tas
|
|||||||
// Set current tab value to new task dialog
|
// Set current tab value to new task dialog
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putInt("list", currentTabPosition);
|
args.putInt("list", currentTabPosition);
|
||||||
|
args.putBoolean("layout", mIsLargeLayout);
|
||||||
taskDialogFragment.setArguments(args);
|
taskDialogFragment.setArguments(args);
|
||||||
|
|
||||||
if (mIsLargeLayout)
|
if (mIsLargeLayout)
|
||||||
|
@@ -13,11 +13,11 @@ import android.view.View;
|
|||||||
import com.wismna.geoffroy.donext.R;
|
import com.wismna.geoffroy.donext.R;
|
||||||
|
|
||||||
public class ConfirmDialogFragment extends DialogFragment {
|
public class ConfirmDialogFragment extends DialogFragment {
|
||||||
public interface ConfirmDialogListener {
|
interface ConfirmDialogListener {
|
||||||
void onConfirmDialogClick(DialogFragment dialog, ButtonEvent event);
|
void onConfirmDialogClick(DialogFragment dialog, ButtonEvent event);
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ButtonEvent{
|
enum ButtonEvent{
|
||||||
YES,
|
YES,
|
||||||
NO
|
NO
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
package com.wismna.geoffroy.donext.fragments;
|
package com.wismna.geoffroy.donext.fragments;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
@@ -14,9 +16,9 @@ import android.view.MenuInflater;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.Window;
|
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Button;
|
||||||
import android.widget.DatePicker;
|
import android.widget.DatePicker;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
@@ -44,7 +46,7 @@ public class TaskDialogFragment extends DialogFragment {
|
|||||||
* implement this interface in order to receive event callbacks.
|
* implement this interface in order to receive event callbacks.
|
||||||
* Each method passes the DialogFragment in case the host needs to query it. */
|
* Each method passes the DialogFragment in case the host needs to query it. */
|
||||||
interface NewTaskListener {
|
interface NewTaskListener {
|
||||||
void onNewTaskDialogPositiveClick(DialogFragment dialog);
|
void onNewTaskDialogPositiveClick(DialogFragment dialog, View dialogView);
|
||||||
void onNewTaskDialogNeutralClick(DialogFragment dialog);
|
void onNewTaskDialogNeutralClick(DialogFragment dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,12 +54,10 @@ public class TaskDialogFragment extends DialogFragment {
|
|||||||
private NewTaskListener mListener;
|
private NewTaskListener mListener;
|
||||||
private Task task;
|
private Task task;
|
||||||
private List<TaskList> taskLists;
|
private List<TaskList> taskLists;
|
||||||
|
private boolean isLargeLayout;
|
||||||
|
|
||||||
public static TaskDialogFragment newInstance(Task task, List<TaskList> taskLists, NewTaskListener newTaskListener) {
|
public static TaskDialogFragment newInstance(Task task, List<TaskList> taskLists, NewTaskListener newTaskListener) {
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
|
||||||
TaskDialogFragment fragment = new TaskDialogFragment();
|
TaskDialogFragment fragment = new TaskDialogFragment();
|
||||||
fragment.setArguments(args);
|
|
||||||
fragment.task = task;
|
fragment.task = task;
|
||||||
fragment.taskLists = taskLists;
|
fragment.taskLists = taskLists;
|
||||||
fragment.mListener = newTaskListener;
|
fragment.mListener = newTaskListener;
|
||||||
@@ -65,35 +65,137 @@ public class TaskDialogFragment extends DialogFragment {
|
|||||||
return fragment;
|
return fragment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
isLargeLayout = getArguments().getBoolean("layout");
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.fragment_task_form, container, false);
|
if (!isLargeLayout) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_task_form, container, false);
|
||||||
|
AppCompatActivity activity = (AppCompatActivity) getActivity();
|
||||||
|
activity.setSupportActionBar(setToolbarTitle(view));
|
||||||
|
|
||||||
Toolbar toolbar = (Toolbar) view.findViewById(R.id.new_task_toolbar);
|
ActionBar actionBar = activity.getSupportActionBar();
|
||||||
|
if (actionBar != null) {
|
||||||
((AppCompatActivity) getActivity()).setSupportActionBar(toolbar);
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
|
actionBar.setHomeButtonEnabled(true);
|
||||||
ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
|
actionBar.setHomeAsUpIndicator(android.R.drawable.ic_menu_close_clear_cancel);
|
||||||
if (actionBar != null) {
|
}
|
||||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
setHasOptionsMenu(true);
|
||||||
actionBar.setHomeButtonEnabled(true);
|
setTaskValues(view);
|
||||||
actionBar.setHomeAsUpIndicator(android.R.drawable.ic_menu_close_clear_cancel);
|
return view;
|
||||||
}
|
}
|
||||||
setHasOptionsMenu(true);
|
return super.onCreateView(inflater, container, savedInstanceState);
|
||||||
// Inflate and set the layout for the dialog
|
}
|
||||||
// Pass null as the parent view because its going in the dialog layout
|
|
||||||
/*builder.setView(view)
|
|
||||||
// Add action buttons
|
|
||||||
.setPositiveButton(R.string.new_task_save, null)
|
|
||||||
.setNegativeButton(R.string.new_task_cancel, new DialogInterface.OnClickListener() {
|
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
|
||||||
// Send the negative button event back to the host activity
|
|
||||||
// Canceled creation, nothing to do
|
|
||||||
TaskDialogFragment.this.getDialog().cancel();
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@NonNull
|
||||||
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
|
// Inflate and set the layout for the dialog
|
||||||
|
LayoutInflater inflater = getActivity().getLayoutInflater();
|
||||||
|
View view = inflater.inflate(R.layout.fragment_task_form, null);
|
||||||
|
setToolbarTitle(view);
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||||
|
// Pass null as the parent view because its going in the dialog layout
|
||||||
|
builder.setView(view)
|
||||||
|
//.setTitle(getString(task == null ? R.string.action_new_task : R.string.action_edit_task))
|
||||||
|
// Add action buttons
|
||||||
|
.setPositiveButton(R.string.new_task_save, null)
|
||||||
|
.setNegativeButton(R.string.new_task_cancel, new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
// Send the negative button event back to the host activity
|
||||||
|
// Canceled creation, nothing to do
|
||||||
|
TaskDialogFragment.this.getDialog().cancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (task != null) {
|
||||||
|
builder.setNeutralButton(R.string.new_task_delete, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
mListener.onNewTaskDialogNeutralClick(TaskDialogFragment.this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setTaskValues(view);
|
||||||
|
return builder.create();
|
||||||
|
//Dialog dialog = super.onCreateDialog(savedInstanceState);
|
||||||
|
//dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
//return dialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
|
||||||
|
Dialog dialog = getDialog();
|
||||||
|
if(dialog != null && dialog instanceof AlertDialog/* && isLargeLayout*/)
|
||||||
|
{
|
||||||
|
AlertDialog d = (AlertDialog) dialog;
|
||||||
|
Button positiveButton = d.getButton(Dialog.BUTTON_POSITIVE);
|
||||||
|
positiveButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
onSaveClickListener(v.getRootView());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||||
|
//super.onCreateOptionsMenu(menu, inflater);
|
||||||
|
menu.clear();
|
||||||
|
getActivity().getMenuInflater().inflate(R.menu.menu_new_task, menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPrepareOptionsMenu(Menu menu) {
|
||||||
|
if (task == null) {
|
||||||
|
menu.removeItem(R.id.menu_new_task_delete);
|
||||||
|
}
|
||||||
|
super.onPrepareOptionsMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
int id = item.getItemId();
|
||||||
|
|
||||||
|
if (id == R.id.menu_new_task_save) {
|
||||||
|
onSaveClickListener(getView());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (id == R.id.menu_new_task_delete) {
|
||||||
|
// handle confirmation button click here
|
||||||
|
mListener.onNewTaskDialogNeutralClick(TaskDialogFragment.this);
|
||||||
|
dismiss();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (id == android.R.id.home) {
|
||||||
|
// handle close button click here
|
||||||
|
dismiss();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
dismiss();
|
||||||
|
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroyView() {
|
||||||
|
Dialog dialog = getDialog();
|
||||||
|
// Stop the dialog from being dismissed on rotation, due to a bug with the compatibility library
|
||||||
|
// https://code.google.com/p/android/issues/detail?id=17423
|
||||||
|
if (dialog != null && getRetainInstance()) {
|
||||||
|
dialog.setDismissMessage(null);
|
||||||
|
}
|
||||||
|
super.onDestroyView();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setTaskValues(View view) {
|
||||||
// Get date picker
|
// Get date picker
|
||||||
final DatePicker dueDatePicker = (DatePicker) view.findViewById(R.id.new_task_due_date);
|
final DatePicker dueDatePicker = (DatePicker) view.findViewById(R.id.new_task_due_date);
|
||||||
|
|
||||||
@@ -129,7 +231,6 @@ public class TaskDialogFragment extends DialogFragment {
|
|||||||
|
|
||||||
// Set other properties if they exist
|
// Set other properties if they exist
|
||||||
if (task != null) {
|
if (task != null) {
|
||||||
toolbar.setTitle(R.string.action_edit_task);
|
|
||||||
|
|
||||||
EditText titleText = (EditText) view.findViewById(R.id.new_task_name);
|
EditText titleText = (EditText) view.findViewById(R.id.new_task_name);
|
||||||
titleText.setText(task.getName());
|
titleText.setText(task.getName());
|
||||||
@@ -141,114 +242,41 @@ public class TaskDialogFragment extends DialogFragment {
|
|||||||
// Set Due Date
|
// Set Due Date
|
||||||
LocalDate dueDate = task.getDueDate();
|
LocalDate dueDate = task.getDueDate();
|
||||||
dueDatePicker.updateDate(dueDate.getYear(), dueDate.getMonthOfYear() - 1, dueDate.getDayOfMonth());
|
dueDatePicker.updateDate(dueDate.getYear(), dueDate.getMonthOfYear() - 1, dueDate.getDayOfMonth());
|
||||||
|
|
||||||
// Add the Delete button
|
|
||||||
/* builder.setNeutralButton(R.string.new_task_delete, new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
|
||||||
mListener.onNewTaskDialogNeutralClick(TaskDialogFragment.this);
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
toolbar.setTitle(R.string.action_new_task);
|
|
||||||
// Disallow past dates on new tasks
|
// Disallow past dates on new tasks
|
||||||
dueDatePicker.setMinDate(LocalDate.now().toDate().getTime());
|
dueDatePicker.setMinDate(LocalDate.now().toDate().getTime());
|
||||||
}
|
}
|
||||||
return view;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private Toolbar setToolbarTitle(View view) {
|
||||||
@NonNull
|
Toolbar toolbar = (Toolbar) view.findViewById(R.id.new_task_toolbar);
|
||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
|
||||||
Dialog dialog = super.onCreateDialog(savedInstanceState);
|
|
||||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
|
||||||
return dialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStart() {
|
|
||||||
super.onStart();
|
|
||||||
|
|
||||||
final Dialog d = (Dialog) getDialog();
|
|
||||||
if(d != null)
|
|
||||||
{
|
|
||||||
//d.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
|
||||||
/*Button positiveButton = d.getButton(Dialog.BUTTON_POSITIVE);
|
|
||||||
positiveButton.setOnClickListener(new View.OnClickListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onClick(View v)
|
|
||||||
{
|
|
||||||
EditText titleText = (EditText) d.findViewById(R.id.new_task_name);
|
|
||||||
if (titleText.getText().toString().matches(""))
|
|
||||||
titleText.setError(getResources().getString(R.string.new_task_name_error));
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Send the positive button event back to the host activity
|
|
||||||
mListener.onNewTaskDialogPositiveClick(TaskDialogFragment.this);
|
|
||||||
dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
|
||||||
//super.onCreateOptionsMenu(menu, inflater);
|
|
||||||
menu.clear();
|
|
||||||
getActivity().getMenuInflater().inflate(R.menu.menu_new_task, menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPrepareOptionsMenu(Menu menu) {
|
|
||||||
if (task == null) {
|
if (task == null) {
|
||||||
menu.removeItem(R.id.menu_new_task_delete);
|
toolbar.setTitle(R.string.action_new_task);
|
||||||
}
|
}
|
||||||
super.onPrepareOptionsMenu(menu);
|
else {
|
||||||
|
toolbar.setTitle(R.string.action_edit_task);
|
||||||
|
}
|
||||||
|
return toolbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private void onSaveClickListener(View view) {
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
/*if (source == null) return;
|
||||||
int id = item.getItemId();
|
EditText titleText = null;
|
||||||
|
if (source instanceof View)
|
||||||
if (id == R.id.menu_new_task_save) {
|
titleText = (EditText) ((View)source).findViewById(R.id.new_task_name);
|
||||||
EditText titleText = (EditText) getView().findViewById(R.id.new_task_name);
|
if (source instanceof AlertDialog)
|
||||||
// handle confirmation button click hereEditText titleText = (EditText) d.findViewById(R.id.new_task_name);
|
titleText = (EditText) ((AlertDialog)source).findViewById(R.id.new_task_name);
|
||||||
if (titleText.getText().toString().matches(""))
|
if (titleText == null) return;*/
|
||||||
titleText.setError(getResources().getString(R.string.new_task_name_error));
|
if (view == null) return;
|
||||||
else {
|
EditText titleText = (EditText) view.findViewById(R.id.new_task_name);
|
||||||
// Send the positive button event back to the host activity
|
// handle confirmation button click hereEditText titleText = (EditText) d.findViewById(R.id.new_task_name);
|
||||||
mListener.onNewTaskDialogPositiveClick(TaskDialogFragment.this);
|
if (titleText.getText().toString().matches(""))
|
||||||
dismiss();
|
titleText.setError(getResources().getString(R.string.new_task_name_error));
|
||||||
}
|
else {
|
||||||
return true;
|
// Send the positive button event back to the host activity
|
||||||
}
|
mListener.onNewTaskDialogPositiveClick(TaskDialogFragment.this, view);
|
||||||
else if (id == R.id.menu_new_task_delete) {
|
|
||||||
// handle confirmation button click here
|
|
||||||
mListener.onNewTaskDialogNeutralClick(TaskDialogFragment.this);
|
|
||||||
dismiss();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (id == android.R.id.home) {
|
|
||||||
// handle close button click here
|
|
||||||
dismiss();
|
dismiss();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
dismiss();
|
|
||||||
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroyView() {
|
|
||||||
Dialog dialog = getDialog();
|
|
||||||
// Stop the dialog from being dismissed on rotation, due to a bug with the compatibility library
|
|
||||||
// https://code.google.com/p/android/issues/detail?id=17423
|
|
||||||
if (dialog != null && getRetainInstance()) {
|
|
||||||
dialog.setDismissMessage(null);
|
|
||||||
}
|
|
||||||
super.onDestroyView();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -129,6 +129,7 @@ public class TasksFragment extends Fragment implements
|
|||||||
public void onItemClick(View view, int position) {
|
public void onItemClick(View view, int position) {
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putInt("position", position);
|
args.putInt("position", position);
|
||||||
|
args.putBoolean("layout", mIsLargeLayout);
|
||||||
|
|
||||||
// Set current tab value to new task dialog
|
// Set current tab value to new task dialog
|
||||||
ViewPager viewPager = (ViewPager) getActivity().findViewById(R.id.container);
|
ViewPager viewPager = (ViewPager) getActivity().findViewById(R.id.container);
|
||||||
@@ -137,7 +138,8 @@ public class TasksFragment extends Fragment implements
|
|||||||
FragmentManager manager = getFragmentManager();
|
FragmentManager manager = getFragmentManager();
|
||||||
TaskDialogFragment taskDialogFragment = TaskDialogFragment.newInstance(
|
TaskDialogFragment taskDialogFragment = TaskDialogFragment.newInstance(
|
||||||
taskRecyclerViewAdapter.getItem(position),
|
taskRecyclerViewAdapter.getItem(position),
|
||||||
((MainActivity.SectionsPagerAdapter) viewPager.getAdapter()).getAllItems(), TasksFragment.this);
|
((MainActivity.SectionsPagerAdapter) viewPager.getAdapter()).getAllItems(),
|
||||||
|
TasksFragment.this);
|
||||||
|
|
||||||
taskDialogFragment.setArguments(args);
|
taskDialogFragment.setArguments(args);
|
||||||
|
|
||||||
@@ -315,9 +317,8 @@ public class TasksFragment extends Fragment implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNewTaskDialogPositiveClick(DialogFragment dialog) {
|
public void onNewTaskDialogPositiveClick(DialogFragment dialog, View dialogView) {
|
||||||
// Get the dialog fragment
|
// Get the dialog fragment
|
||||||
View dialogView = dialog.getView();
|
|
||||||
if (dialogView == null) return;
|
if (dialogView == null) return;
|
||||||
long id = 0;
|
long id = 0;
|
||||||
Task task = ((TaskDialogFragment)dialog).getTask();
|
Task task = ((TaskDialogFragment)dialog).getTask();
|
||||||
|
@@ -14,13 +14,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/appbar_padding_top"
|
android:paddingTop="@dimen/appbar_padding_top"
|
||||||
android:theme="@style/AppTheme.AppBarOverlay">
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
<android.support.v7.widget.Toolbar
|
<include layout="@layout/toolbar" android:id="@+id/toolbar" />
|
||||||
android:id="@+id/toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:background="?attr/colorPrimary"
|
|
||||||
app:layout_scrollFlags="enterAlways"
|
|
||||||
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
@@ -14,14 +14,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/appbar_padding_top"
|
android:paddingTop="@dimen/appbar_padding_top"
|
||||||
android:theme="@style/AppTheme.AppBarOverlay">
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
|
<include layout="@layout/toolbar" android:id="@+id/toolbar" />
|
||||||
<android.support.v7.widget.Toolbar
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:background="?attr/colorPrimary"
|
|
||||||
app:layout_scrollFlags="enterAlways"
|
|
||||||
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
<android.support.design.widget.CoordinatorLayout
|
<android.support.design.widget.CoordinatorLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@@ -12,12 +11,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:theme="@style/AppTheme.AppBarOverlay">
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
<android.support.v7.widget.Toolbar
|
<include layout="@layout/toolbar" android:id="@+id/new_task_toolbar" />
|
||||||
android:id="@+id/new_task_toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?attr/actionBarSize"
|
|
||||||
android:background="?attr/colorPrimary"
|
|
||||||
app:popupTheme="@style/AppTheme.PopupOverlay"/>
|
|
||||||
</android.support.design.widget.AppBarLayout>
|
</android.support.design.widget.AppBarLayout>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
9
DoNExt/app/src/main/res/layout/toolbar.xml
Normal file
9
DoNExt/app/src/main/res/layout/toolbar.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.v7.widget.Toolbar
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
|
app:layout_scrollFlags="enterAlways"
|
||||||
|
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
@@ -6,7 +6,7 @@
|
|||||||
<string name="action_about">À propos</string>
|
<string name="action_about">À propos</string>
|
||||||
<string name="action_changeLayout">Changer l\'apparence</string>
|
<string name="action_changeLayout">Changer l\'apparence</string>
|
||||||
<string name="action_editTabs">Éditer les listes</string>
|
<string name="action_editTabs">Éditer les listes</string>
|
||||||
<string name="action_edit_task">Éditer la tâche</string>
|
<string name="action_edit_task">Éditer</string>
|
||||||
<string name="action_newTab">Nouvelle liste</string>
|
<string name="action_newTab">Nouvelle liste</string>
|
||||||
<string name="action_new_task">Nouvelle tâche</string>
|
<string name="action_new_task">Nouvelle tâche</string>
|
||||||
<string name="action_settings">Paramètres</string>
|
<string name="action_settings">Paramètres</string>
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
<string name="title_activity_task_list">TaskListActivity</string>
|
||||||
|
|
||||||
<!-- Activities and menu strings -->
|
<!-- Activities and menu strings -->
|
||||||
<string name="app_name">DoNext</string>
|
<string name="app_name">DoNext</string>
|
||||||
<string name="action_settings">Settings</string>
|
<string name="action_settings">Settings</string>
|
||||||
@@ -6,7 +8,7 @@
|
|||||||
<string name="action_editTabs">Edit lists</string>
|
<string name="action_editTabs">Edit lists</string>
|
||||||
<string name="action_about">About</string>
|
<string name="action_about">About</string>
|
||||||
<string name="action_new_task">New task</string>
|
<string name="action_new_task">New task</string>
|
||||||
<string name="action_edit_task">Edit task</string>
|
<string name="action_edit_task">Edit</string>
|
||||||
<string name="action_changeLayout">Change layout</string>
|
<string name="action_changeLayout">Change layout</string>
|
||||||
|
|
||||||
<!-- Strings related to tabs -->
|
<!-- Strings related to tabs -->
|
||||||
@@ -20,6 +22,8 @@
|
|||||||
<string name="task_list_delete">Delete</string>
|
<string name="task_list_delete">Delete</string>
|
||||||
<string name="task_list_confirmation_delete">Delete task list?</string>
|
<string name="task_list_confirmation_delete">Delete task list?</string>
|
||||||
<string name="task_list_drag_handle">Drag handle</string>
|
<string name="task_list_drag_handle">Drag handle</string>
|
||||||
|
<string name="task_list_today">Today</string>
|
||||||
|
<string name="task_list_today_list_error">Name \"Today\" is reserved. You may activate the Today list from the Settings.</string>
|
||||||
|
|
||||||
<!-- Strings related to new task dialog -->
|
<!-- Strings related to new task dialog -->
|
||||||
<string name="new_task_list">List</string>
|
<string name="new_task_list">List</string>
|
||||||
@@ -32,6 +36,7 @@
|
|||||||
<string name="new_task_priority_low">Low</string>
|
<string name="new_task_priority_low">Low</string>
|
||||||
<string name="new_task_priority_normal">Normal</string>
|
<string name="new_task_priority_normal">Normal</string>
|
||||||
<string name="new_task_priority_high">High</string>
|
<string name="new_task_priority_high">High</string>
|
||||||
|
<string name="new_task_due_date">Due date</string>
|
||||||
<string name="new_task_save">Save</string>
|
<string name="new_task_save">Save</string>
|
||||||
<string name="new_task_cancel">Cancel</string>
|
<string name="new_task_cancel">Cancel</string>
|
||||||
<string name="new_task_delete">Delete</string>
|
<string name="new_task_delete">Delete</string>
|
||||||
@@ -42,6 +47,7 @@
|
|||||||
<string name="task_total_cycles">%1$d cycle%2$s</string>
|
<string name="task_total_cycles">%1$d cycle%2$s</string>
|
||||||
<string name="task_total">%1$d task%2$s</string>
|
<string name="task_total">%1$d task%2$s</string>
|
||||||
<string name="task_remaining">%1$d more task%2$s</string>
|
<string name="task_remaining">%1$d more task%2$s</string>
|
||||||
|
<string name="task_alarm">Task is past due date</string>
|
||||||
|
|
||||||
<!-- String related to the SnackBar -->
|
<!-- String related to the SnackBar -->
|
||||||
<string name="snackabar_label">Task %s</string>
|
<string name="snackabar_label">Task %s</string>
|
||||||
@@ -69,20 +75,14 @@
|
|||||||
<string name="settings_confirm_markdone">Confirm on done?</string>
|
<string name="settings_confirm_markdone">Confirm on done?</string>
|
||||||
<string name="settings_confirm_delete">Confirm on delete?</string>
|
<string name="settings_confirm_delete">Confirm on delete?</string>
|
||||||
<string name="settings_task_layout">Task layout</string>
|
<string name="settings_task_layout">Task layout</string>
|
||||||
|
<string name="settings_today_title">Today list</string>
|
||||||
|
<string name="settings_today_enable">Enable Today list?</string>
|
||||||
|
<string name="settings_today_desc">The Today list is a special kind of list, in which tasks only exist for the current day. Each day, the list is reset.</string>
|
||||||
|
<string name="settings_today_action_title">Action at the end of the day</string>
|
||||||
<string name="settings_max_lists_label">Maximum number of lists</string>
|
<string name="settings_max_lists_label">Maximum number of lists</string>
|
||||||
<string name="title_activity_task_list">TaskListActivity</string>
|
|
||||||
|
|
||||||
<!-- Strings related to About -->
|
<!-- Strings related to About -->
|
||||||
<string name="about_version_donext">DoNext version %s</string>
|
<string name="about_version_donext">DoNext version %s</string>
|
||||||
<string name="about_version_android">Android version %d</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://github.com/wismna</string>
|
||||||
<string name="settings_today_title">Today list</string>
|
|
||||||
<string name="settings_today_enable">Enable Today list?</string>
|
|
||||||
<string name="settings_today_desc">The Today list is a special kind of list, in which tasks only exist for the current day. Each day, the list is reset.</string>
|
|
||||||
<string name="task_list_today">Today</string>
|
|
||||||
<string name="task_list_today_list_error">Name \"Today\" is reserved. You may activate the Today list from the Settings.</string>
|
|
||||||
<string name="settings_today_action_title">Action at the end of the day</string>
|
|
||||||
<string name="new_task_due_date">Due date</string>
|
|
||||||
<string name="task_alarm">Task is past due date</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Reference in New Issue
Block a user