commit
807a3fa238
3 changed files with 15 additions and 11 deletions
|
@ -39,9 +39,8 @@
|
|||
<uses-feature android:name="android.hardware.bluetooth" android:required="false" />
|
||||
<uses-feature android:name="com.sec.feature.spen_usp" android:required="false"/>
|
||||
|
||||
<!-- com.getkeepsafe.taptargetview, studio.carbonylgroup.textfieldboxes, android.support.customtabs -->
|
||||
<uses-sdk android:targetSdkVersion="26" android:minSdkVersion="15"
|
||||
tools:overrideLibrary=""/>
|
||||
tools:overrideLibrary="com.getkeepsafe.taptargetview, studio.carbonylgroup.textfieldboxes, android.support.customtabs"/>
|
||||
|
||||
<supports-screens android:resizeable="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true"
|
||||
android:xlargeScreens="true" android:anyDensity="true" />
|
||||
|
|
|
@ -7,6 +7,7 @@ import android.content.Intent;
|
|||
import android.content.res.ColorStateList;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
|
@ -212,10 +213,16 @@ public class WikipediaDialogFragment extends WikiArticleBaseDialogFragment {
|
|||
}
|
||||
|
||||
public static void showFullArticle(@NonNull Context context, @NonNull Uri uri, boolean nightMode) {
|
||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
|
||||
CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder()
|
||||
.setToolbarColor(ContextCompat.getColor(context, nightMode ? R.color.actionbar_dark_color : R.color.actionbar_light_color))
|
||||
.build();
|
||||
customTabsIntent.launchUrl(context, uri);
|
||||
} else {
|
||||
Intent i = new Intent(Intent.ACTION_VIEW);
|
||||
i.setData(uri);
|
||||
context.startActivity(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,6 +13,7 @@ import android.widget.TextView;
|
|||
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.wikipedia.WikipediaDialogFragment;
|
||||
|
||||
public class StartEditingTravelCard extends BaseTravelCard {
|
||||
|
||||
|
@ -36,11 +37,8 @@ public class StartEditingTravelCard extends BaseTravelCard {
|
|||
holder.button.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder()
|
||||
.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(context, Uri.parse(text));
|
||||
WikipediaDialogFragment.showFullArticle(context,
|
||||
Uri.parse("https://" + app.getLanguage().toLowerCase() + ".m.wikivoyage.org"), nightMode);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue