Search in sources :

Example 1 with TextEditBottomSheet

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

the class MasterProductCatOptionalFragment method showDescriptionBottomSheet.

public void showDescriptionBottomSheet() {
    Bundle bundle = new Bundle();
    bundle.putString(Constants.ARGUMENT.TITLE, getString(R.string.title_edit_description));
    bundle.putString(Constants.ARGUMENT.HINT, getString(R.string.property_description));
    Spanned description = viewModel.getFormData().getDescriptionLive().getValue();
    bundle.putString(Constants.ARGUMENT.HTML, description != null ? Html.toHtml(description) : null);
    activity.showBottomSheet(new TextEditBottomSheet(), bundle);
}
Also used : Bundle(android.os.Bundle) EmbeddedFragmentScannerBundle(xyz.zedler.patrick.grocy.scanner.EmbeddedFragmentScannerBundle) TextEditBottomSheet(xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.TextEditBottomSheet) Spanned(android.text.Spanned)

Example 2 with TextEditBottomSheet

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

the class ShoppingModeFragment method showNotesEditor.

private void showNotesEditor() {
    Bundle bundle = new Bundle();
    bundle.putString(Constants.ARGUMENT.TITLE, activity.getString(R.string.action_edit_notes));
    bundle.putString(Constants.ARGUMENT.HINT, activity.getString(R.string.property_notes));
    ShoppingList shoppingList = viewModel.getSelectedShoppingList();
    if (shoppingList == null) {
        return;
    }
    bundle.putString(Constants.ARGUMENT.HTML, shoppingList.getNotes());
    activity.showBottomSheet(new TextEditBottomSheet(), bundle);
}
Also used : Bundle(android.os.Bundle) ShoppingList(xyz.zedler.patrick.grocy.model.ShoppingList) TextEditBottomSheet(xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.TextEditBottomSheet)

Example 3 with TextEditBottomSheet

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

the class ShoppingListFragment method showNotesEditor.

private void showNotesEditor() {
    Bundle bundle = new Bundle();
    bundle.putString(Constants.ARGUMENT.TITLE, activity.getString(R.string.action_edit_notes));
    bundle.putString(Constants.ARGUMENT.HINT, activity.getString(R.string.property_notes));
    ShoppingList shoppingList = viewModel.getSelectedShoppingList();
    if (shoppingList == null) {
        return;
    }
    bundle.putString(Constants.ARGUMENT.HTML, shoppingList.getNotes());
    activity.showBottomSheet(new TextEditBottomSheet(), bundle);
}
Also used : Bundle(android.os.Bundle) ShoppingList(xyz.zedler.patrick.grocy.model.ShoppingList) TextEditBottomSheet(xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.TextEditBottomSheet)

Aggregations

Bundle (android.os.Bundle)3 TextEditBottomSheet (xyz.zedler.patrick.grocy.fragment.bottomSheetDialog.TextEditBottomSheet)3 ShoppingList (xyz.zedler.patrick.grocy.model.ShoppingList)2 Spanned (android.text.Spanned)1 EmbeddedFragmentScannerBundle (xyz.zedler.patrick.grocy.scanner.EmbeddedFragmentScannerBundle)1