Commit de3b81ed authored by Leonardo Aramaki's avatar Leonardo Aramaki

Add chrome custom tabs dependency

parent 9959d848
......@@ -12,7 +12,8 @@ ext {
constraintLayout : "com.android.support.constraint:constraint-layout:${constraintLayoutVersion}",
cardView : "com.android.support:cardview-v7:${supportLibraryVersion}",
supportV13 : "com.android.support:support-v13:${supportLibraryVersion}",
multidex : "com.android.support:multidex:1.0.2"
multidex : "com.android.support:multidex:1.0.2",
customTabs : "com.android.support:customtabs:${supportLibraryVersion}"
]
extraDependencies = [
okHTTP : "com.squareup.okhttp3:okhttp:${okHttpVersion}",
......
......@@ -39,6 +39,7 @@ dependencies {
compile supportDependencies.designSupportLibrary
compile supportDependencies.constraintLayout
compile supportDependencies.supportV13
compile supportDependencies.customTabs
compile rxbindingDependencies.rxBinding
compile rxbindingDependencies.rxBindingSupport
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$rootProject.ext.kotlinVersion"
......
......@@ -7,6 +7,7 @@ import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.support.customtabs.CustomTabsIntent;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.TextViewCompat;
import android.text.TextUtils;
......@@ -170,13 +171,10 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
titleView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(link));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
final Context context = view.getContext();
if (intent.resolveActivity(context.getPackageManager()) != null) {
context.startActivity(intent);
}
new CustomTabsIntent.Builder()
.setToolbarColor(ContextCompat.getColor(getContext(), R.color.colorPrimary))
.build()
.launchUrl(getContext(), Uri.parse(link));
}
});
TextViewCompat.setTextAppearance(titleView,
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="color_accent">#FF2D91FA</color>
<color name="colorPrimary">#044b76</color>
<color name="colorPrimaryDark">#FFF</color>
<color name="color_shadow">#FFE6E6E7</color>
<color name="color_icon_composer">#FFA8A8A8</color>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment