Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8c48c00f9d
14 changed files with 147 additions and 100 deletions
Binary file not shown.
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 14 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 8.5 KiB |
|
@ -1,9 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/wikivoyage_active_light"/>
|
||||
|
||||
<corners android:radius="3dp"/>
|
||||
|
||||
</shape>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<nine-patch android:src="@drawable/bg_card_shadow_cr3dp"/>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/wikivoyage_active_light"/>
|
||||
<corners android:radius="3dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/wikivoyage_welcome_bg_color">
|
||||
|
||||
<include layout="@layout/wikivoyage_welcome_screen"/>
|
||||
|
||||
</ScrollView>
|
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/wikivoyage_bg_color"
|
||||
|
@ -16,9 +15,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dashboard_map_toolbar"
|
||||
android:background="?attr/wikivoyage_card_bg_color"
|
||||
android:minHeight="@dimen/dashboard_map_toolbar"
|
||||
app:contentInsetLeft="54dp"
|
||||
app:contentInsetStart="54dp">
|
||||
android:minHeight="@dimen/dashboard_map_toolbar">
|
||||
|
||||
<include layout="@layout/search_text_layout"/>
|
||||
|
||||
|
|
|
@ -1,90 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/wikivoyage_welcome_bg_color"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/main_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/wikivoyage_welcome_image_top_margin"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:src="@drawable/img_start_screen_travel_night"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/content_padding"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/access_shared_string_navigate_up"
|
||||
tools:src="@drawable/ic_arrow_back"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/wikivoyage_welcome_content_margin"
|
||||
android:layout_marginRight="@dimen/wikivoyage_welcome_content_margin"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/wikivoyage_welcome_title_bottom_margin"
|
||||
android:layout_marginTop="@dimen/wikivoyage_welcome_title_top_margin"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:text="@string/travel_guide"
|
||||
android:textColor="?attr/wikivoyage_primary_text_color"
|
||||
android:textSize="@dimen/welcome_header_text_size"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:text="@string/travel_guide_description"
|
||||
android:textColor="@color/wikivoyage_secondary_text"
|
||||
android:textSize="@dimen/default_list_text_size"/>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="@dimen/wikivoyage_welcome_content_margin"
|
||||
android:layout_marginTop="@dimen/content_padding"
|
||||
android:background="@drawable/wikivoyage_welcome_btn_bg">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/continue_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/wikivoyage_card_button_height"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:text="@string/shared_string_continue"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/text_button_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<include layout="@layout/wikivoyage_welcome_screen"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -17,16 +17,16 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:minHeight="@dimen/bottom_sheet_selected_item_title_height"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding">
|
||||
android:paddingLeft="@dimen/wikivoyage_search_icon_margin_left"
|
||||
android:paddingRight="@dimen/wikivoyage_search_icon_margin_left">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="@dimen/content_padding"
|
||||
android:layout_marginRight="@dimen/content_padding"
|
||||
android:layout_marginEnd="@dimen/wikivoyage_search_icon_margin_right"
|
||||
android:layout_marginRight="@dimen/wikivoyage_search_icon_margin_right"
|
||||
tools:src="@drawable/ic_action_placeholder_city"/>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -80,8 +80,8 @@
|
|||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="@dimen/bottom_sheet_selected_item_title_height"
|
||||
android:layout_marginStart="@dimen/bottom_sheet_selected_item_title_height"
|
||||
android:layout_marginLeft="@dimen/wikivoyage_search_divider_margin_start"
|
||||
android:layout_marginStart="@dimen/wikivoyage_search_divider_margin_start"
|
||||
android:background="?attr/wikivoyage_card_divider_color"
|
||||
android:focusable="false"/>
|
||||
|
||||
|
|
91
OsmAnd/res/layout/wikivoyage_welcome_screen.xml
Normal file
91
OsmAnd/res/layout/wikivoyage_welcome_screen.xml
Normal file
|
@ -0,0 +1,91 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/main_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/wikivoyage_welcome_image_top_margin"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:scaleType="centerCrop"
|
||||
tools:src="@drawable/img_start_screen_travel_night"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/content_padding"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/access_shared_string_navigate_up"
|
||||
tools:src="@drawable/ic_arrow_back"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/wikivoyage_welcome_content_margin"
|
||||
android:layout_marginRight="@dimen/wikivoyage_welcome_content_margin"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/wikivoyage_welcome_title_bottom_margin"
|
||||
android:layout_marginTop="@dimen/wikivoyage_welcome_title_top_margin"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:text="@string/travel_guide"
|
||||
android:textColor="?attr/wikivoyage_primary_text_color"
|
||||
android:textSize="@dimen/title_text_size"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:text="@string/travel_guide_description"
|
||||
android:textColor="@color/wikivoyage_secondary_text"
|
||||
android:textSize="@dimen/default_list_text_size"/>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="@dimen/wikivoyage_welcome_content_margin"
|
||||
android:layout_marginTop="@dimen/content_padding"
|
||||
android:background="@drawable/wikivoyage_welcome_btn_bg">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/continue_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/wikivoyage_card_button_height"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:text="@string/shared_string_continue"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/text_button_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -203,4 +203,7 @@
|
|||
<dimen name="wikivoyage_welcome_title_bottom_margin">23dp</dimen>
|
||||
<dimen name="wikivoyage_welcome_content_margin">48dp</dimen>
|
||||
<dimen name="wikivoyage_card_button_height">54dp</dimen>
|
||||
<dimen name="wikivoyage_search_icon_margin_left">21dp</dimen>
|
||||
<dimen name="wikivoyage_search_icon_margin_right">33dp</dimen>
|
||||
<dimen name="wikivoyage_search_divider_margin_start">82dp</dimen>
|
||||
</resources>
|
|
@ -286,6 +286,9 @@
|
|||
<dimen name="wikivoyage_welcome_title_bottom_margin">15dp</dimen>
|
||||
<dimen name="wikivoyage_welcome_content_margin">32dp</dimen>
|
||||
<dimen name="wikivoyage_card_button_height">36dp</dimen>
|
||||
|
||||
<dimen name="wikivoyage_search_icon_margin_left">14dp</dimen>
|
||||
<dimen name="wikivoyage_search_icon_margin_right">22dp</dimen>
|
||||
<dimen name="wikivoyage_search_divider_margin_start">64dp</dimen>
|
||||
|
||||
<dimen name="text_button_letter_spacing" format="float">0.01</dimen>
|
||||
</resources>
|
|
@ -9,6 +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="travel_guide">Travel Guide</string>
|
||||
<string name="travel_guide_description">Browse the Wikivoyage guides to the most interesting places on the planet inside OsmAnd without an internet connection.</string>
|
||||
<string name="monthly_map_updates">Map updates: <b>every month</b></string>
|
||||
<string name="daily_map_updates">Map updates: <b>every day, every hour</b></string>
|
||||
<string name="in_app_purchase">In-App purchase</string>
|
||||
|
|
|
@ -9,8 +9,10 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ImageView.ScaleType;
|
||||
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||
import net.osmand.plus.wikivoyage.explore.WikivoyageExploreDialogFragment;
|
||||
|
||||
public class WikivoyageWelcomeDialogFragment extends WikivoyageBaseDialogFragment {
|
||||
|
@ -20,6 +22,8 @@ public class WikivoyageWelcomeDialogFragment extends WikivoyageBaseDialogFragmen
|
|||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
final boolean portrait = AndroidUiHelper.isOrientationPortrait(getActivity());
|
||||
|
||||
View mainView = inflate(R.layout.fragment_wikivoyage_welcome_dialog, container);
|
||||
|
||||
ImageView backBtn = (ImageView) mainView.findViewById(R.id.back_button);
|
||||
|
@ -32,7 +36,9 @@ public class WikivoyageWelcomeDialogFragment extends WikivoyageBaseDialogFragmen
|
|||
});
|
||||
|
||||
int imgId = nightMode ? R.drawable.img_start_screen_travel_night : R.drawable.img_start_screen_travel_day;
|
||||
((ImageView) mainView.findViewById(R.id.main_image)).setImageResource(imgId);
|
||||
ImageView mainImage = (ImageView) mainView.findViewById(R.id.main_image);
|
||||
mainImage.setScaleType(portrait ? ScaleType.CENTER_CROP : ScaleType.CENTER_INSIDE);
|
||||
mainImage.setImageResource(imgId);
|
||||
|
||||
mainView.findViewById(R.id.continue_button).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -49,6 +55,11 @@ public class WikivoyageWelcomeDialogFragment extends WikivoyageBaseDialogFragmen
|
|||
return mainView;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getStatusBarColor() {
|
||||
return nightMode ? R.color.wikivoyage_welcome_bg_dark : R.color.wikivoyage_welcome_bg_light;
|
||||
}
|
||||
|
||||
public static boolean showInstance(FragmentManager fm) {
|
||||
try {
|
||||
new WikivoyageWelcomeDialogFragment().show(fm, TAG);
|
||||
|
|
|
@ -49,6 +49,7 @@ public class WikivoyageOptionsBottomSheetDialogFragment extends MenuBottomSheetD
|
|||
BaseBottomSheetItem selectTravelBook = new BottomSheetItemWithDescription.Builder()
|
||||
.setDescription(dbHelper.formatTravelBookName(dbHelper.getSelectedTravelBook()))
|
||||
.setDescriptionColorId(nightMode ? R.color.wikivoyage_active_dark : R.color.wikivoyage_active_light)
|
||||
.setIcon(getContentIcon(R.drawable.ic_action_travel))
|
||||
.setTitle(getString(R.string.shared_string_travel_book))
|
||||
.setLayoutId(R.layout.bottom_sheet_item_with_right_descr)
|
||||
.setOnClickListener(new View.OnClickListener() {
|
||||
|
@ -60,6 +61,8 @@ public class WikivoyageOptionsBottomSheetDialogFragment extends MenuBottomSheetD
|
|||
})
|
||||
.create();
|
||||
items.add(selectTravelBook);
|
||||
|
||||
items.add(new DividerHalfItem(getContext()));
|
||||
}
|
||||
|
||||
BaseBottomSheetItem showImagesItem = new BottomSheetItemWithDescription.Builder()
|
||||
|
|
|
@ -55,6 +55,9 @@ public class WikivoyageSearchDialogFragment extends WikivoyageBaseDialogFragment
|
|||
|
||||
Toolbar toolbar = (Toolbar) mainView.findViewById(R.id.toolbar);
|
||||
setupToolbar(toolbar);
|
||||
toolbar.setContentInsetStartWithNavigation(
|
||||
getResources().getDimensionPixelOffset(R.dimen.wikivoyage_search_divider_margin_start)
|
||||
);
|
||||
|
||||
searchEt = (EditText) toolbar.findViewById(R.id.searchEditText);
|
||||
searchEt.setHint(R.string.shared_string_search);
|
||||
|
|
Loading…
Reference in a new issue