mirror of
https://github.com/wismna/DoNext.git
synced 2025-10-04 16:10:13 -04:00
Update Gradle to latest
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.wismna.geoffroy.donext">
|
||||
|
||||
<application
|
||||
android:name=".DoNext"
|
||||
android:allowBackup="true"
|
||||
@@ -9,7 +10,10 @@
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<meta-data android:name="android.max_aspect" android:value="2.1" />
|
||||
<meta-data
|
||||
android:name="android.max_aspect"
|
||||
android:value="2.1" />
|
||||
|
||||
<activity
|
||||
android:name=".activities.MainActivity"
|
||||
android:label="@string/app_name"
|
||||
@@ -18,6 +22,7 @@
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
@@ -54,6 +59,7 @@
|
||||
android:name="android.support.PARENT_ACTIVITY"
|
||||
android:value=".activities.MainActivity" />
|
||||
</activity>
|
||||
<activity android:name=".activities.HistoryActivity" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
@@ -2,132 +2,30 @@ package com.wismna.geoffroy.donext.activities;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Point;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.design.widget.TabLayout;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentPagerAdapter;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
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.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.wismna.geoffroy.donext.R;
|
||||
import com.wismna.geoffroy.donext.adapters.SmartFragmentStatePagerAdapter;
|
||||
import com.wismna.geoffroy.donext.adapters.TaskRecyclerViewAdapter;
|
||||
import com.wismna.geoffroy.donext.dao.Task;
|
||||
import com.wismna.geoffroy.donext.dao.TaskList;
|
||||
import com.wismna.geoffroy.donext.database.TaskListDataAccess;
|
||||
import com.wismna.geoffroy.donext.fragments.MainFragment;
|
||||
import com.wismna.geoffroy.donext.fragments.TaskFormDialogFragment;
|
||||
import com.wismna.geoffroy.donext.fragments.TasksFragment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MainActivity extends AppCompatActivity implements TasksFragment.TaskChangedAdapter {
|
||||
|
||||
/**
|
||||
* The {@link android.support.v4.view.PagerAdapter} that will provide
|
||||
* fragments for each of the sections. We use a
|
||||
* {@link FragmentPagerAdapter} derivative, which will keep every
|
||||
* loaded fragment in memory. If this becomes too memory intensive, it
|
||||
* may be best to switch to a
|
||||
* {@link android.support.v4.app.FragmentStatePagerAdapter}.
|
||||
*/
|
||||
private SectionsPagerAdapter mSectionsPagerAdapter;
|
||||
/**
|
||||
* The {@link ViewPager} that will host the section contents.
|
||||
*/
|
||||
private ViewPager mViewPager;
|
||||
private TabLayout tabLayout;
|
||||
private List<TaskList> taskLists;
|
||||
private boolean mIsLargeLayout;
|
||||
/**
|
||||
* Main Activity class
|
||||
*/
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
mIsLargeLayout = getResources().getBoolean(R.bool.large_layout);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
// Create the adapter that will return a fragment for each of the three
|
||||
// primary sections of the activity.
|
||||
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
|
||||
|
||||
SharedPreferences sharedPref =
|
||||
PreferenceManager.getDefaultSharedPreferences(MainActivity.this);
|
||||
|
||||
// Access database to retrieve Tabs
|
||||
try (TaskListDataAccess taskListDataAccess = new TaskListDataAccess(this)) {
|
||||
taskLists = taskListDataAccess.getAllTaskLists();
|
||||
mSectionsPagerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
if (taskLists.size() == 0) {
|
||||
Intent intent = new Intent(this, TaskListActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
else {
|
||||
|
||||
// Set up the ViewPager with the sections adapter.
|
||||
mViewPager = (ViewPager) findViewById(R.id.container);
|
||||
mViewPager.setAdapter(mSectionsPagerAdapter);
|
||||
// Open last opened tab
|
||||
int lastOpenedList = sharedPref.getInt("last_opened_tab", 0);
|
||||
mViewPager.setCurrentItem(lastOpenedList);
|
||||
|
||||
if (!mIsLargeLayout) {
|
||||
tabLayout = (TabLayout) findViewById(R.id.tabs);
|
||||
tabLayout.setupWithViewPager(mViewPager);
|
||||
|
||||
// Handles scroll detection (only available for SDK version >=23)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
toggleTabLayoutArrows(tabLayout.getScrollX());
|
||||
//tabLayout.setScrollIndicators(TabLayout.SCROLL_INDICATOR_LEFT | TabLayout.SCROLL_INDICATOR_RIGHT);
|
||||
tabLayout.setOnScrollChangeListener(new View.OnScrollChangeListener() {
|
||||
@Override
|
||||
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
|
||||
toggleTabLayoutArrows(scrollX);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
ListView listView = (ListView) findViewById(R.id.list);
|
||||
//listView.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, taskLists));
|
||||
listView.setAdapter(new ArrayAdapter<>(this, R.layout.list_tasklist_item, taskLists));
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
mViewPager.setCurrentItem(position);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
|
||||
// No tabs exist yet, nothing to save
|
||||
if (mViewPager == null) return;
|
||||
// Otherwise, save currently opened tab
|
||||
SharedPreferences sharedPref =
|
||||
PreferenceManager.getDefaultSharedPreferences(MainActivity.this);
|
||||
SharedPreferences.Editor editor = sharedPref.edit();
|
||||
editor.putInt("last_opened_tab", mViewPager.getCurrentItem());
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -159,46 +57,6 @@ public class MainActivity extends AppCompatActivity implements TasksFragment.Tas
|
||||
return id == R.id.action_settings || super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTaskListChanged(Task task, int tabPosition) {
|
||||
TaskRecyclerViewAdapter destinationTaskAdapter = getSpecificTabAdapter(tabPosition);
|
||||
if (destinationTaskAdapter != null) destinationTaskAdapter.add(task, destinationTaskAdapter.getItemCount());
|
||||
}
|
||||
|
||||
/** Called when user clicks on the New Task floating button */
|
||||
public void onNewTaskClick(View view) {
|
||||
int currentTabPosition = mViewPager.getCurrentItem();
|
||||
TaskFormDialogFragment taskDialogFragment = TaskFormDialogFragment.newInstance(null,
|
||||
mSectionsPagerAdapter.getAllItems(),
|
||||
(TasksFragment) mSectionsPagerAdapter.getRegisteredFragment(currentTabPosition));
|
||||
|
||||
// Set some configuration values for the tab
|
||||
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("list", currentTabPosition);
|
||||
args.putBoolean("today", sharedPref.getBoolean("pref_conf_today_enable", false));
|
||||
args.putBoolean("neutral", false);
|
||||
args.putString("button_positive", getString(R.string.new_task_save));
|
||||
args.putString("button_negative", getString(R.string.new_task_cancel));
|
||||
args.putString("button_neutral", getString(R.string.new_task_delete));
|
||||
taskDialogFragment.setArguments(args);
|
||||
|
||||
String title = getString(R.string.action_new_task);
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
if (mIsLargeLayout)
|
||||
taskDialogFragment.show(fragmentManager, title);
|
||||
else {
|
||||
// The device is smaller, so show the fragment fullscreen
|
||||
FragmentTransaction transaction = fragmentManager.beginTransaction();
|
||||
// For a little polish, specify a transition animation
|
||||
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
|
||||
// To make it fullscreen, use the 'content' root view as the container
|
||||
// for the fragment, which is always the root view for the activity
|
||||
transaction.add(android.R.id.content, taskDialogFragment, title)
|
||||
.addToBackStack(null).commit();
|
||||
}
|
||||
}
|
||||
|
||||
/** Called when the user clicks on the Today List button */
|
||||
public void showTodayList(MenuItem item) {
|
||||
Intent intent = new Intent(this, TodayActivity.class);
|
||||
@@ -215,7 +73,9 @@ public class MainActivity extends AppCompatActivity implements TasksFragment.Tas
|
||||
editor.apply();
|
||||
|
||||
// Update the ViewPagerAdapter to refresh all tabs
|
||||
mSectionsPagerAdapter.notifyDataSetChanged();
|
||||
MainFragment fragment = getMainFragment();
|
||||
fragment.getViewPager().getAdapter().notifyDataSetChanged();
|
||||
//mSectionsPagerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
/** Called when the user clicks the Edit Lists button */
|
||||
@@ -224,6 +84,12 @@ public class MainActivity extends AppCompatActivity implements TasksFragment.Tas
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
/** Called when the user clicks the History button*/
|
||||
public void openHistory(MenuItem item) {
|
||||
MainFragment fragment = getMainFragment();
|
||||
fragment.toggleHistory();
|
||||
}
|
||||
|
||||
/** Called when the user clicks the Settings button */
|
||||
public void openSettings(MenuItem menuItem) {
|
||||
Intent intent = new Intent(this, SettingsActivity.class);
|
||||
@@ -236,70 +102,46 @@ public class MainActivity extends AppCompatActivity implements TasksFragment.Tas
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private TaskRecyclerViewAdapter getSpecificTabAdapter(int position) {
|
||||
TasksFragment taskFragment = (TasksFragment) mSectionsPagerAdapter.getRegisteredFragment(position);
|
||||
if (taskFragment == null) return null;
|
||||
View view = taskFragment.getView();
|
||||
if (view == null) return null;
|
||||
RecyclerView recyclerView = ((RecyclerView) view.findViewById(R.id.task_list_view));
|
||||
if (recyclerView == null) return null;
|
||||
return (TaskRecyclerViewAdapter) recyclerView.getAdapter();
|
||||
}
|
||||
/** Called when user clicks on the New Task floating button */
|
||||
public void onNewTaskClick(View view) {
|
||||
|
||||
/** Toggles scrolling arrows visibility */
|
||||
private void toggleTabLayoutArrows(int scrollX){
|
||||
// Hide left arrow when scrolled to the left
|
||||
View leftArrow = findViewById(R.id.left_arrow);
|
||||
if (leftArrow != null) {
|
||||
if (scrollX <= 1) leftArrow.setVisibility(View.INVISIBLE);
|
||||
else leftArrow.setVisibility(View.VISIBLE);
|
||||
}
|
||||
// Hide right arrow when scrolled to the right
|
||||
View rightArrow = findViewById(R.id.right_arrow);
|
||||
if (rightArrow != null) {
|
||||
Point size = new Point();
|
||||
getWindowManager().getDefaultDisplay().getSize(size);
|
||||
if (scrollX == tabLayout.getChildAt(0).getMeasuredWidth() - tabLayout.getMeasuredWidth())
|
||||
rightArrow.setVisibility(View.INVISIBLE);
|
||||
else rightArrow.setVisibility(View.VISIBLE);
|
||||
MainFragment fragment = getMainFragment();
|
||||
ViewPager viewPager = fragment.getViewPager();
|
||||
int currentTabPosition = viewPager.getCurrentItem();
|
||||
MainFragment.SectionsPagerAdapter pagerAdapter = (MainFragment.SectionsPagerAdapter) viewPager.getAdapter();
|
||||
TaskFormDialogFragment taskDialogFragment = TaskFormDialogFragment.newInstance(null,
|
||||
pagerAdapter.getAllItems(),
|
||||
(TasksFragment) pagerAdapter.getRegisteredFragment(currentTabPosition));
|
||||
|
||||
// Set some configuration values for the tab
|
||||
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("list", currentTabPosition);
|
||||
args.putBoolean("today", sharedPref.getBoolean("pref_conf_today_enable", false));
|
||||
args.putBoolean("neutral", false);
|
||||
args.putString("button_positive", getString(R.string.new_task_save));
|
||||
args.putString("button_negative", getString(R.string.new_task_cancel));
|
||||
args.putString("button_neutral", getString(R.string.new_task_delete));
|
||||
taskDialogFragment.setArguments(args);
|
||||
|
||||
String title = getString(R.string.action_new_task);
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
if (!getResources().getBoolean(R.bool.large_layout))
|
||||
taskDialogFragment.show(fragmentManager, title);
|
||||
else {
|
||||
// The device is smaller, so show the fragment fullscreen
|
||||
FragmentTransaction transaction = fragmentManager.beginTransaction();
|
||||
// For a little polish, specify a transition animation
|
||||
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
|
||||
// To make it fullscreen, use the 'content' root view as the container
|
||||
// for the fragment, which is always the root view for the activity
|
||||
transaction.add(android.R.id.content, taskDialogFragment, title)
|
||||
.addToBackStack(null).commit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
|
||||
* one of the sections/tabs/pages.
|
||||
*/
|
||||
public class SectionsPagerAdapter extends SmartFragmentStatePagerAdapter {
|
||||
|
||||
SectionsPagerAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
// getItem is called to instantiate the fragment for the given page.
|
||||
// Return a PlaceholderFragment (defined as a static inner class below).
|
||||
TaskList taskList = taskLists.get(position);
|
||||
return TasksFragment.newTaskListInstance(taskList.getId(), MainActivity.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
if (taskLists != null) {
|
||||
// Show the task lists
|
||||
return taskLists.size();
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
if (taskLists == null) return "N/A";
|
||||
return taskLists.get(position).getName();
|
||||
}
|
||||
|
||||
public List<TaskList> getAllItems(){
|
||||
return taskLists;
|
||||
}
|
||||
private MainFragment getMainFragment(){
|
||||
FragmentManager manager = getSupportFragmentManager();
|
||||
return (MainFragment)manager.findFragmentById(R.id.fragment_main);
|
||||
}
|
||||
}
|
||||
|
@@ -11,5 +11,4 @@ public class TaskListActivity extends AppCompatActivity{
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_tasklists);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -93,7 +93,7 @@ public class TaskDataAccess implements AutoCloseable {
|
||||
" ON " + DatabaseHelper.TASKS_TABLE_NAME + "." + DatabaseHelper.TASKS_COLUMN_LIST +
|
||||
" = " + DatabaseHelper.TASKLIST_TABLE_NAME + "." + DatabaseHelper.COLUMN_ID +
|
||||
" WHERE " + DatabaseHelper.TASKS_TABLE_NAME + "." + DatabaseHelper.TASKS_COLUMN_DONE + " = " + 0 +
|
||||
" AND " + DatabaseHelper.TASKS_TABLE_NAME + "." + DatabaseHelper.TASKS_COLUMN_DELETED + " = " + 0
|
||||
" AND " + DatabaseHelper.TASKS_TABLE_NAME + "." + DatabaseHelper.TASKS_COLUMN_DELETED + " = " + 0
|
||||
, null);
|
||||
List<Task> tasks = new ArrayList<>();
|
||||
|
||||
@@ -113,11 +113,12 @@ public class TaskDataAccess implements AutoCloseable {
|
||||
return tasks;
|
||||
}
|
||||
|
||||
public List<Task> getAllTasksFromList(long id) {
|
||||
public List<Task> getAllTasksFromList(long id, boolean isHistory) {
|
||||
int history = isHistory ? 1 : 0;
|
||||
Cursor cursor = database.query(DatabaseHelper.TASKS_TABLE_NAME, taskColumns,
|
||||
DatabaseHelper.TASKS_COLUMN_LIST + " = " + id +
|
||||
" AND " + DatabaseHelper.TASKS_COLUMN_DONE + " = " + 0 +
|
||||
" AND " + DatabaseHelper.TASKS_COLUMN_DELETED + " = " + 0,
|
||||
" AND (" + DatabaseHelper.TASKS_COLUMN_DONE + " = " + history +
|
||||
(isHistory ? " OR " : " AND ") + DatabaseHelper.TASKS_COLUMN_DELETED + " = " + history + ")",
|
||||
null, null, null,
|
||||
DatabaseHelper.TASKS_COLUMN_CYCLE + ", " + DatabaseHelper.COLUMN_ID + " DESC");
|
||||
return getTasksFromCursor(cursor);
|
||||
|
@@ -164,7 +164,7 @@ public abstract class DynamicDialogFragment extends DialogFragment {
|
||||
|
||||
/** Sets the title of the Fragment from the Tag */
|
||||
private Toolbar setToolbarTitle(View view) {
|
||||
Toolbar toolbar = (Toolbar) view.findViewById(R.id.dialog_toolbar);
|
||||
Toolbar toolbar = view.findViewById(R.id.dialog_toolbar);
|
||||
toolbar.setTitle(getTag());
|
||||
return toolbar;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ public abstract class DynamicDialogFragment extends DialogFragment {
|
||||
// Ensure that the content view is set
|
||||
if (mContentLayoutId == 0) return;
|
||||
// Insert the content view
|
||||
FrameLayout content = (FrameLayout) view.findViewById(R.id.dynamic_fragment_content);
|
||||
FrameLayout content = view.findViewById(R.id.dynamic_fragment_content);
|
||||
content.addView(inflater.inflate(mContentLayoutId, (ViewGroup) view.getParent()));
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,234 @@
|
||||
package com.wismna.geoffroy.donext.fragments;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Point;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.design.widget.TabLayout;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentPagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ListView;
|
||||
|
||||
import com.wismna.geoffroy.donext.R;
|
||||
import com.wismna.geoffroy.donext.activities.TaskListActivity;
|
||||
import com.wismna.geoffroy.donext.adapters.SmartFragmentStatePagerAdapter;
|
||||
import com.wismna.geoffroy.donext.adapters.TaskRecyclerViewAdapter;
|
||||
import com.wismna.geoffroy.donext.dao.Task;
|
||||
import com.wismna.geoffroy.donext.dao.TaskList;
|
||||
import com.wismna.geoffroy.donext.database.TaskListDataAccess;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Fragment that will handle the main display
|
||||
*/
|
||||
public class MainFragment extends Fragment implements TasksFragment.TaskChangedAdapter {
|
||||
|
||||
private View mView;
|
||||
private ViewPager mViewPager;
|
||||
private SectionsPagerAdapter mSectionsPagerAdapter;
|
||||
private TabLayout tabLayout;
|
||||
private List<TaskList> taskLists;
|
||||
private boolean isHistory = false;
|
||||
|
||||
public MainFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this factory method to create a new instance of
|
||||
* this fragment using the provided parameters.
|
||||
*
|
||||
* @param isHistory Will this fragment show the task history?
|
||||
* @return A new instance of fragment MainFragment.
|
||||
*/
|
||||
// TODO: Rename and change types and number of parameters
|
||||
public static MainFragment newInstance(boolean isHistory) {
|
||||
MainFragment fragment = new MainFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putBoolean("history", isHistory);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
public ViewPager getViewPager() {
|
||||
return mViewPager;
|
||||
}
|
||||
|
||||
public void toggleHistory() {
|
||||
isHistory = !isHistory;
|
||||
mSectionsPagerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if (getArguments() != null) {
|
||||
isHistory = getArguments().getBoolean("history");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
mView = inflater.inflate(R.layout.fragment_main, container, false);
|
||||
AppCompatActivity activity = (AppCompatActivity) getActivity();
|
||||
Toolbar toolbar = mView.findViewById(R.id.toolbar);
|
||||
activity.setSupportActionBar(toolbar);
|
||||
|
||||
// Create the adapter that will return a fragment for each of the three
|
||||
// primary sections of the activity.
|
||||
mSectionsPagerAdapter = new SectionsPagerAdapter(getFragmentManager());
|
||||
|
||||
SharedPreferences sharedPref =
|
||||
PreferenceManager.getDefaultSharedPreferences(activity);
|
||||
|
||||
// Access database to retrieve Tabs
|
||||
try (TaskListDataAccess taskListDataAccess = new TaskListDataAccess(activity)) {
|
||||
taskLists = taskListDataAccess.getAllTaskLists();
|
||||
mSectionsPagerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
if (taskLists.size() == 0) {
|
||||
Intent intent = new Intent(getContext(), TaskListActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
else {
|
||||
|
||||
// Set up the ViewPager with the sections adapter.
|
||||
mViewPager = mView.findViewById(R.id.container);
|
||||
mViewPager.setAdapter(mSectionsPagerAdapter);
|
||||
// Open last opened tab
|
||||
int lastOpenedList = sharedPref.getInt("last_opened_tab", 0);
|
||||
mViewPager.setCurrentItem(lastOpenedList);
|
||||
|
||||
if (!getResources().getBoolean(R.bool.large_layout)) {
|
||||
tabLayout = mView.findViewById(R.id.tabs);
|
||||
tabLayout.setupWithViewPager(mViewPager);
|
||||
|
||||
// Handles scroll detection (only available for SDK version >=23)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
toggleTabLayoutArrows(tabLayout.getScrollX());
|
||||
//tabLayout.setScrollIndicators(TabLayout.SCROLL_INDICATOR_LEFT | TabLayout.SCROLL_INDICATOR_RIGHT);
|
||||
tabLayout.setOnScrollChangeListener(new View.OnScrollChangeListener() {
|
||||
@Override
|
||||
public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
|
||||
toggleTabLayoutArrows(scrollX);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
ListView listView = mView.findViewById(R.id.list);
|
||||
//listView.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, taskLists));
|
||||
listView.setAdapter(new ArrayAdapter<>(activity, R.layout.list_tasklist_item, taskLists));
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
mViewPager.setCurrentItem(position);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return mView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
// No tabs exist yet, nothing to save
|
||||
if (mViewPager == null) return;
|
||||
// Otherwise, save currently opened tab
|
||||
SharedPreferences sharedPref =
|
||||
PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
SharedPreferences.Editor editor = sharedPref.edit();
|
||||
editor.putInt("last_opened_tab", mViewPager.getCurrentItem());
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTaskListChanged(Task task, int tabPosition) {
|
||||
TaskRecyclerViewAdapter destinationTaskAdapter = getSpecificTabAdapter(tabPosition);
|
||||
if (destinationTaskAdapter != null) destinationTaskAdapter.add(task, destinationTaskAdapter.getItemCount());
|
||||
}
|
||||
|
||||
private TaskRecyclerViewAdapter getSpecificTabAdapter(int position) {
|
||||
TasksFragment taskFragment = (TasksFragment) mSectionsPagerAdapter.getRegisteredFragment(position);
|
||||
if (taskFragment == null) return null;
|
||||
View view = taskFragment.getView();
|
||||
if (view == null) return null;
|
||||
RecyclerView recyclerView = view.findViewById(R.id.task_list_view);
|
||||
if (recyclerView == null) return null;
|
||||
return (TaskRecyclerViewAdapter) recyclerView.getAdapter();
|
||||
}
|
||||
|
||||
/** Toggles scrolling arrows visibility */
|
||||
private void toggleTabLayoutArrows(int scrollX){
|
||||
// Hide left arrow when scrolled to the left
|
||||
View leftArrow = mView.findViewById(R.id.left_arrow);
|
||||
if (leftArrow != null) {
|
||||
if (scrollX <= 1) leftArrow.setVisibility(View.INVISIBLE);
|
||||
else leftArrow.setVisibility(View.VISIBLE);
|
||||
}
|
||||
// Hide right arrow when scrolled to the right
|
||||
View rightArrow = mView.findViewById(R.id.right_arrow);
|
||||
if (rightArrow != null) {
|
||||
Point size = new Point();
|
||||
getActivity().getWindowManager().getDefaultDisplay().getSize(size);
|
||||
if (scrollX == tabLayout.getChildAt(0).getMeasuredWidth() - tabLayout.getMeasuredWidth())
|
||||
rightArrow.setVisibility(View.INVISIBLE);
|
||||
else rightArrow.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
|
||||
* one of the sections/tabs/pages.
|
||||
*/
|
||||
public class SectionsPagerAdapter extends SmartFragmentStatePagerAdapter {
|
||||
|
||||
SectionsPagerAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
// getItem is called to instantiate the fragment for the given page.
|
||||
// Return a PlaceholderFragment (defined as a static inner class below).
|
||||
TaskList taskList = taskLists.get(position);
|
||||
return TasksFragment.newTaskListInstance(taskList.getId(), isHistory, MainFragment.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
if (taskLists != null) {
|
||||
// Show the task lists
|
||||
return taskLists.size();
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
if (taskLists == null) return "N/A";
|
||||
return taskLists.get(position).getName();
|
||||
}
|
||||
|
||||
public List<TaskList> getAllItems(){
|
||||
return taskLists;
|
||||
}
|
||||
}
|
||||
}
|
@@ -73,7 +73,7 @@ public class TaskFormDialogFragment extends DynamicDialogFragment {
|
||||
@Override
|
||||
protected void onPositiveButtonClick(View view) {
|
||||
if (view == null) return;
|
||||
EditText titleText = (EditText) view.findViewById(R.id.new_task_name);
|
||||
EditText titleText = view.findViewById(R.id.new_task_name);
|
||||
// handle confirmation button click hereEditText titleText = (EditText) d.findViewById(R.id.new_task_name);
|
||||
if (titleText.getText().toString().matches(""))
|
||||
titleText.setError(getResources().getString(R.string.new_task_name_error));
|
||||
|
@@ -59,11 +59,11 @@ public class TaskListsFragment extends Fragment implements
|
||||
|
||||
mView = inflater.inflate(R.layout.fragment_tasklists, container, false);
|
||||
|
||||
Button createTaskListButton = (Button) mView.findViewById(R.id.new_task_list_button);
|
||||
Button createTaskListButton = mView.findViewById(R.id.new_task_list_button);
|
||||
createTaskListButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
EditText editText = (EditText) mView.findViewById(R.id.new_task_list_name);
|
||||
EditText editText = mView.findViewById(R.id.new_task_list_name);
|
||||
String text = editText.getText().toString();
|
||||
if (text.matches("")) {
|
||||
editText.setError(getResources().getString(R.string.task_list_new_list_error));
|
||||
@@ -97,7 +97,7 @@ public class TaskListsFragment extends Fragment implements
|
||||
}
|
||||
|
||||
private void toggleVisibleCreateNewTaskListLayout(View view) {
|
||||
LinearLayout layout = (LinearLayout) view.findViewById(R.id.new_task_list_layout);
|
||||
LinearLayout layout = view.findViewById(R.id.new_task_list_layout);
|
||||
int taskListCount = taskListRecyclerViewAdapter.getItemCount();
|
||||
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
String maxTaskListsString = sharedPref.getString("pref_conf_max_lists", "5");
|
||||
@@ -134,7 +134,7 @@ public class TaskListsFragment extends Fragment implements
|
||||
@Override
|
||||
public void onConfirmDialogClick(DialogFragment dialog, ConfirmDialogFragment.ButtonEvent event) {
|
||||
// Handle never ask again checkbox
|
||||
CheckBox neverAskAgainCheckBox = (CheckBox) dialog.getDialog().findViewById(R.id.task_confirmation_never);
|
||||
CheckBox neverAskAgainCheckBox = dialog.getDialog().findViewById(R.id.task_confirmation_never);
|
||||
if (neverAskAgainCheckBox.isChecked()) {
|
||||
|
||||
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
@@ -195,7 +195,7 @@ public class TaskListsFragment extends Fragment implements
|
||||
|
||||
// Set the adapter
|
||||
Context context = mView.getContext();
|
||||
RecyclerView recyclerView = (RecyclerView) mView.findViewById(R.id.task_lists_view);
|
||||
RecyclerView recyclerView = mView.findViewById(R.id.task_lists_view);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
recyclerView.setAdapter(taskListRecyclerViewAdapter);
|
||||
|
||||
|
@@ -26,7 +26,6 @@ import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.wismna.geoffroy.donext.R;
|
||||
import com.wismna.geoffroy.donext.activities.MainActivity;
|
||||
import com.wismna.geoffroy.donext.adapters.TaskRecyclerViewAdapter;
|
||||
import com.wismna.geoffroy.donext.dao.Task;
|
||||
import com.wismna.geoffroy.donext.dao.TaskList;
|
||||
@@ -49,13 +48,14 @@ public class TasksFragment extends Fragment implements
|
||||
ConfirmDialogFragment.ConfirmDialogListener,
|
||||
TaskTouchHelper.TaskTouchHelperAdapter{
|
||||
|
||||
public interface TaskChangedAdapter {
|
||||
interface TaskChangedAdapter {
|
||||
void onTaskListChanged(Task task, int tabPosition);
|
||||
}
|
||||
|
||||
private static final String TASK_LIST_ID = "task_list_id";
|
||||
private long taskListId = -1;
|
||||
private boolean isTodayView = true;
|
||||
private boolean isHistory = false;
|
||||
private TaskRecyclerViewAdapter taskRecyclerViewAdapter;
|
||||
private View view;
|
||||
private RecyclerView recyclerView;
|
||||
@@ -69,10 +69,12 @@ public class TasksFragment extends Fragment implements
|
||||
public TasksFragment() {
|
||||
}
|
||||
|
||||
public static TasksFragment newTaskListInstance(long taskListId, TaskChangedAdapter taskChangedAdapter) {
|
||||
public static TasksFragment newTaskListInstance(long taskListId, boolean isHistory,
|
||||
TaskChangedAdapter taskChangedAdapter) {
|
||||
TasksFragment fragment = new TasksFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putLong(TASK_LIST_ID, taskListId);
|
||||
args.putBoolean("history", isHistory);
|
||||
fragment.setArguments(args);
|
||||
fragment.mAdapter = taskChangedAdapter;
|
||||
fragment.isTodayView = false;
|
||||
@@ -86,6 +88,7 @@ public class TasksFragment extends Fragment implements
|
||||
|
||||
if (getArguments() != null) {
|
||||
taskListId = getArguments().getLong(TASK_LIST_ID);
|
||||
isHistory = getArguments().getBoolean("history");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +99,7 @@ public class TasksFragment extends Fragment implements
|
||||
final Context context = view.getContext();
|
||||
|
||||
// Set the Recycler view
|
||||
recyclerView = (RecyclerView) view.findViewById(R.id.task_list_view);
|
||||
recyclerView = view.findViewById(R.id.task_list_view);
|
||||
recyclerView.setLayoutManager(new NoScrollingLayoutManager(context));
|
||||
|
||||
// Set RecyclerView Adapter
|
||||
@@ -105,7 +108,7 @@ public class TasksFragment extends Fragment implements
|
||||
// Get all tasks
|
||||
try (TaskDataAccess taskDataAccess = new TaskDataAccess(view.getContext())) {
|
||||
taskRecyclerViewAdapter = new TaskRecyclerViewAdapter(
|
||||
isTodayView? taskDataAccess.getTodayTasks() : taskDataAccess.getAllTasksFromList(taskListId),
|
||||
isTodayView? taskDataAccess.getTodayTasks() : taskDataAccess.getAllTasksFromList(taskListId, isHistory),
|
||||
Integer.valueOf(sharedPref.getString("pref_conf_task_layout", "1")), isTodayView);
|
||||
}
|
||||
recyclerView.setAdapter(taskRecyclerViewAdapter);
|
||||
@@ -134,11 +137,11 @@ public class TasksFragment extends Fragment implements
|
||||
args.putString("button_neutral", getString(R.string.new_task_delete));
|
||||
|
||||
// Set current tab value to new task dialog
|
||||
ViewPager viewPager = (ViewPager) getActivity().findViewById(R.id.container);
|
||||
ViewPager viewPager = getActivity().findViewById(R.id.container);
|
||||
List<TaskList> taskLists;
|
||||
Task task = taskRecyclerViewAdapter.getItem(position);
|
||||
if (viewPager != null) {
|
||||
taskLists = ((MainActivity.SectionsPagerAdapter) viewPager.getAdapter()).getAllItems();
|
||||
taskLists = ((MainFragment.SectionsPagerAdapter) viewPager.getAdapter()).getAllItems();
|
||||
args.putInt("list", viewPager.getCurrentItem());
|
||||
}
|
||||
else {
|
||||
@@ -188,14 +191,14 @@ public class TasksFragment extends Fragment implements
|
||||
|
||||
// Update total cycle count
|
||||
int totalCycles = taskRecyclerViewAdapter.getCycleCount();
|
||||
TextView totalCyclesView = (TextView) view.findViewById(R.id.total_task_cycles);
|
||||
TextView totalCyclesView = view.findViewById(R.id.total_task_cycles);
|
||||
if (totalCycles != 0)
|
||||
totalCyclesView.setText(resources.getQuantityString(R.plurals.task_total_cycles, totalCycles, totalCycles));
|
||||
else totalCyclesView.setText("");
|
||||
|
||||
// Update total tasks
|
||||
int totalTasks = taskRecyclerViewAdapter.getItemCount();
|
||||
TextView totalTasksView = (TextView) view.findViewById(R.id.total_task_count);
|
||||
TextView totalTasksView = view.findViewById(R.id.total_task_count);
|
||||
View noMoreTasks = view.findViewById(R.id.no_more_tasks);
|
||||
if (totalTasks == 0) {
|
||||
noMoreTasks.setVisibility(View.VISIBLE);
|
||||
@@ -208,7 +211,7 @@ public class TasksFragment extends Fragment implements
|
||||
}
|
||||
|
||||
// Update remaining tasks
|
||||
TextView remainingTasksView = (TextView) view.findViewById(R.id.remaining_task_count);
|
||||
TextView remainingTasksView = view.findViewById(R.id.remaining_task_count);
|
||||
NoScrollingLayoutManager layoutManager = (NoScrollingLayoutManager) recyclerView.getLayoutManager();
|
||||
int remainingTaskCount = totalTasks - layoutManager.findLastVisibleItemPosition() - 1;
|
||||
if (remainingTaskCount == 0) remainingTasksView.setText("");
|
||||
@@ -236,7 +239,7 @@ public class TasksFragment extends Fragment implements
|
||||
int direction = args.getInt("Direction");
|
||||
|
||||
// Handle never ask again checkbox
|
||||
CheckBox neverAskAgainCheckBox = (CheckBox) dialog.getDialog().findViewById(R.id.task_confirmation_never);
|
||||
CheckBox neverAskAgainCheckBox = dialog.getDialog().findViewById(R.id.task_confirmation_never);
|
||||
if (neverAskAgainCheckBox.isChecked()) {
|
||||
|
||||
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
@@ -273,14 +276,14 @@ public class TasksFragment extends Fragment implements
|
||||
if (task != null) id = task.getId();
|
||||
|
||||
// Get the controls
|
||||
Spinner listSpinner = (Spinner) dialogView.findViewById(R.id.new_task_list);
|
||||
EditText nameText = (EditText) dialogView.findViewById(R.id.new_task_name);
|
||||
EditText descText = (EditText) dialogView.findViewById(R.id.new_task_description);
|
||||
SeekBar seekBar = (SeekBar) dialogView.findViewById(R.id.new_task_priority);
|
||||
CheckBox setDueDate = (CheckBox) dialogView.findViewById(R.id.new_task_due_date_set);
|
||||
DatePicker dueDatePicker = (DatePicker) dialogView.findViewById(R.id.new_task_due_date);
|
||||
Spinner listSpinner = dialogView.findViewById(R.id.new_task_list);
|
||||
EditText nameText = dialogView.findViewById(R.id.new_task_name);
|
||||
EditText descText = dialogView.findViewById(R.id.new_task_description);
|
||||
SeekBar seekBar = dialogView.findViewById(R.id.new_task_priority);
|
||||
CheckBox setDueDate = dialogView.findViewById(R.id.new_task_due_date_set);
|
||||
DatePicker dueDatePicker = dialogView.findViewById(R.id.new_task_due_date);
|
||||
TaskList taskList = (TaskList) listSpinner.getSelectedItem();
|
||||
CheckBox todayList = (CheckBox) dialogView.findViewById(R.id.new_task_today);
|
||||
CheckBox todayList = dialogView.findViewById(R.id.new_task_today);
|
||||
boolean isToday = todayList.isChecked();
|
||||
// Add the task to the database
|
||||
try (TaskDataAccess taskDataAccess = new TaskDataAccess(view.getContext(), TaskDataAccess.MODE.WRITE)) {
|
||||
|
@@ -8,48 +8,12 @@
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".activities.MainActivity">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/appbar_padding_top"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
<include layout="@layout/toolbar" android:id="@+id/toolbar" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:id="@+id/left_arrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@string/tab_left_arrow"
|
||||
android:src="@drawable/ic_keyboard_arrow_left_white_24dp" />
|
||||
<ImageView
|
||||
android:id="@+id/right_arrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@string/tab_right_arrow"
|
||||
android:src="@drawable/ic_keyboard_arrow_right_white_24dp" />
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@+id/left_arrow"
|
||||
android:layout_toStartOf="@+id/right_arrow"
|
||||
app:tabMode="scrollable" />
|
||||
</RelativeLayout>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<com.wismna.geoffroy.donext.widgets.NonSwipeableViewPager
|
||||
android:id="@+id/container"
|
||||
<fragment
|
||||
android:id="@+id/fragment_main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
android:name="com.wismna.geoffroy.donext.fragments.MainFragment"
|
||||
/>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
|
51
DoNExt/app/src/main/res/layout/fragment_main.xml
Normal file
51
DoNExt/app/src/main/res/layout/fragment_main.xml
Normal file
@@ -0,0 +1,51 @@
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.wismna.geoffroy.donext.fragments.MainFragment">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/appbar_padding_top"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
<include layout="@layout/toolbar" android:id="@+id/toolbar" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:id="@+id/left_arrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@string/tab_left_arrow"
|
||||
android:src="@drawable/ic_keyboard_arrow_left_white_24dp" />
|
||||
<ImageView
|
||||
android:id="@+id/right_arrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:contentDescription="@string/tab_right_arrow"
|
||||
android:src="@drawable/ic_keyboard_arrow_right_white_24dp" />
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toEndOf="@+id/left_arrow"
|
||||
android:layout_toStartOf="@+id/right_arrow"
|
||||
app:tabMode="scrollable" />
|
||||
</RelativeLayout>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<com.wismna.geoffroy.donext.widgets.NonSwipeableViewPager
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
@@ -30,6 +30,13 @@
|
||||
android:onClick="openTaskLists"
|
||||
android:icon="@drawable/ic_list_white_24dp"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/action_history"
|
||||
android:orderInCategory="25"
|
||||
android:title="@string/action_history"
|
||||
android:onClick="openHistory"
|
||||
android:icon="@drawable/ic_list_white_24dp"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:orderInCategory="30"
|
||||
|
@@ -58,4 +58,5 @@
|
||||
<string name="action_today_select">Choisissez des tâches</string>
|
||||
<string name="task_list_edit_list_hint">Nom de la liste</string>
|
||||
<string name="incompatible_sdk_version">Sorry, your Android version is not supported.</string>
|
||||
<string name="action_history">Historique</string>
|
||||
</resources>
|
@@ -77,4 +77,9 @@
|
||||
<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="action_history">History</string>
|
||||
|
||||
<!-- TODO: Remove or change this placeholder text -->
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
<string name="title_activity_main2">Main2Activity</string>
|
||||
</resources>
|
||||
|
Reference in New Issue
Block a user