refactored some code
This commit is contained in:
parent
fa5f619c3c
commit
a145ead97a
1 changed files with 5 additions and 7 deletions
|
@ -291,13 +291,11 @@ public class AmenityMenuBuilder extends MenuBuilder {
|
||||||
ll.setOnClickListener(new View.OnClickListener() {
|
ll.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (textPrefix.equals("Wikipedia")) {
|
if (textPrefix.equals("Wikipedia") && (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH)) {
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
|
CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder()
|
||||||
CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder()
|
.setToolbarColor(ContextCompat.getColor(v.getContext(), !light ? R.color.actionbar_dark_color : R.color.actionbar_light_color))
|
||||||
.setToolbarColor(ContextCompat.getColor(v.getContext(), !light ? R.color.actionbar_dark_color : R.color.actionbar_light_color))
|
.build();
|
||||||
.build();
|
customTabsIntent.launchUrl(v.getContext(), Uri.parse(text));
|
||||||
customTabsIntent.launchUrl(v.getContext(), Uri.parse(text));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||||
intent.setData(Uri.parse(text));
|
intent.setData(Uri.parse(text));
|
||||||
|
|
Loading…
Reference in a new issue