modifiche bottom sheet dialog
This commit is contained in:
parent
08841537f5
commit
dfa2a1106e
@ -88,6 +88,8 @@ import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceComponen
|
||||
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceModule;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__item_edit.BottomSheetItemEditComponent;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__item_edit.BottomSheetItemEditModule;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalComponent;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteComponent;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteModule;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsComponent;
|
||||
@ -163,6 +165,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
||||
BottomSheetItemEditModule.class,
|
||||
BottomSheetInventarioActionsModule.class,
|
||||
BottomSheetInventarioRowActionsModule.class,
|
||||
BottomSheetMtbColrEditModalModule.class,
|
||||
})
|
||||
public interface MainApplicationComponent {
|
||||
|
||||
@ -274,6 +277,8 @@ public interface MainApplicationComponent {
|
||||
|
||||
BottomSheetInventarioRowActionsComponent.Factory bottomSheetInventarioRowActionsComponent();
|
||||
|
||||
BottomSheetMtbColrEditModalComponent.Factory bottomSheetMtbColrEditModalComponent();
|
||||
|
||||
void inject(MainApplication mainApplication);
|
||||
|
||||
void inject(AppContext mainApplication);
|
||||
|
||||
@ -43,13 +43,13 @@ import it.integry.integrywmsnative.gest.contab_doc_interni.dto.TipiDocDTO;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.dialog.selectDocRows.DialogSelectDocRowsView;
|
||||
import it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.ui.DocumentRowsListAdapter;
|
||||
import it.integry.integrywmsnative.ui.FabMenuCustomAnimations;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalView;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
|
||||
public class DocInterniEditFormActivity extends BaseActivity implements DocInterniEditFormViewModel.Listener, BottomSheetMtbColrEditView.Listener {
|
||||
public class DocInterniEditFormActivity extends BaseActivity implements DocInterniEditFormViewModel.Listener, BottomSheetMtbColrEditModalView.Listener {
|
||||
|
||||
private static final String DATA_KEY_DOCUMENT = "document";
|
||||
private static final String DATA_KEY_PRODUCTS_LIST = "productsList";
|
||||
@ -144,7 +144,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
binding.toolbar.setTitle(R.string.edit_doc);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
FabMenuCustomAnimations.changeIconOnFocus(binding.closeActivityFab, R.drawable.ic_menu_24dp, R.drawable.ic_close_24dp);
|
||||
binding.bottomSheetMtbColrEdit.setListener(this);
|
||||
|
||||
}
|
||||
|
||||
private void initViewModel() {
|
||||
@ -159,8 +159,9 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
binding.documentRowsList.setAdapter(listAdapter);
|
||||
binding.documentRowsList.setLayoutManager(new LinearLayoutManager(this));
|
||||
listAdapter.setOnItemClicked(row -> {
|
||||
binding.bottomSheetMtbColrEdit.setMtbColr(sqlToEntity(row));
|
||||
binding.bottomSheetMtbColrEdit.expand();
|
||||
new BottomSheetMtbColrEditModalView(sqlToEntity(row))
|
||||
.setListener(this)
|
||||
.show(getSupportFragmentManager(), "BottomSheetMtbColrEditModal");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalView;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_cliente.DialogAskClienteView;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArts;
|
||||
@ -62,7 +62,7 @@ import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQua
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
*/
|
||||
public class PickingLiberoFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, ILifecycleFragment, PickingLiberoViewModel.Listener, BottomSheetMtbColrEditView.Listener {
|
||||
public class PickingLiberoFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, ILifecycleFragment, PickingLiberoViewModel.Listener, BottomSheetMtbColrEditModalView.Listener {
|
||||
|
||||
private FragmentPickingLiberoBinding mBindings;
|
||||
|
||||
@ -135,7 +135,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
|
||||
this.initVars();
|
||||
this.initBarcodeReader();
|
||||
this.initBottomSheet();
|
||||
|
||||
this.initRecyclerView();
|
||||
|
||||
boolean flagAskCliente = SettingsManager.iDB().isFlagAskClienteInPickingLibero();
|
||||
@ -162,10 +162,6 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
private void initBottomSheet() {
|
||||
mBindings.bottomSheetMtbColrEdit.setListener(this);
|
||||
}
|
||||
|
||||
|
||||
private void initRecyclerView() {
|
||||
mBindings.pickingLiberoMainList.setNestedScrollingEnabled(false);
|
||||
@ -182,8 +178,9 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
mBindings.pickingLiberoMainList.setAdapter(mAdapter);
|
||||
|
||||
this.mAdapter.setOnItemClickListener(clickedMtbColr -> {
|
||||
mBindings.bottomSheetMtbColrEdit.setMtbColr(clickedMtbColr);
|
||||
mBindings.bottomSheetMtbColrEdit.expand();
|
||||
new BottomSheetMtbColrEditModalView(clickedMtbColr)
|
||||
.setListener(this)
|
||||
.show(getParentFragmentManager(), "BottomSheetMtbColrEditModal");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ import it.integry.integrywmsnative.gest.prod_rientro_merce.order_list.ProdRientr
|
||||
import it.integry.integrywmsnative.gest.prod_versamento_materiale.dto.OrdineLavorazioneDTO;
|
||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalView;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
|
||||
public class ProdRientroMerceFragment extends BaseFragment implements
|
||||
@ -41,7 +41,7 @@ public class ProdRientroMerceFragment extends BaseFragment implements
|
||||
ILifecycleFragment,
|
||||
ProdRientroMerceViewModel.Listener,
|
||||
BottomSheetFragmentLUContentView.Listener,
|
||||
BottomSheetMtbColrEditView.Listener,
|
||||
BottomSheetMtbColrEditModalView.Listener,
|
||||
ProdRientroMerceOrderListFragment.OnRefreshListener {
|
||||
|
||||
|
||||
@ -64,7 +64,6 @@ public class ProdRientroMerceFragment extends BaseFragment implements
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@ -77,7 +76,6 @@ public class ProdRientroMerceFragment extends BaseFragment implements
|
||||
mProdRientroMerceOrderDetailFragment = ProdRientroMerceOrderDetailFragment.newInstance();
|
||||
|
||||
|
||||
|
||||
mProdRientroMerceOrderListFragment
|
||||
.setOnItemSelectedRunnable(order -> {
|
||||
if (!isLargeLayout) {
|
||||
@ -92,8 +90,9 @@ public class ProdRientroMerceFragment extends BaseFragment implements
|
||||
})
|
||||
.setOnRefreshListener(this);
|
||||
mProdRientroMerceOrderDetailFragment.setOnMtbColtClicked(item -> {
|
||||
mBindings.bottomSheetMtbColrEdit.setMtbColr(item.getMtbColr().get(0));
|
||||
mBindings.bottomSheetMtbColrEdit.expand();
|
||||
new BottomSheetMtbColrEditModalView(item.getMtbColr().get(0))
|
||||
.setListener(this)
|
||||
.show(getParentFragmentManager(), "BottomSheetMtbColrEditModal");
|
||||
});
|
||||
|
||||
if (isLargeLayout) {
|
||||
@ -128,7 +127,6 @@ public class ProdRientroMerceFragment extends BaseFragment implements
|
||||
|
||||
mViewModel.setListener(this);
|
||||
|
||||
this.initBottomSheet();
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
@ -182,11 +180,6 @@ public class ProdRientroMerceFragment extends BaseFragment implements
|
||||
}
|
||||
|
||||
|
||||
private void initBottomSheet() {
|
||||
mBindings.bottomSheetMtbColrEdit.setListener(this);
|
||||
mBindings.bottomSheetMtbColrEdit.disableEditButton();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMtbColrEdit(MtbColr mtbColr) {
|
||||
|
||||
@ -222,7 +215,7 @@ public class ProdRientroMerceFragment extends BaseFragment implements
|
||||
|
||||
@Override
|
||||
public void onPreDestroy(Runnable onComplete) {
|
||||
if(getChildFragmentManager().getBackStackEntryCount() > 0)
|
||||
if (getChildFragmentManager().getBackStackEntryCount() > 0)
|
||||
getChildFragmentManager().popBackStack();
|
||||
|
||||
else onComplete.run();
|
||||
|
||||
@ -55,7 +55,7 @@ import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGExcep
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalView;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_position_of_lu.DialogAskPositionOfLUView;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
@ -65,7 +65,7 @@ import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQua
|
||||
import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCreateLUView;
|
||||
import it.integry.integrywmsnative.view.dialogs.yes_no.DialogYesNoView;
|
||||
|
||||
public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFragment, ILifecycleFragment, RettificaGiacenzeViewModel.Listener, BottomSheetMtbColrEditView.Listener {
|
||||
public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFragment, ILifecycleFragment, RettificaGiacenzeViewModel.Listener, BottomSheetMtbColrEditModalView.Listener {
|
||||
|
||||
private FragmentMainRettificaGiacenzeBinding mBinding = null;
|
||||
|
||||
@ -132,7 +132,6 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
|
||||
this.initVars();
|
||||
this.initBarcodeReader();
|
||||
this.initBottomSheet();
|
||||
this.initRecyclerView();
|
||||
|
||||
this.init();
|
||||
@ -152,10 +151,6 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
.setOnScanFailed(ex -> UtilityExceptions.defaultException(getActivity(), ex, false)));
|
||||
}
|
||||
|
||||
private void initBottomSheet() {
|
||||
mBinding.bottomSheetMtbColrEdit.setListener(this);
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
mBinding.rettificaGiacenzeMainList.setNestedScrollingEnabled(false);
|
||||
mBinding.rettificaGiacenzeMainList.setHasFixedSize(true);
|
||||
@ -173,8 +168,11 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
||||
|
||||
|
||||
this.mAdapter.setOnItemClickListener(clickedMtbColr -> {
|
||||
mBinding.bottomSheetMtbColrEdit.setMtbColr(clickedMtbColr);
|
||||
mBinding.bottomSheetMtbColrEdit.expand();
|
||||
new BottomSheetMtbColrEditModalView(clickedMtbColr)
|
||||
.setListener(this)
|
||||
.show(getParentFragmentManager(), "tag");
|
||||
// mBinding.bottomSheetMtbColrEdit.setMtbColr(clickedMtbColr);
|
||||
// mBinding.bottomSheetMtbColrEdit.expand();
|
||||
});
|
||||
|
||||
mBinding.rettificaGiacenzeMainList.setAdapter(mAdapter);
|
||||
|
||||
@ -224,7 +224,6 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
}
|
||||
|
||||
|
||||
|
||||
private boolean isOrdTrasf() {
|
||||
|
||||
return mTestateOrdini != null && !mTestateOrdini.isEmpty() && Stream.of(mTestateOrdini)
|
||||
@ -832,7 +831,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
.setCanOverflowOrderQuantity(canOverflowOrderQuantity)
|
||||
.setCanLUBeClosed(true)
|
||||
.setCanPartitaMagBeChanged(canPartitaMagBeChanged)
|
||||
.setStatoPartitaMag(pickingObjectDTO.getStatoArticoloDTO())
|
||||
.setStatoPartitaMag(pickingObjectDTO != null ? pickingObjectDTO.getStatoArticoloDTO() : null)
|
||||
.setNotifyProductLotStatus(SettingsManager.iDB().isNotifyLotStatus());
|
||||
|
||||
if (!mDialogInputQuantityV2View.isVisible())
|
||||
|
||||
@ -6,6 +6,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.Observable;
|
||||
import androidx.databinding.ObservableList;
|
||||
@ -19,9 +20,9 @@ import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.databinding.BottomSheetFragmentLuContentBinding;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__base.BottomSheetFragmentBaseView;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalView;
|
||||
|
||||
public class BottomSheetFragmentLUContentView extends BottomSheetFragmentBaseView implements BottomSheetMtbColrEditView.Listener {
|
||||
public class BottomSheetFragmentLUContentView extends BottomSheetFragmentBaseView implements BottomSheetMtbColrEditModalView.Listener {
|
||||
|
||||
private BottomSheetFragmentLuContentBinding mBinding;
|
||||
private BottomSheetFragmentLUContentViewModel mViewModel;
|
||||
@ -41,7 +42,6 @@ public class BottomSheetFragmentLUContentView extends BottomSheetFragmentBaseVie
|
||||
mViewModel = new BottomSheetFragmentLUContentViewModel();
|
||||
mBinding.setViewModel(mViewModel);
|
||||
|
||||
mBinding.bottomSheetMtbColrEdit.setListener(this);
|
||||
|
||||
mBinding.titleLayout.setOnClickListener(new OnSingleClickListener() {
|
||||
@Override
|
||||
@ -67,8 +67,11 @@ public class BottomSheetFragmentLUContentView extends BottomSheetFragmentBaseVie
|
||||
this.mBinding.mtbColrRecyclerView.setAdapter(this.mAdapter);
|
||||
|
||||
this.mAdapter.setOnItemClickListener(clickedMtbColr -> {
|
||||
this.mBinding.bottomSheetMtbColrEdit.setMtbColr(clickedMtbColr);
|
||||
this.mBinding.bottomSheetMtbColrEdit.expand();
|
||||
|
||||
new BottomSheetMtbColrEditModalView(clickedMtbColr)
|
||||
.setListener(this)
|
||||
.show(((AppCompatActivity) mContext).getSupportFragmentManager(), "tag");
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
package it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit;
|
||||
|
||||
import dagger.Subcomponent;
|
||||
|
||||
@Subcomponent
|
||||
public interface BottomSheetMtbColrEditModalComponent {
|
||||
|
||||
@Subcomponent.Factory
|
||||
interface Factory {
|
||||
BottomSheetMtbColrEditModalComponent create();
|
||||
}
|
||||
|
||||
void inject(BottomSheetMtbColrEditModalView bottomSheetMtbColrEditModalView);
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
||||
@Module(subcomponents = BottomSheetMtbColrEditModalComponent.class)
|
||||
public class BottomSheetMtbColrEditModalModule {
|
||||
|
||||
@Provides
|
||||
BottomSheetMtbColrEditViewModel providesBottomSheetMtbColrEditViewModel() {
|
||||
return new BottomSheetMtbColrEditViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
package it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.ObservableField;
|
||||
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.databinding.BottomSheetMtbColrEditBinding;
|
||||
|
||||
public class BottomSheetMtbColrEditModalView extends BottomSheetDialogFragment {
|
||||
|
||||
@Inject
|
||||
BottomSheetMtbColrEditViewModel mViewModel;
|
||||
|
||||
public ObservableField<Boolean> enabledEditButton = new ObservableField<>(true);
|
||||
public ObservableField<Boolean> enabledDeleteButton = new ObservableField<>(true);
|
||||
|
||||
private BottomSheetMtbColrEditBinding mBinding;
|
||||
private Listener mListener;
|
||||
|
||||
public final ObservableField<MtbColr> inputMtbColr = new ObservableField<>();
|
||||
|
||||
public BottomSheetMtbColrEditModalView(MtbColr inputMtbColr) {
|
||||
this.inputMtbColr.set(inputMtbColr);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
MainApplication.appComponent
|
||||
.bottomSheetMtbColrEditModalComponent()
|
||||
.create()
|
||||
.inject(this);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBinding = BottomSheetMtbColrEditBinding.inflate(inflater, container, true);
|
||||
|
||||
mBinding.setLifecycleOwner(this);
|
||||
mBinding.setView(this);
|
||||
|
||||
mBinding.executePendingBindings();
|
||||
|
||||
return mBinding.getRoot();
|
||||
}
|
||||
|
||||
|
||||
public BottomSheetMtbColrEditModalView enableEditButton() {
|
||||
this.enabledEditButton.set(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BottomSheetMtbColrEditModalView disableEditButton() {
|
||||
this.enabledEditButton.set(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BottomSheetMtbColrEditModalView enableDeleteButton() {
|
||||
this.enabledDeleteButton.set(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BottomSheetMtbColrEditModalView disableDeleteButton() {
|
||||
this.enabledDeleteButton.set(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public void editMtbColr() {
|
||||
if (this.mListener != null) this.mListener.onMtbColrEdit(this.inputMtbColr.get());
|
||||
this.dismiss();
|
||||
}
|
||||
|
||||
public void deleteMtbColr() {
|
||||
if (this.mListener != null) this.mListener.onMtbColrDelete(this.inputMtbColr.get());
|
||||
this.dismiss();
|
||||
}
|
||||
|
||||
|
||||
public BottomSheetMtbColrEditModalView setListener(Listener listener) {
|
||||
this.mListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface Listener {
|
||||
|
||||
void onMtbColrEdit(MtbColr mtbColr);
|
||||
|
||||
void onMtbColrDelete(MtbColr mtbColr);
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,116 +0,0 @@
|
||||
package it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableField;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
import it.integry.integrywmsnative.databinding.BottomSheetMtbColrEditBinding;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__base.BottomSheetFragmentBaseView;
|
||||
import it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.exceptions.NullMtbColrException;
|
||||
|
||||
public class BottomSheetMtbColrEditView extends BottomSheetFragmentBaseView {
|
||||
|
||||
private final BottomSheetMtbColrEditBinding mBinding;
|
||||
private final BottomSheetMtbColrEditViewModel mViewModel;
|
||||
|
||||
public ObservableField<Boolean> enabledEditButton = new ObservableField<>(true);
|
||||
public ObservableField<Boolean> enabledDeleteButton = new ObservableField<>(true);
|
||||
|
||||
private Listener mListener;
|
||||
|
||||
public BottomSheetMtbColrEditView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.bottom_sheet__mtb_colr_edit, this, true);
|
||||
|
||||
|
||||
mViewModel = new BottomSheetMtbColrEditViewModel();
|
||||
mBinding.setViewModel(mViewModel);
|
||||
mBinding.setView(this);
|
||||
}
|
||||
|
||||
public void setMtbColr(MtbColr mtbColr) {
|
||||
this.mBinding.invalidateAll();
|
||||
this.mViewModel.setMtbColr(mtbColr);
|
||||
this.mBinding.executePendingBindings();
|
||||
|
||||
this.parentView.requestLayout();
|
||||
}
|
||||
|
||||
public void editMtbColr() {
|
||||
if(this.mListener != null) this.mListener.onMtbColrEdit(this.mViewModel.getMtbColr());
|
||||
this.collapse();
|
||||
}
|
||||
|
||||
public void deleteMtbColr() {
|
||||
if(this.mListener != null) this.mListener.onMtbColrDelete(this.mViewModel.getMtbColr());
|
||||
this.collapse();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void expand() {
|
||||
if(this.mViewModel.getMtbColr() == null) {
|
||||
UtilityLogger.error(new NullMtbColrException());
|
||||
return;
|
||||
}
|
||||
|
||||
super.expand();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStateChangedCallback(State newState) {
|
||||
if(newState == State.COLLAPSED) this.mViewModel.setMtbColr(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSlideCallback(float slideOffset) {
|
||||
|
||||
}
|
||||
|
||||
public void enableEditButton() {
|
||||
this.enabledEditButton.set(true);
|
||||
}
|
||||
|
||||
public void disableEditButton() {
|
||||
this.enabledEditButton.set(false);
|
||||
}
|
||||
|
||||
public void enableDeleteButton() {
|
||||
this.enabledDeleteButton.set(true);
|
||||
}
|
||||
|
||||
public void disableDeleteButton() {
|
||||
this.enabledDeleteButton.set(false);
|
||||
}
|
||||
|
||||
|
||||
public BottomSheetMtbColrEditViewModel getViewModelInstance() {
|
||||
return this.mViewModel;
|
||||
}
|
||||
|
||||
|
||||
public BottomSheetMtbColrEditView setListener(Listener listener) {
|
||||
this.mListener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface Listener {
|
||||
|
||||
void onMtbColrEdit(MtbColr mtbColr);
|
||||
|
||||
void onMtbColrDelete(MtbColr mtbColr);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,22 +1,5 @@
|
||||
package it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit;
|
||||
|
||||
import androidx.databinding.ObservableField;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
|
||||
public class BottomSheetMtbColrEditViewModel {
|
||||
|
||||
private final ObservableField<MtbColr> mtbColr = new ObservableField<>();
|
||||
|
||||
|
||||
public MtbColr getMtbColr() {
|
||||
return mtbColr.get();
|
||||
}
|
||||
|
||||
public BottomSheetMtbColrEditViewModel setMtbColr(MtbColr mtbColr) {
|
||||
this.mtbColr.set(mtbColr);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -4,13 +4,15 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:fab="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormActivity"
|
||||
/>
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormActivity" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="it.integry.integrywmsnative.gest.contab_doc_interni.edit_form.DocInterniEditFormViewModel" />
|
||||
@ -28,16 +30,14 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/full_white"
|
||||
android:orientation="vertical"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
>
|
||||
android:descendantFocusability="blocksDescendants">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/full_white"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp"
|
||||
>
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<it.integry.integrywmsnative.ui.ElevatedToolbar
|
||||
android:id="@+id/elevated_toolbar"
|
||||
@ -48,6 +48,7 @@
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/toolbar_title"
|
||||
android:layout_width="wrap_content"
|
||||
@ -55,6 +56,7 @@
|
||||
tools:text="@string/edit_doc"
|
||||
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
|
||||
android:layout_gravity="start" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/add_extra_items_toolbar"
|
||||
android:layout_width="wrap_content"
|
||||
@ -64,7 +66,7 @@
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/ic_search_black_24dp"
|
||||
android:onClick="@{()->view.manualSearch()}"
|
||||
android:tint="@color/colorPrimaryGray"/>
|
||||
android:tint="@color/colorPrimaryGray" />
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
</it.integry.integrywmsnative.ui.ElevatedToolbar>
|
||||
@ -241,6 +243,7 @@
|
||||
android:layout_marginBottom="92dp"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingEnd="2dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/scan_art_spinner"
|
||||
android:layout_width="wrap_content"
|
||||
@ -255,7 +258,7 @@
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -266,7 +269,7 @@
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_horizontal"
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
android:text="@string/scan_item"/>
|
||||
android:text="@string/scan_item" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@ -323,6 +326,7 @@
|
||||
app:fab_colorRipple="#66FFFFFF"
|
||||
app:onClick="@{() -> viewModel.exportDocument()}"
|
||||
fab:fab_label="@string/export_document" />
|
||||
|
||||
<com.github.clans.fab.FloatingActionButton
|
||||
android:id="@+id/delete_document"
|
||||
android:layout_width="wrap_content"
|
||||
@ -348,23 +352,5 @@
|
||||
|
||||
|
||||
</com.github.clans.fab.FloatingActionMenu>
|
||||
<View
|
||||
android:id="@+id/bottom_sheet__mtb_colr_edit__background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#99000000"
|
||||
android:visibility="gone"
|
||||
android:clickable="true"
|
||||
android:focusable="true"/>
|
||||
|
||||
<it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView
|
||||
android:id="@+id/bottom_sheet__mtb_colr_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:behavior_hideable="true"
|
||||
app:behavior_peekHeight="0dp"
|
||||
app:layout_behavior=".view.bottom_sheet__base.AutoCloseBottomSheetBehavior"
|
||||
app:parentView="@id/bottom_sheet__mtb_colr_edit"
|
||||
app:backgroundView="@id/bottom_sheet__mtb_colr_edit__background"/>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</layout>
|
||||
@ -65,7 +65,7 @@
|
||||
android:src="@drawable/ic_add_24dp"
|
||||
android:tint="@color/colorPrimaryGray"
|
||||
app:visibility="@{spedizioneView.addExtraItemsEnabled}"
|
||||
app:singleClick="@{() -> spedizioneView.addExtraItem()}"/>
|
||||
app:singleClick="@{() -> spedizioneView.addExtraItem()}" />
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
@ -293,6 +293,14 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/bottom_sheet__background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#99000000"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:visibility="gone" />
|
||||
|
||||
<it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView
|
||||
android:id="@+id/bottom_sheet_lu_content"
|
||||
|
||||
@ -12,11 +12,7 @@
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView" />
|
||||
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditViewModel" />
|
||||
type="it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditModalView" />
|
||||
</data>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
@ -52,7 +48,7 @@
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{viewModel.mtbColr.descrizione}"
|
||||
android:text="@{view.inputMtbColr.descrizione}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Descrizione articolo" />
|
||||
@ -62,7 +58,7 @@
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{viewModel.mtbColr.codMart}"
|
||||
android:text="@{view.inputMtbColr.codMart}"
|
||||
tools:text="ABF52IL" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
@ -86,7 +82,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:text="@{UtilityNumber.decimalToString(viewModel.mtbColr.qtaCol)}"
|
||||
android:text="@{UtilityNumber.decimalToString(view.inputMtbColr.qtaCol)}"
|
||||
android:textStyle="bold"
|
||||
tools:text="250" />
|
||||
|
||||
@ -96,7 +92,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:gravity="end"
|
||||
android:text="@{viewModel.mtbColr.untMis}"
|
||||
android:text="@{view.inputMtbColr.untMis}"
|
||||
android:textStyle="bold"
|
||||
tools:text="PZ" />
|
||||
|
||||
@ -113,7 +109,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:text="@{UtilityNumber.decimalToString(viewModel.mtbColr.numCnf)}"
|
||||
android:text="@{UtilityNumber.decimalToString(view.inputMtbColr.numCnf)}"
|
||||
android:textStyle="bold"
|
||||
tools:text="250" />
|
||||
|
||||
|
||||
@ -528,24 +528,5 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<View
|
||||
android:id="@+id/bottom_sheet__mtb_colr_edit__background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#99000000"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:visibility="gone" />
|
||||
|
||||
<it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView
|
||||
android:id="@+id/bottom_sheet__mtb_colr_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:behavior_hideable="true"
|
||||
app:behavior_peekHeight="0dp"
|
||||
app:layout_behavior=".view.bottom_sheet__base.AutoCloseBottomSheetBehavior"
|
||||
app:parentView="@id/bottom_sheet__mtb_colr_edit"
|
||||
app:backgroundView="@id/bottom_sheet__mtb_colr_edit__background" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</layout>
|
||||
@ -314,26 +314,6 @@
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<View
|
||||
android:id="@+id/bottom_sheet__mtb_colr_edit__background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#99000000"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:visibility="gone" />
|
||||
|
||||
<it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView
|
||||
android:id="@+id/bottom_sheet__mtb_colr_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:behavior_hideable="true"
|
||||
app:behavior_peekHeight="0dp"
|
||||
app:layout_behavior=".view.bottom_sheet__base.AutoCloseBottomSheetBehavior"
|
||||
app:parentView="@id/bottom_sheet__mtb_colr_edit"
|
||||
app:backgroundView="@id/bottom_sheet__mtb_colr_edit__background"/>
|
||||
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:fab="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
|
||||
<variable
|
||||
@ -122,41 +123,18 @@
|
||||
style="?attr/floatingActionButtonSecondaryStyle" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <com.github.clans.fab.FloatingActionButton-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_gravity="bottom|end"-->
|
||||
<!-- android:layout_marginEnd="8dp"-->
|
||||
<!-- android:layout_marginBottom="8dp"-->
|
||||
<!-- android:onClick="@{() -> view.closeLU()}"-->
|
||||
<!-- android:src="@drawable/ic_check_white_24dp"-->
|
||||
<!-- app:visibility="@{view.thereIsAnOpenedUL}"-->
|
||||
<!-- fab:fab_colorNormal="@color/mainGreen"-->
|
||||
<!-- fab:fab_colorPressed="@color/white_pressed"-->
|
||||
<!-- fab:fab_colorRipple="#66FFFFFF" />-->
|
||||
|
||||
|
||||
<View
|
||||
android:id="@+id/bottom_sheet__mtb_colr_edit__background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#99000000"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:visibility="gone" />
|
||||
|
||||
<it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView
|
||||
android:id="@+id/bottom_sheet__mtb_colr_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:behavior_hideable="true"
|
||||
app:behavior_peekHeight="0dp"
|
||||
app:layout_behavior=".view.bottom_sheet__base.AutoCloseBottomSheetBehavior"
|
||||
app:backgroundView="@id/bottom_sheet__mtb_colr_edit__background"
|
||||
app:parentView="@id/bottom_sheet__mtb_colr_edit" />
|
||||
<!-- <com.github.clans.fab.FloatingActionButton-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_gravity="bottom|end"-->
|
||||
<!-- android:layout_marginEnd="8dp"-->
|
||||
<!-- android:layout_marginBottom="8dp"-->
|
||||
<!-- android:onClick="@{() -> view.closeLU()}"-->
|
||||
<!-- android:src="@drawable/ic_check_white_24dp"-->
|
||||
<!-- app:visibility="@{view.thereIsAnOpenedUL}"-->
|
||||
<!-- fab:fab_colorNormal="@color/mainGreen"-->
|
||||
<!-- fab:fab_colorPressed="@color/white_pressed"-->
|
||||
<!-- fab:fab_colorRipple="#66FFFFFF" />-->
|
||||
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
@ -53,29 +53,5 @@
|
||||
tools:layout="@layout/fragment_prod_rientro_merce_order_list" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<View
|
||||
android:id="@+id/bottom_sheet__mtb_colr_edit__background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#99000000"
|
||||
android:visibility="gone"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
|
||||
<it.integry.integrywmsnative.view.bottom_sheet__mtb_colr_edit.BottomSheetMtbColrEditView
|
||||
android:id="@+id/bottom_sheet__mtb_colr_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:behavior_hideable="true"
|
||||
app:behavior_peekHeight="0dp"
|
||||
app:layout_behavior=".view.bottom_sheet__base.AutoCloseBottomSheetBehavior"
|
||||
app:parentView="@id/bottom_sheet__mtb_colr_edit"
|
||||
app:backgroundView="@id/bottom_sheet__mtb_colr_edit__background" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</layout>
|
||||
Loading…
x
Reference in New Issue
Block a user