Finish v1.17.0(218)
This commit is contained in:
commit
91b43d1974
@ -6,8 +6,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 217
|
||||
def appVersionName = '1.16.35'
|
||||
def appVersionCode = 218
|
||||
def appVersionName = '1.17.0'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@ -190,7 +190,6 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
|
||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||
BarcodeManager.disable();
|
||||
|
||||
this.openProgress();
|
||||
|
||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||
@ -238,6 +237,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
|
||||
@Override
|
||||
public void onLUOpened(MtbColt mtbColt) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
mToolbarTitleText.setText(String.format(getActivity().getText(R.string.lu_number_text).toString(), mtbColt.getNumCollo()));
|
||||
|
||||
initAdapter();
|
||||
@ -253,15 +253,18 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
});
|
||||
|
||||
FBToast.successToast(getActivity(), getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLUClosed() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
mToolbarTitleText.setText(getActivity().getText(R.string.free_picking_title_fragment).toString());
|
||||
destroyAdapter();
|
||||
|
||||
thereIsAnyRowInUL.set(false);
|
||||
thereIsAnOpenedUL.set(false);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -276,6 +279,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
|
||||
@Override
|
||||
public void onError(Exception ex) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
this.closeProgress();
|
||||
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
@ -285,6 +289,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
}
|
||||
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -357,7 +362,9 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
||||
|
||||
@Override
|
||||
public void onRowSaved() {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
FBToast.successToast(getActivity(), getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -181,15 +181,18 @@ public class PickingLiberoViewModel {
|
||||
if (this.mFlagAskCliente) {
|
||||
this.sendOnLoadingEnded();
|
||||
this.sendLUClienteRequired((vtbDest, codJcom) -> {
|
||||
this.sendOnLoadingStarted();
|
||||
createNewLU_PostClienteAsk(customNumCollo, customSerCollo, vtbDest, codJcom, onComplete);
|
||||
}, onComplete);
|
||||
}, () -> {
|
||||
|
||||
});
|
||||
} else {
|
||||
createNewLU_PostClienteAsk(customNumCollo, customSerCollo, null, null, onComplete);
|
||||
}
|
||||
}
|
||||
|
||||
private void createNewLU_PostClienteAsk(Integer customNumCollo, String customSerCollo, VtbDest vtbDest, String codJcom, Runnable onComplete) {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
MtbColt mtbColt = new MtbColt();
|
||||
mtbColt.initDefaultFields();
|
||||
mtbColt.setGestione(mDefaultGestione)
|
||||
@ -211,7 +214,7 @@ public class PickingLiberoViewModel {
|
||||
mtbColt.setCodVdes(vtbDest.getCodVdes());
|
||||
}
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(codJcom)) {
|
||||
if (!UtilityString.isNullOrEmpty(codJcom)) {
|
||||
mtbColt.setCodJcom(codJcom);
|
||||
}
|
||||
|
||||
@ -378,6 +381,7 @@ public class PickingLiberoViewModel {
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
new Thread(() -> {
|
||||
mColliMagazzinoRESTConsumer.saveCollo(clonedTestata, value -> {
|
||||
for (int i = 0; i < mtbColrObservableField.size(); i++) {
|
||||
MtbColr initialMtbColr = mtbColrObservableField.get(i);
|
||||
@ -389,19 +393,6 @@ public class PickingLiberoViewModel {
|
||||
.setSerCollo(value.getSerCollo());
|
||||
|
||||
initialMtbColr.setRiga(value.getMtbColr().get(i).getRiga());
|
||||
|
||||
// for (int j = 0; j < value.getMtbColr().size(); j++) {
|
||||
// MtbColr savedMtbColr = value.getMtbColr().get(j);
|
||||
// if (savedMtbColr.getCodMart().equals(initialMtbColr.getCodMart()) &&
|
||||
// UtilityString.equalsIgnoreCase(savedMtbColr.getPartitaMag(), initialMtbColr.getPartitaMag()) &&
|
||||
// UtilityString.equalsIgnoreCase(savedMtbColr.getCodCol(), initialMtbColr.getCodCol()) &&
|
||||
// UtilityString.equalsIgnoreCase(savedMtbColr.getCodTagl(), initialMtbColr.getCodTagl()) &&
|
||||
// savedMtbColr.getQtaCol().equals(initialMtbColr.getQtaCol()) &&
|
||||
// savedMtbColr.getNumCnf().equals(initialMtbColr.getNumCnf())) {
|
||||
// initialMtbColr.setRiga(savedMtbColr.getRiga());
|
||||
// }
|
||||
// }
|
||||
|
||||
mCurrentMtbColt.getMtbColr().add(mtbColrObservableField.get(i));
|
||||
}
|
||||
|
||||
@ -409,7 +400,10 @@ public class PickingLiberoViewModel {
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
onComplete.run();
|
||||
|
||||
}, this::sendError);
|
||||
|
||||
}).start();
|
||||
}
|
||||
}, onComplete);
|
||||
} else {
|
||||
|
||||
@ -96,6 +96,7 @@ public class DialogAskClienteAdapter extends PagerAdapter implements ViewPager.O
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
if(position != lastPage) {
|
||||
if(lastPage != -1) mDatasetViews.get(lastPage).getValue().onDismiss();
|
||||
viewPager.onPageChanged(mDatasetViews.get(position).getKey().getRoot());
|
||||
mDatasetViews.get(position).getValue().onShow();
|
||||
lastPage = position;
|
||||
@ -111,4 +112,8 @@ public class DialogAskClienteAdapter extends PagerAdapter implements ViewPager.O
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
|
||||
public void onDismiss() {
|
||||
if(lastPage != -1) mDatasetViews.get(lastPage).getValue().onDismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,6 +133,7 @@ public class DialogAskClienteView extends BaseDialogFragment {
|
||||
|
||||
@Override
|
||||
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||
mAdapter.onDismiss();
|
||||
if(!mIsClienteSelected) {
|
||||
this.mOnAbort.run();
|
||||
}
|
||||
|
||||
@ -66,8 +66,8 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
||||
"WHERE vtb_clie.flag_stato = 'A' " +
|
||||
"ORDER BY rag_soc";
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<HashMap<String, Object>>>() {
|
||||
}.getType();
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<HashMap<String, Object>>>() { }.getType();
|
||||
|
||||
SystemRESTConsumer.processSqlStatic(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<HashMap<String, Object>>>() {
|
||||
@Override
|
||||
public void onSuccess(ArrayList<HashMap<String, Object>> value) {
|
||||
@ -106,6 +106,11 @@ public class DialogAskCliente_Page1ViewModel implements IDialogAskClienteViewMod
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss() {
|
||||
BarcodeManager.removeCallback(mBarcodeScannerInstanceID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnConfirmClickListener(Runnable onConfirm) {
|
||||
this.mBinding.buttonYes.setOnClickListener(v -> {
|
||||
|
||||
@ -71,6 +71,10 @@ public class DialogAskCliente_Page2ViewModel implements IDialogAskClienteViewMod
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnConfirmClickListener(Runnable onConfirm) {
|
||||
this.mOnConfirm = onConfirm;
|
||||
|
||||
@ -12,6 +12,8 @@ public interface IDialogAskClienteViewModel {
|
||||
|
||||
void onShow();
|
||||
|
||||
void onDismiss();
|
||||
|
||||
void setOnConfirmClickListener(Runnable onConfirm);
|
||||
|
||||
void setOnAbortClickListener(Runnable onAbort);
|
||||
|
||||
@ -7,6 +7,7 @@ import android.graphics.drawable.ColorDrawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
@ -22,7 +23,6 @@ import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
@ -42,13 +42,13 @@ public class DialogChooseArtsFromListaArts {
|
||||
private Context currentContext;
|
||||
private Dialog mDialog;
|
||||
|
||||
private DialogChooseArtsFromListaArtsLayoutBinding mBindings;
|
||||
private DialogChooseArtsFromListaArtsAdapter currentAdapter;
|
||||
|
||||
private RunnableArgs<List<MtbColr>> mOnItemsChoosed;
|
||||
private Runnable mOnAbort;
|
||||
|
||||
private List<DialogChooseArtsFromListaArtsItemModel> mDataset;
|
||||
private BindableBoolean filterStatus = new BindableBoolean(false);
|
||||
|
||||
public static void make(@NotNull final FragmentActivity activity, List<MtbColr> listaMtbColr, RunnableArgs<List<MtbColr>> onItemsChoosed, Runnable onAbort) {
|
||||
activity.runOnUiThread(() -> {
|
||||
@ -64,9 +64,9 @@ public class DialogChooseArtsFromListaArts {
|
||||
|
||||
mDataset = new ArrayList<>();
|
||||
|
||||
if(listaMtbColr != null){
|
||||
if (listaMtbColr != null) {
|
||||
for (MtbColr mtbColr : listaMtbColr) {
|
||||
if(UtilityString.isNullOrEmpty(mtbColr.getUntMis()) && mtbColr.getMtbAart() != null){
|
||||
if (UtilityString.isNullOrEmpty(mtbColr.getUntMis()) && mtbColr.getMtbAart() != null) {
|
||||
mtbColr.setUntMis(mtbColr.getMtbAart().getUntMis());
|
||||
}
|
||||
|
||||
@ -75,56 +75,131 @@ public class DialogChooseArtsFromListaArts {
|
||||
}
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
DialogChooseArtsFromListaArtsLayoutBinding binding = DataBindingUtil.inflate(inflater, R.layout.dialog_choose_arts_from_lista_arts_layout, null, false);
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.dialog_choose_arts_from_lista_arts_layout, null, false);
|
||||
|
||||
binding.setFilterStatus(filterStatus);
|
||||
binding.emptyView.setVisibility(listaMtbColr != null && listaMtbColr.size() > 0 ? View.GONE : View.VISIBLE);
|
||||
mBindings.emptyView.setVisibility(listaMtbColr != null && listaMtbColr.size() > 0 ? View.GONE : View.VISIBLE);
|
||||
|
||||
|
||||
mDialog = new Dialog(context);
|
||||
mDialog.setContentView(binding.getRoot());
|
||||
mDialog.setContentView(mBindings.getRoot());
|
||||
mDialog.setCanceledOnTouchOutside(false);
|
||||
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
mDialog.setOnCancelListener(dialog -> {
|
||||
if(this.mOnAbort != null) this.mOnAbort.run();
|
||||
if (this.mOnAbort != null) this.mOnAbort.run();
|
||||
});
|
||||
|
||||
UtilityDialog.setTo90PercentWidth(context, mDialog);
|
||||
|
||||
|
||||
initRecyclerView(binding);
|
||||
initRecyclerView();
|
||||
|
||||
initRemoveFilterButton(binding);
|
||||
initFilter();
|
||||
|
||||
setupBarcode();
|
||||
|
||||
binding.positiveButton.setOnClickListener(v -> {
|
||||
mBindings.positiveButton.setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
onPositiveClick();
|
||||
});
|
||||
|
||||
binding.negativeButton.setOnClickListener(v -> {
|
||||
mBindings.negativeButton.setOnClickListener(v -> {
|
||||
mDialog.dismiss();
|
||||
onNegativeClick();
|
||||
});
|
||||
}
|
||||
|
||||
private void initRecyclerView(DialogChooseArtsFromListaArtsLayoutBinding binding) {
|
||||
binding.dialogChooseArtsFromListaArtMainList.setNestedScrollingEnabled(false);
|
||||
private void initRecyclerView() {
|
||||
mBindings.dialogChooseArtsFromListaArtMainList.setNestedScrollingEnabled(false);
|
||||
|
||||
binding.dialogChooseArtsFromListaArtMainList.setHasFixedSize(true);
|
||||
mBindings.dialogChooseArtsFromListaArtMainList.setHasFixedSize(true);
|
||||
|
||||
binding.dialogChooseArtsFromListaArtMainList.setLayoutManager(new LinearLayoutManager(currentContext));
|
||||
mBindings.dialogChooseArtsFromListaArtMainList.setLayoutManager(new LinearLayoutManager(currentContext));
|
||||
|
||||
currentAdapter = new DialogChooseArtsFromListaArtsAdapter(currentContext, mDataset);
|
||||
binding.dialogChooseArtsFromListaArtMainList.setAdapter(currentAdapter);
|
||||
mBindings.dialogChooseArtsFromListaArtMainList.setAdapter(currentAdapter);
|
||||
}
|
||||
|
||||
|
||||
private void initRemoveFilterButton(DialogChooseArtsFromListaArtsLayoutBinding binding) {
|
||||
binding.buttonRemoveFilter.setOnClickListener(v -> {
|
||||
private void initFilter() {
|
||||
mBindings.mainSearch.setOnCloseListener(() -> {
|
||||
this.removeListFilter();
|
||||
return true;
|
||||
});
|
||||
|
||||
mBindings.mainSearch.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
// removeListFilter();
|
||||
//
|
||||
// if (!UtilityString.isNullOrEmpty(query) && query.trim().length() > 3) {
|
||||
// List<DialogChooseArtsFromListaArtsItemModel> foundRowsList = Stream.of(mDataset)
|
||||
// .filter(x -> {
|
||||
// String codMart = x.getMtbColr().getMtbAart().getCodMart();
|
||||
// String descrizioneArt = x.getMtbColr().getMtbAart().getDescrizioneEstesa();
|
||||
// String diacod = x.getMtbColr().getMtbAart().getDiacod();
|
||||
//
|
||||
// return ((codMart.startsWith(query) ||
|
||||
// codMart.endsWith(query) ||
|
||||
// codMart.contains(query) ||
|
||||
// codMart.equalsIgnoreCase(query)) ||
|
||||
// (descrizioneArt.startsWith(query) ||
|
||||
// descrizioneArt.endsWith(query) ||
|
||||
// descrizioneArt.contains(query) ||
|
||||
// descrizioneArt.equalsIgnoreCase(query)) ||
|
||||
// (diacod.startsWith(query) ||
|
||||
// diacod.endsWith(query) ||
|
||||
// diacod.contains(query) ||
|
||||
// diacod.equalsIgnoreCase(query))) &&
|
||||
// !x.isHidden();
|
||||
// })
|
||||
// .toList();
|
||||
//
|
||||
// for (int i = 0; i < mDataset.size(); i++) {
|
||||
// mDataset.get(i).setHidden(!foundRowsList.contains(mDataset.get(i)));
|
||||
// }
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
removeListFilter();
|
||||
|
||||
newText = newText.toLowerCase();
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(newText) && newText.trim().length() > 2) {
|
||||
String finalNewText = newText;
|
||||
List<DialogChooseArtsFromListaArtsItemModel> foundRowsList = Stream.of(mDataset)
|
||||
.filter(x -> {
|
||||
String codMart = x.getMtbColr().getMtbAart().getCodMart().toLowerCase();
|
||||
String descrizioneArt = x.getMtbColr().getMtbAart().getDescrizioneEstesa().toLowerCase();
|
||||
String diacod = x.getMtbColr().getMtbAart().getDiacod().toLowerCase();
|
||||
|
||||
return ((codMart.startsWith(finalNewText) ||
|
||||
codMart.endsWith(finalNewText) ||
|
||||
codMart.contains(finalNewText) ||
|
||||
codMart.equalsIgnoreCase(finalNewText)) ||
|
||||
(descrizioneArt.startsWith(finalNewText) ||
|
||||
descrizioneArt.endsWith(finalNewText) ||
|
||||
descrizioneArt.contains(finalNewText) ||
|
||||
descrizioneArt.equalsIgnoreCase(finalNewText)) ||
|
||||
(diacod.startsWith(finalNewText) ||
|
||||
diacod.endsWith(finalNewText) ||
|
||||
diacod.contains(finalNewText) ||
|
||||
diacod.equalsIgnoreCase(finalNewText))) &&
|
||||
!x.isHidden();
|
||||
})
|
||||
.toList();
|
||||
|
||||
for (int i = 0; i < mDataset.size(); i++) {
|
||||
mDataset.get(i).setHidden(!foundRowsList.contains(mDataset.get(i)));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -147,9 +222,9 @@ public class DialogChooseArtsFromListaArts {
|
||||
|
||||
Dialog progressDialog = UtilityProgress.createDefaultProgressDialog(currentContext);
|
||||
|
||||
if(UtilityBarcode.isEan13(data)){
|
||||
if (UtilityBarcode.isEan13(data)) {
|
||||
this.loadArticolo(data.getStringValue(), null, progressDialog);
|
||||
} else if(UtilityBarcode.isEtichetta128(data)) {
|
||||
} else if (UtilityBarcode.isEtichetta128(data)) {
|
||||
this.executeEtichettaEan128(data, progressDialog);
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
@ -165,14 +240,15 @@ public class DialogChooseArtsFromListaArts {
|
||||
|
||||
String barcodeProd = null;
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Content)) barcodeProd = ean128Model.Content;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Content))
|
||||
barcodeProd = ean128Model.Content;
|
||||
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Gtin) || !UtilityString.isNullOrEmpty(ean128Model.Content)){
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Gtin) || !UtilityString.isNullOrEmpty(ean128Model.Content)) {
|
||||
this.loadArticolo(barcodeProd, ean128Model, progressDialog);
|
||||
} else {
|
||||
DialogCommon.showNoArtFoundDialog(currentContext, () -> {
|
||||
@ -191,22 +267,23 @@ public class DialogChooseArtsFromListaArts {
|
||||
});
|
||||
|
||||
}
|
||||
}, ex-> {
|
||||
}, ex -> {
|
||||
UtilityExceptions.defaultException(currentContext, ex, progressDialog);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void loadArticolo(String barcodeProd, Ean128Model ean128Model, Dialog progressDialog) {
|
||||
if(barcodeProd.length() == 14) {
|
||||
if (barcodeProd.length() == 14) {
|
||||
barcodeProd = UtilityBarcode.convertITF14toEAN13(barcodeProd);
|
||||
}
|
||||
|
||||
String finalBarcodeProd = barcodeProd;
|
||||
ArticoloRESTConsumer.getByBarcodeProdStatic(barcodeProd, mtbAartList -> {
|
||||
|
||||
if(mtbAartList != null && mtbAartList.size() > 0) {
|
||||
if (mtbAartList != null && mtbAartList.size() > 0) {
|
||||
this.mBindings.mainSearch.setQuery(finalBarcodeProd, false);
|
||||
|
||||
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
||||
|
||||
@ -236,42 +313,34 @@ public class DialogChooseArtsFromListaArts {
|
||||
!x.isHidden())
|
||||
.toList();
|
||||
|
||||
if(foundRowsList.size() == 0) {
|
||||
if (foundRowsList.size() == 0) {
|
||||
DialogCommon.showNoArtFoundDialog(currentContext, null);
|
||||
} else {
|
||||
|
||||
for(int i = 0; i < mDataset.size(); i++) {
|
||||
for (int i = 0; i < mDataset.size(); i++) {
|
||||
mDataset.get(i).setHidden(!foundRowsList.contains(mDataset.get(i)));
|
||||
}
|
||||
|
||||
filterStatus.set(true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void removeListFilter() {
|
||||
filterStatus.set(false);
|
||||
for (DialogChooseArtsFromListaArtsItemModel itemModel : mDataset) {
|
||||
itemModel.setHidden(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void onPositiveClick() {
|
||||
if(mOnItemsChoosed != null) {
|
||||
if (mOnItemsChoosed != null) {
|
||||
mOnItemsChoosed.run(currentAdapter.getSelectedItems());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void onNegativeClick() {
|
||||
if(this.mOnAbort != null) mOnAbort.run();
|
||||
if (this.mOnAbort != null) mOnAbort.run();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -3,103 +3,54 @@
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="filterStatus"
|
||||
type="it.integry.integrywmsnative.core.di.BindableBoolean" />
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/base_root"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/buttons"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_default="wrap"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintStart_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextViewMaterial.DialogTitle"
|
||||
android:text="@string/dialog_choose_arts_from_lista_art"
|
||||
android:gravity="center_horizontal"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_remove_filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
style="@style/Button.DangerOutline"
|
||||
app:icon="@drawable/ic_clear_24dp"
|
||||
app:strokeColor="@color/red_400"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:visibility="@{filterStatus.get() ? View.VISIBLE : View.GONE}"
|
||||
android:text="@string/remove_filter_button"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_text"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"/>
|
||||
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/button_remove_filter"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent">
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/buttons"
|
||||
android:layout_below="@id/title_container"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/empty_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp">
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center"
|
||||
android:padding="16dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/no_item_to_pick_text"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/empty_view_gray"/>
|
||||
android:text="@string/no_item_to_pick_text"
|
||||
android:textColor="@color/empty_view_gray"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
@ -110,64 +61,110 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:id="@+id/title_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title_text"
|
||||
style="@style/TextViewMaterial.DialogTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/dialog_choose_arts_from_lista_art" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center">
|
||||
|
||||
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/main_search"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:iconifiedByDefault="true"
|
||||
app:defaultQueryHint="@string/search"
|
||||
app:iconifiedByDefault="false"
|
||||
android:layout_gravity="end"
|
||||
android:tint="@android:color/black"/>
|
||||
|
||||
<!-- <com.google.android.material.button.MaterialButton-->
|
||||
<!-- android:id="@+id/button_remove_filter"-->
|
||||
<!-- style="@style/Button.DangerOutline"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_gravity="center_horizontal"-->
|
||||
<!-- android:layout_marginTop="8dp"-->
|
||||
<!-- android:text="@string/remove_filter_button"-->
|
||||
<!-- android:visibility="@{filterStatus.get() ? View.VISIBLE : View.GONE}"-->
|
||||
<!-- app:icon="@drawable/ic_clear_24dp"-->
|
||||
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!-- app:layout_constraintRight_toRightOf="parent"-->
|
||||
<!-- app:strokeColor="@color/red_400" />-->
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:paddingBottom="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/center_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5"/>
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/negative_button"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryOutline"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:text="@string/abort"
|
||||
app:layout_constrainedHeight="true"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/center_guideline"
|
||||
android:text="@string/abort"/>
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/positive_button"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:layout_constrainedHeight="true"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/center_guideline"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:text="@string/confirm"/>
|
||||
app:layout_constraintStart_toStartOf="@id/center_guideline"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
10
build.gradle
10
build.gradle
@ -31,11 +31,11 @@ allprojects {
|
||||
}
|
||||
|
||||
|
||||
gradle.projectsEvaluated {
|
||||
tasks.withType(JavaCompile) {
|
||||
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||
}
|
||||
}
|
||||
// gradle.projectsEvaluated {
|
||||
// tasks.withType(JavaCompile) {
|
||||
// options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user