Skip to content

Commit

Permalink
courses: refresh myCourses on change (fixes #2684) (#2685)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Okuro3499 and dogi authored Nov 7, 2023
1 parent 931c02a commit 8a22237
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 21
targetSdkVersion 34
versionCode 1135
versionName "0.11.35"
versionCode 1136
versionName "0.11.36"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ public void afterTextChanged(Editable s) {
.setMessage(R.string.are_you_sure_you_want_to_delete_these_courses)
.setPositiveButton(R.string.yes, (dialogInterface, i) -> {
deleteSelected(true);
checkList();
CourseFragment newFragment = new CourseFragment();
recreateFragment(newFragment);
})
.setNegativeButton(R.string.no, null).show());
getView().findViewById(R.id.btn_collections).setOnClickListener(view -> {
Expand Down Expand Up @@ -320,9 +321,19 @@ public void onPause() {
}

public void recreateFragment(Fragment fragment) {
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, fragment);
transaction.addToBackStack(null);
transaction.commit();
if(isMyCourseLib){
Bundle args = new Bundle();
args.putBoolean("isMyCourseLib", true);
fragment.setArguments(args);
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, fragment);
transaction.addToBackStack(null);
transaction.commit();
} else{
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, fragment);
transaction.addToBackStack(null);
transaction.commit();
}
}
}

0 comments on commit 8a22237

Please sign in to comment.