Merge pull request #8755 from osmandapp/minor_fixes

Minor fixes
This commit is contained in:
vshcherb 2020-04-03 17:54:39 +02:00 committed by GitHub
commit bd216ac793
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -33,6 +33,7 @@ import net.osmand.plus.activities.HelpActivity;
import net.osmand.plus.activities.actions.AppModeDialog;
import net.osmand.plus.dialogs.ConfigureMapMenu;
import net.osmand.plus.dialogs.HelpArticleDialogFragment;
import net.osmand.plus.helpers.AndroidUiHelper;
import org.apache.commons.logging.Log;
@ -258,6 +259,9 @@ public class ContextMenuAdapter {
icon.setVisibility(View.INVISIBLE);
desc.setVisibility(View.GONE);
} else {
AndroidUiHelper.updateVisibility(icon, true);
AndroidUiHelper.updateVisibility(desc, true);
AndroidUtils.setTextPrimaryColor(app, title, nightMode);
icon.setImageDrawable(mIconsCache.getIcon(item.getIcon(), colorResId));
desc.setText(item.getDescription());
boolean selectedMode = tag == PROFILES_CHOSEN_PROFILE_TAG;

View file

@ -184,13 +184,14 @@ public class MainSettingsFragment extends BaseSettingsFragment {
SwitchPreferenceEx pref = new SwitchPreferenceEx(app);
pref.setPersistent(false);
pref.setKey(applicationMode.getStringKey());
preferenceCategory.addPreference(pref);
pref.setIcon(getAppProfilesIcon(applicationMode, isAppProfileEnabled));
pref.setTitle(applicationMode.toHumanString());
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);
}
}