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();
}
Aggregations