I'm trying to re-design my app, but I'm not sure the best way to go about it.
I currently have an expandable list view with some workouts as the headers/parent items. Each workout has 4 child items, representing 4 weeks. When the user clicks a week, it sends them to a new activity that has 3 tab fragments(representing monday, wed, and friday). These fragments each have a recycler view, that is populated with data depending on what item is clicked (custom object). Here is a small example:
//RECYCLERVIEW
final RecyclerView rv = (RecyclerView) view.findViewById(R.id.mRecyclerMon);
rv.setLayoutManager(new LinearLayoutManager(this.getActivity()));
rv.setAdapter(new MyRecyclerAdapter(this.getActivity(), getMondayWorkout(), 1));
private ArrayList<Workout> getMondayWorkout() {
ArrayList<Workout> workout = new ArrayList<>();
switch (workout3) {
case "w29w1": {
Workout workouts = new Workout(getActivity().getString(R.string.benchpress), "50", "5", bench50, false);
workout.add(workouts);
workouts = new Workout(getActivity().getString(R.string.benchpress), "60", "4", bench60, false);
workout.add(workouts);
That's just a small example. This works good, but I would like to make it easier to use. My idea is to have the user select a workout, then add each workout as an event to Caldroid calendar, and when they click that Workout (For example, Monday), the same view I was using before with the recycler view will be used. So far I believe I know how to do all this.
My question is, I'd like to implement a save feature. So when the user is done the Workout, it is saved to the corresponding day on Caldroid, and changes the bg colour of the day so the user knows it is complete. I'm just not sure how I can save the workout so the user can go back to that day and check it out, as right now the recycler view is always re-used, and re-uses the same arraylists, depending on what day they click. I would also like to add an option to take notes, which makes things even more complicated..
Basically I want it so when the user saves the workout they have done, it saves every part of that activity, the recycler view items (including the checkmark state), and the notes taken with that workout.
I have thought about using sqlite, but I'm not sure how exactly I would save the state of an ArrayList/recyclerview with custom objects into sqlite, then refer back to that after the item has been saved and the user clicks on a specific date
If anyone has any help at all, or can point me in the right direction, it is greatly appreciated! I have no idea where to even start! Thanks a lot!