Added images for purchased features
This commit is contained in:
parent
22e8d255a3
commit
16378b7e76
5 changed files with 62 additions and 3 deletions
19
OsmAnd/res/drawable/img_feature_purchased.xml
Normal file
19
OsmAnd/res/drawable/img_feature_purchased.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<item>
|
||||
<inset>
|
||||
<shape android:shape="oval" >
|
||||
<solid android:color="@color/feature_purchased_bg" />
|
||||
</shape>
|
||||
</inset>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<bitmap
|
||||
android:gravity="center"
|
||||
android:src="@drawable/ic_action_marker_passed" />
|
||||
</item>
|
||||
|
||||
|
||||
</layer-list>
|
|
@ -23,6 +23,16 @@
|
|||
android:src="@drawable/ic_action_plus"
|
||||
android:tint="?attr/wikivoyage_active_color"/>
|
||||
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:id="@+id/img_purchased"
|
||||
android:layout_width="@dimen/standard_icon_size"
|
||||
android:layout_height="@dimen/standard_icon_size"
|
||||
android:layout_marginLeft="@dimen/list_content_padding"
|
||||
android:layout_marginRight="@dimen/dialog_content_margin"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/img_feature_purchased"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -23,6 +23,16 @@
|
|||
android:src="@drawable/ic_action_plus"
|
||||
android:tint="?attr/wikivoyage_active_color"/>
|
||||
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:id="@+id/img_purchased"
|
||||
android:layout_width="@dimen/standard_icon_size"
|
||||
android:layout_height="@dimen/standard_icon_size"
|
||||
android:layout_marginLeft="@dimen/list_content_padding"
|
||||
android:layout_marginRight="@dimen/dialog_content_margin"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/img_feature_purchased"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<color name="feature_purchased_bg">#78cc5c</color>
|
||||
|
||||
<color name="dialog_title_color_light">#212121</color>
|
||||
<color name="dialog_title_color_dark">#cccccc</color>
|
||||
<color name="dialog_description_color_light">#212121</color>
|
||||
|
@ -11,7 +13,6 @@
|
|||
<color name="card_description_text_color_light">#b3b3b3</color>
|
||||
<color name="card_description_text_color_dark">#4d4d4d</color>
|
||||
|
||||
|
||||
<color name="ctx_menu_nearby_routes_text_color_dark">#bfbfbf</color>
|
||||
<color name="map_toolbar_switch_track_color">#c5d2e6</color>
|
||||
<color name="mapillary_color">#3db878</color>
|
||||
|
|
|
@ -83,11 +83,12 @@ public abstract class ChoosePlanDialogFragment extends BaseOsmAndDialogFragment
|
|||
case UNLOCK_ALL_FEATURES:
|
||||
case DONATION_TO_OSM:
|
||||
return false;
|
||||
case SEA_DEPTH_MAPS:
|
||||
return ctx.getSettings().DEPTH_CONTOURS_PURCHASED.get();
|
||||
case WIKIVOYAGE_OFFLINE:
|
||||
return ctx.getSettings().TRAVEL_ARTICLES_PURCHASED.get();
|
||||
case CONTOUR_LINES_HILLSHADE_MAPS:
|
||||
boolean srtmEnabled = OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null;
|
||||
return srtmEnabled && ctx.getSettings().DEPTH_CONTOURS_PURCHASED.get();
|
||||
return OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -234,6 +235,15 @@ public abstract class ChoosePlanDialogFragment extends BaseOsmAndDialogFragment
|
|||
String featureName = feature.toHumanString(ctx);
|
||||
View featureRow = inflate(hasSelectedOsmLiveFeature(feature)
|
||||
? R.layout.purchase_dialog_card_selected_row : R.layout.purchase_dialog_card_row, cardView);
|
||||
AppCompatImageView imgView = (AppCompatImageView) featureRow.findViewById(R.id.img);
|
||||
AppCompatImageView imgPurchasedView = (AppCompatImageView) featureRow.findViewById(R.id.img_purchased);
|
||||
if (feature.isFeaturePurchased(app)) {
|
||||
imgView.setVisibility(View.GONE);
|
||||
imgPurchasedView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
imgView.setVisibility(View.VISIBLE);
|
||||
imgPurchasedView.setVisibility(View.GONE);
|
||||
}
|
||||
TextViewEx titleView = (TextViewEx) featureRow.findViewById(R.id.title);
|
||||
titleView.setText(featureName);
|
||||
featureRowDiv = featureRow.findViewById(R.id.div);
|
||||
|
@ -325,6 +335,15 @@ public abstract class ChoosePlanDialogFragment extends BaseOsmAndDialogFragment
|
|||
String featureName = feature.toHumanString(ctx);
|
||||
featureRow = inflate(hasSelectedPlanTypeFeature(feature)
|
||||
? R.layout.purchase_dialog_card_selected_row : R.layout.purchase_dialog_card_row, cardView);
|
||||
AppCompatImageView imgView = (AppCompatImageView) featureRow.findViewById(R.id.img);
|
||||
AppCompatImageView imgPurchasedView = (AppCompatImageView) featureRow.findViewById(R.id.img_purchased);
|
||||
if (feature.isFeaturePurchased(app)) {
|
||||
imgView.setVisibility(View.GONE);
|
||||
imgPurchasedView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
imgView.setVisibility(View.VISIBLE);
|
||||
imgPurchasedView.setVisibility(View.GONE);
|
||||
}
|
||||
TextViewEx titleView = (TextViewEx) featureRow.findViewById(R.id.title);
|
||||
titleView.setText(featureName);
|
||||
rowsContainer.addView(featureRow);
|
||||
|
|
Loading…
Reference in a new issue