initial android app setup, adds fragments, camera

- scans in camera view for qr code
- camera view inside fragment
- fragment 1 passed to camera fragment
- prints qr code to log
This commit is contained in:
2021-12-12 15:44:30 +01:00
commit 59044e0554
49 changed files with 1396 additions and 0 deletions

View File

@ -0,0 +1,45 @@
package com.example.bump
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.navigation.fragment.findNavController
import com.example.bump.databinding.FragmentSecondBinding
/**
* A simple [Fragment] subclass as the second destination in the navigation.
*/
class SecondFragment : Fragment() {
private var _binding: FragmentSecondBinding? = null
// This property is only valid between onCreateView and
// onDestroyView.
private val binding get() = _binding!!
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
_binding = FragmentSecondBinding.inflate(inflater, container, false)
return binding.root
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.viewFinder
binding.viewFinder.bitmap
}
override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
}