Refactoring activity contenuto bancale
This commit is contained in:
parent
624a880ad5
commit
ea6b26e00f
@ -9,6 +9,8 @@ import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
|||||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneModule;
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneModule;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingComponent;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingModule;
|
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingModule;
|
||||||
|
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleComponent;
|
||||||
|
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleModule;
|
||||||
import it.integry.integrywmsnative.gest.main.MainActivityComponent;
|
import it.integry.integrywmsnative.gest.main.MainActivityComponent;
|
||||||
import it.integry.integrywmsnative.gest.main.MainActivityModule;
|
import it.integry.integrywmsnative.gest.main.MainActivityModule;
|
||||||
import it.integry.integrywmsnative.gest.main.MainFragmentComponent;
|
import it.integry.integrywmsnative.gest.main.MainFragmentComponent;
|
||||||
@ -58,9 +60,10 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
RoomModule.class,
|
RoomModule.class,
|
||||||
SplashActivityModule.class,
|
SplashActivityModule.class,
|
||||||
MainApplicationModule.class,
|
MainApplicationModule.class,
|
||||||
|
MainActivityModule.class,
|
||||||
MainFragmentModule.class,
|
MainFragmentModule.class,
|
||||||
MainAccettazioneModule.class,
|
MainAccettazioneModule.class,
|
||||||
MainActivityModule.class,
|
ContenutoBancaleModule.class,
|
||||||
PVOrdineAcquistoGrigliaModule.class,
|
PVOrdineAcquistoGrigliaModule.class,
|
||||||
PVOrdineAcquistoEditModule.class,
|
PVOrdineAcquistoEditModule.class,
|
||||||
PickingLiberoModule.class,
|
PickingLiberoModule.class,
|
||||||
@ -87,6 +90,7 @@ public interface MainApplicationComponent {
|
|||||||
MainActivityComponent.Factory mainActivityComponent();
|
MainActivityComponent.Factory mainActivityComponent();
|
||||||
MainFragmentComponent.Factory mainFragmentComponent();
|
MainFragmentComponent.Factory mainFragmentComponent();
|
||||||
MainAccettazioneComponent.Factory mainAccettazioneComponent();
|
MainAccettazioneComponent.Factory mainAccettazioneComponent();
|
||||||
|
ContenutoBancaleComponent.Factory contenutoBancaleComponent();
|
||||||
PVOrdineAcquistoGrigliaComponent.Factory pvOrdineAcquistoGrigliaComponent();
|
PVOrdineAcquistoGrigliaComponent.Factory pvOrdineAcquistoGrigliaComponent();
|
||||||
PVOrdineAcquistoEditComponent.Factory pvOrdineAcquistoEditComponent();
|
PVOrdineAcquistoEditComponent.Factory pvOrdineAcquistoEditComponent();
|
||||||
PickingLiberoComponent.Factory pickingLiberoComponent();
|
PickingLiberoComponent.Factory pickingLiberoComponent();
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import it.integry.integrywmsnative.core.menu.MenuService;
|
|||||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.MagazzinoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.MesRESTConsumer;
|
||||||
@ -82,6 +83,12 @@ public class MainApplicationModule {
|
|||||||
return new ArticoloRESTConsumer();
|
return new ArticoloRESTConsumer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Provides
|
||||||
|
@Singleton
|
||||||
|
DepositoRESTConsumer provideDepositoRESTConsumer() {
|
||||||
|
return new DepositoRESTConsumer();
|
||||||
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
MenuRESTConsumer provideMenuRESTConsumer() {
|
MenuRESTConsumer provideMenuRESTConsumer() {
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import android.view.KeyEvent;
|
|||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
|
|
||||||
public class BaseActivity extends AppCompatActivity {
|
public class BaseActivity extends AppCompatActivity {
|
||||||
@ -38,19 +39,45 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void openProgress() {
|
protected void openProgress() {
|
||||||
BarcodeManager.disable();
|
runOnUiThread(() -> {
|
||||||
if (this.mCurrentProgress == null) {
|
BarcodeManager.disable();
|
||||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(this);
|
if (this.mCurrentProgress == null) {
|
||||||
}
|
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(this);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void closeProgress() {
|
protected void closeProgress() {
|
||||||
BarcodeManager.enable();
|
runOnUiThread(() -> {
|
||||||
if (mCurrentProgress != null) {
|
BarcodeManager.enable();
|
||||||
mCurrentProgress.dismiss();
|
if (mCurrentProgress != null) {
|
||||||
mCurrentProgress = null;
|
mCurrentProgress.dismiss();
|
||||||
}
|
mCurrentProgress = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onLoadingStarted() {
|
||||||
|
new Thread(() -> {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.openProgress();
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLoadingEnded() {
|
||||||
|
new Thread(() -> {
|
||||||
|
this.closeProgress();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onError(Exception ex) {
|
||||||
|
this.runOnUiThread(() -> {
|
||||||
|
this.closeProgress();
|
||||||
|
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||||
|
BarcodeManager.enable();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,31 +2,33 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||||
import it.integry.integrywmsnative.core.model.MtbDepo;
|
import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
|
||||||
|
|
||||||
public class DepositoRESTConsumer {
|
@Singleton
|
||||||
|
public class DepositoRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
public static void getDepoByCodMdep(String codMdep, RunnableArgs<MtbDepo> onComplete) {
|
public void getDepoByCodMdep(String codMdep, RunnableArgs<MtbDepo> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
MtbDepo mtbDepo = new MtbDepo();
|
MtbDepo mtbDepo = new MtbDepo();
|
||||||
mtbDepo.setCodMdep(codMdep);
|
mtbDepo.setCodMdep(codMdep);
|
||||||
mtbDepo.setOperation(CommonModelConsts.OPERATION.SELECT);
|
mtbDepo.setOperation(CommonModelConsts.OPERATION.SELECT);
|
||||||
mtbDepo.setOnlyPkMaster(false);
|
mtbDepo.setOnlyPkMaster(false);
|
||||||
|
|
||||||
EntityRESTConsumer.selectEntity(mtbDepo, new ISimpleOperationCallback<List<MtbDepo>>() {
|
EntityRESTConsumer.selectEntity(mtbDepo, new ISimpleOperationCallback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<MtbDepo> value) {
|
public void onSuccess(List<MtbDepo> value) {
|
||||||
if(value != null && value.size() > 0) {
|
if (value != null && value.size() > 0) {
|
||||||
onComplete.run(value.get(0));
|
onComplete.run(value.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailed(Exception ex) {
|
public void onFailed(Exception ex) {
|
||||||
UtilityLogger.errorMe(ex);
|
onFailed.run(ex);
|
||||||
}
|
}
|
||||||
}, MtbDepo.class);
|
}, MtbDepo.class);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,27 +32,7 @@ public class PrinterRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void getAvailablePrintersStatic(final ISimpleOperationCallback<List<String>> callback) {
|
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
|
||||||
printerService.getAvailablePrinters().enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Call<ServiceRESTResponse<List<String>>> call, Response<ServiceRESTResponse<List<String>>> response) {
|
|
||||||
analyzeAnswer(response, "GetAvailablePrinters", callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFailure(Call<ServiceRESTResponse<List<String>>> call, Throwable t) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getAvailablePrinters(String codMdep, final RunnableArgs<List<String>> onComplete, final RunnableArgs<Exception> onFailed) {
|
public void getAvailablePrinters(String codMdep, final RunnableArgs<List<String>> onComplete, final RunnableArgs<Exception> onFailed) {
|
||||||
getAvailablePrintersStatic(codMdep, onComplete, onFailed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void getAvailablePrintersStatic(String codMdep, final RunnableArgs<List<String>> onComplete, RunnableArgs<Exception> onFailed) {
|
|
||||||
|
|
||||||
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
PrinterRESTConsumerService printerService = RESTBuilder.getService(PrinterRESTConsumerService.class);
|
||||||
printerService.getAvailablePrinters(codMdep).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
printerService.getAvailablePrinters(codMdep).enqueue(new Callback<ServiceRESTResponse<List<String>>>() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -117,8 +117,6 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
mBindings.bottomSheetLuContent.setListener(this);
|
mBindings.bottomSheetLuContent.setListener(this);
|
||||||
mBottomSheetFragmentLUContentViewModel.setListener(this);
|
mBottomSheetFragmentLUContentViewModel.setListener(this);
|
||||||
|
|
||||||
setSupportActionBar(this.mBindings.toolbar);
|
|
||||||
|
|
||||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
mShowSecondaryUntMis = sharedPreferences.getBoolean("picking_ingresso_enable_sec_unt_mis", true);
|
mShowSecondaryUntMis = sharedPreferences.getBoolean("picking_ingresso_enable_sec_unt_mis", true);
|
||||||
|
|
||||||
|
|||||||
@ -1,25 +1,53 @@
|
|||||||
package it.integry.integrywmsnative.gest.contenuto_bancale;
|
package it.integry.integrywmsnative.gest.contenuto_bancale;
|
||||||
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.res.Resources;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.report.ReportManager;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.databinding.ActivityContenutoBancaleBinding;
|
import it.integry.integrywmsnative.databinding.ActivityContenutoBancaleBinding;
|
||||||
import it.integry.integrywmsnative.gest.contenuto_bancale.viewmodel.ContenutoBancaleViewModel;
|
import it.integry.integrywmsnative.gest.contenuto_bancale.core.ContenutoBancaleListAdapter;
|
||||||
|
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||||
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class ContenutoBancaleActivity extends BaseActivity {
|
public class ContenutoBancaleActivity extends BaseActivity implements ContenutoBancaleViewModel.Listener {
|
||||||
|
|
||||||
public ActivityContenutoBancaleBinding bindings;
|
public ActivityContenutoBancaleBinding bindings;
|
||||||
|
|
||||||
private ContenutoBancaleViewModel mViewModel;
|
@Inject
|
||||||
|
ContenutoBancaleViewModel mViewModel;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DepositoRESTConsumer mDepositoRESTConsumer;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
PrinterRESTConsumer mPrinterRESTConsumer;
|
||||||
|
|
||||||
|
public final ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
||||||
|
public final ObservableField<String> descrizioneDepo = new ObservableField<>();
|
||||||
|
|
||||||
|
public ObservableField<Boolean> fabVisible = new ObservableField<>(true);
|
||||||
|
public ObservableField<Boolean> recoverFabMenuVisible = new ObservableField<>(false);
|
||||||
|
|
||||||
|
private String mReportName;
|
||||||
|
private PrinterRESTConsumer.Type mPrinterType;
|
||||||
|
|
||||||
private static class Key {
|
private static class Key {
|
||||||
private static final String MtbColtKey = "mtbColtKey";
|
private static final String MtbColtKey = "mtbColtKey";
|
||||||
@ -50,24 +78,106 @@ public class ContenutoBancaleActivity extends BaseActivity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
boolean canRecoverUL = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
|
||||||
|
mtbColt.set(DataCache.retrieveItem(getIntent().getStringExtra(Key.MtbColtKey)));
|
||||||
|
mReportName = DataCache.retrieveItem(getIntent().getStringExtra(Key.ReportName));
|
||||||
|
mPrinterType = DataCache.retrieveItem(getIntent().getStringExtra(Key.PrinterType));
|
||||||
|
|
||||||
bindings = DataBindingUtil.setContentView(this, R.layout.activity_contenuto_bancale);
|
bindings = DataBindingUtil.setContentView(this, R.layout.activity_contenuto_bancale);
|
||||||
|
|
||||||
boolean canRecoverUL = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
|
MainApplication.appComponent
|
||||||
MtbColt mtbColt = DataCache.retrieveItem(getIntent().getStringExtra(Key.MtbColtKey));
|
.contenutoBancaleComponent()
|
||||||
String reportName = DataCache.retrieveItem(getIntent().getStringExtra(Key.ReportName));
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
PrinterRESTConsumer.Type mPrinterType = DataCache.retrieveItem(getIntent().getStringExtra(Key.PrinterType));
|
bindings.setView(this);
|
||||||
|
bindings.setViewModel(this.mViewModel);
|
||||||
mViewModel = new ContenutoBancaleViewModel(this, mtbColt, canRecoverUL, mPrinterType, reportName);
|
|
||||||
|
|
||||||
bindings.elevatedToolbar.setNestedScrollView(bindings.scrollView);
|
bindings.elevatedToolbar.setNestedScrollView(bindings.scrollView);
|
||||||
|
|
||||||
setSupportActionBar(this.bindings.toolbar);
|
setSupportActionBar(this.bindings.toolbar);
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
mViewModel.setListener(this);
|
||||||
|
mViewModel.init(mtbColt.get(), mPrinterType, mReportName);
|
||||||
|
|
||||||
|
recoverFabMenuVisible.set(canRecoverUL);
|
||||||
|
|
||||||
|
initRecyclerView();
|
||||||
|
initColloInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initRecyclerView() {
|
||||||
|
this.bindings.contenutoBancaleMainList.setNestedScrollingEnabled(false);
|
||||||
|
|
||||||
|
this.bindings.contenutoBancaleMainList.setHasFixedSize(true);
|
||||||
|
|
||||||
|
this.bindings.contenutoBancaleMainList.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
|
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(this, SimpleDividerItemDecoration.VERTICAL);
|
||||||
|
itemDecorator.setDrawable(ContextCompat.getDrawable(this, R.drawable.divider));
|
||||||
|
this.bindings.contenutoBancaleMainList.addItemDecoration(itemDecorator);
|
||||||
|
|
||||||
|
ContenutoBancaleListAdapter adapter = new ContenutoBancaleListAdapter(mtbColt.get().getMtbColr());
|
||||||
|
this.bindings.contenutoBancaleMainList.setAdapter(adapter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initColloInfo() {
|
||||||
|
mDepositoRESTConsumer.getDepoByCodMdep(mtbColt.get().getCodMdep(), depo -> {
|
||||||
|
descrizioneDepo.set("(" + depo.getDescrizione() + ")");
|
||||||
|
}, this::onError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void recoverUL() {
|
||||||
|
Intent data = new Intent();
|
||||||
|
String key = DataCache.addItem(mtbColt.get());
|
||||||
|
data.putExtra("key", key);
|
||||||
|
|
||||||
|
this.setResult(RESULT_OK, data);
|
||||||
|
this.finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void printUL() {
|
||||||
|
this.bindings.contenutoBancaleFab.close(true);
|
||||||
|
this.onLoadingStarted();
|
||||||
|
|
||||||
|
this.mPrinterRESTConsumer.getAvailablePrinters(SettingsManager.i().getUserSession().getDepo().getCodMdep(), mPrinterType, value -> {
|
||||||
|
if (value.size() > 0) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
String reportName = ReportManager.getReportNameLUFromGestione(mtbColt.get().getGestioneEnum());
|
||||||
|
reportName = mReportName != null ? mReportName : reportName;
|
||||||
|
|
||||||
|
this.mPrinterRESTConsumer.printCollo(value.get(0),
|
||||||
|
mtbColt.get(),
|
||||||
|
1,
|
||||||
|
reportName,
|
||||||
|
() -> {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
|
||||||
|
Resources res = this.getResources();
|
||||||
|
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
||||||
|
DialogSimpleMessageView
|
||||||
|
.makeSuccessDialog(res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null)
|
||||||
|
.show(getSupportFragmentManager(), "tag");
|
||||||
|
}, this::onError);
|
||||||
|
|
||||||
|
} catch (Exception ex) {
|
||||||
|
this.onError(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
String errorMessage = "Nessuna stampante configurata";
|
||||||
|
this.onError(new Exception(errorMessage));
|
||||||
|
}
|
||||||
|
}, this::onError);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onSupportNavigateUp() {
|
public boolean onSupportNavigateUp() {
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contenuto_bancale;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface ContenutoBancaleComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
ContenutoBancaleComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(ContenutoBancaleActivity contenutoBancaleActivity);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contenuto_bancale;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
|
||||||
|
@Module(subcomponents = ContenutoBancaleComponent.class)
|
||||||
|
public class ContenutoBancaleModule {
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.contenuto_bancale;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
||||||
|
|
||||||
|
public class ContenutoBancaleViewModel {
|
||||||
|
|
||||||
|
private final DepositoRESTConsumer mDepositoRESTConsumer;
|
||||||
|
|
||||||
|
|
||||||
|
private Listener mListener;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public ContenutoBancaleViewModel(DepositoRESTConsumer depositoRESTConsumer) {
|
||||||
|
this.mDepositoRESTConsumer = depositoRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(MtbColt mtbColt, PrinterRESTConsumer.Type printerType, String defaultReportName) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ContenutoBancaleViewModel setListener(Listener listener) {
|
||||||
|
this.mListener = listener;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface Listener extends ILoadingListener {
|
||||||
|
|
||||||
|
void onError(Exception ex);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,15 +1,15 @@
|
|||||||
package it.integry.integrywmsnative.gest.contenuto_bancale.core;
|
package it.integry.integrywmsnative.gest.contenuto_bancale.core;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
|
||||||
import androidx.databinding.ObservableList;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.view.ExtendedRecyclerView;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||||
@ -17,13 +17,13 @@ import it.integry.integrywmsnative.core.utility.UtilityResources;
|
|||||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.ListaContenutoBancaleListModelBinding;
|
import it.integry.integrywmsnative.databinding.ListaContenutoBancaleListModelBinding;
|
||||||
|
|
||||||
public class ContenutoBancaleListAdapter extends RecyclerView.Adapter<ContenutoBancaleListAdapter.ViewHolder> {
|
public class ContenutoBancaleListAdapter extends ExtendedRecyclerView<MtbColr, ContenutoBancaleListAdapter.ViewHolder> {
|
||||||
|
|
||||||
|
private RunnableArgs<MtbColr> mOnItemClickListener;
|
||||||
|
|
||||||
protected static Context mContext;
|
public ContenutoBancaleListAdapter(ObservableArrayList<MtbColr> myDataset) {
|
||||||
protected ObservableArrayList<MtbColr> mDataset;
|
super(myDataset);
|
||||||
|
}
|
||||||
private IRecyclerItemClicked<MtbColr> mOnItemClickListener;
|
|
||||||
|
|
||||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
protected ListaContenutoBancaleListModelBinding mViewDataBinding;
|
protected ListaContenutoBancaleListModelBinding mViewDataBinding;
|
||||||
@ -37,12 +37,11 @@ public class ContenutoBancaleListAdapter extends RecyclerView.Adapter<ContenutoB
|
|||||||
public void bind(MtbColr mtbColr) {
|
public void bind(MtbColr mtbColr) {
|
||||||
mViewDataBinding.setMtbColr(mtbColr);
|
mViewDataBinding.setMtbColr(mtbColr);
|
||||||
|
|
||||||
|
|
||||||
//Setting qty with unt_mis
|
//Setting qty with unt_mis
|
||||||
if(!SettingsManager.iDB().isFlagForceAllToColli() && (mtbColr.getMtbAart() == null || mtbColr.getMtbAart().isFlagQtaCnfFissaBoolean())){
|
if (!SettingsManager.iDB().isFlagForceAllToColli() && (mtbColr.getMtbAart() == null || mtbColr.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||||
String text = UtilityNumber.decimalToString(mtbColr.getQtaCol());
|
String text = UtilityNumber.decimalToString(mtbColr.getQtaCol());
|
||||||
|
|
||||||
if(mtbColr.getMtbAart() != null) {
|
if (mtbColr.getMtbAart() != null) {
|
||||||
text += !UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : "";
|
text += !UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,14 +55,6 @@ public class ContenutoBancaleListAdapter extends RecyclerView.Adapter<ContenutoB
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ContenutoBancaleListAdapter(Context context, ObservableArrayList<MtbColr> myDataset, IRecyclerItemClicked<MtbColr> onItemClickListener) {
|
|
||||||
mContext = context;
|
|
||||||
mDataset = myDataset;
|
|
||||||
mOnItemClickListener = onItemClickListener;
|
|
||||||
|
|
||||||
myDataset.addOnListChangedCallback(onListChangedCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ContenutoBancaleListAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
public ContenutoBancaleListAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
// create a new view
|
// create a new view
|
||||||
@ -78,10 +69,10 @@ public class ContenutoBancaleListAdapter extends RecyclerView.Adapter<ContenutoB
|
|||||||
holder.bind(mtbColr);
|
holder.bind(mtbColr);
|
||||||
|
|
||||||
//Setting qty with unt_mis
|
//Setting qty with unt_mis
|
||||||
if(!SettingsManager.iDB().isFlagForceAllToColli() && (mtbColr.getMtbAart() == null || mtbColr.getMtbAart().isFlagQtaCnfFissaBoolean())){
|
if (!SettingsManager.iDB().isFlagForceAllToColli() && (mtbColr.getMtbAart() == null || mtbColr.getMtbAart().isFlagQtaCnfFissaBoolean())) {
|
||||||
String text = UtilityNumber.decimalToString(mtbColr.getQtaCol());
|
String text = UtilityNumber.decimalToString(mtbColr.getQtaCol());
|
||||||
|
|
||||||
if(mtbColr.getMtbAart() != null) {
|
if (mtbColr.getMtbAart() != null) {
|
||||||
text += !UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : "";
|
text += !UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,50 +82,15 @@ public class ContenutoBancaleListAdapter extends RecyclerView.Adapter<ContenutoB
|
|||||||
}
|
}
|
||||||
|
|
||||||
holder.mViewDataBinding.getRoot().setOnClickListener(x -> {
|
holder.mViewDataBinding.getRoot().setOnClickListener(x -> {
|
||||||
if(mOnItemClickListener != null) {
|
if (mOnItemClickListener != null) {
|
||||||
mOnItemClickListener.onItemClick(mtbColr, position);
|
mOnItemClickListener.run(mtbColr);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onViewRecycled(ContenutoBancaleListAdapter.ViewHolder holder) {
|
public ContenutoBancaleListAdapter setOnItemClickListener(RunnableArgs<MtbColr> onItemClickListener) {
|
||||||
super.onViewRecycled(holder);
|
this.mOnItemClickListener = onItemClickListener;
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount() {
|
|
||||||
return mDataset.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private ObservableList.OnListChangedCallback onListChangedCallback = new ObservableList.OnListChangedCallback<ObservableList<MtbColr>>(){
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onChanged(ObservableList<MtbColr> sender) {
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeChanged(ObservableList<MtbColr> sender, int positionStart, int itemCount) {
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeInserted(ObservableList<MtbColr> sender, int positionStart, int itemCount) {
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeMoved(ObservableList<MtbColr> sender, int fromPosition, int toPosition, int itemCount) {
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemRangeRemoved(ObservableList<MtbColr> sender, int positionStart, int itemCount) {
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,143 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.gest.contenuto_bancale.viewmodel;
|
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.res.Resources;
|
|
||||||
import android.text.SpannableString;
|
|
||||||
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.databinding.ObservableField;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
|
|
||||||
import it.integry.integrywmsnative.R;
|
|
||||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
|
||||||
import it.integry.integrywmsnative.core.di.BindableString;
|
|
||||||
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
|
||||||
import it.integry.integrywmsnative.core.report.ReportManager;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.PrinterRESTConsumer;
|
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|
||||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleActivity;
|
|
||||||
import it.integry.integrywmsnative.gest.contenuto_bancale.core.ContenutoBancaleListAdapter;
|
|
||||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
|
||||||
|
|
||||||
import static android.app.Activity.RESULT_OK;
|
|
||||||
|
|
||||||
public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr> {
|
|
||||||
|
|
||||||
private ContenutoBancaleActivity mContext;
|
|
||||||
|
|
||||||
public ObservableField<MtbColt> mtbColt;
|
|
||||||
public BindableString descrizioneDepo = new BindableString();
|
|
||||||
|
|
||||||
public ObservableField<Boolean> isFabVisible = new ObservableField<>();
|
|
||||||
public ObservableField<Boolean> isRecoverFabMenuVisible = new ObservableField<>();
|
|
||||||
|
|
||||||
private ContenutoBancaleListAdapter mAdapter;
|
|
||||||
|
|
||||||
private PrinterRESTConsumer.Type mPrinterType;
|
|
||||||
private String mReportName;
|
|
||||||
|
|
||||||
public ContenutoBancaleViewModel(ContenutoBancaleActivity context, MtbColt mtbColt, boolean canRecoverUL, PrinterRESTConsumer.Type printerType, String defaultReportName) {
|
|
||||||
mContext = context;
|
|
||||||
this.mtbColt = new ObservableField<>(mtbColt);
|
|
||||||
this.isFabVisible.set(true);
|
|
||||||
this.isRecoverFabMenuVisible.set(canRecoverUL);
|
|
||||||
this.mPrinterType = printerType;
|
|
||||||
this.mReportName = defaultReportName;
|
|
||||||
|
|
||||||
mContext.bindings.setViewModel(this);
|
|
||||||
|
|
||||||
initRecyclerView();
|
|
||||||
|
|
||||||
initColloInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void initRecyclerView() {
|
|
||||||
mContext.bindings.contenutoBancaleMainList.setNestedScrollingEnabled(false);
|
|
||||||
|
|
||||||
mContext.bindings.contenutoBancaleMainList.setHasFixedSize(true);
|
|
||||||
|
|
||||||
mContext.bindings.contenutoBancaleMainList.setLayoutManager(new LinearLayoutManager(mContext));
|
|
||||||
|
|
||||||
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(mContext, SimpleDividerItemDecoration.VERTICAL);
|
|
||||||
itemDecorator.setDrawable(ContextCompat.getDrawable(mContext, R.drawable.divider));
|
|
||||||
mContext.bindings.contenutoBancaleMainList.addItemDecoration(itemDecorator);
|
|
||||||
|
|
||||||
mAdapter = new ContenutoBancaleListAdapter(mContext, mtbColt.get().getMtbColr(), this);
|
|
||||||
mContext.bindings.contenutoBancaleMainList.setAdapter(mAdapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void initColloInfo() {
|
|
||||||
DepositoRESTConsumer.getDepoByCodMdep(mtbColt.get().getCodMdep(), depo -> {
|
|
||||||
descrizioneDepo.set("(" + depo.getDescrizione() + ")");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemClick(MtbColr item, int position) {
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void recoverUL() {
|
|
||||||
Intent data = new Intent();
|
|
||||||
String key = DataCache.addItem(mtbColt.get());
|
|
||||||
data.putExtra("key", key);
|
|
||||||
|
|
||||||
mContext.setResult(RESULT_OK, data);
|
|
||||||
mContext.finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void printUL() {
|
|
||||||
mContext.bindings.contenutoBancaleFab.close(true);
|
|
||||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
|
||||||
|
|
||||||
PrinterRESTConsumer.getAvailablePrintersStatic(SettingsManager.i().getUserSession().getDepo().getCodMdep(), mPrinterType, value -> {
|
|
||||||
|
|
||||||
if (value.size() > 0) {
|
|
||||||
|
|
||||||
try {
|
|
||||||
String reportName = ReportManager.getReportNameLUFromGestione(mtbColt.get().getGestioneEnum());
|
|
||||||
|
|
||||||
reportName = mReportName != null ? mReportName : reportName;
|
|
||||||
|
|
||||||
PrinterRESTConsumer.printColloStatic(value.get(0),
|
|
||||||
mtbColt.get(),
|
|
||||||
1,
|
|
||||||
reportName,
|
|
||||||
() -> {
|
|
||||||
progress.dismiss();
|
|
||||||
|
|
||||||
Resources res = mContext.getResources();
|
|
||||||
String errorMessage = res.getText(R.string.alert_print_completed_message).toString();
|
|
||||||
DialogSimpleMessageView
|
|
||||||
.makeSuccessDialog(res.getText(R.string.completed).toString(), new SpannableString(errorMessage), null, null)
|
|
||||||
.show(mContext.getSupportFragmentManager(), "tag");
|
|
||||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
|
||||||
|
|
||||||
} catch (Exception ex) {
|
|
||||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
progress.dismiss();
|
|
||||||
String errorMessage = "Nessuna stampante configurata";
|
|
||||||
DialogSimpleMessageView
|
|
||||||
.makeWarningDialog(new SpannableString(errorMessage), null, null)
|
|
||||||
.show(mContext.getSupportFragmentManager(), "tag");;
|
|
||||||
}
|
|
||||||
}, ex -> {
|
|
||||||
UtilityExceptions.defaultException(mContext, ex, progress);
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,15 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<layout xmlns:tools="http://schemas.android.com/tools"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:fab="http://schemas.android.com/apk/res-auto">
|
xmlns:fab="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<import type="android.view.View" />
|
<import type="android.view.View" />
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="viewModel"
|
name="viewModel"
|
||||||
type="it.integry.integrywmsnative.gest.contenuto_bancale.viewmodel.ContenutoBancaleViewModel" />
|
type="it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleViewModel" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="view"
|
||||||
|
type="it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleActivity" />
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
@ -18,183 +24,182 @@
|
|||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:background="@color/full_white">
|
|
||||||
|
|
||||||
<it.integry.integrywmsnative.ui.ElevatedToolbar
|
|
||||||
android:id="@+id/elevated_toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
|
||||||
android:id="@+id/toolbar"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?actionBarSize"
|
|
||||||
tools:title="Contenuto bancale"
|
|
||||||
app:popupTheme="@style/AppTheme.PopupOverlay"/>
|
|
||||||
|
|
||||||
</it.integry.integrywmsnative.ui.ElevatedToolbar>
|
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
|
||||||
android:id="@+id/scroll_view"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
android:background="@color/full_white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<it.integry.integrywmsnative.ui.ElevatedToolbar
|
||||||
<LinearLayout
|
android:id="@+id/elevated_toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:orientation="vertical"
|
|
||||||
android:paddingTop="8dp"
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:focusableInTouchMode="true"
|
android:id="@+id/toolbar"
|
||||||
tools:context=".gest.contenuto_bancale.ContenutoBancaleActivity">
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||||
|
tools:title="Contenuto bancale" />
|
||||||
|
|
||||||
|
</it.integry.integrywmsnative.ui.ElevatedToolbar>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:id="@+id/scroll_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/gray_detail_background_round8"
|
android:focusableInTouchMode="true"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_marginLeft="8dp"
|
android:paddingTop="8dp"
|
||||||
android:layout_marginRight="8dp"
|
tools:context=".gest.contenuto_bancale.ContenutoBancaleActivity">
|
||||||
android:padding="16dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:background="@drawable/gray_detail_background_round8"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="16dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Data creazione: "
|
android:orientation="horizontal">
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:textSize="16sp"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:layout_width="wrap_content"
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Data creazione: "
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{view.mtbColt.getDataColloHumanLong()}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="22 ottobre 2018" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@{viewModel.mtbColt.getDataColloHumanLong()}"
|
android:orientation="horizontal">
|
||||||
tools:text="22 ottobre 2018"
|
|
||||||
android:textColor="@android:color/black"
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:textSize="16sp"
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
android:textStyle="bold"
|
android:layout_width="wrap_content"
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Preparato da "
|
||||||
|
android:textColor="@android:color/black" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{view.mtbColt.getPreparatoDa() != null ? view.mtbColt.getPreparatoDa() : `N/D`}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="italic"
|
||||||
|
tools:text="Vito Falagario" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Posizione "
|
||||||
|
android:textColor="@android:color/black" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{view.mtbColt.getPosizione() != null ? view.mtbColt.getPosizione() : `N/D`}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="A00F00C00L00" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Deposito "
|
||||||
|
android:textColor="@android:color/black" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{view.mtbColt.getCodMdep()}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="10" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:text="@{view.descrizioneDepo}"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="(Bari)" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/contenuto_bancale_main_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginBottom="92dp"
|
||||||
|
android:paddingStart="2dp"
|
||||||
|
android:paddingEnd="2dp">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
</androidx.recyclerview.widget.RecyclerView>
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Preparato da "
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{viewModel.mtbColt.getPreparatoDa() != null ? viewModel.mtbColt.getPreparatoDa() : `N/D`}"
|
|
||||||
tools:text="Vito Falagario"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:textStyle="italic"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_marginTop="12dp">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Posizione "
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{viewModel.mtbColt.getPosizione() != null ? viewModel.mtbColt.getPosizione() : `N/D`}"
|
|
||||||
tools:text="A00F00C00L00"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:textStyle="bold"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Deposito "
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{viewModel.mtbColt.getCodMdep()}"
|
|
||||||
tools:text="10"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:textStyle="bold"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:text="@{viewModel.descrizioneDepo}"
|
|
||||||
tools:text="(Bari)"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:textStyle="bold"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
</LinearLayout>
|
||||||
android:id="@+id/contenuto_bancale_main_list"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:layout_marginBottom="92dp"
|
|
||||||
android:paddingStart="2dp"
|
|
||||||
android:paddingEnd="2dp">
|
|
||||||
|
|
||||||
</androidx.recyclerview.widget.RecyclerView>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<com.github.clans.fab.FloatingActionMenu
|
<com.github.clans.fab.FloatingActionMenu
|
||||||
android:id="@+id/contenuto_bancale_fab"
|
android:id="@+id/contenuto_bancale_fab"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:visibility="@{viewModel.isFabVisible ? View.VISIBLE : View.GONE}"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:visibility="@{view.fabVisible}"
|
||||||
fab:menu_animationDelayPerItem="50"
|
fab:menu_animationDelayPerItem="50"
|
||||||
fab:menu_backgroundColor="@color/white_bg_alpha"
|
fab:menu_backgroundColor="@color/white_bg_alpha"
|
||||||
fab:menu_buttonSpacing="0dp"
|
fab:menu_buttonSpacing="0dp"
|
||||||
@ -228,14 +233,14 @@
|
|||||||
android:id="@+id/accettazione_ordine_inevaso_fab_item1"
|
android:id="@+id/accettazione_ordine_inevaso_fab_item1"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:scaleX="-1"
|
||||||
android:src="@drawable/ic_recover_ul_24dp"
|
android:src="@drawable/ic_recover_ul_24dp"
|
||||||
android:visibility="@{viewModel.isRecoverFabMenuVisible ? View.VISIBLE : View.GONE}"
|
|
||||||
app:fab_colorNormal="@color/white"
|
app:fab_colorNormal="@color/white"
|
||||||
app:fab_colorPressed="@color/white_pressed"
|
app:fab_colorPressed="@color/white_pressed"
|
||||||
app:fab_colorRipple="#66FFFFFF"
|
app:fab_colorRipple="#66FFFFFF"
|
||||||
app:onClick="@{() -> viewModel.recoverUL()}"
|
app:onClick="@{() -> view.recoverUL()}"
|
||||||
fab:fab_label="@string/action_recover_ul"
|
app:visibility="@{view.recoverFabMenuVisible}"
|
||||||
android:scaleX="-1" />
|
fab:fab_label="@string/action_recover_ul" />
|
||||||
|
|
||||||
<com.github.clans.fab.FloatingActionButton
|
<com.github.clans.fab.FloatingActionButton
|
||||||
android:id="@+id/accettazione_ordine_inevaso_fab_item2"
|
android:id="@+id/accettazione_ordine_inevaso_fab_item2"
|
||||||
@ -245,7 +250,7 @@
|
|||||||
app:fab_colorNormal="@color/white"
|
app:fab_colorNormal="@color/white"
|
||||||
app:fab_colorPressed="@color/white_pressed"
|
app:fab_colorPressed="@color/white_pressed"
|
||||||
app:fab_colorRipple="#66FFFFFF"
|
app:fab_colorRipple="#66FFFFFF"
|
||||||
app:onClick="@{() -> viewModel.printUL()}"
|
app:onClick="@{() -> view.printUL()}"
|
||||||
fab:fab_label="@string/action_print_ul" />
|
fab:fab_label="@string/action_print_ul" />
|
||||||
|
|
||||||
</com.github.clans.fab.FloatingActionMenu>
|
</com.github.clans.fab.FloatingActionMenu>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user