Merge pull request #5460 from osmandapp/UiImprovements

Choose plan ui improvements
This commit is contained in:
Alexey 2018-05-22 18:03:19 +03:00 committed by GitHub
commit 3ee4a542f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 24 deletions

View file

@ -10,6 +10,7 @@
- For wording and consistency, please note http://osmand.net/help-online?id=technical-articles#Creating_a_Consistent_User_Experience
Thx - Hardy
-->
<string name="get_osmand_live">Get OsmAnd Live to unlock all features: Daily map updates with unlimited downloads, all paid and free plugins, Wikipedia, Wikivoyage and much more.</string>
<string name="unirs_render_descr">Modification of the default style to increase contrast of pedestrian and bicycle roads. Uses legacy Mapnik colors.</string>
<string name="shared_string_bookmark">Bookmark</string>
<string name="hide_full_description">Hide full description</string>
@ -2152,7 +2153,7 @@
<string name="live_monitoring_max_interval_to_send_desrc">Specify a time buffer to keep locations to send without connection</string>
<string name="gpx_monitoring_disabled_warn">Log track using GPX widget or via \'Trip recording\' settings.</string>
<string name="show_current_gpx_title">Show current track</string>
<string name="free_version_message">This free OsmAnd version is limited to %1$s map downloads (to add or update maps) and does not support offline Wikipedia articles.</string>
<string name="free_version_message">You can download or update %1$s maps.</string>
<string name="free_version_title">Free version</string>
<string name="poi_context_menu_showdescription">Show POI description.</string>
<string name="index_name_north_america">North America</string>

View file

@ -35,6 +35,7 @@ import net.osmand.plus.R;
import net.osmand.plus.Version;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.BaseOsmAndDialogFragment;
import net.osmand.plus.download.DownloadValidationManager;
import net.osmand.plus.inapp.InAppPurchaseHelper;
import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseListener;
import net.osmand.plus.inapp.InAppPurchaseHelper.InAppPurchaseTaskType;
@ -209,6 +210,16 @@ public abstract class ChoosePlanDialogFragment extends BaseOsmAndDialogFragment
}
}
public String getInfoDescription() {
if (Version.isFreeVersion(getOsmandApplication())) {
String description = getString(R.string.free_version_message,
DownloadValidationManager.MAXIMUM_AVAILABLE_FREE_DOWNLOADS) + "\n";
return description + getString(R.string.get_osmand_live);
} else {
return getString(R.string.get_osmand_live);
}
}
public OsmandApplication getOsmandApplication() {
return app;
}
@ -221,8 +232,6 @@ public abstract class ChoosePlanDialogFragment extends BaseOsmAndDialogFragment
public abstract OsmAndFeature[] getSelectedPlanTypeFeatures();
public abstract String getInfoDescription();
@DrawableRes
public abstract int getPlanTypeHeaderImageId();

View file

@ -6,7 +6,6 @@ import android.view.View;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.OsmandInAppPurchaseActivity;
import net.osmand.plus.download.DownloadValidationManager;
import net.osmand.plus.inapp.InAppPurchaseHelper;
public class ChoosePlanFreeBannerDialogFragment extends ChoosePlanDialogFragment {
@ -55,12 +54,6 @@ public class ChoosePlanFreeBannerDialogFragment extends ChoosePlanDialogFragment
return selectedPlanTypeFeatures;
}
@Override
public String getInfoDescription() {
return getString(R.string.free_version_message,
DownloadValidationManager.MAXIMUM_AVAILABLE_FREE_DOWNLOADS);
}
@Override
public int getPlanTypeHeaderImageId() {
return R.drawable.img_logo_38dp_osmand;

View file

@ -50,11 +50,6 @@ public class ChoosePlanHillshadeSrtmDialogFragment extends ChoosePlanDialogFragm
return selectedPlanTypeFeatures;
}
@Override
public String getInfoDescription() {
return "";
}
@Override
public int getPlanTypeHeaderImageId() {
return R.drawable.img_logo_38dp_contour_lines;

View file

@ -50,11 +50,6 @@ public class ChoosePlanSeaDepthMapsDialogFragment extends ChoosePlanDialogFragme
return selectedPlanTypeFeatures;
}
@Override
public String getInfoDescription() {
return "";
}
@Override
public int getPlanTypeHeaderImageId() {
return R.drawable.img_logo_38dp_sea_depth;

View file

@ -46,8 +46,4 @@ public class ChoosePlanWikipediaDialogFragment extends ChoosePlanFreeBannerDialo
return selectedPlanTypeFeatures;
}
@Override
public String getInfoDescription() {
return "";
}
}