Updated some TODOs with info on probable error causes

Changed visibility from Invisible to Gone on task lists
This commit is contained in:
BONNEVILLE Geoffroy
2017-12-21 15:13:31 +01:00
parent ee86b42c1a
commit 1c505b3b45
2 changed files with 4 additions and 3 deletions

View File

@@ -101,7 +101,7 @@ public class MainFragment extends Fragment implements TasksFragment.TaskChangedA
tabLayout = mView.findViewById(R.id.tabs); tabLayout = mView.findViewById(R.id.tabs);
// Hide the tabs if there is only one task list // Hide the tabs if there is only one task list
if (taskLists.size() == 1) tabLayout.setVisibility(View.INVISIBLE); if (taskLists.size() == 1) tabLayout.setVisibility(View.GONE);
tabLayout.setupWithViewPager(mViewPager); tabLayout.setupWithViewPager(mViewPager);
// Handles scroll detection (only available for SDK version >=23) // Handles scroll detection (only available for SDK version >=23)
@@ -119,7 +119,7 @@ public class MainFragment extends Fragment implements TasksFragment.TaskChangedA
else { else {
ListView listView = mView.findViewById(R.id.list); ListView listView = mView.findViewById(R.id.list);
// Hide the list if there is only one task list // Hide the list if there is only one task list
if (taskLists.size() == 1) listView.setVisibility(View.INVISIBLE); if (taskLists.size() == 1) listView.setVisibility(View.GONE);
//listView.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, taskLists)); //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.setAdapter(new ArrayAdapter<>(activity, R.layout.list_tasklist_item, taskLists));
//listView.setSelection(lastOpenedList); //listView.setSelection(lastOpenedList);

View File

@@ -92,7 +92,7 @@ public class TasksFragment extends Fragment implements
Activity parentActivity = getActivity(); Activity parentActivity = getActivity();
if (parentActivity instanceof HistoryActivity) isHistory = true; if (parentActivity instanceof HistoryActivity) isHistory = true;
if (parentActivity instanceof TodayActivity) isTodayView = true; if (parentActivity instanceof TodayActivity) isTodayView = true;
// TODO: check that this works! // TODO: this does not work! No tasks are shown
mAdapter = (MainFragment)getParentFragment(); mAdapter = (MainFragment)getParentFragment();
} }
} }
@@ -118,6 +118,7 @@ public class TasksFragment extends Fragment implements
} }
recyclerView.setAdapter(taskRecyclerViewAdapter); recyclerView.setAdapter(taskRecyclerViewAdapter);
// TODO: check that this works
if (!isHistory) { if (!isHistory) {
// Set ItemTouch helper in RecyclerView to handle swipe move on elements // Set ItemTouch helper in RecyclerView to handle swipe move on elements
ItemTouchHelper.Callback callback = new TaskTouchHelper(this, ItemTouchHelper.Callback callback = new TaskTouchHelper(this,