Skip to content

Commit

Permalink
kotlin extension removal modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
t0thkr1s committed Mar 15, 2021
1 parent 77e29b4 commit f6727ef
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions app/src/main/java/infosecadventures/allsafe/about/About.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,29 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import androidx.fragment.app.Fragment
import infosecadventures.allsafe.BuildConfig
import infosecadventures.allsafe.Constants
import infosecadventures.allsafe.R
import infosecadventures.allsafe.utils.ClipUtil
import infosecadventures.allsafe.utils.SnackUtil
import kotlinx.android.synthetic.main.fragment_about.view.*

class About : Fragment() {

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.fragment_about, container, false)
view.version.text = "Version: ${BuildConfig.VERSION_NAME}"
view.blog.setOnClickListener { startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Constants.MEDIUM))) }
view.github.setOnClickListener { startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Constants.GITHUB))) }
view.twitter.setOnClickListener { startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Constants.TWITTER))) }
view.bitcoin.setOnClickListener {
val version = "Version: ${BuildConfig.VERSION_NAME}"
view.findViewById<TextView>(R.id.version).text = version
view.findViewById<Button>(R.id.blog).setOnClickListener { startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Constants.MEDIUM))) }
view.findViewById<Button>(R.id.github).setOnClickListener { startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Constants.GITHUB))) }
view.findViewById<Button>(R.id.twitter).setOnClickListener { startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Constants.TWITTER))) }
view.findViewById<Button>(R.id.bitcoin).setOnClickListener {
ClipUtil.copyToClipboard(requireActivity(), Constants.BTC_ADDRESS)
SnackUtil.simpleMessage(requireActivity(), "Bitcoin address copied to clipboard!")
}
view.ethereum.setOnClickListener {
view.findViewById<Button>(R.id.ethereum).setOnClickListener {
ClipUtil.copyToClipboard(requireActivity(), Constants.ETH_ADDRESS)
SnackUtil.simpleMessage(requireActivity(), "Ethereum address copied to clipboard!")
}
Expand Down

0 comments on commit f6727ef

Please sign in to comment.