Removed unused TODOs and warnings in fragments-package

This commit is contained in:
Caesar2011
2018-07-14 00:23:28 +02:00
parent f850bdad31
commit 023a90ec4f
13 changed files with 6 additions and 74 deletions

View File

@@ -14,14 +14,13 @@ import de.sebse.fuplanner.tools.ui.ItemViewHolder;
/** /**
* {@link RecyclerView.Adapter} that can display a {@link Modules.Module} and makes a call to the * {@link RecyclerView.Adapter} that can display a {@link Modules.Module} and makes a call to the
* specified {@link OnModulesFragmentInteractionListener}. * specified {@link OnModulesFragmentInteractionListener}.
* TODO: Replace the implementation with code for your data type.
*/ */
public class ModulesAdapter extends RecyclerView.Adapter<ItemViewHolder> { public class ModulesAdapter extends RecyclerView.Adapter<ItemViewHolder> {
private Modules mValues; private Modules mValues;
private final OnModulesFragmentInteractionListener mListener; private final OnModulesFragmentInteractionListener mListener;
public ModulesAdapter(OnModulesFragmentInteractionListener listener) { ModulesAdapter(OnModulesFragmentInteractionListener listener) {
mValues = null; mValues = null;
mListener = listener; mListener = listener;
} }

View File

@@ -24,10 +24,6 @@ import de.sebse.fuplanner.tools.logging.Logger;
* interface. * interface.
*/ */
public class ModulesFragment extends Fragment { public class ModulesFragment extends Fragment {
// TODO: Customize parameter argument names
//private static final String ARG_COLUMN_COUNT = "column-count";
// TODO: Customize parameters
private OnModulesFragmentInteractionListener mListener; private OnModulesFragmentInteractionListener mListener;
private Logger log = new Logger(this); private Logger log = new Logger(this);
private ModulesAdapter adapter; private ModulesAdapter adapter;
@@ -40,8 +36,6 @@ public class ModulesFragment extends Fragment {
public ModulesFragment() { public ModulesFragment() {
} }
// TODO: Customize parameter initialization
@SuppressWarnings("unused")
public static ModulesFragment newInstance() { public static ModulesFragment newInstance() {
ModulesFragment fragment = new ModulesFragment(); ModulesFragment fragment = new ModulesFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
@@ -107,18 +101,7 @@ public class ModulesFragment extends Fragment {
mListener = null; mListener = null;
} }
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p/>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnModulesFragmentInteractionListener { public interface OnModulesFragmentInteractionListener {
// TODO: Update argument type and name
void onModulesFragmentInteraction(int item); void onModulesFragmentInteraction(int item);
} }
} }

View File

@@ -26,14 +26,11 @@ import de.sebse.fuplanner.tools.ui.weekview.WeekViewEvent;
/** /**
* A simple {@link Fragment} subclass. * A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the * Activities that contain this fragment must implement the
* {@link ScheduleFragment.OnFragmentInteractionListener} interface * {@link ScheduleFragment.OnScheduleFragmentInteractionListener} interface
* to handle interaction events. * to handle interaction events.
* Use the {@link ScheduleFragment#newInstance} factory method to * Use the {@link ScheduleFragment#newInstance} factory method to
* create an instance of this fragment. * create an instance of this fragment.
* *
* TODO Reduce day range to 6-20h as in https://stackoverflow.com/questions/35944431/filter-specific-range-of-hours-to-show-in-alamkanak-android-week-view
*
* TODO Scroll week wise (snap)
*/ */
public class ScheduleFragment extends Fragment implements MonthLoader.MonthChangeListener, WeekView.ScrollListener { public class ScheduleFragment extends Fragment implements MonthLoader.MonthChangeListener, WeekView.ScrollListener {
private OnScheduleFragmentInteractionListener mListener; private OnScheduleFragmentInteractionListener mListener;
@@ -76,7 +73,6 @@ public class ScheduleFragment extends Fragment implements MonthLoader.MonthChang
mWeekView.notifyDatasetChanged(); mWeekView.notifyDatasetChanged();
} }
} }
}, error1 -> log.e(error1)); }, error1 -> log.e(error1));
} }
}, error -> log.e(error)); }, error -> log.e(error));
@@ -146,18 +142,7 @@ public class ScheduleFragment extends Fragment implements MonthLoader.MonthChang
mListener.onScheduleFragmentInteraction(newFirstVisibleDay, newLastVisibleDay); mListener.onScheduleFragmentInteraction(newFirstVisibleDay, newLastVisibleDay);
} }
/**
* This interface must be implemented by activities that contain this
* fragment to allow an interaction in this fragment to be communicated
* to the activity and potentially other fragments contained in that
* activity.
* <p>
* See the Android Training lesson <a href=
* "http://developer.android.com/training/basics/fragments/communicating.html"
* >Communicating with Other Fragments</a> for more information.
*/
public interface OnScheduleFragmentInteractionListener { public interface OnScheduleFragmentInteractionListener {
// TODO: Update argument type and name
void onScheduleFragmentInteraction(Calendar firstVisibleDate, Calendar lastVisibleDay); void onScheduleFragmentInteraction(Calendar firstVisibleDate, Calendar lastVisibleDay);
} }
} }

View File

@@ -6,14 +6,12 @@ import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter; import android.support.v4.app.FragmentStatePagerAdapter;
import de.sebse.fuplanner.R; import de.sebse.fuplanner.R;
import de.sebse.fuplanner.tools.logging.Logger;
class ModDetailAdapter extends FragmentStatePagerAdapter { class ModDetailAdapter extends FragmentStatePagerAdapter {
private final int mItemPos; private final int mItemPos;
private final Context mContext; private final Context mContext;
private Logger log = new Logger(this);
public ModDetailAdapter(FragmentManager fm, int itemPosition, Context context) { ModDetailAdapter(FragmentManager fm, int itemPosition, Context context) {
super(fm); super(fm);
this.mContext = context; this.mContext = context;
this.mItemPos = itemPosition; this.mItemPos = itemPosition;

View File

@@ -1,7 +1,6 @@
package de.sebse.fuplanner.fragments.moddetails; package de.sebse.fuplanner.fragments.moddetails;
import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
@@ -23,11 +22,8 @@ import de.sebse.fuplanner.tools.logging.Logger;
* create an instance of this fragment. * create an instance of this fragment.
*/ */
public class ModDetailAnnounceFragment extends Fragment { public class ModDetailAnnounceFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_POSITION = "itemPosition"; private static final String ARG_POSITION = "itemPosition";
// TODO: Rename and change types of parameters
private int mItemPos; private int mItemPos;
private Logger log = new Logger(this); private Logger log = new Logger(this);
private ModDetailAnnounceAdapter adapter; private ModDetailAnnounceAdapter adapter;
@@ -45,7 +41,6 @@ public class ModDetailAnnounceFragment extends Fragment {
* @param itemPosition Item position in module list. * @param itemPosition Item position in module list.
* @return A new instance of fragment ModDetailAnnounceFragment. * @return A new instance of fragment ModDetailAnnounceFragment.
*/ */
// TODO: Rename and change types and number of parameters
public static ModDetailAnnounceFragment newInstance(int itemPosition) { public static ModDetailAnnounceFragment newInstance(int itemPosition) {
ModDetailAnnounceFragment fragment = new ModDetailAnnounceFragment(); ModDetailAnnounceFragment fragment = new ModDetailAnnounceFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
@@ -68,9 +63,7 @@ public class ModDetailAnnounceFragment extends Fragment {
// Inflate the layout for this fragment // Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_expandable_list_view, container, false); View view = inflater.inflate(R.layout.fragment_expandable_list_view, container, false);
// Set the adapter // Set the adapter
Context context = view.getContext();
ExpandableListView expandableListView = view.findViewById(R.id.list); ExpandableListView expandableListView = view.findViewById(R.id.list);
//expandableListView.setLayoutManager(new LinearLayoutManager(context));
adapter = new ModDetailAnnounceAdapter(); adapter = new ModDetailAnnounceAdapter();
expandableListView.setAdapter(adapter); expandableListView.setAdapter(adapter);

View File

@@ -1,7 +1,6 @@
package de.sebse.fuplanner.fragments.moddetails; package de.sebse.fuplanner.fragments.moddetails;
import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
@@ -23,11 +22,8 @@ import de.sebse.fuplanner.tools.logging.Logger;
* create an instance of this fragment. * create an instance of this fragment.
*/ */
public class ModDetailAssignmentFragment extends Fragment { public class ModDetailAssignmentFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_POSITION = "itemPosition"; private static final String ARG_POSITION = "itemPosition";
// TODO: Rename and change types of parameters
private int mItemPos; private int mItemPos;
private Logger log = new Logger(this); private Logger log = new Logger(this);
private ModDetailAssignmentAdapter adapter; private ModDetailAssignmentAdapter adapter;
@@ -45,7 +41,6 @@ public class ModDetailAssignmentFragment extends Fragment {
* @param itemPosition Item position in module list. * @param itemPosition Item position in module list.
* @return A new instance of fragment ModDetailAnnounceFragment. * @return A new instance of fragment ModDetailAnnounceFragment.
*/ */
// TODO: Rename and change types and number of parameters
public static ModDetailAssignmentFragment newInstance(int itemPosition) { public static ModDetailAssignmentFragment newInstance(int itemPosition) {
ModDetailAssignmentFragment fragment = new ModDetailAssignmentFragment(); ModDetailAssignmentFragment fragment = new ModDetailAssignmentFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
@@ -68,9 +63,7 @@ public class ModDetailAssignmentFragment extends Fragment {
// Inflate the layout for this fragment // Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_expandable_list_view, container, false); View view = inflater.inflate(R.layout.fragment_expandable_list_view, container, false);
// Set the adapter // Set the adapter
Context context = view.getContext();
ExpandableListView expandableListView = view.findViewById(R.id.list); ExpandableListView expandableListView = view.findViewById(R.id.list);
//expandableListView.setLayoutManager(new LinearLayoutManager(context));
adapter = new ModDetailAssignmentAdapter(); adapter = new ModDetailAssignmentAdapter();
expandableListView.setAdapter(adapter); expandableListView.setAdapter(adapter);

View File

@@ -31,10 +31,8 @@ public class ModDetailEventAdapter extends RecyclerView.Adapter<RecyclerView.Vie
private Modules.Module mValue; private Modules.Module mValue;
private final ArrayList<Pair<Integer, Integer>> mPositionalData; private final ArrayList<Pair<Integer, Integer>> mPositionalData;
private Logger log = new Logger(this);
//private final ModulesFragment.OnModulesFragmentInteractionListener mListener;
public ModDetailEventAdapter(/*ModulesFragment.OnModulesFragmentInteractionListener listener*/) { ModDetailEventAdapter() {
mValue = null; mValue = null;
mPositionalData = new ArrayList<>(); mPositionalData = new ArrayList<>();
//mListener = listener; //mListener = listener;

View File

@@ -24,11 +24,8 @@ import de.sebse.fuplanner.tools.logging.Logger;
* create an instance of this fragment. * create an instance of this fragment.
*/ */
public class ModDetailEventFragment extends Fragment { public class ModDetailEventFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_POSITION = "itemPosition"; private static final String ARG_POSITION = "itemPosition";
// TODO: Rename and change types of parameters
private int mItemPos; private int mItemPos;
private Logger log = new Logger(this); private Logger log = new Logger(this);
private ModDetailEventAdapter adapter; private ModDetailEventAdapter adapter;
@@ -46,7 +43,6 @@ public class ModDetailEventFragment extends Fragment {
* @param itemPosition Item position in module list. * @param itemPosition Item position in module list.
* @return A new instance of fragment ModDetailAnnounceFragment. * @return A new instance of fragment ModDetailAnnounceFragment.
*/ */
// TODO: Rename and change types and number of parameters
public static ModDetailEventFragment newInstance(int itemPosition) { public static ModDetailEventFragment newInstance(int itemPosition) {
ModDetailEventFragment fragment = new ModDetailEventFragment(); ModDetailEventFragment fragment = new ModDetailEventFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();

View File

@@ -21,8 +21,6 @@ import de.sebse.fuplanner.R;
* create an instance of this fragment. * create an instance of this fragment.
*/ */
public class ModDetailFragment extends Fragment { public class ModDetailFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_POSITION = "itemPosition"; private static final String ARG_POSITION = "itemPosition";
// Parameters // Parameters

View File

@@ -25,10 +25,8 @@ public class ModDetailGradebookAdapter extends RecyclerView.Adapter<RecyclerView
private Modules.Module mValue; private Modules.Module mValue;
private final ArrayList<Pair<Integer, Integer>> mPositionalData; private final ArrayList<Pair<Integer, Integer>> mPositionalData;
private Logger log = new Logger(this);
//private final ModulesFragment.OnModulesFragmentInteractionListener mListener;
public ModDetailGradebookAdapter(/*ModulesFragment.OnModulesFragmentInteractionListener listener*/) { ModDetailGradebookAdapter() {
mValue = null; mValue = null;
mPositionalData = new ArrayList<>(); mPositionalData = new ArrayList<>();
//mListener = listener; //mListener = listener;

View File

@@ -24,11 +24,8 @@ import de.sebse.fuplanner.tools.logging.Logger;
* create an instance of this fragment. * create an instance of this fragment.
*/ */
public class ModDetailGradebookFragment extends Fragment { public class ModDetailGradebookFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_POSITION = "itemPosition"; private static final String ARG_POSITION = "itemPosition";
// TODO: Rename and change types of parameters
private int mItemPos; private int mItemPos;
private Logger log = new Logger(this); private Logger log = new Logger(this);
private ModDetailGradebookAdapter adapter; private ModDetailGradebookAdapter adapter;
@@ -46,7 +43,6 @@ public class ModDetailGradebookFragment extends Fragment {
* @param itemPosition Item position in module list. * @param itemPosition Item position in module list.
* @return A new instance of fragment ModDetailAnnounceFragment. * @return A new instance of fragment ModDetailAnnounceFragment.
*/ */
// TODO: Rename and change types and number of parameters
public static ModDetailGradebookFragment newInstance(int itemPosition) { public static ModDetailGradebookFragment newInstance(int itemPosition) {
ModDetailGradebookFragment fragment = new ModDetailGradebookFragment(); ModDetailGradebookFragment fragment = new ModDetailGradebookFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();

View File

@@ -38,9 +38,8 @@ public class ModDetailOverviewAdapter extends RecyclerView.Adapter<RecyclerView.
private Modules.Module mValue; private Modules.Module mValue;
private final ArrayList<Pair<Integer, Object>> mPositionalData; private final ArrayList<Pair<Integer, Object>> mPositionalData;
private Logger log = new Logger(this); private Logger log = new Logger(this);
//private final ModulesFragment.OnModulesFragmentInteractionListener mListener;
public ModDetailOverviewAdapter(/*ModulesFragment.OnModulesFragmentInteractionListener listener*/) { ModDetailOverviewAdapter() {
mValue = null; mValue = null;
mPositionalData = new ArrayList<>(); mPositionalData = new ArrayList<>();
//mListener = listener; //mListener = listener;

View File

@@ -24,11 +24,8 @@ import de.sebse.fuplanner.tools.logging.Logger;
* create an instance of this fragment. * create an instance of this fragment.
*/ */
public class ModDetailOverviewFragment extends Fragment { public class ModDetailOverviewFragment extends Fragment {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_POSITION = "itemPosition"; private static final String ARG_POSITION = "itemPosition";
// TODO: Rename and change types of parameters
private int mItemPos; private int mItemPos;
private Logger log = new Logger(this); private Logger log = new Logger(this);
private ModDetailOverviewAdapter adapter; private ModDetailOverviewAdapter adapter;
@@ -46,7 +43,6 @@ public class ModDetailOverviewFragment extends Fragment {
* @param itemPosition Item position in module list. * @param itemPosition Item position in module list.
* @return A new instance of fragment ModDetailOverviewFragment. * @return A new instance of fragment ModDetailOverviewFragment.
*/ */
// TODO: Rename and change types and number of parameters
public static ModDetailOverviewFragment newInstance(int itemPosition) { public static ModDetailOverviewFragment newInstance(int itemPosition) {
ModDetailOverviewFragment fragment = new ModDetailOverviewFragment(); ModDetailOverviewFragment fragment = new ModDetailOverviewFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();