Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
cec1b2ca6b
15 changed files with 186 additions and 64 deletions
|
@ -1,27 +1,40 @@
|
|||
body {
|
||||
max-width: 100% !important;
|
||||
display: block;
|
||||
margin: 5%;
|
||||
margin-top: 7%;
|
||||
margin-bottom: 0;
|
||||
margin-left: 7%;
|
||||
margin-right: 7%;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 2em;
|
||||
letter-spacing: 0.05em;
|
||||
color: #727272;
|
||||
font-family: serif;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 2em;
|
||||
color: #212121;
|
||||
font-size: 1.5em;
|
||||
font-family: sans-serif;
|
||||
padding-top: 5%;
|
||||
}
|
||||
|
||||
p, li {
|
||||
p {
|
||||
font-family: sans-serif;
|
||||
font-size: 1.1em;
|
||||
line-height: 1.6em;
|
||||
}
|
||||
|
||||
li {
|
||||
font-family: sans-serif;
|
||||
font-size: 1em;
|
||||
line-height: 1em;
|
||||
line-height: 250%;
|
||||
}
|
||||
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
}
|
||||
|
@ -31,23 +44,21 @@ a {
|
|||
text-decoration-color: #a3c8ff;
|
||||
}
|
||||
|
||||
.external-free {
|
||||
background-color: #f44336;
|
||||
color: white;
|
||||
padding: 14px 25px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
a.external-free {
|
||||
word-wrap: break-word;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
|
||||
.thumb-tright, .thumbinner {
|
||||
width: 100%;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.thumbcaption {
|
||||
padding-top: 3%;
|
||||
width: 100%;
|
||||
font-size: 1em;
|
||||
font-size: 1.1em;
|
||||
color: #727272;
|
||||
font-style: italic;
|
||||
text-align: center;
|
||||
}
|
||||
|
|
|
@ -164,6 +164,7 @@
|
|||
<!-- Longitude row: -->
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/longitude_row"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/content_padding_small"
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/wikivoyage_bg"
|
||||
android:background="?attr/wikivoyage_bg_color"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/toolbar_height"
|
||||
android:background="?attr/wikivoyage_app_bar"
|
||||
android:background="?attr/wikivoyage_app_bar_color"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/toolbar_height"
|
||||
osmand:contentInsetLeft="54dp"
|
||||
|
@ -41,10 +41,10 @@
|
|||
android:textAllCaps="true"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
tools:background="?attr/ctx_menu_controller_bg"
|
||||
tools:background="@drawable/wikipedia_select_lang_bg_dark_n"
|
||||
tools:drawableLeft="@drawable/ic_action_map_language"
|
||||
tools:text="En"
|
||||
tools:textColor="?attr/ctx_menu_controller_text_color"/>
|
||||
tools:textColor="?attr/wikivoyage_active_color"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/ctx_menu_info_view_bg"
|
||||
android:background="?attr/wikivoyage_bg_color"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
|
@ -13,7 +13,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dashboard_map_toolbar"
|
||||
android:minHeight="@dimen/dashboard_map_toolbar"
|
||||
android:theme="?attr/toolbar_theme"
|
||||
osmand:contentInsetLeft="54dp"
|
||||
osmand:contentInsetStart="54dp">
|
||||
|
||||
|
@ -31,9 +30,9 @@
|
|||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:text="@string/shared_string_travel"
|
||||
android:textColor="?attr/wikivoyage_app_bar_text_color"
|
||||
android:textSize="@dimen/dialog_header_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
tools:textColor="@color/color_white"/>
|
||||
osmand:typeface="@string/font_roboto_medium"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/options_button"
|
||||
|
@ -47,7 +46,7 @@
|
|||
android:paddingRight="16dp"
|
||||
android:text="@string/shared_string_options"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/dashboard_blue"
|
||||
android:textColor="?attr/wikivoyage_active_color"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"/>
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/ctx_menu_info_view_bg"
|
||||
android:background="?attr/wikivoyage_bg_color"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
|
@ -15,9 +15,8 @@
|
|||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dashboard_map_toolbar"
|
||||
android:background="?attr/bg_color"
|
||||
android:background="?attr/wikivoyage_card_bg_color"
|
||||
android:minHeight="@dimen/dashboard_map_toolbar"
|
||||
android:theme="?attr/toolbar_theme"
|
||||
app:contentInsetLeft="54dp"
|
||||
app:contentInsetStart="54dp">
|
||||
|
||||
|
|
|
@ -65,8 +65,11 @@
|
|||
<attr name="primary_icon_color" format="color"/>
|
||||
<attr name="light_icon_color" format="color"/>
|
||||
|
||||
<attr name="wikivoyage_bg" format="reference"/>
|
||||
<attr name="wikivoyage_app_bar" format="reference"/>
|
||||
<attr name="wikivoyage_bg_color" format="reference"/>
|
||||
<attr name="wikivoyage_card_bg_color" format="reference"/>
|
||||
<attr name="wikivoyage_app_bar_color" format="reference"/>
|
||||
<attr name="wikivoyage_app_bar_text_color" format="reference"/>
|
||||
<attr name="wikivoyage_active_color" format="reference"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="PagerSlidingTabStrip">
|
||||
|
|
|
@ -142,8 +142,10 @@
|
|||
<color name="status_bar_dim_light">#8a4e00</color>
|
||||
<color name="status_bar_dim_dark">#13171a</color>
|
||||
<color name="status_bar_coordinate_input_dark">#0d0f0f</color>
|
||||
<color name="status_bar_wikivoyage_light">#f2f2f2</color>
|
||||
<color name="status_bar_wikivoyage_dark">#222526</color>
|
||||
<color name="status_bar_wikivoyage_light">#dddddd</color>
|
||||
<color name="status_bar_wikivoyage_dark">#101112</color>
|
||||
<color name="status_bar_wikivoyage_article_light">#f2f2f2</color>
|
||||
<color name="status_bar_wikivoyage_article_dark">#222526</color>
|
||||
|
||||
|
||||
<color name="color_transparent">#0000</color>
|
||||
|
@ -396,5 +398,7 @@
|
|||
<color name="wikivoyage_active_dark">#d28521</color>
|
||||
<color name="wikivoyage_app_bar_light">#f2f2f2</color>
|
||||
<color name="wikivoyage_app_bar_dark">#222526</color>
|
||||
<color name="wikivoyage_app_bar_text_light">#454545</color>
|
||||
<color name="wikivoyage_app_bar_text_dark">#ababab</color>
|
||||
|
||||
</resources>
|
|
@ -9,7 +9,8 @@
|
|||
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
|
||||
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
||||
-->
|
||||
<string name="shared_string_travel">Travel</string>
|
||||
<string name="use_two_digits_longitude">Use two digits longitude</string>
|
||||
<string name="shared_string_travel">Travel</string>
|
||||
<string name="waypoints_removed_from_map_markers">Waypoints removed from map markers</string>
|
||||
<string name="nothing_found_in_radius">Nothing found within the radius:</string>
|
||||
<string name="select_waypoints_category_description">You can add all of the track\'s waypoints, or select separate categories.</string>
|
||||
|
|
|
@ -193,8 +193,11 @@
|
|||
|
||||
<item name="coordinate_input_edit_text_normal">@color/coordinate_input_edit_text_normal_light</item>
|
||||
|
||||
<item name="wikivoyage_bg">@color/wikivoyage_bg_light</item>
|
||||
<item name="wikivoyage_app_bar">@color/wikivoyage_app_bar_light</item>
|
||||
<item name="wikivoyage_bg_color">@color/wikivoyage_bg_light</item>
|
||||
<item name="wikivoyage_card_bg_color">@color/wikivoyage_card_bg_light</item>
|
||||
<item name="wikivoyage_app_bar_color">@color/wikivoyage_app_bar_light</item>
|
||||
<item name="wikivoyage_app_bar_text_color">@color/wikivoyage_app_bar_text_light</item>
|
||||
<item name="wikivoyage_active_color">@color/wikivoyage_active_light</item>
|
||||
</style>
|
||||
|
||||
<style name="OverflowMenuButton" parent="@style/Widget.AppCompat.ActionButton.Overflow">
|
||||
|
@ -380,8 +383,11 @@
|
|||
|
||||
<item name="coordinate_input_edit_text_normal">@color/coordinate_input_edit_text_normal_dark</item>
|
||||
|
||||
<item name="wikivoyage_bg">@color/wikivoyage_bg_dark</item>
|
||||
<item name="wikivoyage_app_bar">@color/wikivoyage_app_bar_dark</item>
|
||||
<item name="wikivoyage_bg_color">@color/wikivoyage_bg_dark</item>
|
||||
<item name="wikivoyage_card_bg_color">@color/wikivoyage_card_bg_dark</item>
|
||||
<item name="wikivoyage_app_bar_color">@color/wikivoyage_app_bar_dark</item>
|
||||
<item name="wikivoyage_app_bar_text_color">@color/wikivoyage_app_bar_text_dark</item>
|
||||
<item name="wikivoyage_active_color">@color/wikivoyage_active_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="FreeVersionBanner" parent="OsmandDarkTheme">
|
||||
|
|
|
@ -721,7 +721,8 @@ public class OsmandSettings {
|
|||
|
||||
public final CommonPreference<Boolean> COORDS_INPUT_USE_RIGHT_SIDE = new BooleanPreference("coords_input_use_right_side", true).makeGlobal();
|
||||
public final CommonPreference<Integer> COORDS_INPUT_FORMAT = new IntPreference("coords_input_format", CoordinateInputFormats.DD_MM_MMM);
|
||||
public final CommonPreference<Boolean> COORDS_INPUT_USE_OSMAND_KEYBOARD = new BooleanPreference("coords_input_use_osmand_keyboard", true).makeGlobal();
|
||||
public final CommonPreference<Boolean> COORDS_INPUT_USE_OSMAND_KEYBOARD = new BooleanPreference("coords_input_use_osmand_keyboard", Build.VERSION.SDK_INT >= 16).makeGlobal();
|
||||
public final CommonPreference<Boolean> COORDS_INPUT_TWO_DIGITS_LONGTITUDE = new BooleanPreference("coords_input_two_digits_longitude", false).makeGlobal();
|
||||
|
||||
public final CommonPreference<Boolean> USE_MAPILLARY_FILTER = new BooleanPreference("use_mapillary_filters", false).makeGlobal();
|
||||
public final CommonPreference<String> MAPILLARY_FILTER_USER_KEY = new StringPreference("mapillary_filter_user_key", "").makeGlobal();
|
||||
|
|
|
@ -55,6 +55,26 @@ public class CoordinateInputBottomSheetDialogFragment extends MenuBottomSheetDia
|
|||
.create();
|
||||
items.add(useSystemKeyboardItem);
|
||||
|
||||
boolean useTwoDigitsLogtitude = settings.COORDS_INPUT_TWO_DIGITS_LONGTITUDE.get();
|
||||
BaseBottomSheetItem twoDigitsLongtitudeItem = new BottomSheetItemWithCompoundButton.Builder()
|
||||
.setChecked(useTwoDigitsLogtitude)
|
||||
.setIcon(getContentIcon(R.drawable.ic_action_next_field_stroke))
|
||||
.setTitle(getString(R.string.use_two_digits_longitude))
|
||||
.setLayoutId(R.layout.bottom_sheet_item_with_switch)
|
||||
.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (listener != null) {
|
||||
OsmandSettings.CommonPreference<Boolean> pref = settings.COORDS_INPUT_TWO_DIGITS_LONGTITUDE;
|
||||
pref.set(!pref.get());
|
||||
listener.onTwoDigitsLongtitudeChanged();
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
})
|
||||
.create();
|
||||
items.add(twoDigitsLongtitudeItem);
|
||||
|
||||
if (!AndroidUiHelper.isOrientationPortrait(getActivity())) {
|
||||
boolean rightHand = settings.COORDS_INPUT_USE_RIGHT_SIDE.get();
|
||||
|
||||
|
@ -130,6 +150,8 @@ public class CoordinateInputBottomSheetDialogFragment extends MenuBottomSheetDia
|
|||
|
||||
interface CoordinateInputFormatChangeListener {
|
||||
|
||||
void onTwoDigitsLongtitudeChanged();
|
||||
|
||||
void onKeyboardChanged();
|
||||
|
||||
void onHandChanged();
|
||||
|
|
|
@ -88,6 +88,8 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
|||
private boolean lightTheme;
|
||||
private boolean orientationPortrait;
|
||||
|
||||
private boolean isSoftKeyboardShown = true;
|
||||
private boolean useTwoDigitsLongtitude;
|
||||
private boolean north = true;
|
||||
private boolean east = true;
|
||||
|
||||
|
@ -105,6 +107,7 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
|||
super.onCreate(savedInstanceState);
|
||||
lightTheme = getMyApplication().getSettings().isLightContent();
|
||||
setStyle(STYLE_NO_FRAME, lightTheme ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme);
|
||||
useTwoDigitsLongtitude = getMyApplication().getSettings().COORDS_INPUT_TWO_DIGITS_LONGTITUDE.get();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
@ -247,12 +250,30 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
|||
pointNameKeyboardBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (isOsmandKeyboardOn()) {
|
||||
changeKeyboard();
|
||||
if (isOsmandKeyboardCurrentlyVisible()) {
|
||||
changeOsmandKeyboardVisibility(false);
|
||||
}
|
||||
editTexts.get(6).requestFocus();
|
||||
final View focusedView = getDialog().getCurrentFocus();
|
||||
if (focusedView != null) {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
isSoftKeyboardShown = true;
|
||||
AndroidUtils.showSoftKeyboard(focusedView);
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
});
|
||||
editTexts.get(6).setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if (!hasFocus && isOsmandKeyboardOn() && isOsmandKeyboardCurrentlyVisible()) {
|
||||
AndroidUtils.hideSoftKeyboard(getActivity(), v);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
adapter = new CoordinateInputAdapter(mapActivity, mapMarkers);
|
||||
RecyclerView recyclerView = (RecyclerView) mainView.findViewById(R.id.markers_recycler_view);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
|
@ -343,10 +364,25 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
|||
@Override
|
||||
public void onClick(View view) {
|
||||
boolean isCurrentlyVisible = isOsmandKeyboardCurrentlyVisible();
|
||||
if (!isCurrentlyVisible && !isOsmandKeyboardOn()) {
|
||||
changeKeyboard();
|
||||
} else {
|
||||
if (isOsmandKeyboardOn() && !isSoftKeyboardShown) {
|
||||
changeOsmandKeyboardVisibility(!isCurrentlyVisible);
|
||||
} else {
|
||||
final View focusedView = getDialog().getCurrentFocus();
|
||||
if (focusedView != null) {
|
||||
if (isSoftKeyboardShown) {
|
||||
isSoftKeyboardShown = false;
|
||||
AndroidUtils.hideSoftKeyboard(getActivity(), focusedView);
|
||||
} else {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
isSoftKeyboardShown = true;
|
||||
AndroidUtils.showSoftKeyboard(focusedView);
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
changeEditTextSelections();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -448,6 +484,19 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
|||
super.onResume();
|
||||
adapter.setScreenOrientation(DashLocationFragment.getScreenOrientation(getActivity()));
|
||||
startLocationUpdate();
|
||||
|
||||
final View focusedView = getDialog().getCurrentFocus();
|
||||
if (focusedView != null) {
|
||||
if (!isOsmandKeyboardOn()) {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
isSoftKeyboardShown = true;
|
||||
AndroidUtils.showSoftKeyboard(focusedView);
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -670,8 +719,8 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
|||
|
||||
int format = getMyApplication().getSettings().COORDS_INPUT_FORMAT.get();
|
||||
|
||||
setupEditTextEx(R.id.lat_first_input_et, CoordinateInputFormats.getFirstPartSymbolsCount(format, true), true);
|
||||
setupEditTextEx(R.id.lon_first_input_et, CoordinateInputFormats.getFirstPartSymbolsCount(format, false), false);
|
||||
setupEditTextEx(R.id.lat_first_input_et, CoordinateInputFormats.getFirstPartSymbolsCount(format, true, useTwoDigitsLongtitude), true);
|
||||
setupEditTextEx(R.id.lon_first_input_et, CoordinateInputFormats.getFirstPartSymbolsCount(format, false, useTwoDigitsLongtitude), false);
|
||||
|
||||
String firstSeparator = CoordinateInputFormats.getFirstSeparator(format);
|
||||
((TextView) mainView.findViewById(R.id.lat_first_separator_tv)).setText(firstSeparator);
|
||||
|
@ -764,6 +813,11 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
|||
private CoordinateInputFormatChangeListener createCoordinateInputFormatChangeListener() {
|
||||
return new CoordinateInputFormatChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onTwoDigitsLongtitudeChanged() {
|
||||
changeTwoDigitsLongtitude();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKeyboardChanged() {
|
||||
changeKeyboard();
|
||||
|
@ -787,6 +841,13 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
|||
registerMainView();
|
||||
}
|
||||
|
||||
private void changeTwoDigitsLongtitude() {
|
||||
editTexts.get(3).setMaxSymbolsCount(getMyApplication().getSettings().COORDS_INPUT_TWO_DIGITS_LONGTITUDE.get() ? 2 : 3);
|
||||
((LinearLayout)mainView.findViewById(R.id.longitude_row)).removeView(editTexts.get(3));
|
||||
// editTexts.get(3).invalidate();
|
||||
registerMainView();
|
||||
}
|
||||
|
||||
private void changeEditTextSelections() {
|
||||
for (EditText et : editTexts) {
|
||||
et.setSelection(et.getText().length());
|
||||
|
|
|
@ -43,8 +43,12 @@ public class CoordinateInputFormats {
|
|||
return format == DD_MM_MMM || format == DD_MM_MMMM || format == DD_MM_SS;
|
||||
}
|
||||
|
||||
public static int getFirstPartSymbolsCount(@CoordinateInputFormatDef int format, boolean latitude) {
|
||||
return latitude ? 2 : 3;
|
||||
public static int getFirstPartSymbolsCount(@CoordinateInputFormatDef int format, boolean latitude, boolean isTwoDigitsLongtitute) {
|
||||
if (latitude) {
|
||||
return 2;
|
||||
} else {
|
||||
return isTwoDigitsLongtitute ? 2 : 3;
|
||||
}
|
||||
}
|
||||
|
||||
public static int getSecondPartSymbolsCount(@CoordinateInputFormatDef int format) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.osmand.plus.wikivoyage;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
|
@ -15,7 +14,6 @@ import android.view.LayoutInflater;
|
|||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
@ -48,22 +46,6 @@ public class WikivoyageArticleDialogFragment extends WikivoyageBaseDialogFragmen
|
|||
private TextView selectedLangTv;
|
||||
private WebView contentWebView;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
int themeId = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme_LightStatusBar;
|
||||
Dialog dialog = new Dialog(getContext(), themeId);
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
Window window = dialog.getWindow();
|
||||
if (window != null) {
|
||||
window.setStatusBarColor(getResolvedColor(nightMode
|
||||
? R.color.status_bar_wikivoyage_dark
|
||||
: R.color.status_bar_wikivoyage_light));
|
||||
}
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
|
@ -109,6 +91,11 @@ public class WikivoyageArticleDialogFragment extends WikivoyageBaseDialogFragmen
|
|||
outState.putString(SELECTED_LANG_KEY, selectedLang);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getStatusBarColor() {
|
||||
return nightMode ? R.color.status_bar_wikivoyage_article_dark : R.color.status_bar_wikivoyage_article_light;
|
||||
}
|
||||
|
||||
private void showPopupLangMenu(View view) {
|
||||
if (searchResult == null) {
|
||||
return;
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
package net.osmand.plus.wikivoyage;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.ColorRes;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.LayoutRes;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
|
@ -13,6 +16,7 @@ import android.view.ContextThemeWrapper;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.base.BaseOsmAndDialogFragment;
|
||||
|
@ -27,6 +31,20 @@ public class WikivoyageBaseDialogFragment extends BaseOsmAndDialogFragment {
|
|||
nightMode = isNightMode(false);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
int themeId = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme_LightStatusBar;
|
||||
Dialog dialog = new Dialog(getContext(), themeId);
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
Window window = dialog.getWindow();
|
||||
if (window != null) {
|
||||
window.setStatusBarColor(getResolvedColor(getStatusBarColor()));
|
||||
}
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Drawable getContentIcon(int id) {
|
||||
return getIcon(id, R.color.icon_color);
|
||||
|
@ -36,6 +54,11 @@ public class WikivoyageBaseDialogFragment extends BaseOsmAndDialogFragment {
|
|||
return getIcon(iconId, nightMode ? R.color.wikivoyage_active_dark : R.color.wikivoyage_active_light);
|
||||
}
|
||||
|
||||
@ColorRes
|
||||
protected int getStatusBarColor() {
|
||||
return nightMode ? R.color.status_bar_wikivoyage_dark : R.color.status_bar_wikivoyage_light;
|
||||
}
|
||||
|
||||
@ColorInt
|
||||
protected int getResolvedColor(@ColorRes int colorId) {
|
||||
return ContextCompat.getColor(getContext(), colorId);
|
||||
|
|
Loading…
Reference in a new issue