MainSettingsFragment->ConfigureProfileFragment for every profile.
This commit is contained in:
parent
4812fa58f4
commit
913559a40a
3 changed files with 7 additions and 2 deletions
|
@ -2092,7 +2092,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
String fragmentName = pref.getFragment();
|
||||
Fragment fragment = Fragment.instantiate(this, fragmentName);
|
||||
if (caller instanceof BaseSettingsFragment) {
|
||||
fragment.setArguments(((BaseSettingsFragment) caller).buildArguments());
|
||||
fragment.setArguments(((BaseSettingsFragment) caller).buildArguments(pref.getKey()));
|
||||
}
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.replace(R.id.fragmentContainer, fragment, fragment.getClass().getName())
|
||||
|
|
|
@ -319,8 +319,12 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
|
|||
}
|
||||
|
||||
public Bundle buildArguments() {
|
||||
return buildArguments(appMode.getStringKey());
|
||||
}
|
||||
|
||||
public Bundle buildArguments(String key) {
|
||||
Bundle args = new Bundle();
|
||||
args.putString(APP_MODE_KEY, appMode.getStringKey());
|
||||
args.putString(APP_MODE_KEY, key);
|
||||
return args;
|
||||
}
|
||||
|
||||
|
|
|
@ -115,6 +115,7 @@ public class MainSettingsFragment extends BaseSettingsFragment {
|
|||
pref.setSummary(getAppModeDescription(getContext(), applicationMode));
|
||||
pref.setChecked(isAppProfileEnabled);
|
||||
pref.setLayoutResource(R.layout.preference_with_descr_dialog_and_switch);
|
||||
pref.setFragment(ConfigureProfileFragment.class.getName());
|
||||
preferenceCategory.addPreference(pref);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue