From 37e52b3f2f5badcdb64b20d036527e626aa43c95 Mon Sep 17 00:00:00 2001 From: leca Date: Sun, 17 Nov 2024 22:37:54 +0300 Subject: [PATCH] Fixed category filter --- .../barcodescannerforemployees/activities/MainActivity.kt | 1 + .../barcodescannerforemployees/fragments/CategoriesFragment.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/foxarmy/barcodescannerforemployees/activities/MainActivity.kt b/app/src/main/java/org/foxarmy/barcodescannerforemployees/activities/MainActivity.kt index f315103..0d04402 100644 --- a/app/src/main/java/org/foxarmy/barcodescannerforemployees/activities/MainActivity.kt +++ b/app/src/main/java/org/foxarmy/barcodescannerforemployees/activities/MainActivity.kt @@ -332,6 +332,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte adapter.addFragment(CategoriesFragment(), getString(R.string.categories_title)) viewpager.adapter = adapter + viewpager.offscreenPageLimit = 3 } override fun onCreateOptionsMenu(menu: Menu): Boolean { diff --git a/app/src/main/java/org/foxarmy/barcodescannerforemployees/fragments/CategoriesFragment.kt b/app/src/main/java/org/foxarmy/barcodescannerforemployees/fragments/CategoriesFragment.kt index d3165ab..4c50226 100644 --- a/app/src/main/java/org/foxarmy/barcodescannerforemployees/fragments/CategoriesFragment.kt +++ b/app/src/main/java/org/foxarmy/barcodescannerforemployees/fragments/CategoriesFragment.kt @@ -35,7 +35,7 @@ class CategoriesFragment : Fragment() { } private fun prepareDatabaseConnection() { - val dbHelper = DBStorageController(requireContext(), sharedPreferences.getString("currentGroup", "database")!!) + val dbHelper = DBStorageController(requireContext(), sharedPreferences.getString("currentGroup", "offline")!!) categoryDAO = CategoryDAO(dbHelper) }