Advertisement
AzisMM

DetailDoaActivity

Oct 4th, 2021
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 1.07 KB | None | 0 0
  1. class DetailDoaActivity : AppCompatActivity() {
  2.  
  3.     companion object{
  4.         const val EXTRA_DOA = "extra_doa"
  5.     }
  6.  
  7.     private lateinit var binding: ActivityDetailDoaBinding
  8.  
  9.     override fun onCreate(savedInstanceState: Bundle?) {
  10.         super.onCreate(savedInstanceState)
  11.         binding = ActivityDetailDoaBinding.inflate(layoutInflater)
  12.         val view = binding.root
  13.         setContentView(view)
  14.  
  15.         val doa = intent.getParcelableExtra<DoaModel>(EXTRA_DOA) as DoaModel
  16.         setSupportActionBar(binding.toolbarDetailDoa)
  17.         supportActionBar?.title = doa.title
  18.  
  19.         binding.tvTitleDoa.text = doa.title
  20.         binding.tvTitleArab.text = doa.doa
  21.         binding.tvTitleArti.text = doa.translate
  22.         binding.tvTitleLatin.text = "(${doa.latin})"
  23.         binding.tvTitleRiwayat.text = doa.profile
  24.     }
  25.  
  26.     override fun onOptionsItemSelected(item: MenuItem): Boolean {
  27.         when(item.itemId){
  28.             android.R.id.home -> {
  29.                 finish()
  30.             }
  31.         }
  32.         return super.onOptionsItemSelected(item)
  33.     }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement