mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
Use Dagger injection to store title and desc
This commit is contained in:
parent
9354c1c93e
commit
a03ea07608
1 changed files with 2 additions and 3 deletions
|
|
@ -25,7 +25,7 @@ public class DirectUpload {
|
||||||
private Fragment fragment;
|
private Fragment fragment;
|
||||||
private SharedPreferences prefs;
|
private SharedPreferences prefs;
|
||||||
|
|
||||||
|
@Inject @Named("direct_nearby_upload_prefs") SharedPreferences directPrefs;
|
||||||
|
|
||||||
DirectUpload(String title, String desc, Fragment fragment, ContributionController controller, SharedPreferences prefs) {
|
DirectUpload(String title, String desc, Fragment fragment, ContributionController controller, SharedPreferences prefs) {
|
||||||
this.title = title;
|
this.title = title;
|
||||||
|
|
@ -36,8 +36,7 @@ public class DirectUpload {
|
||||||
}
|
}
|
||||||
|
|
||||||
void storeSharedPrefs() {
|
void storeSharedPrefs() {
|
||||||
SharedPreferences sharedPref = fragment.getActivity().getSharedPreferences("Direct Upload", Context.MODE_PRIVATE);
|
SharedPreferences.Editor editor = directPrefs.edit();
|
||||||
SharedPreferences.Editor editor = sharedPref.edit();
|
|
||||||
|
|
||||||
editor.putString("Title", title);
|
editor.putString("Title", title);
|
||||||
editor.putString("Desc", desc);
|
editor.putString("Desc", desc);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue