Search in sources :

Example 1 with ConsumeFragment

use of xyz.zedler.patrick.grocy.fragment.ConsumeFragment in project grocy-android by patzly.

the class DrawerBottomSheet method onCreateView.

@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    binding = FragmentBottomsheetDrawerBinding.inflate(inflater, container, false);
    activity = (MainActivity) requireActivity();
    sharedPrefs = PreferenceManager.getDefaultSharedPreferences(activity);
    binding.buttonDrawerShoppingMode.setOnClickListener(v -> navigateDeepLink(R.string.deep_link_shoppingModeFragment));
    ClickUtil.setOnClickListeners(this, binding.linearDrawerStock, binding.linearDrawerShoppingList, binding.linearDrawerConsume, binding.linearDrawerPurchase, binding.linearDrawerTransfer, binding.linearDrawerInventory, binding.linearDrawerMasterData, binding.linearDrawerSettings, binding.linearDrawerFeedback, binding.linearDrawerHelp);
    BaseFragment currentFragment = activity.getCurrentFragment();
    if (currentFragment instanceof StockOverviewFragment) {
        select(binding.linearDrawerStock, binding.textDrawerStock, false);
    } else if (currentFragment instanceof ShoppingListFragment) {
        select(binding.linearDrawerShoppingList, binding.textDrawerShoppingList, false);
    } else if (currentFragment instanceof ConsumeFragment) {
        select(binding.linearDrawerConsume, null, true);
    } else if (currentFragment instanceof PurchaseFragment) {
        select(binding.linearDrawerPurchase, null, true);
    } else if (currentFragment instanceof TransferFragment) {
        select(binding.linearDrawerTransfer, null, true);
    } else if (currentFragment instanceof InventoryFragment) {
        select(binding.linearDrawerInventory, null, true);
    } else if (currentFragment instanceof MasterObjectListFragment) {
        select(binding.linearDrawerMasterData, binding.textDrawerMasterData, false);
    } else if (currentFragment instanceof SettingsFragment) {
        select(binding.linearDrawerSettings, binding.textDrawerSettings, false);
    }
    hideDisabledFeatures();
    return binding.getRoot();
}
Also used : SettingsFragment(xyz.zedler.patrick.grocy.fragment.SettingsFragment) StockOverviewFragment(xyz.zedler.patrick.grocy.fragment.StockOverviewFragment) MasterObjectListFragment(xyz.zedler.patrick.grocy.fragment.MasterObjectListFragment) ConsumeFragment(xyz.zedler.patrick.grocy.fragment.ConsumeFragment) ShoppingListFragment(xyz.zedler.patrick.grocy.fragment.ShoppingListFragment) PurchaseFragment(xyz.zedler.patrick.grocy.fragment.PurchaseFragment) InventoryFragment(xyz.zedler.patrick.grocy.fragment.InventoryFragment) BaseFragment(xyz.zedler.patrick.grocy.fragment.BaseFragment) TransferFragment(xyz.zedler.patrick.grocy.fragment.TransferFragment)

Aggregations

BaseFragment (xyz.zedler.patrick.grocy.fragment.BaseFragment)1 ConsumeFragment (xyz.zedler.patrick.grocy.fragment.ConsumeFragment)1 InventoryFragment (xyz.zedler.patrick.grocy.fragment.InventoryFragment)1 MasterObjectListFragment (xyz.zedler.patrick.grocy.fragment.MasterObjectListFragment)1 PurchaseFragment (xyz.zedler.patrick.grocy.fragment.PurchaseFragment)1 SettingsFragment (xyz.zedler.patrick.grocy.fragment.SettingsFragment)1 ShoppingListFragment (xyz.zedler.patrick.grocy.fragment.ShoppingListFragment)1 StockOverviewFragment (xyz.zedler.patrick.grocy.fragment.StockOverviewFragment)1 TransferFragment (xyz.zedler.patrick.grocy.fragment.TransferFragment)1