Merge pull request #5366 from osmandapp/ChumvaIssuesFixes
Fix StartEditingTravelCard
This commit is contained in:
commit
22187c820a
2 changed files with 8 additions and 3 deletions
|
@ -133,7 +133,7 @@ public class ExploreTabFragment extends BaseOsmAndFragment implements DownloadIn
|
|||
}
|
||||
}
|
||||
}
|
||||
items.add(new StartEditingTravelCard(app, nightMode));
|
||||
items.add(new StartEditingTravelCard(app, getMyActivity(), nightMode));
|
||||
adapter.setItems(items);
|
||||
|
||||
final DownloadIndexesThread downloadThread = app.getDownloadThread();
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package net.osmand.plus.wikivoyage.explore.travelcards;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.customtabs.CustomTabsIntent;
|
||||
|
@ -16,8 +18,11 @@ public class StartEditingTravelCard extends BaseTravelCard {
|
|||
|
||||
public static final int TYPE = 1;
|
||||
|
||||
public StartEditingTravelCard(OsmandApplication app, boolean nightMode) {
|
||||
private Context context;
|
||||
|
||||
public StartEditingTravelCard(OsmandApplication app, Activity context, boolean nightMode) {
|
||||
super(app, nightMode);
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,7 +40,7 @@ public class StartEditingTravelCard extends BaseTravelCard {
|
|||
.setToolbarColor(ContextCompat.getColor(app, nightMode ? R.color.actionbar_dark_color : R.color.actionbar_light_color))
|
||||
.build();
|
||||
String text = "https://" + app.getLanguage().toLowerCase() + ".m.wikivoyage.org";
|
||||
customTabsIntent.launchUrl(app, Uri.parse(text));
|
||||
customTabsIntent.launchUrl(context, Uri.parse(text));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue