add version name in the settings
This commit is contained in:
@@ -9,6 +9,7 @@ import androidx.lifecycle.ViewModelProvider
|
||||
import com.example.hpostesting.presentation.dashboard.ui.slideshow.SlideshowViewModel
|
||||
import `in`.sminnovations.hpostesting.databinding.FragmentSlideshowBinding
|
||||
|
||||
|
||||
class SlideshowFragment : Fragment() {
|
||||
|
||||
private var _binding: FragmentSlideshowBinding? = null
|
||||
@@ -20,7 +21,7 @@ class SlideshowFragment : Fragment() {
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
savedInstanceState: Bundle?,
|
||||
): View {
|
||||
val slideshowViewModel =
|
||||
ViewModelProvider(this).get(SlideshowViewModel::class.java)
|
||||
@@ -28,6 +29,12 @@ class SlideshowFragment : Fragment() {
|
||||
_binding = FragmentSlideshowBinding.inflate(inflater, container, false)
|
||||
val root: View = binding.root
|
||||
|
||||
val pInfo = requireActivity().packageManager.getPackageInfo(
|
||||
requireActivity().packageName, 0
|
||||
)
|
||||
val version = pInfo.versionName
|
||||
binding.textSlideshow.text = version
|
||||
|
||||
// val textView: TextView = binding.textSlideshow
|
||||
// slideshowViewModel.text.observe(viewLifecycleOwner) {
|
||||
// textView.text = it
|
||||
|
||||
Reference in New Issue
Block a user