Fix status bar color

This commit is contained in:
Dima-1 2020-11-23 23:56:01 +02:00
parent ad6c0c420f
commit 4a56b6cb29
2 changed files with 13 additions and 1 deletions

View file

@ -53,6 +53,8 @@ public class OPRWebviewActivity extends OsmandActionBarActivity {
boolean nightMode = !settings.isLightContent();
int themeId = nightMode ? R.style.OsmandDarkTheme_NoActionbar : R.style.OsmandLightTheme_NoActionbar_LightStatusBar;
setTheme(themeId);
getWindow().setStatusBarColor(ContextCompat.getColor(this, nightMode
? R.color.list_background_color_dark : R.color.list_background_color_light));
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_opr_webview);
Bundle bundle = getIntent().getExtras();

View file

@ -2,6 +2,7 @@ package net.osmand.plus.openplacereviews;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Build;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
@ -26,10 +27,11 @@ public class OprStartFragment extends BaseOsmAndFragment {
private static final String TAG = OprStartFragment.class.getSimpleName();
private static final Log LOG = PlatformUtil.getLog(OprStartFragment.class);
private static final String openPlaceReviewsUrl = "OpenPlaceReviews.org";
private boolean nightMode;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
boolean nightMode = getMyApplication().getDaynightHelper().isNightModeForMapControls();
nightMode = getMyApplication().getDaynightHelper().isNightModeForMapControls();
View v = UiUtilities.getInflater(requireMyActivity(), nightMode).inflate(R.layout.fragment_opr_login, container,
false);
View createAccount = v.findViewById(R.id.register_opr_create_account);
@ -78,6 +80,14 @@ public class OprStartFragment extends BaseOsmAndFragment {
v.<TextView>findViewById(R.id.start_opr_description).setMovementMethod(LinkMovementMethod.getInstance());
}
@Override
public int getStatusBarColorId() {
View view = getView();
if (view != null && Build.VERSION.SDK_INT >= 23 && !nightMode) {
view.setSystemUiVisibility(view.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
return nightMode ? R.color.list_background_color_dark : R.color.list_background_color_light;
}
private class URLSpanNoUnderline extends URLSpan {
public URLSpanNoUnderline(String url) {