Merge pull request #5223 from osmandapp/WikivoyageImprovements

add right colors, icons and shadow for contents
This commit is contained in:
Alexander Sytnyk 2018-04-11 17:38:01 +03:00 committed by GitHub
commit 3357d3ae93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 21 deletions

View file

@ -65,10 +65,15 @@
<LinearLayout
android:id="@+id/bottom_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_sheet_cancel_button_height"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="10dp"
android:background="@drawable/bg_contextmenu_shadow_top_light" />
<View
android:id="@+id/bottom_row_divider"
android:layout_width="match_parent"
@ -77,12 +82,12 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="@dimen/bottom_sheet_cancel_button_height"
android:background="?attr/wikivoyage_bottom_bar_bg_color">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/contents_button"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="0.5"
@ -104,16 +109,9 @@
tools:drawableTint="?attr/wikivoyage_active_color"
tools:ignore="UnusedAttribute"/>
<View
android:id="@+id/bottom_buttons_divider"
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="?attr/wikivoyage_bottom_bar_divider_color"
android:visibility="visible"/>
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/save_button"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical|end"
android:layout_weight="1"

View file

@ -400,8 +400,10 @@
<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>
<color name="wikivoyage_contents_icon_light">#536dfe</color>
<color name="wikivoyage_contents_icon_dark">#d28521</color>
<color name="wikivoyage_contents_parent_icon_light">#536dfe</color>
<color name="wikivoyage_contents_parent_icon_dark">#d28521</color>
<color name="wikivoyage_contents_child_icon_light">#bfbfbf</color>
<color name="wikivoyage_contents_child_icon_dark">#727272</color>
<color name="wikivoyage_bottom_bar_bg_light">#f5f5f5</color>
<color name="wikivoyage_bottom_bar_bg_dark">#222526</color>
<color name="wikivoyage_bottom_bar_divider_light">#e3e3e3</color>

View file

@ -118,6 +118,16 @@ public class WikivoyageArticleContentsFragment extends MenuBottomSheetDialogFrag
}
}
@Override
protected int getDismissButtonTextId() {
return R.string.shared_string_close;
}
@Override
protected int getBgColorId() {
return nightMode ? R.color.wikivoyage_bottom_bar_bg_dark : R.color.bg_color_light;
}
@Override
protected boolean useScrollableItemsContainer() {
return false;
@ -139,11 +149,11 @@ public class WikivoyageArticleContentsFragment extends MenuBottomSheetDialogFrag
this.listDataHeader = listDataHeader;
this.listDataChild = listChildData;
itemGroupIcon = getIcon(R.drawable.ic_action_contents, nightMode
? R.color.wikivoyage_active_dark : R.color.wikivoyage_active_light);
itemGroupIcon = getIcon(R.drawable.ic_action_list_header, nightMode
? R.color.wikivoyage_contents_parent_icon_dark : R.color.wikivoyage_contents_parent_icon_light);
itemChildIcon = getIcon(R.drawable.ic_action_list_bullet, nightMode
? R.color.route_info_unchecked_mode_icon_color
: R.color.ctx_menu_nearby_routes_text_color_dark);
? R.color.wikivoyage_contents_child_icon_dark
: R.color.wikivoyage_contents_child_icon_light);
}
@Override
@ -167,8 +177,8 @@ public class WikivoyageArticleContentsFragment extends MenuBottomSheetDialogFrag
TextView txtListChild = (TextView) convertView.findViewById(R.id.item_label);
txtListChild.setText(childText);
txtListChild.setTextColor(getResolvedColor(nightMode
? R.color.wikivoyage_contents_icon_dark
: R.color.wikivoyage_contents_icon_light));
? R.color.wikivoyage_contents_parent_icon_dark
: R.color.wikivoyage_contents_parent_icon_light));
txtListChild.setCompoundDrawablesWithIntrinsicBounds(itemChildIcon, null, null, null);
return convertView;
@ -205,7 +215,7 @@ public class WikivoyageArticleContentsFragment extends MenuBottomSheetDialogFrag
}
TextView lblListHeader = (TextView) convertView.findViewById(R.id.item_label);
lblListHeader.setText(headerTitle);
lblListHeader.setTextColor(getResolvedColor(isNightMode() ? R.color.wikivoyage_contents_icon_dark : R.color.wikivoyage_contents_icon_light));
lblListHeader.setTextColor(getResolvedColor(isNightMode() ? R.color.wikivoyage_contents_parent_icon_dark : R.color.wikivoyage_contents_parent_icon_light));
lblListHeader.setCompoundDrawablesWithIntrinsicBounds(itemGroupIcon, null, null, null);
return convertView;

View file

@ -96,7 +96,7 @@ public class WikivoyageArticleDialogFragment extends WikivoyageBaseDialogFragmen
TextView contentsBtn = (TextView) mainView.findViewById(R.id.contents_button);
contentsBtn.setCompoundDrawablesWithIntrinsicBounds(
getActiveIcon(R.drawable.ic_action_list_header), null, null, null
getActiveIcon(R.drawable.ic_action_contents), null, null, null
);
contentsBtn.setOnClickListener(new View.OnClickListener() {
@Override