Fix padding and theme for EditProfilesFragment

This commit is contained in:
Dima-1 2019-12-26 17:44:54 +02:00
parent 42524a8e78
commit be9d72b620
4 changed files with 11 additions and 16 deletions

View file

@ -24,7 +24,8 @@
android:layout_height="match_parent"
android:background="?attr/list_background_color"
android:clipToPadding="false"
android:paddingBottom="72dp" />
android:paddingBottom="72dp"
android:paddingTop="16dp"/>
<LinearLayout
android:layout_width="match_parent"

View file

@ -65,9 +65,7 @@ public class EditProfilesFragment extends BaseOsmAndFragment {
}
nightMode = !app.getSettings().isLightContent();
View mainView = inflater.inflate(R.layout.edit_profiles_list_fragment, container, false);
AndroidUtils.addStatusBarPadding21v(getContext(), mainView);
View mainView =UiUtilities.getInflater(getContext(), nightMode).inflate(R.layout.edit_profiles_list_fragment, container, false);
ImageButton closeButton = mainView.findViewById(R.id.close_button);
closeButton.setImageResource(R.drawable.ic_action_remove_dark);
closeButton.setOnClickListener(new View.OnClickListener() {
@ -130,7 +128,7 @@ public class EditProfilesFragment extends BaseOsmAndFragment {
recyclerView.setAdapter(adapter);
View cancelButton = mainView.findViewById(R.id.dismiss_button);
UiUtilities.setupDialogButton(false, cancelButton, UiUtilities.DialogButtonType.SECONDARY, R.string.shared_string_cancel);
UiUtilities.setupDialogButton(nightMode, cancelButton, UiUtilities.DialogButtonType.SECONDARY, R.string.shared_string_cancel);
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -144,7 +142,7 @@ public class EditProfilesFragment extends BaseOsmAndFragment {
mainView.findViewById(R.id.buttons_divider).setVisibility(View.VISIBLE);
View applyButton = mainView.findViewById(R.id.right_bottom_button);
UiUtilities.setupDialogButton(false, applyButton, UiUtilities.DialogButtonType.PRIMARY, R.string.shared_string_apply);
UiUtilities.setupDialogButton(nightMode, applyButton, UiUtilities.DialogButtonType.PRIMARY, R.string.shared_string_apply);
applyButton.setVisibility(View.VISIBLE);
applyButton.setOnClickListener(new View.OnClickListener() {
@Override
@ -185,6 +183,11 @@ public class EditProfilesFragment extends BaseOsmAndFragment {
return mainView;
}
@Override
protected boolean isFullScreenAllowed() {
return false;
}
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);

View file

@ -268,7 +268,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
if (!(activity instanceof MapActivity) && statusBarColor != -1) {
activity.getWindow().setStatusBarColor(statusBarColor);
}
if (!isFullScreenAllowed() && activity instanceof MapActivity) {
if (activity instanceof MapActivity) {
((MapActivity) activity).enterToFullScreen();
}
}
@ -367,10 +367,6 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
}
}
protected boolean isFullScreenAllowed() {
return true;
}
protected abstract void setupPreferences();
protected void onBindPreferenceViewHolder(Preference preference, PreferenceViewHolder holder) {

View file

@ -177,11 +177,6 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
return view;
}
@Override
protected boolean isFullScreenAllowed() {
return false;
}
private boolean isChanged() {
return !profile.equals(changedProfile);
}