Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2018-04-11 16:53:21 +02:00
commit 4175fe7246
6 changed files with 52 additions and 23 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

@ -60,8 +60,10 @@
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding"
android:visibility="gone"
tools:ignore="ContentDescription"
tools:src="@drawable/ic_empty_state_marker_history_night"/>
tools:src="@drawable/ic_empty_state_marker_history_night"
tools:visibility="visible"/>
</LinearLayout>

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

View file

@ -11,10 +11,14 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;
import net.osmand.AndroidUtils;
import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.widgets.tools.CropCircleTransformation;
import net.osmand.plus.wikivoyage.data.WikivoyageArticle;
import net.osmand.plus.wikivoyage.data.WikivoyageLocalDataHelper;
@ -68,10 +72,23 @@ public class SavedArticlesRvAdapter extends RecyclerView.Adapter<RecyclerView.Vi
WikivoyageArticle article = (WikivoyageArticle) getItem(position);
boolean lastItem = position == getItemCount() - 1;
Picasso.get()
.load(WikivoyageArticle.getImageUrl(article.getImageTitle(), false))
.transform(new CropCircleTransformation())
.into(holder.icon, new Callback() {
@Override
public void onSuccess() {
holder.icon.setVisibility(View.VISIBLE);
}
@Override
public void onError(Exception e) {
holder.icon.setVisibility(View.GONE);
}
});
holder.title.setText(article.getTitle());
holder.content.setText(article.getContent());
holder.partOf.setText(article.getGeoDescription());
holder.icon.setVisibility(View.GONE); // todo
holder.leftButton.setText(app.getString(R.string.shared_string_read));
holder.leftButton.setCompoundDrawablesWithIntrinsicBounds(readIcon, null, null, null);
holder.rightButton.setText(app.getString(R.string.shared_string_delete));