package dev.tajik.cdt.ui.producti
import android.content.Intent
import android.net.Uri
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.core.content.ContextCompat
import androidx.core.content.ContextCompat.startActivity
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import dev.tajik.cdt.R
class ProductiFragment : Fragment() {
private lateinit var productiViewModel: ProductiViewModel
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val xView = inflater.inflate(R.layout.fragment_produkt, container, false)
//Open nun.tj
val btnnuntj = xView.findViewById<Button>(R.id.btn_nuntj)
btnnuntj?.setOnClickListener {
opennuntj()
}
return xView
}
fun opennuntj() {
//Toast.makeText(context, "Test my button!", Toast.LENGTH_SHORT).show()
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse("https://nun.tj/store/938848488/")) // put URL/Uri here
startActivity(browserIntent)
}
}