mirror of
https://github.com/russok/FitoTrack.git
synced 2025-10-29 00:32:11 -07:00
Fix #25 Workouts not visible after recording has stopped
This commit is contained in:
parent
607850b8c6
commit
4f22a6f500
@ -47,6 +47,7 @@ public class ListWorkoutsActivity extends Activity implements WorkoutAdapter.Wor
|
|||||||
private RecyclerView.LayoutManager layoutManager;
|
private RecyclerView.LayoutManager layoutManager;
|
||||||
private FloatingActionMenu menu;
|
private FloatingActionMenu menu;
|
||||||
Workout[] workouts;
|
Workout[] workouts;
|
||||||
|
private boolean recorderHasStarted= false;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -78,8 +79,7 @@ public class ListWorkoutsActivity extends Activity implements WorkoutAdapter.Wor
|
|||||||
|
|
||||||
checkFirstStart();
|
checkFirstStart();
|
||||||
|
|
||||||
adapter= new WorkoutAdapter(workouts, this);
|
refreshAdapter();
|
||||||
listView.setAdapter(adapter);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,6 +101,8 @@ public class ListWorkoutsActivity extends Activity implements WorkoutAdapter.Wor
|
|||||||
RecordWorkoutActivity.ACTIVITY= activity;
|
RecordWorkoutActivity.ACTIVITY= activity;
|
||||||
final Intent intent= new Intent(this, RecordWorkoutActivity.class);
|
final Intent intent= new Intent(this, RecordWorkoutActivity.class);
|
||||||
new Handler().postDelayed(() -> startActivity(intent), 300);
|
new Handler().postDelayed(() -> startActivity(intent), 300);
|
||||||
|
|
||||||
|
recorderHasStarted= true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -108,7 +110,10 @@ public class ListWorkoutsActivity extends Activity implements WorkoutAdapter.Wor
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
loadData();
|
loadData();
|
||||||
adapter.notifyDataSetChanged();
|
if(recorderHasStarted){
|
||||||
|
refreshAdapter();
|
||||||
|
recorderHasStarted= false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -130,6 +135,11 @@ public class ListWorkoutsActivity extends Activity implements WorkoutAdapter.Wor
|
|||||||
workouts= Instance.getInstance(this).db.workoutDao().getWorkouts();
|
workouts= Instance.getInstance(this).db.workoutDao().getWorkouts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void refreshAdapter(){
|
||||||
|
adapter= new WorkoutAdapter(workouts, this);
|
||||||
|
listView.setAdapter(adapter);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user