--------------------------------------------------...
# compose
m
---------------------------------------------------------- How to use this in jetpack compose without xml ---------------------------------------------------------- class SimpleTabsFragment : Fragment() { private lateinit var dashboardViewModel: DashboardViewModel var builder = CustomTabsIntent.Builder() override fun onCreateView(inflater: LayoutInflater,container: ViewGroup?, savedInstanceState: Bundle?): View? { dashboardViewModel = ViewModelProviders.of(this).get(DashboardViewModel::class.java) val root = inflater.inflate(R.layout.fragment_simple_tabs, container, false) return root } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) simple_tabs_button.setOnClickListener { var url = "www.google.com" var customTabsIntent :CustomTabsIntent = builder.build(); customTabsIntent.launchUrl(requireContext(), Uri.parse(url)) } } }
🧵 6