Commit de3b81ed authored by Leonardo Aramaki's avatar Leonardo Aramaki

Add chrome custom tabs dependency

parent 9959d848
...@@ -12,7 +12,8 @@ ext { ...@@ -12,7 +12,8 @@ ext {
constraintLayout : "com.android.support.constraint:constraint-layout:${constraintLayoutVersion}", constraintLayout : "com.android.support.constraint:constraint-layout:${constraintLayoutVersion}",
cardView : "com.android.support:cardview-v7:${supportLibraryVersion}", cardView : "com.android.support:cardview-v7:${supportLibraryVersion}",
supportV13 : "com.android.support:support-v13:${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 = [ extraDependencies = [
okHTTP : "com.squareup.okhttp3:okhttp:${okHttpVersion}", okHTTP : "com.squareup.okhttp3:okhttp:${okHttpVersion}",
......
...@@ -39,6 +39,7 @@ dependencies { ...@@ -39,6 +39,7 @@ dependencies {
compile supportDependencies.designSupportLibrary compile supportDependencies.designSupportLibrary
compile supportDependencies.constraintLayout compile supportDependencies.constraintLayout
compile supportDependencies.supportV13 compile supportDependencies.supportV13
compile supportDependencies.customTabs
compile rxbindingDependencies.rxBinding compile rxbindingDependencies.rxBinding
compile rxbindingDependencies.rxBindingSupport compile rxbindingDependencies.rxBindingSupport
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$rootProject.ext.kotlinVersion" compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$rootProject.ext.kotlinVersion"
......
...@@ -7,6 +7,7 @@ import android.graphics.Color; ...@@ -7,6 +7,7 @@ import android.graphics.Color;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.support.customtabs.CustomTabsIntent;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.support.v4.widget.TextViewCompat; import android.support.v4.widget.TextViewCompat;
import android.text.TextUtils; import android.text.TextUtils;
...@@ -170,13 +171,10 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout { ...@@ -170,13 +171,10 @@ public class RocketChatMessageAttachmentsLayout extends LinearLayout {
titleView.setOnClickListener(new OnClickListener() { titleView.setOnClickListener(new OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(link)); new CustomTabsIntent.Builder()
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); .setToolbarColor(ContextCompat.getColor(getContext(), R.color.colorPrimary))
.build()
final Context context = view.getContext(); .launchUrl(getContext(), Uri.parse(link));
if (intent.resolveActivity(context.getPackageManager()) != null) {
context.startActivity(intent);
}
} }
}); });
TextViewCompat.setTextAppearance(titleView, TextViewCompat.setTextAppearance(titleView,
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="color_accent">#FF2D91FA</color> <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_shadow">#FFE6E6E7</color>
<color name="color_icon_composer">#FFA8A8A8</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