|
|
|
@ -106,11 +106,6 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate, PurchaseLis |
|
|
|
private var _binding: FragmentFeedBinding? = null |
|
|
|
private var _binding: FragmentFeedBinding? = null |
|
|
|
private val binding get() = _binding!! |
|
|
|
private val binding get() = _binding!! |
|
|
|
|
|
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) { |
|
|
|
|
|
|
|
super.onCreate(savedInstanceState) |
|
|
|
|
|
|
|
AppGuard.registerListener(this) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onCreateView( |
|
|
|
override fun onCreateView( |
|
|
|
inflater: LayoutInflater, |
|
|
|
inflater: LayoutInflater, |
|
|
|
container: ViewGroup?, |
|
|
|
container: ViewGroup?, |
|
|
|
@ -154,35 +149,11 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate, PurchaseLis |
|
|
|
|
|
|
|
|
|
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
|
|
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
|
|
|
super.onViewCreated(view, savedInstanceState) |
|
|
|
super.onViewCreated(view, savedInstanceState) |
|
|
|
initUI() |
|
|
|
|
|
|
|
initData() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (ContextCompat.checkSelfPermission(requireActivity(), Manifest.permission.READ_EXTERNAL_STORAGE) |
|
|
|
AppGuard.registerListener(this) |
|
|
|
// != PackageManager.PERMISSION_GRANTED) { |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
// if (ActivityCompat.shouldShowRequestPermissionRationale(requireActivity(), |
|
|
|
|
|
|
|
// Manifest.permission.READ_EXTERNAL_STORAGE)) { |
|
|
|
|
|
|
|
// // Show an explanation to the user *asynchronously* -- don't block |
|
|
|
|
|
|
|
// // this thread waiting for the user's response! After the user |
|
|
|
|
|
|
|
// // sees the explanation, try again to request the permission. |
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// // No explanation needed, we can request the permission. |
|
|
|
|
|
|
|
// ActivityCompat.requestPermissions(requireActivity(), |
|
|
|
|
|
|
|
// arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE), |
|
|
|
|
|
|
|
// 12) |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
// // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an |
|
|
|
|
|
|
|
// // app-defined int constant. The callback method gets the |
|
|
|
|
|
|
|
// // result of the request. |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
// val uri = Uri.fromFile(File("sdcard/Download/Results_0802.csv")) |
|
|
|
|
|
|
|
// ImportActivity.newInstanceForResult(requireActivity(), uri) |
|
|
|
|
|
|
|
// |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initUI() |
|
|
|
|
|
|
|
initData() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
|
|
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
|
|
|
@ -214,12 +185,12 @@ class FeedFragment : FilterableFragment(), RowRepresentableDelegate, PurchaseLis |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onDestroy() { |
|
|
|
override fun onDestroy() { |
|
|
|
AppGuard.unregisterListener(this) |
|
|
|
|
|
|
|
super.onDestroy() |
|
|
|
super.onDestroy() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onDestroyView() { |
|
|
|
override fun onDestroyView() { |
|
|
|
super.onDestroyView() |
|
|
|
super.onDestroyView() |
|
|
|
|
|
|
|
AppGuard.unregisterListener(this) |
|
|
|
realmTransactions.removeAllChangeListeners() |
|
|
|
realmTransactions.removeAllChangeListeners() |
|
|
|
_binding = null |
|
|
|
_binding = null |
|
|
|
} |
|
|
|
} |
|
|
|
|