Merge pull request #10940 from osmandapp/default_profileName_2
fix empty profile name on main settings screen
This commit is contained in:
commit
dd1c4b5311
2 changed files with 9 additions and 3 deletions
|
@ -15,6 +15,8 @@ import net.osmand.plus.profiles.ProfileIconColors;
|
|||
import net.osmand.plus.routing.RouteProvider.RouteService;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
@ -330,8 +332,12 @@ public class ApplicationMode {
|
|||
|
||||
public String toHumanString() {
|
||||
String userProfileName = getUserProfileName();
|
||||
if (Algorithms.isEmpty(userProfileName) && keyName != -1) {
|
||||
return app.getString(keyName);
|
||||
if (Algorithms.isEmpty(userProfileName)) {
|
||||
if (keyName != -1) {
|
||||
return app.getString(keyName);
|
||||
} else {
|
||||
return StringUtils.capitalize(getStringKey());
|
||||
}
|
||||
} else {
|
||||
return userProfileName;
|
||||
}
|
||||
|
|
|
@ -465,7 +465,7 @@ public class ConfigureProfileFragment extends BaseSettingsFragment implements Co
|
|||
bld.setTitle(R.string.profile_alert_delete_title);
|
||||
bld.setMessage(String
|
||||
.format(getString(R.string.profile_alert_delete_msg),
|
||||
profile.getUserProfileName()));
|
||||
profile.toHumanString()));
|
||||
bld.setPositiveButton(R.string.shared_string_delete,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue