Commit 30879463 authored by Stefan Zabka's avatar Stefan Zabka
Browse files

now redirecting on intention

parent 3e789563
Pipeline #2921 passed with stage
in 4 minutes
......@@ -39,16 +39,22 @@ import kotlinx.android.synthetic.main.main_fragment.*
class MainFragment : Fragment() {
private val bluetoothAdapter = BluetoothAdapter.getDefaultAdapter()
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?) =
inflater.inflate(R.layout.main_fragment, container, false)
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
if(activity!!.intent.action == "application/x.card10.app") {
findNavController().navigate(MainFragmentDirections.Installer())
return null
}
return inflater.inflate(R.layout.main_fragment, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
val findNavController = findNavController()
button_pair.setOnClickListener { findNavController.navigate(MainFragmentDirections.Scan()) }
button_mood.setOnClickListener { findNavController.navigate(MainFragmentDirections.Mood()) }
button_beautiful.setOnClickListener { findNavController.navigate(MainFragmentDirections.Beautiful()) }
button_hatchery.setOnClickListener { findNavController.navigate(MainFragmentDirections.AppList()) }
button_send.setOnClickListener { findNavController.navigate(MainFragmentDirections.Transfer()) }
val con = findNavController()
button_pair.setOnClickListener { con.navigate(MainFragmentDirections.Scan()) }
button_mood.setOnClickListener { con.navigate(MainFragmentDirections.Mood()) }
button_beautiful.setOnClickListener { con.navigate(MainFragmentDirections.Beautiful()) }
button_hatchery.setOnClickListener { con.navigate(MainFragmentDirections.AppList()) }
button_send.setOnClickListener { con.navigate(MainFragmentDirections.Transfer()) }
button_set_time.setOnClickListener {
val dialogFragment = TimeUpdateDialog()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment