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 com.example.hpostesting.presentation.dashboard.ui.slideshow.SlideshowViewModel
|
||||||
import `in`.sminnovations.hpostesting.databinding.FragmentSlideshowBinding
|
import `in`.sminnovations.hpostesting.databinding.FragmentSlideshowBinding
|
||||||
|
|
||||||
|
|
||||||
class SlideshowFragment : Fragment() {
|
class SlideshowFragment : Fragment() {
|
||||||
|
|
||||||
private var _binding: FragmentSlideshowBinding? = null
|
private var _binding: FragmentSlideshowBinding? = null
|
||||||
@@ -20,7 +21,7 @@ class SlideshowFragment : Fragment() {
|
|||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
inflater: LayoutInflater,
|
inflater: LayoutInflater,
|
||||||
container: ViewGroup?,
|
container: ViewGroup?,
|
||||||
savedInstanceState: Bundle?
|
savedInstanceState: Bundle?,
|
||||||
): View {
|
): View {
|
||||||
val slideshowViewModel =
|
val slideshowViewModel =
|
||||||
ViewModelProvider(this).get(SlideshowViewModel::class.java)
|
ViewModelProvider(this).get(SlideshowViewModel::class.java)
|
||||||
@@ -28,6 +29,12 @@ class SlideshowFragment : Fragment() {
|
|||||||
_binding = FragmentSlideshowBinding.inflate(inflater, container, false)
|
_binding = FragmentSlideshowBinding.inflate(inflater, container, false)
|
||||||
val root: View = binding.root
|
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
|
// val textView: TextView = binding.textSlideshow
|
||||||
// slideshowViewModel.text.observe(viewLifecycleOwner) {
|
// slideshowViewModel.text.observe(viewLifecycleOwner) {
|
||||||
// textView.text = it
|
// textView.text = it
|
||||||
|
|||||||
Reference in New Issue
Block a user