Merge pull request #5291 from osmandapp/WikivoyageExploreCards
Wikivoyage explore cards
This commit is contained in:
commit
0b9c5277e1
6 changed files with 13 additions and 8 deletions
|
@ -44,6 +44,7 @@
|
|||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingMultiplier="@dimen/text_button_line_spacing_multiplier"
|
||||
android:layout_marginBottom="@dimen/list_content_padding"
|
||||
android:layout_marginEnd="@dimen/list_content_padding"
|
||||
android:layout_marginLeft="@dimen/list_content_padding"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
android:layout_marginLeft="@dimen/list_content_padding"
|
||||
android:layout_marginRight="@dimen/list_content_padding"
|
||||
android:layout_marginStart="@dimen/list_content_padding"
|
||||
android:layout_marginTop="42dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/primary_text_dark"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
|
@ -50,6 +50,7 @@
|
|||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingMultiplier="@dimen/text_button_line_spacing_multiplier"
|
||||
android:layout_marginBottom="@dimen/list_content_padding"
|
||||
android:layout_marginEnd="@dimen/list_content_padding"
|
||||
android:layout_marginLeft="@dimen/list_content_padding"
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:lineSpacingMultiplier="@dimen/text_button_line_spacing_multiplier"
|
||||
android:text="@string/travel_guide_description"
|
||||
android:textColor="@color/wikivoyage_secondary_text"
|
||||
android:textSize="@dimen/default_list_text_size"/>
|
||||
|
|
|
@ -208,6 +208,6 @@
|
|||
<dimen name="wikivoyage_search_icon_margin_right">33dp</dimen>
|
||||
<dimen name="wikivoyage_search_divider_margin_start">82dp</dimen>
|
||||
<dimen name="wikivoyage_explore_card_image_height">216dp</dimen>
|
||||
<dimen name="wikivoyage_travel_card_button_padding">22dp</dimen>
|
||||
<dimen name="wikivoyage_travel_card_button_padding">24dp</dimen>
|
||||
|
||||
</resources>
|
|
@ -291,9 +291,10 @@
|
|||
<dimen name="wikivoyage_search_icon_margin_left">14dp</dimen>
|
||||
<dimen name="wikivoyage_search_icon_margin_right">22dp</dimen>
|
||||
<dimen name="wikivoyage_search_divider_margin_start">64dp</dimen>
|
||||
<dimen name="wikivoyage_travel_card_button_padding">15dp</dimen>
|
||||
<dimen name="wikivoyage_travel_card_button_padding">16dp</dimen>
|
||||
|
||||
<dimen name="wikivoyage_explore_card_image_height">144dp</dimen>
|
||||
|
||||
<dimen name="text_button_letter_spacing" format="float">0.01</dimen>
|
||||
<dimen name="text_button_line_spacing_multiplier" format="float">1.2</dimen>
|
||||
</resources>
|
|
@ -166,8 +166,11 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadIn
|
|||
startEditingTravelCard = new StartEditingTravelCard(app, nightMode);
|
||||
addOpenBetaTravelCard(items, nightMode);
|
||||
items.add(startEditingTravelCard);
|
||||
|
||||
if (app.getTravelDbHelper().getSelectedTravelBook() != null) {
|
||||
items.add(new HeaderTravelCard(app, nightMode, getString(R.string.popular_destinations)));
|
||||
addPopularDestinations(app);
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
@ -200,8 +203,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadIn
|
|||
|
||||
private void addOpenBetaTravelCard(List<BaseTravelCard> items, final boolean nightMode) {
|
||||
final OsmandApplication app = getMyApplication();
|
||||
if ((Version.isFreeVersion(app) && !app.getSettings().LIVE_UPDATES_PURCHASED.get()
|
||||
&& !app.getSettings().FULL_VERSION_PURCHASED.get())) {
|
||||
if (!Version.isPaidVersion(app)) {
|
||||
items.add(new OpenBetaTravelCard(app, nightMode, getFragmentManager()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue