diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f5a45a2e..3a265d22 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -24,8 +24,8 @@ android:allowBackup="true" android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" - android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" + android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true" diff --git a/app/src/main/ic_launcher-playstore.png b/app/src/main/ic_launcher-playstore.png new file mode 100644 index 00000000..4d5d53a1 Binary files /dev/null and b/app/src/main/ic_launcher-playstore.png differ diff --git a/app/src/main/java/it/integry/integrywmsnative/core/expansion/BaseActivity.java b/app/src/main/java/it/integry/integrywmsnative/core/expansion/BaseActivity.java index 5cf92c86..7dd9641e 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/expansion/BaseActivity.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/expansion/BaseActivity.java @@ -53,16 +53,16 @@ public class BaseActivity extends AppCompatActivity { private void openProgress() { BarcodeManager.disable(); - //executorService.execute(() -> { +// executorService.execute(() -> { this.mCurrentProgress.show(getSupportFragmentManager()); - //}); +// }); } private void closeProgress() { BarcodeManager.enable(); - //executorService.execute(() -> { +// executorService.execute(() -> { mCurrentProgress.dismiss(); - //}); +// }); } @Override diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumer.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumer.java index ab10d9d8..3dcd2596 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumer.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumer.java @@ -11,6 +11,7 @@ import org.jetbrains.annotations.NotNull; import java.lang.reflect.Type; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -31,6 +32,8 @@ import it.integry.integrywmsnative.core.rest.RESTBuilder; import it.integry.integrywmsnative.core.rest.model.RettificaULDTO; import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse; import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO; +import it.integry.integrywmsnative.core.rest.model.SpostaULRequestDTO; +import it.integry.integrywmsnative.core.rest.model.UpdateTipoULRequestDTO; import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO; import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO; import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO; @@ -404,11 +407,7 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer { }); } - public void changePosizione(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs onFailed) { - - String codMdep = posizione.getCodMdep(); - String posizioneString = posizione.getPosizione(); - + public void spostaUL(MtbColt mtbColtToMove, String codMdep, String posizione, boolean createDocAutomatically, Runnable onComplete, RunnableArgs onFailed) { MtbColt mtbColtToMoveClone = (MtbColt) mtbColtToMove.clone(); for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) { @@ -417,26 +416,66 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer { .setMtbPartitaMag(null); } + SpostaULRequestDTO spostaUlRequestDTO = new SpostaULRequestDTO() + .setCodMdep(codMdep) + .setPosizione(posizione) + .setMtbColtsToMove(Collections.singletonList(mtbColtToMoveClone)) + .setCreateDocAutomatically(createDocAutomatically); + ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class); colliMagazzinoRESTConsumerService - .spostaULInPosizione(codMdep, - posizioneString, - mtbColtToMoveClone) - .enqueue(new Callback>() { + .spostaUL(spostaUlRequestDTO) + .enqueue(new Callback<>() { @Override - public void onResponse(Call> call, Response> response) { - analyzeAnswer(response, "changePosizione", mtbColts -> { + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "spostaUL", mtbColts -> { onComplete.run(); }, onFailed); } @Override - public void onFailure(Call> call, Throwable t) { + public void onFailure(Call> call, Throwable t) { if (onFailed != null) onFailed.run(new Exception(t)); } }); } + public void spostaUL(MtbColt mtbColtToMove, MtbDepoPosizione posizione, Runnable onComplete, RunnableArgs onFailed) { + + String codMdep = posizione.getCodMdep(); + String posizioneString = posizione.getPosizione(); + + spostaUL(mtbColtToMove, codMdep, posizioneString, true, onComplete, onFailed); + } + + public void updateTipoUL(MtbColt mtbColt, String codTcol, Runnable onComplete, RunnableArgs onFailed) { + + MtbColt mtbColtClone = (MtbColt) mtbColt.clone(); + mtbColtClone.setMtbColr(new ObservableArrayList<>()); + + UpdateTipoULRequestDTO updateTipoULRequest = new UpdateTipoULRequestDTO() + .setMtbColt(mtbColtClone) + .setCodTcol(codTcol); + + ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class); + colliMagazzinoRESTConsumerService + .updateTipoUL(updateTipoULRequest) + .enqueue(new Callback<>() { + @Override + public void onResponse(Call> call, Response> response) { + analyzeAnswer(response, "updateTipoUL", mtbColts -> { + onComplete.run(); + }, onFailed); + } + + @Override + public void onFailure(Call> call, Throwable t) { + if (onFailed != null) onFailed.run(new Exception(t)); + } + }); + + } + public void updateDataFine(MtbColt mtbColt, Runnable onComplete, RunnableArgs onFailed) { MtbColt cloneMtbColt = (MtbColt) mtbColt.clone(); @@ -517,14 +556,14 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer { ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class); colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new Callback<>() { @Override - public void onResponse(Call> call, Response> response) { + public void onResponse(Call> call, Response> response) { analyzeAnswer(response, "spostaArtsTraUL", data -> { onComplete.run(); }, onFailed); } @Override - public void onFailure(Call> call, Throwable t) { + public void onFailure(Call> call, Throwable t) { if (onFailed != null) onFailed.run(new Exception(t)); } }); diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumerService.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumerService.java index 1e13a7d0..5da77d5e 100644 --- a/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumerService.java +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/consumers/ColliMagazzinoRESTConsumerService.java @@ -7,6 +7,8 @@ import it.integry.integrywmsnative.core.model.MtbColt; import it.integry.integrywmsnative.core.rest.model.RettificaULDTO; import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse; import it.integry.integrywmsnative.core.rest.model.SpostaArtsTraULRequestDTO; +import it.integry.integrywmsnative.core.rest.model.SpostaULRequestDTO; +import it.integry.integrywmsnative.core.rest.model.UpdateTipoULRequestDTO; import it.integry.integrywmsnative.core.rest.model.VersamentoAutomaticoULResponseDTO; import it.integry.integrywmsnative.core.rest.model.uds.CanULBeDeletedRequestDTO; import it.integry.integrywmsnative.core.rest.model.uds.DeleteULRequestDTO; @@ -31,11 +33,14 @@ public interface ColliMagazzinoRESTConsumerService { @POST("creaRettificaCollo") Call> creaRettificaCollo(@Query("codMdep") String codMdep, @Body RettificaULDTO rettificaULDTO); - @POST("wms/spostaULInPosizione") - Call> spostaULInPosizione(@Query("codMdep") String codMdep, @Query("posizione") String posizione, @Body MtbColt mtbColtToMove); + @POST("wms/updateTipoUL") + Call> updateTipoUL(@Body UpdateTipoULRequestDTO requestDto); + + @POST("wms/spostaUL") + Call> spostaUL(@Body SpostaULRequestDTO requestDto); @POST("wms/spostaArtsTraUL") - Call> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO); + Call> spostaArtsTraUL(@Body SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO); @POST("wms/assegnaLottoSuColloScarico") Call> assegnaLottoSuColloScarico(@Body MtbColt mtbColt); diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/SpostaULRequestDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/SpostaULRequestDTO.java new file mode 100644 index 00000000..e25ef0db --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/SpostaULRequestDTO.java @@ -0,0 +1,61 @@ +package it.integry.integrywmsnative.core.rest.model; + +import java.util.ArrayList; +import java.util.List; + +import it.integry.integrywmsnative.core.model.MtbColt; + +public class SpostaULRequestDTO { + + private String codMdep; + private String posizione; + private String annotazioni; + private boolean createDocAutomatically = true; + private List mtbColtsToMove = new ArrayList<>(); + + + public String getCodMdep() { + return codMdep; + } + + public SpostaULRequestDTO setCodMdep(String codMdep) { + this.codMdep = codMdep; + return this; + } + + public String getPosizione() { + return posizione; + } + + public SpostaULRequestDTO setPosizione(String posizione) { + this.posizione = posizione; + return this; + } + + public String getAnnotazioni() { + return annotazioni; + } + + public SpostaULRequestDTO setAnnotazioni(String annotazioni) { + this.annotazioni = annotazioni; + return this; + } + + public boolean isCreateDocAutomatically() { + return createDocAutomatically; + } + + public SpostaULRequestDTO setCreateDocAutomatically(boolean createDocAutomatically) { + this.createDocAutomatically = createDocAutomatically; + return this; + } + + public List getMtbColtsToMove() { + return mtbColtsToMove; + } + + public SpostaULRequestDTO setMtbColtsToMove(List mtbColtsToMove) { + this.mtbColtsToMove = mtbColtsToMove; + return this; + } +} diff --git a/app/src/main/java/it/integry/integrywmsnative/core/rest/model/UpdateTipoULRequestDTO.java b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/UpdateTipoULRequestDTO.java new file mode 100644 index 00000000..066476af --- /dev/null +++ b/app/src/main/java/it/integry/integrywmsnative/core/rest/model/UpdateTipoULRequestDTO.java @@ -0,0 +1,27 @@ +package it.integry.integrywmsnative.core.rest.model; + +import it.integry.integrywmsnative.core.model.MtbColt; + +public class UpdateTipoULRequestDTO { + + private MtbColt mtbColt; + private String codTcol; + + public MtbColt getMtbColt() { + return mtbColt; + } + + public UpdateTipoULRequestDTO setMtbColt(MtbColt mtbColt) { + this.mtbColt = mtbColt; + return this; + } + + public String getCodTcol() { + return codTcol; + } + + public UpdateTipoULRequestDTO setCodTcol(String codTcol) { + this.codTcol = codTcol; + return this; + } +} diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/prod_riposizionamento_da_prod/ProdRiposizionamentoDaProdViewModel.java b/app/src/main/java/it/integry/integrywmsnative/gest/prod_riposizionamento_da_prod/ProdRiposizionamentoDaProdViewModel.java index f08c9147..e30ca795 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/prod_riposizionamento_da_prod/ProdRiposizionamentoDaProdViewModel.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/prod_riposizionamento_da_prod/ProdRiposizionamentoDaProdViewModel.java @@ -143,7 +143,7 @@ public class ProdRiposizionamentoDaProdViewModel { this.sendError(new ScannedPositionNotExistException()); } else { if (mtbColt != null) { - mColliMagazzinoRESTConsumer.changePosizione(mtbColt, mtbDepoPosizione, () -> { + mColliMagazzinoRESTConsumer.spostaUL(mtbColt, mtbDepoPosizione, () -> { List mvwSitArtUdcDetInventarioList = mMvwSitArtUdcDetInventarioLiveData.getValue(); if (mvwSitArtUdcDetInventarioList != null) { diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java b/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java index 8a4b558b..db57f139 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/spedizione/SpedizioneViewModel.java @@ -855,7 +855,7 @@ public class SpedizioneViewModel { private void loadMatchedRows(List matchedRows) { - if (matchedRows == null || matchedRows.size() == 0) { + if (matchedRows == null || matchedRows.isEmpty()) { this.sendError(new NoArtsFoundException()); } else if (matchedRows.size() == 1) { PickingObjectDTO matchedItem = matchedRows.get(0); @@ -898,9 +898,6 @@ public class SpedizioneViewModel { public void dispatchOrdineRow(final PickingObjectDTO pickingObjectDTO, MtbColt refMtbColt, MtbColr refMtbColr, boolean canPartitaMagBeChanged) { - //TODO: Al posto di prelevare la prima riga bisognerebbe controllare se c'è ne una che corrisponde con la partita richiesta -// MtbColr refMtbColr = refMtbColt != null ? refMtbColt.getMtbColr().get(0) : null; - if (pickingObjectDTO.getTempPickData() != null && pickingObjectDTO.getTempPickData().getSourceMtbColt() != null && pickingObjectDTO.getTempPickData().getSourceMtbColt().getMtbColr() != null) { @@ -1100,8 +1097,12 @@ public class SpedizioneViewModel { BigDecimal initialQtaTot = mUseColliPedana ? initialNumCnf.multiply(initialQtaCnf) : mUseQtaOrd ? qtaColDaPrelevare : null; MtbColt finalRefMtbColt = refMtbColt; + this.onItemDispatched(pickingObjectDTO, pickingObjectDTO.getMtbAart(), initialNumCnf, initialQtaCnf, initialQtaTot, qtaDaEvadere, numCnfDaEvadere, qtaCnfDaEvadere, qtaColDaPrelevare, numCnfDaPrelevare, qtaCnfDaPrelevare, totalQtaAvailable, totalNumCnfAvailable, qtaCnfAvailable, partitaMag, dataScad, mCanOverflowOrderQuantity, canPartitaMagBeChanged, (pickedQuantityDTO, shouldCloseLU) -> { + this.saveNewRow(pickingObjectDTO, finalRefMtbColt, pickedQuantityDTO.getNumCnf(), pickedQuantityDTO.getQtaCnf(), pickedQuantityDTO.getQtaTot(), pickedQuantityDTO.getPartitaMag(), pickedQuantityDTO.getDataScad(), shouldCloseLU); + + }); } @@ -1430,50 +1431,80 @@ public class SpedizioneViewModel { insertUDSRowRequestDto .setDataScad(dataScad); - this.mColliScaricoRESTConsumer.insertUDSRow(insertUDSRowRequestDto, createdMtbColr -> { - pickingObjectDTO.getWithdrawMtbColrs().add(createdMtbColr); - this.mCurrentMtbColt.getMtbColr().add(createdMtbColr); + executeDepositChangeIfNeeded(refMtbColt, + () -> executeTipoUlChangeIfNeeded(refMtbColt, + () -> this.mColliScaricoRESTConsumer.insertUDSRow(insertUDSRowRequestDto, createdMtbColr -> { + pickingObjectDTO.getWithdrawMtbColrs().add(createdMtbColr); + this.mCurrentMtbColt.getMtbColr().add(createdMtbColr); - createdMtbColr - .setUntMis(pickingObjectDTO.getMtbAart().getUntMis()) - .setMtbAart(pickingObjectDTO.getMtbAart()); + createdMtbColr + .setUntMis(pickingObjectDTO.getMtbAart().getUntMis()) + .setMtbAart(pickingObjectDTO.getMtbAart()); - if (mEnableGiacenza) { - MtbColr refMtbColr = new MtbColr() - .setCodMart(createdMtbColr.getCodMart()) - .setPartitaMag(createdMtbColr.getPartitaMag()) - .setCodTagl(createdMtbColr.getCodTagl()) - .setCodCol(createdMtbColr.getCodCol()); + if (mEnableGiacenza) { + MtbColr refMtbColr = new MtbColr() + .setCodMart(createdMtbColr.getCodMart()) + .setPartitaMag(createdMtbColr.getPartitaMag()) + .setCodTagl(createdMtbColr.getCodTagl()) + .setCodCol(createdMtbColr.getCodCol()); - if (refMtbColt != null) { + if (refMtbColt != null) { - MtbColr originalRefMtbColr = refMtbColt.getMtbColr() != null && refMtbColt.getMtbColr().size() > 0 ? refMtbColt.getMtbColr().get(0) : null; + MtbColr originalRefMtbColr = refMtbColt.getMtbColr() != null && !refMtbColt.getMtbColr().isEmpty() ? refMtbColt.getMtbColr().get(0) : null; - if (originalRefMtbColr != null) { - refMtbColr.setId(originalRefMtbColr.getId()); - } + if (originalRefMtbColr != null) { + refMtbColr.setId(originalRefMtbColr.getId()); + } - refMtbColr.setNumCollo(refMtbColt.getNumCollo()) - .setDataCollo(refMtbColt.getDataColloS()) - .setSerCollo(refMtbColt.getSerCollo()) - .setGestione(refMtbColt.getGestione()); - } - createdMtbColr.setRefMtbColr(refMtbColr); - } + refMtbColr.setNumCollo(refMtbColt.getNumCollo()) + .setDataCollo(refMtbColt.getDataColloS()) + .setSerCollo(refMtbColt.getSerCollo()) + .setGestione(refMtbColt.getGestione()); + } + createdMtbColr.setRefMtbColr(refMtbColr); + } - //Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei - resetMatchedRows(); + //Chiamato removeListFilter perché cosi mi cancella tutti i dati di pick temporanei + resetMatchedRows(); - this.sendOnRowSaved(); - this.sendOnLoadingEnded(); + this.sendOnRowSaved(); + this.sendOnLoadingEnded(); - if (shouldCloseLU) requestCloseLU(shouldPrint); + if (shouldCloseLU) requestCloseLU(shouldPrint); - }, this::sendError); + }, this::sendError))); } + private void executeDepositChangeIfNeeded(MtbColt refMtbColt, Runnable onComplete) { + //Considero solo la prima UDC scansionata + boolean shouldChangeCodMdep = refMtbColt != null && !refMtbColt.getCodMdep().equalsIgnoreCase(mCurrentMtbColt.getCodMdep()) && + mCurrentMtbColt.getMtbColr().isEmpty(); + String newCodMdep = shouldChangeCodMdep ? refMtbColt.getCodMdep() : null; + + if (shouldChangeCodMdep) { + mColliMagazzinoRESTConsumer.spostaUL(mCurrentMtbColt, newCodMdep, null, false, () -> { + mCurrentMtbColt.setCodMdep(newCodMdep); + onComplete.run(); + }, this::sendError); + } else onComplete.run(); + } + + private void executeTipoUlChangeIfNeeded(MtbColt refMtbColt, Runnable onComplete) { + boolean shouldChangeCodTcol = refMtbColt != null && refMtbColt.getCodTcol() != null && + !refMtbColt.getCodTcol().equalsIgnoreCase(mCurrentMtbColt.getCodTcol()) && + mCurrentMtbColt.getMtbColr().isEmpty(); + String newTipoUL = shouldChangeCodTcol ? refMtbColt.getCodTcol() : null; + + if (shouldChangeCodTcol) { + mColliMagazzinoRESTConsumer.updateTipoUL(mCurrentMtbColt, newTipoUL, () -> { + mCurrentMtbColt.setCodTcol(newTipoUL); + onComplete.run(); + }, this::sendError); + } else onComplete.run(); + } + private void saveEditedRow(MtbColr mtbColrToUpdate, BigDecimal numCnf, BigDecimal qtaCnf, BigDecimal qtaTot, String partitaMag, LocalDate dataScad, boolean shouldCloseLU) { this.sendOnLoadingStarted(); @@ -1732,7 +1763,7 @@ public class SpedizioneViewModel { } private void askInfoAggiuntive(Runnable onComplete) { - if (mDefaultSegnoCol != -1 || !SettingsManager.iDB().isFlagAskInfoAggiuntiveSpedizione()) { + if (!SettingsManager.iDB().isFlagAskInfoAggiuntiveSpedizione()) { onComplete.run(); return; } diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/versamento_merce/VersamentoMerceViewModel.java b/app/src/main/java/it/integry/integrywmsnative/gest/versamento_merce/VersamentoMerceViewModel.java index 8edf5632..4a2388ef 100644 --- a/app/src/main/java/it/integry/integrywmsnative/gest/versamento_merce/VersamentoMerceViewModel.java +++ b/app/src/main/java/it/integry/integrywmsnative/gest/versamento_merce/VersamentoMerceViewModel.java @@ -302,7 +302,7 @@ public class VersamentoMerceViewModel { public void updatePosizione(MtbDepoPosizione mtbDepoPosizione) { this.sendOnLoadingStarted(); - mColliMagazzinoRESTConsumer.changePosizione(mCurrentMtbColt.getValue(), mtbDepoPosizione, () -> { + mColliMagazzinoRESTConsumer.spostaUL(mCurrentMtbColt.getValue(), mtbDepoPosizione, () -> { this.sendOnLoadingEnded(); this.sendOnDataSaved(); }, this::sendError); diff --git a/app/src/main/java/it/integry/integrywmsnative/view/dialogs/base/DialogSimpleMessageView.java b/app/src/main/java/it/integry/integrywmsnative/view/dialogs/base/DialogSimpleMessageView.java index 6189f6b9..69bde96f 100644 --- a/app/src/main/java/it/integry/integrywmsnative/view/dialogs/base/DialogSimpleMessageView.java +++ b/app/src/main/java/it/integry/integrywmsnative/view/dialogs/base/DialogSimpleMessageView.java @@ -136,31 +136,26 @@ public class DialogSimpleMessageView extends BaseDialogFragment { private void initContent() { int colorBackgroundTitle = -1; - Drawable titleIconRes = null; - - switch (mType) { - case INFO: + Drawable titleIconRes = switch (mType) { + case INFO -> { colorBackgroundTitle = ContextCompat.getColor(requireContext(), R.color.colorPrimary); - titleIconRes = ResourcesCompat.getDrawable(requireContext().getResources(), R.drawable.ic_info_78dp, null); - break; - - case SUCCESS: + yield ResourcesCompat.getDrawable(requireContext().getResources(), R.drawable.ic_info_78dp, null); + } + case SUCCESS -> { colorBackgroundTitle = ContextCompat.getColor(requireContext(), R.color.green_300); - titleIconRes = ResourcesCompat.getDrawable(requireContext().getResources(), R.drawable.ic_done_white_24dp, null); - break; - - case WARNING: + yield ResourcesCompat.getDrawable(requireContext().getResources(), R.drawable.ic_done_white_24dp, null); + } + case WARNING -> { colorBackgroundTitle = ContextCompat.getColor(requireContext(), R.color.yellow_600); - titleIconRes = ResourcesCompat.getDrawable(requireContext().getResources(), R.drawable.ic_warning_white_24dp, null); - break; - - case ERROR: + yield ResourcesCompat.getDrawable(requireContext().getResources(), R.drawable.ic_warning_white_24dp, null); + } + case ERROR -> { colorBackgroundTitle = ContextCompat.getColor(requireContext(), R.color.red_300); - titleIconRes = ResourcesCompat.getDrawable(requireContext().getResources(), R.drawable.ic_mood_bad_24dp, null); - break; - } + yield ResourcesCompat.getDrawable(requireContext().getResources(), R.drawable.ic_mood_bad_24dp, null); + } + }; - this.positiveButtonText = requireContext().getText(R.string.ok).toString(); + this.positiveButtonText = requireContext().getText(mOnNegativeClick != null ? R.string.yes : R.string.ok).toString(); this.negativeButtonText = requireContext().getText(R.string.no).toString(); //Title VIEW diff --git a/app/src/main/res/drawable/app_round_icon.xml b/app/src/main/res/drawable/app_round_icon.xml index 943787b8..249bed37 100644 --- a/app/src/main/res/drawable/app_round_icon.xml +++ b/app/src/main/res/drawable/app_round_icon.xml @@ -1,37 +1,39 @@ - - - - - - - - - - - - - \ No newline at end of file + android:width="222.9dp" + android:height="222.9dp" + android:viewportWidth="222.9" + android:viewportHeight="222.9"> + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 00000000..d7972540 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml index 02f04f8a..da3cfa4c 100644 --- a/app/src/main/res/layout/app_bar_main.xml +++ b/app/src/main/res/layout/app_bar_main.xml @@ -33,12 +33,10 @@ android:layout_gravity="center"> + android:padding="8dp" + android:clickable="true" + android:focusable="true" + android:background="?attr/selectableItemBackground"> - + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index 036d09bc..7353dbd1 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 5a51dba6..00000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 00000000..6582824d Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png deleted file mode 100644 index f5fbca90..00000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index c887da06..00000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 00000000..ce973e52 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 42fd3eb1..00000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 00000000..a48e025e Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png deleted file mode 100644 index d1ad74fa..00000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index d4d733d4..00000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 00000000..f7ec9b38 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index bab2c009..00000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 00000000..5a364803 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png deleted file mode 100644 index bb45d61a..00000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index 4cd8e716..00000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..fd26a792 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 3c6949bc..00000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 00000000..4534f365 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png deleted file mode 100644 index e3fa253e..00000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index 488aa103..00000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..875eb4c9 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 8e638e32..00000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 00000000..af06cbd2 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 7106807b..00000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index 374091fc..00000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 00000000..64c524bc Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ