Merge pull request #10483 from osmandapp/closechangeset_default_set
change default settings for the "Close changeset" switch
This commit is contained in:
commit
249c419931
1 changed files with 14 additions and 10 deletions
|
@ -72,20 +72,13 @@ public class SendPoiBottomSheetFragment extends MenuBottomSheetDialogFragment {
|
||||||
String userNameOpenID = settings.USER_NAME.get();
|
String userNameOpenID = settings.USER_NAME.get();
|
||||||
String userName = isLoginOAuth(settings) ? userNameOAuth : userNameOpenID;
|
String userName = isLoginOAuth(settings) ? userNameOAuth : userNameOpenID;
|
||||||
accountName.setText(userName);
|
accountName.setText(userName);
|
||||||
closeChangeSet.setBackgroundResource(isNightMode ? R.drawable.layout_bg_dark : R.drawable.layout_bg);
|
|
||||||
final int paddingSmall = app.getResources().getDimensionPixelSize(R.dimen.content_padding_small);
|
final int paddingSmall = app.getResources().getDimensionPixelSize(R.dimen.content_padding_small);
|
||||||
closeChangeSet.setPadding(paddingSmall, 0, paddingSmall, 0);
|
closeChangeSet.setChecked(true);
|
||||||
|
setCloseChangeSet(isNightMode, paddingSmall);
|
||||||
closeChangeSet.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
closeChangeSet.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
if (isNightMode) {
|
setCloseChangeSet(isNightMode, paddingSmall);
|
||||||
closeChangeSet.setBackgroundResource(
|
|
||||||
isChecked ? R.drawable.layout_bg_dark_solid : R.drawable.layout_bg_dark);
|
|
||||||
} else {
|
|
||||||
closeChangeSet.setBackgroundResource(
|
|
||||||
isChecked ? R.drawable.layout_bg_solid : R.drawable.layout_bg);
|
|
||||||
}
|
|
||||||
closeChangeSet.setPadding(paddingSmall, 0, paddingSmall, 0);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
LinearLayout account = sendOsmPoiView.findViewById(R.id.account_container);
|
LinearLayout account = sendOsmPoiView.findViewById(R.id.account_container);
|
||||||
|
@ -254,5 +247,16 @@ public class SendPoiBottomSheetFragment extends MenuBottomSheetDialogFragment {
|
||||||
}
|
}
|
||||||
return comment;
|
return comment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setCloseChangeSet(boolean isNightMode, int paddingSmall) {
|
||||||
|
if (isNightMode) {
|
||||||
|
closeChangeSet.setBackgroundResource(
|
||||||
|
closeChangeSet.isChecked() ? R.drawable.layout_bg_dark_solid : R.drawable.layout_bg_dark);
|
||||||
|
} else {
|
||||||
|
closeChangeSet.setBackgroundResource(
|
||||||
|
closeChangeSet.isChecked() ? R.drawable.layout_bg_solid : R.drawable.layout_bg);
|
||||||
|
}
|
||||||
|
closeChangeSet.setPadding(paddingSmall, 0, paddingSmall, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue