|
|
|
|
@ -18,7 +18,6 @@ import android.widget.Toast |
|
|
|
|
import androidx.appcompat.app.AlertDialog |
|
|
|
|
import androidx.appcompat.widget.AppCompatTextView |
|
|
|
|
import androidx.appcompat.widget.SearchView |
|
|
|
|
import androidx.browser.customtabs.CustomTabsIntent |
|
|
|
|
import androidx.core.content.ContextCompat |
|
|
|
|
import androidx.core.content.FileProvider |
|
|
|
|
import androidx.core.graphics.drawable.toBitmap |
|
|
|
|
@ -103,10 +102,8 @@ fun BaseActivity.openContactMail(subjectStringRes: Int, filePath: String? = null |
|
|
|
|
|
|
|
|
|
// Open custom tab |
|
|
|
|
fun Context.openUrl(url: String) { |
|
|
|
|
val builder: CustomTabsIntent.Builder = CustomTabsIntent.Builder() |
|
|
|
|
builder.setToolbarColor(ContextCompat.getColor(this, R.color.colorPrimary)) |
|
|
|
|
val customTabsIntent = builder.build() |
|
|
|
|
customTabsIntent.launchUrl(this, Uri.parse(url)) |
|
|
|
|
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) |
|
|
|
|
ContextCompat.startActivity(this, browserIntent, null) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Display Alert Dialog |
|
|
|
|
|