Nuova gestione linee di produzione
This commit is contained in:
parent
84cbab334f
commit
e0e9e657c9
@ -0,0 +1,12 @@
|
|||||||
|
package it.integry.integrywmsnative.core.di.binders;
|
||||||
|
|
||||||
|
import androidx.appcompat.widget.AppCompatImageView;
|
||||||
|
import androidx.databinding.BindingAdapter;
|
||||||
|
|
||||||
|
public class ImageViewBinders {
|
||||||
|
@BindingAdapter("tint")
|
||||||
|
public static void bindImageViewTint(final AppCompatImageView view, final int color) {
|
||||||
|
view.setColorFilter(color, android.graphics.PorterDuff.Mode.MULTIPLY);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.Callback;
|
||||||
|
import retrofit2.Response;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
public class ProductionLinesRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
public void avviaLineaDiProduzione(String codJfas, Integer hrNum, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> callable = restService.avviaLineaDiProduzione(codJfas, hrNum);
|
||||||
|
callable.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
|
analyzeAnswer(response, "avviaLineaDiProduzione", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void arrestaLineaDiProduzione(String codJfas, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> callable = restService.arrestaLineaDiProduzione(codJfas);
|
||||||
|
callable.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
|
analyzeAnswer(response, "arrestaLineaDiProduzione", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void avviaProduzioneArticoloSuLinea(String codJfas, String codMart, String partitaMag, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class, 300);
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> callable = restService.avviaProduzioneArticoloSuLinea(codJfas, codMart, partitaMag);
|
||||||
|
callable.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<JsonObject>> call, Response<ServiceRESTResponse<JsonObject>> response) {
|
||||||
|
analyzeAnswer(response, "avviaProduzioneArticoloSuLinea", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<JsonObject>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getStatoLinee(String codMdep, RunnableArgs<List<ProdLineStatusDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ProductionLinesRESTConsumerService restService = RESTBuilder.getService(ProductionLinesRESTConsumerService.class);
|
||||||
|
Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> callable = restService.getStatoLinee(codMdep);
|
||||||
|
callable.enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Response<ServiceRESTResponse<List<ProdLineStatusDTO>>> response) {
|
||||||
|
analyzeAnswer(response, "getStatoLinee", onComplete::run, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> call, Throwable t) {
|
||||||
|
onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface ProductionLinesRESTConsumerService {
|
||||||
|
|
||||||
|
@POST("mes_v2/avviaLineaDiProduzione")
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> avviaLineaDiProduzione(@Query("codJfas") String codJfas, @Query("hrNum") Integer hrNum);
|
||||||
|
|
||||||
|
@POST("mes_v2/arrestaLineaDiProduzione")
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> arrestaLineaDiProduzione(@Query("codJfas") String codJfas);
|
||||||
|
|
||||||
|
@POST("mes_v2/avviaProduzioneArticoloSuLinea")
|
||||||
|
Call<ServiceRESTResponse<JsonObject>> avviaProduzioneArticoloSuLinea(@Query("codJfas") String codJfas, @Query("codMart") String codMart, @Query("partitaMag") String partitaMag);
|
||||||
|
|
||||||
|
@GET("mes_v2/statoLineeProd")
|
||||||
|
Call<ServiceRESTResponse<List<ProdLineStatusDTO>>> getStatoLinee(@Query("codMdep") String codMdep);
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_linee_produzione;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface ProdLineeProduzioneComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
ProdLineeProduzioneComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(ProdLineeProduzioneFragment prodLineeProduzioneFragment);
|
||||||
|
}
|
||||||
@ -0,0 +1,187 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_linee_produzione;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.InputType;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.appcompat.widget.AppCompatTextView;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
|
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.expansion.BaseFragment;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.databinding.FragmentLineeProdBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dialogs.BottomSheetLineAction;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dialogs.DialogStartProduction;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.ui.LinesListAdapter;
|
||||||
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputHelper;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
|
public class ProdLineeProduzioneFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, ProdLineeProduzioneViewModel.Listener {
|
||||||
|
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
ProdLineeProduzioneViewModel mViewModel;
|
||||||
|
|
||||||
|
private final ObservableArrayList<ProdLineStatusDTO> mLinesObservableList = new ObservableArrayList<>();
|
||||||
|
private FragmentLineeProdBinding mBinding;
|
||||||
|
private ElevatedToolbar mToolbar;
|
||||||
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
|
this.onLoadingStarted();
|
||||||
|
|
||||||
|
this.mViewModel.processBarcodeDTO(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
public static ProdLineeProduzioneFragment newInstance() {
|
||||||
|
return new ProdLineeProduzioneFragment();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_linee_prod, container, false);
|
||||||
|
MainApplication.appComponent
|
||||||
|
.prodLineeProduzioneComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
|
mViewModel.setListener(this);
|
||||||
|
mBinding.setLifecycleOwner(this);
|
||||||
|
this.initRecyclerView();
|
||||||
|
this.initBarcodeReader();
|
||||||
|
mViewModel.init();
|
||||||
|
|
||||||
|
return mBinding.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initBarcodeReader() {
|
||||||
|
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
|
.setOnScanSuccessful(onScanSuccessful)
|
||||||
|
.setOnScanFailed(this::onError));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||||
|
mToolbar = toolbar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void refreshLineeProd(List<ProdLineStatusDTO> linesList) {
|
||||||
|
this.mLinesObservableList.clear();
|
||||||
|
if (linesList != null) {
|
||||||
|
|
||||||
|
this.mLinesObservableList.addAll(linesList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initRecyclerView() {
|
||||||
|
this.mViewModel.getProdLinesList().observe(getViewLifecycleOwner(), this::refreshLineeProd);
|
||||||
|
LinesListAdapter prodLinesListAdapter = new LinesListAdapter(this.requireActivity(), this.mLinesObservableList);
|
||||||
|
prodLinesListAdapter.setEmptyView(this.mBinding.linesListEmptyView);
|
||||||
|
this.mBinding.linesMainList.setAdapter(prodLinesListAdapter);
|
||||||
|
this.mBinding.linesMainList.setLayoutManager(new LinearLayoutManager(this.requireActivity()));
|
||||||
|
prodLinesListAdapter.setOnItemClicked(this.mViewModel::onLineSelected);
|
||||||
|
if (mToolbar != null)
|
||||||
|
mToolbar.setRecyclerView(this.mBinding.linesMainList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void requestResources(ProdLineStatusDTO prodLine) {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
BarcodeManager.disable();
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
|
||||||
|
DialogSimpleInputHelper.makeInputDialog(requireContext(), "Inserisci il numero di risorse da allocare", qta -> {
|
||||||
|
this.onLoadingStarted();
|
||||||
|
try {
|
||||||
|
Integer hrNum = Integer.parseInt(qta);
|
||||||
|
this.mViewModel.startProductionLine(prodLine, hrNum);
|
||||||
|
} catch (NumberFormatException ex) {
|
||||||
|
this.onError(new Exception("Inserire un numero di risorse valido"));
|
||||||
|
}
|
||||||
|
}, BarcodeManager::enable, InputType.TYPE_CLASS_NUMBER).show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void requestOrderChange(ProdLineStatusDTO prodLine) {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
DialogStartProduction.newInstance((dto) -> {
|
||||||
|
this.mViewModel.checkBarcodeAndStartOrdine(prodLine, dto);
|
||||||
|
}).show(getChildFragmentManager(), "DialogStartProduction");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void requestProductionStop(ProdLineStatusDTO prodLine) {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
BarcodeManager.disable();
|
||||||
|
if (UtilityString.isNullOrEmpty(prodLine.getListaOrd())) {
|
||||||
|
mViewModel.stopProduction(prodLine);
|
||||||
|
} else {
|
||||||
|
this.confirmOrderClose(() -> {
|
||||||
|
mViewModel.stopProduction(prodLine);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void successDialog(String message, Runnable onComplete) {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
requireActivity().runOnUiThread(() -> DialogSimpleMessageView.makeSuccessDialog(getResources().getString(R.string.success),
|
||||||
|
new SpannableString(message), null, onComplete).show(getChildFragmentManager(), "successDialog"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void selectLine(ProdLineStatusDTO dto) {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
BarcodeManager.disable();
|
||||||
|
if (!dto.isStarted()) {
|
||||||
|
this.requestResources(dto);
|
||||||
|
} else {
|
||||||
|
BottomSheetLineAction.newInstance(dto, this::requestResources, this::requestOrderChange, this::requestProductionStop, BarcodeManager::enable).show(getChildFragmentManager(), "BottomSheetLineAction");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void confirmOrderClose(Runnable onConfirm) {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
DialogSimpleMessageView.makeWarningDialog(
|
||||||
|
Html.fromHtml("Per completare l'operazione è necessario chiudere gli ordini attualmente aperti sulla linea."
|
||||||
|
+ "<br /> <br/>" +
|
||||||
|
"Continuare?"),
|
||||||
|
null,
|
||||||
|
onConfirm,
|
||||||
|
BarcodeManager::enable
|
||||||
|
).show(getChildFragmentManager(), "confirmOrderClose");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||||
|
titleText.setText(context.getText(R.string.nav_prod_linee_title).toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_linee_produzione;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
import dagger.Provides;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_rientro_merce.ProdRientroMerceComponent;
|
||||||
|
|
||||||
|
@Module(subcomponents = ProdRientroMerceComponent.class)
|
||||||
|
public class ProdLineeProduzioneModule {
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
ProdLineeProduzioneViewModel providesProdRientroMerceViewModel(ProductionLinesRESTConsumer productionLinesRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer) {
|
||||||
|
return new ProdLineeProduzioneViewModel(productionLinesRESTConsumer, barcodeRESTConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
ProductionLinesRESTConsumer providesProductionLinesRESTConsumer() {
|
||||||
|
return new ProductionLinesRESTConsumer();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,142 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_linee_produzione;
|
||||||
|
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ProductionLinesRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
|
|
||||||
|
public class ProdLineeProduzioneViewModel {
|
||||||
|
|
||||||
|
|
||||||
|
private final ProductionLinesRESTConsumer productionLinesRESTConsumer;
|
||||||
|
private final BarcodeRESTConsumer mBarcodeRESTConsumer;
|
||||||
|
private final MutableLiveData<List<ProdLineStatusDTO>> prodLines = new MutableLiveData<>();
|
||||||
|
|
||||||
|
private Listener mListener;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public ProdLineeProduzioneViewModel(ProductionLinesRESTConsumer productionLinesRESTConsumer, BarcodeRESTConsumer barcodeRESTConsumer) {
|
||||||
|
this.productionLinesRESTConsumer = productionLinesRESTConsumer;
|
||||||
|
this.mBarcodeRESTConsumer = barcodeRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init() {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
reloadLines();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void reloadLines() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
sendOnLoadingStarted();
|
||||||
|
this.productionLinesRESTConsumer.getStatoLinee(SettingsManager.i().getUserSession().getDepo().getCodMdep(), lineeProdList -> {
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
prodLines.postValue(lineeProdList);
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MutableLiveData<List<ProdLineStatusDTO>> getProdLinesList() {
|
||||||
|
return prodLines;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setListener(Listener listener) {
|
||||||
|
this.mListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO) {
|
||||||
|
String codJfas = barcodeScanDTO.getStringValue();
|
||||||
|
|
||||||
|
ProdLineStatusDTO prodLine = prodLines.getValue() != null ? Stream.of(prodLines.getValue()).filter(x -> x.getCodJfas().equalsIgnoreCase(codJfas)).findFirstOrElse(null) : null;
|
||||||
|
if (prodLine != null) {
|
||||||
|
this.onLineSelected(prodLine);
|
||||||
|
} else {
|
||||||
|
this.sendError(new Exception("Linea di produzione " + codJfas + " non trovata"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void sendOnLoadingStarted() {
|
||||||
|
if (this.mListener != null) mListener.onLoadingStarted();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendOnLoadingEnded() {
|
||||||
|
if (this.mListener != null) mListener.onLoadingEnded();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendError(Exception ex) {
|
||||||
|
if (this.mListener != null) mListener.onError(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startProductionLine(ProdLineStatusDTO prodLine, Integer hrNum) {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
this.productionLinesRESTConsumer.avviaLineaDiProduzione(prodLine.getCodJfas(),
|
||||||
|
hrNum,
|
||||||
|
() -> this.mListener.successDialog("Operazione completata", this::reloadLines),
|
||||||
|
this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLineSelected(ProdLineStatusDTO lineSelected) {
|
||||||
|
mListener.selectLine(lineSelected);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void checkBarcodeAndStartOrdine(ProdLineStatusDTO prodLine, BarcodeScanDTO dto) {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
mBarcodeRESTConsumer.decodeEan128(dto, (ean128) -> {
|
||||||
|
String codMart = ean128.Content;
|
||||||
|
String partitaMag = ean128.BatchLot;
|
||||||
|
if (!prodLine.isStarted()) {
|
||||||
|
this.sendError(new Exception("Impossibile avviare una produzione su una linea ferma!"));
|
||||||
|
} else if (UtilityString.isNullOrEmpty(prodLine.getListaOrd())) {
|
||||||
|
this.startProduction(prodLine, codMart, partitaMag);
|
||||||
|
} else {
|
||||||
|
this.mListener.confirmOrderClose(() -> {
|
||||||
|
this.startProduction(prodLine, codMart, partitaMag);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startProduction(ProdLineStatusDTO prodLine, String codMart, String partitaMag) {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
this.productionLinesRESTConsumer.avviaProduzioneArticoloSuLinea(prodLine.getCodJfas(), codMart, partitaMag,
|
||||||
|
() -> this.mListener.successDialog("Operazione completata", this::reloadLines),
|
||||||
|
this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stopProduction(ProdLineStatusDTO prodLine) {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
this.productionLinesRESTConsumer.arrestaLineaDiProduzione(prodLine.getCodJfas(),
|
||||||
|
() -> this.mListener.successDialog("Operazione completata", this::reloadLines),
|
||||||
|
this::sendError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public interface Listener extends ILoadingListener {
|
||||||
|
|
||||||
|
void onError(Exception ex);
|
||||||
|
|
||||||
|
void successDialog(String message, Runnable onComplete);
|
||||||
|
|
||||||
|
void selectLine(ProdLineStatusDTO prodLineStatusDTO);
|
||||||
|
|
||||||
|
void confirmOrderClose(Runnable onConfirm);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,111 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_linee_produzione.dialogs;
|
||||||
|
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
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 com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.databinding.BottomSheetLineActionsBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
|
|
||||||
|
public class BottomSheetLineAction extends BottomSheetDialogFragment {
|
||||||
|
|
||||||
|
private BottomSheetLineActionsBinding mBinding;
|
||||||
|
|
||||||
|
private ProdLineStatusDTO prodLine;
|
||||||
|
private RunnableArgs<ProdLineStatusDTO> onChangeResourcesRequest;
|
||||||
|
private RunnableArgs<ProdLineStatusDTO> onChangeOrdersRequest;
|
||||||
|
private RunnableArgs<ProdLineStatusDTO> onLineCloseRequest;
|
||||||
|
private Runnable onCancelAction;
|
||||||
|
|
||||||
|
public static BottomSheetLineAction newInstance(ProdLineStatusDTO dto, RunnableArgs<ProdLineStatusDTO> onChangeResourcesRequest, RunnableArgs<ProdLineStatusDTO> onChangeOrdersRequest, RunnableArgs<ProdLineStatusDTO> onLineCloseRequest, Runnable onCancel) {
|
||||||
|
BottomSheetLineAction fragment = new BottomSheetLineAction();
|
||||||
|
fragment
|
||||||
|
.setProdLine(dto)
|
||||||
|
.setOnChangeResourcesRequest(onChangeResourcesRequest)
|
||||||
|
.setOnChangeOrdersRequest(onChangeOrdersRequest)
|
||||||
|
.setOnLineCloseRequest(onLineCloseRequest)
|
||||||
|
.setOnCancelAction(onCancel);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBinding = BottomSheetLineActionsBinding.inflate(inflater, container, false);
|
||||||
|
mBinding.setLifecycleOwner(this);
|
||||||
|
mBinding.setView(this);
|
||||||
|
mBinding.setListModel(this.prodLine);
|
||||||
|
|
||||||
|
return mBinding.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BottomSheetLineAction setOnCancelAction(Runnable onCancelAction) {
|
||||||
|
this.onCancelAction = onCancelAction;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BottomSheetLineAction setOnChangeResourcesRequest(RunnableArgs<ProdLineStatusDTO> onChangeResourcesRequest) {
|
||||||
|
this.onChangeResourcesRequest = onChangeResourcesRequest;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public BottomSheetLineAction setOnChangeOrdersRequest(RunnableArgs<ProdLineStatusDTO> onChangeOrdersRequest) {
|
||||||
|
this.onChangeOrdersRequest = onChangeOrdersRequest;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public BottomSheetLineAction setOnLineCloseRequest(RunnableArgs<ProdLineStatusDTO> onLineCloseRequest) {
|
||||||
|
this.onLineCloseRequest = onLineCloseRequest;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO getProdLine() {
|
||||||
|
return prodLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BottomSheetLineAction setProdLine(ProdLineStatusDTO prodLine) {
|
||||||
|
this.prodLine = prodLine;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onResourcesClicked() {
|
||||||
|
if (this.onChangeResourcesRequest != null) {
|
||||||
|
this.onChangeResourcesRequest.run(prodLine);
|
||||||
|
}
|
||||||
|
this.dismiss();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onPlayClicked() {
|
||||||
|
if (this.onChangeOrdersRequest != null) {
|
||||||
|
this.onChangeOrdersRequest.run(prodLine);
|
||||||
|
}
|
||||||
|
this.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onStopClicked() {
|
||||||
|
if (this.onLineCloseRequest != null) {
|
||||||
|
this.onLineCloseRequest.run(prodLine);
|
||||||
|
}
|
||||||
|
this.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCancel(@NonNull DialogInterface dialog) {
|
||||||
|
if (this.onCancelAction != null) {
|
||||||
|
onCancelAction.run();
|
||||||
|
}
|
||||||
|
super.onCancel(dialog);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_linee_produzione.dialogs;
|
||||||
|
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
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 it.integry.barcode_base_android_library.model.BarcodeScanDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||||
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||||
|
import it.integry.integrywmsnative.databinding.DialogStartProductionBinding;
|
||||||
|
|
||||||
|
public class DialogStartProduction extends BaseDialogFragment {
|
||||||
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
private RunnableArgs<BarcodeScanDTO> onScanSuccessful;
|
||||||
|
private DialogStartProductionBinding mBinding;
|
||||||
|
|
||||||
|
public static DialogStartProduction newInstance(RunnableArgs<BarcodeScanDTO> onScanSuccessful) {
|
||||||
|
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
|
||||||
|
DialogStartProduction fragment = new DialogStartProduction();
|
||||||
|
fragment.setArguments(args);
|
||||||
|
fragment.setOnScanSuccessful(onScanSuccessful);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(@NonNull DialogInterface dialog) {
|
||||||
|
BarcodeManager.removeCallback(barcodeScannerIstanceID);
|
||||||
|
super.onDismiss(dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DialogStartProduction setOnScanSuccessful(RunnableArgs<BarcodeScanDTO> onScanSuccessful) {
|
||||||
|
this.onScanSuccessful = onScanSuccessful;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBinding = DialogStartProductionBinding.inflate(inflater, container, false);
|
||||||
|
mBinding.setLifecycleOwner(this);
|
||||||
|
this.initBarcodeReader();
|
||||||
|
setCancelable(true);
|
||||||
|
getDialog().setCanceledOnTouchOutside(true);
|
||||||
|
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
return mBinding.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initBarcodeReader() {
|
||||||
|
barcodeScannerIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||||
|
.setOnScanSuccessful(this::processBarcode)
|
||||||
|
.setOnScanFailed(this::onError));
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processBarcode(BarcodeScanDTO barcodeScanDTO) {
|
||||||
|
if (UtilityBarcode.isEan128(barcodeScanDTO)) {
|
||||||
|
this.onScanSuccessful.run(barcodeScanDTO);
|
||||||
|
this.dismiss();
|
||||||
|
} else {
|
||||||
|
this.onError(new Exception("Il barcode scansionato non è valido!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,129 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_linee_produzione.dto;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class ProdLineStatusDTO {
|
||||||
|
|
||||||
|
private String codJfas;
|
||||||
|
|
||||||
|
private String descrizione;
|
||||||
|
|
||||||
|
private String codMdepLav;
|
||||||
|
|
||||||
|
private Date datetimeStart;
|
||||||
|
|
||||||
|
private Date datetimeEnd;
|
||||||
|
|
||||||
|
private BigDecimal maxAllocazione;
|
||||||
|
|
||||||
|
private Integer qtaAllocate;
|
||||||
|
|
||||||
|
private String listaOrd;
|
||||||
|
|
||||||
|
|
||||||
|
public String getCodJfas() {
|
||||||
|
return codJfas;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setCodJfas(String codJfas) {
|
||||||
|
this.codJfas = codJfas;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMdepLav() {
|
||||||
|
return codMdepLav;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setCodMdepLav(String codMdepLav) {
|
||||||
|
this.codMdepLav = codMdepLav;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDatetimeStart() {
|
||||||
|
return datetimeStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setDatetimeStart(Date datetimeStart) {
|
||||||
|
this.datetimeStart = datetimeStart;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getDatetimeEnd() {
|
||||||
|
return datetimeEnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setDatetimeEnd(Date datetimeEnd) {
|
||||||
|
this.datetimeEnd = datetimeEnd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getMaxAllocazione() {
|
||||||
|
return maxAllocazione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setMaxAllocazione(BigDecimal maxAllocazione) {
|
||||||
|
this.maxAllocazione = maxAllocazione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getQtaAllocate() {
|
||||||
|
return qtaAllocate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setQtaAllocate(Integer qtaAllocate) {
|
||||||
|
this.qtaAllocate = qtaAllocate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getListaOrd() {
|
||||||
|
return listaOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProdLineStatusDTO setListaOrd(String listaOrd) {
|
||||||
|
this.listaOrd = listaOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isStarted() {
|
||||||
|
return datetimeStart != null && datetimeEnd == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isPaused() {
|
||||||
|
if (datetimeEnd == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Calendar today = Calendar.getInstance();
|
||||||
|
today.set(Calendar.MILLISECOND, 0);
|
||||||
|
today.set(Calendar.SECOND, 0);
|
||||||
|
today.set(Calendar.MINUTE, 0);
|
||||||
|
today.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
Calendar lastCloseTime = Calendar.getInstance();
|
||||||
|
lastCloseTime.setTime(datetimeEnd);
|
||||||
|
lastCloseTime.set(Calendar.MILLISECOND, 0);
|
||||||
|
lastCloseTime.set(Calendar.SECOND, 0);
|
||||||
|
lastCloseTime.set(Calendar.MINUTE, 0);
|
||||||
|
lastCloseTime.set(Calendar.HOUR_OF_DAY, 0);
|
||||||
|
return datetimeStart != null && datetimeEnd != null && today.equals(lastCloseTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel() {
|
||||||
|
return codJfas + " - " + descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRisorseLabel() {
|
||||||
|
return qtaAllocate + (maxAllocazione != null && maxAllocazione.compareTo(BigDecimal.ZERO) > 0 ? "/" + maxAllocazione : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.prod_linee_produzione.ui;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.view.ExtendedRecyclerView;
|
||||||
|
import it.integry.integrywmsnative.databinding.FragmentLineeProdMainListModelBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO;
|
||||||
|
|
||||||
|
public class LinesListAdapter extends ExtendedRecyclerView<ProdLineStatusDTO, LinesListAdapter.SingleItemViewHolder> {
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
private RunnableArgs<ProdLineStatusDTO> mOnItemClicked;
|
||||||
|
|
||||||
|
public LinesListAdapter(Context context, ObservableArrayList<ProdLineStatusDTO> myDataset) {
|
||||||
|
super(myDataset);
|
||||||
|
this.mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public LinesListAdapter.SingleItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
FragmentLineeProdMainListModelBinding binding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.fragment_linee_prod_main_list_model, parent, false);
|
||||||
|
return new LinesListAdapter.SingleItemViewHolder(binding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull LinesListAdapter.SingleItemViewHolder holder, int position) {
|
||||||
|
final ProdLineStatusDTO line = mDataset.get(position);
|
||||||
|
|
||||||
|
holder.binding.setListModel(line);
|
||||||
|
holder.binding.executePendingBindings();
|
||||||
|
holder.binding.getRoot().setOnClickListener(v -> {
|
||||||
|
if (this.mOnItemClicked != null)
|
||||||
|
this.mOnItemClicked.run(line);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setOnItemClicked(RunnableArgs<ProdLineStatusDTO> onItemClicked) {
|
||||||
|
this.mOnItemClicked = onItemClicked;
|
||||||
|
}
|
||||||
|
|
||||||
|
static class SingleItemViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
FragmentLineeProdMainListModelBinding binding;
|
||||||
|
|
||||||
|
SingleItemViewHolder(FragmentLineeProdMainListModelBinding binding) {
|
||||||
|
super(binding.getRoot());
|
||||||
|
this.binding = binding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
5
app/src/main/res/drawable/ic_baseline_pause_24.xml
Normal file
5
app/src/main/res/drawable/ic_baseline_pause_24.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#000000"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M6,19h4L10,5L6,5v14zM14,5v14h4L18,5h-4z"/>
|
||||||
|
</vector>
|
||||||
5
app/src/main/res/drawable/ic_baseline_person_add_24.xml
Normal file
5
app/src/main/res/drawable/ic_baseline_person_add_24.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#000000"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M15,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM6,10L6,7L4,7v3L1,10v2h3v3h2v-3h3v-2L6,10zM15,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
|
||||||
|
</vector>
|
||||||
5
app/src/main/res/drawable/ic_baseline_play_arrow_24.xml
Normal file
5
app/src/main/res/drawable/ic_baseline_play_arrow_24.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#000000"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M8,5v14l11,-7z"/>
|
||||||
|
</vector>
|
||||||
5
app/src/main/res/drawable/ic_baseline_stop_24.xml
Normal file
5
app/src/main/res/drawable/ic_baseline_stop_24.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#000000"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M6,6h12v12H6z"/>
|
||||||
|
</vector>
|
||||||
BIN
app/src/main/res/drawable/ic_production_line.png
Normal file
BIN
app/src/main/res/drawable/ic_production_line.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 827 B |
6
app/src/main/res/drawable/ic_stop_circle_24.xml
Normal file
6
app/src/main/res/drawable/ic_stop_circle_24.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#000000"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white"
|
||||||
|
android:fillType="evenOdd" android:pathData="M8,16h8V8H8V16zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10s10,-4.48 10,-10S17.52,2 12,2L12,2z"/>
|
||||||
|
</vector>
|
||||||
211
app/src/main/res/layout/bottom_sheet_line_actions.xml
Normal file
211
app/src/main/res/layout/bottom_sheet_line_actions.xml
Normal file
@ -0,0 +1,211 @@
|
|||||||
|
<?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:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<import type="it.integry.integrywmsnative.R" />
|
||||||
|
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||||
|
|
||||||
|
<import type="android.view.View" />
|
||||||
|
|
||||||
|
<import type="androidx.core.content.ContextCompat" />
|
||||||
|
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||||
|
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityDate" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
type="it.integry.integrywmsnative.gest.prod_linee_produzione.dialogs.BottomSheetLineAction"
|
||||||
|
name="view" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
type="it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO"
|
||||||
|
name="listModel" />
|
||||||
|
|
||||||
|
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="8dp">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/descriptionLayout"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/mtb_grp_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Large"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{listModel.getLabel()}"
|
||||||
|
android:textColor="@{ContextCompat.getColor(context,listModel.isStarted() ? R.color.green_600 : listModel.isPaused() ? R.color.orange_600 : R.color.red_600)}"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="L2 - Linea 2"
|
||||||
|
tools:textColor="@color/green_600" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:background="@drawable/badge_round_corner"
|
||||||
|
android:backgroundTint="@{ContextCompat.getColor(context, listModel.isStarted() ? R.color.green_600 : listModel.isPaused() ? R.color.orange_600 : R.color.red_600)}"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="2"
|
||||||
|
tools:backgroundTint="@color/green_600">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="19dp"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:src="@{ContextCompat.getDrawable(context, listModel.isStarted() ? R.drawable.ic_baseline_play_arrow_24 : listModel.isPaused() ? R.drawable.ic_baseline_pause_24 : R.drawable.ic_baseline_stop_24)}"
|
||||||
|
app:tint="@color/white"
|
||||||
|
tools:src="@drawable/ic_baseline_play_arrow_24" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/peso_lordo_collo"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{listModel.isStarted() ? R.string.in_progress : listModel.isPaused() ? R.string.stand_by : R.string.stopped}"
|
||||||
|
android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="In lavorazione" />
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/lista_ords_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="@{listModel.isStarted() && !UtilityString.isNullOrEmpty(listModel.listaOrd) ? View.VISIBLE : View.GONE}">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:text="@string/orders_in_progress"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/lista_ords"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{listModel.listaOrd}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="125|255" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:onClick="@{()->view.onResourcesClicked()}"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_baseline_person_add_24" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/TextAppearance.Material3.BodyLarge"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:text="@string/ridistribuisci_risorse" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:onClick="@{()->view.onPlayClicked()}"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_baseline_play_arrow_24" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/TextAppearance.Material3.BodyLarge"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:text="@string/avvia_nuova_produzione" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:onClick="@{()->view.onStopClicked()}"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_baseline_stop_24" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/TextAppearance.Material3.BodyLarge"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:text="@string/arresta_produzione" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</layout>
|
||||||
81
app/src/main/res/layout/dialog_start_production.xml
Normal file
81
app/src/main/res/layout/dialog_start_production.xml
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:cardBackgroundColor="@android:color/transparent"
|
||||||
|
app:cardCornerRadius="24dp"
|
||||||
|
app:cardElevation="0dp">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/base"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:cardBackgroundColor="@color/light_blue_300"
|
||||||
|
app:cardCornerRadius="24dp"
|
||||||
|
app:cardElevation="0dp">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:background="@drawable/dialog_card_child_bg"
|
||||||
|
android:padding="24dp">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/title_text"
|
||||||
|
style="@style/TextViewMaterial.Dialog.HeadlineText"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:text="@string/avvia_nuova_produzione" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/title_text"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
style="?android:attr/progressBarStyle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginEnd="12dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text="@string/scan_item"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
</layout>
|
||||||
86
app/src/main/res/layout/fragment_linee_prod.xml
Normal file
86
app/src/main/res/layout/fragment_linee_prod.xml
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:background="@color/full_white">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/lines_main_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scrollbars="vertical"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/lines_list_empty_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:alpha="0.3">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/guideline_empty_top"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
app:layout_constraintGuide_percent="0.1" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/guideline_empty_left"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintGuide_percent="0.15" />
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.Guideline
|
||||||
|
android:id="@+id/guideline_empty_right"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintGuide_percent="0.85" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:layout_width="72dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:src="@drawable/ic_playlist_add_check_24dp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text="@string/nessuna_linea_disponibile"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
||||||
228
app/src/main/res/layout/fragment_linee_prod_main_list_model.xml
Normal file
228
app/src/main/res/layout/fragment_linee_prod_main_list_model.xml
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
<?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:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<import type="it.integry.integrywmsnative.R" />
|
||||||
|
|
||||||
|
<import type="android.view.View" />
|
||||||
|
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||||
|
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityDate" />
|
||||||
|
|
||||||
|
<import type="android.text.Html" />
|
||||||
|
|
||||||
|
<import type="androidx.core.content.ContextCompat" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="listModel"
|
||||||
|
type="it.integry.integrywmsnative.gest.prod_linee_produzione.dto.ProdLineStatusDTO" />
|
||||||
|
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="0dp">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:weightSum="2">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/mtb_grp_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Large"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{listModel.getLabel()}"
|
||||||
|
android:textColor="@{ContextCompat.getColor(context,listModel.isStarted() ? R.color.green_600 : listModel.isPaused() ? R.color.orange_600 : R.color.red_600)}"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="L2 - Linea 2"
|
||||||
|
tools:textColor="@color/green_600" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:background="@drawable/badge_round_corner"
|
||||||
|
android:backgroundTint="@{ContextCompat.getColor(context, listModel.isStarted() ? R.color.green_600 : listModel.isPaused() ? R.color.orange_600 : R.color.red_600)}"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="2"
|
||||||
|
tools:backgroundTint="@color/green_600">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="19dp"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:src="@{ContextCompat.getDrawable(context, listModel.isStarted() ? R.drawable.ic_baseline_play_arrow_24 : listModel.isPaused() ? R.drawable.ic_baseline_pause_24 : R.drawable.ic_baseline_stop_24)}"
|
||||||
|
app:tint="@color/white"
|
||||||
|
tools:src="@drawable/ic_baseline_play_arrow_24" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/peso_lordo_collo"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{listModel.isStarted() ? R.string.in_progress : listModel.isPaused() ? R.string.stand_by : R.string.stopped}"
|
||||||
|
android:textAppearance="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="In lavorazione" />
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/resources_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="@{listModel.isStarted() ? View.VISIBLE : View.GONE}">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:text="@string/risorse_impostate"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/resources"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{listModel.getRisorseLabel()}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="5/25" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/lista_ords_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="@{listModel.isStarted() && !UtilityString.isNullOrEmpty(listModel.listaOrd) ? View.VISIBLE : View.GONE}">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:text="@string/orders_in_progress"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/lista_ords"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{listModel.listaOrd}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="125|255" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/production_start_cotnainer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="@{listModel.isStarted() ? View.VISIBLE : View.GONE}">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:text="@string/inizio_produzione"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/production_start"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{UtilityDate.formatDate(listModel.datetimeStart, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH)}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="05/07/2022 14:00:00" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:id="@+id/production_stop_cotnainer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="@{listModel.isStarted() ? View.GONE : View.VISIBLE}">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="8dp"
|
||||||
|
android:text="@string/ultima_produzione"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/production_stop"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{UtilityDate.formatDate(listModel.datetimeEnd, UtilityDate.COMMONS_DATE_FORMATS.DMY_TIME_SLASH)}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="05/07/2022 23:59:59" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
Loading…
x
Reference in New Issue
Block a user