added WikipediaArticleWikiLinkFragment and custom xml for it

This commit is contained in:
Chumva 2018-05-08 11:59:10 +03:00
parent cbe7d9a73a
commit 17727397a8
5 changed files with 109 additions and 0 deletions

View file

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:minHeight="@dimen/bottom_sheet_selected_item_title_height"
android:paddingEnd="@dimen/content_padding"
android:paddingRight="@dimen/content_padding">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/bottom_sheet_icon_margin"
android:layout_marginRight="@dimen/bottom_sheet_icon_margin"
android:paddingLeft="@dimen/content_padding"
android:paddingStart="@dimen/content_padding"
android:paddingTop="@dimen/content_padding_small"
tools:src="@drawable/list_destination" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="vertical"
android:paddingBottom="@dimen/wikilink_bottom_sheet_padding"
android:paddingLeft="@dimen/bottom_sheet_divider_margin_start"
android:paddingStart="@dimen/bottom_sheet_divider_margin_start"
android:paddingTop="@dimen/content_padding_small">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:paddingBottom="@dimen/bottom_sheet_content_padding_small"
android:textAppearance="@style/TextAppearance.ListItemTitle"
tools:text="Some title" />
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:textSize="@dimen/default_sub_text_size"
tools:text="Some description" />
</LinearLayout>
</FrameLayout>

View file

@ -0,0 +1,47 @@
<?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="wrap_content"
android:background="?attr/selectableItemBackground"
android:minHeight="@dimen/bottom_sheet_selected_item_title_height"
android:paddingBottom="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:paddingTop="@dimen/wikilink_bottom_sheet_padding">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingBottom="@dimen/bottom_sheet_content_padding_small"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="Some title" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:textColor="?attr/color_dialog_buttons"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="Some description" />
</LinearLayout>
</LinearLayout>

View file

@ -212,4 +212,6 @@
<dimen name="wikivoyage_start_editing_card_text_image_padding">60dp</dimen> <dimen name="wikivoyage_start_editing_card_text_image_padding">60dp</dimen>
<dimen name="wikivoyage_show_images_dialog_buttons_height">66dp</dimen> <dimen name="wikivoyage_show_images_dialog_buttons_height">66dp</dimen>
<dimen name="wikilink_bottom_sheet_padding">21dp</dimen>
</resources> </resources>

View file

@ -299,6 +299,8 @@
<dimen name="wikivoyage_explore_card_image_height">144dp</dimen> <dimen name="wikivoyage_explore_card_image_height">144dp</dimen>
<dimen name="wikilink_bottom_sheet_padding">14dp</dimen>
<dimen name="text_button_letter_spacing" format="float">0.01</dimen> <dimen name="text_button_letter_spacing" format="float">0.01</dimen>
<dimen name="text_button_line_spacing_multiplier" format="float">1.2</dimen> <dimen name="text_button_line_spacing_multiplier" format="float">1.2</dimen>
</resources> </resources>

View file

@ -9,6 +9,11 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). 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 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="open_wikipedia_link_online">Open wikipedia link online</string>
<string name="open_wikipedia_link_online_description">OsmAnd will redirect you to the browser and open the link online.</string>
<string name="read_wikipedia_offline_description">Get OsmAnd Live subscription to read Wikipedia and Wikivoyage articles offline.</string>
<string name="how_to_open_link">How to open link?</string>
<string name="read_wikipedia_offline">Read Wikipedia offline</string>
<string name="download_all">Download all</string> <string name="download_all">Download all</string>
<string name="shared_string_restart">Restart</string> <string name="shared_string_restart">Restart</string>
<string name="show_images">Show images</string> <string name="show_images">Show images</string>