convert License to kotlin

This commit is contained in:
tibbi
2016-11-13 23:51:45 +01:00
parent a3a3fbd99c
commit e5d02f5892
2 changed files with 23 additions and 36 deletions

View File

@ -0,0 +1,23 @@
package com.simplemobiletools.notes.activities
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import com.simplemobiletools.notes.R
import kotlinx.android.synthetic.main.activity_license.*
class LicenseActivity : SimpleActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_license)
license_butterknife_title.setOnClickListener { openUrl(R.string.butterknife_url) }
license_ambilwarna_title.setOnClickListener { openUrl(R.string.ambilwarna_url) }
}
private fun openUrl(id: Int) {
val url = resources.getString(id)
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
startActivity(browserIntent)
}
}