Skip to content

Commit

Permalink
Merge pull request #1 from 4d-go-mobile/feature/android_version
Browse files Browse the repository at this point in the history
Implement Android version and move iOS sources
  • Loading branch information
mesopelagique authored Mar 8, 2022
2 parents 7865032 + 4eca46a commit 5c2ea9b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions android/Formatters/UrlAction.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ___PACKAGE___

import android.content.Intent
import android.net.Uri
import android.widget.TextView
import androidx.databinding.BindingAdapter

@BindingAdapter("urlAction")
fun urlAction(view: TextView, urlAction: String?) {
if (urlAction.isNullOrEmpty()) return
view.text = urlAction
view.setOnClickListener {
val urlIntent = Intent(Intent.ACTION_VIEW, Uri.parse(urlAction))
view.context.startActivity(Intent.createChooser(urlIntent, "Url"))
}
}
File renamed without changes.
3 changes: 2 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "url",
"binding": "urlAction",
"type" : "text"
"type" : "text",
"target" : ["ios", "android"]
}

0 comments on commit 5c2ea9b

Please sign in to comment.