diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser
index 70bef5e6..e8c553d8 100644
Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
deleted file mode 100644
index 30aa626c..00000000
--- a/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 00000000..15a15b21
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index d0657fda..08b4c110 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -13,6 +13,7 @@
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 694ab0c8..d1a606f1 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -8,6 +8,7 @@
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index d0ad54a2..4d5c8f75 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services'
android {
- def appVersionCode = 49
- def appVersionName = '1.0.46'
+ def appVersionCode = 50
+ def appVersionName = '1.0.47'
signingConfigs {
release {
@@ -102,7 +102,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha05'
- implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha4'
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha5'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha04'
implementation 'androidx.preference:preference:1.1.0-alpha04'
@@ -140,10 +140,14 @@ dependencies {
testImplementation 'junit:junit:4.12'
implementation 'com.mikhaellopez:lazydatepicker:1.0.0'
implementation 'com.github.demoNo:AutoScrollViewPager:v1.0.2'
+ implementation 'com.github.zhukic:sectioned-recyclerview:1.2.3'
+ implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
+
//AppUpdate
implementation 'com.github.javiersantos:AppUpdater:2.7'
//Barcode
implementation project(':pointmobilescannerlibrary')
+ implementation project(':zebrascannerlibrary')
implementation project(path: ':barcode_base_library')
}
repositories {
diff --git a/app/src/main/assets/EMDKConfig.xml b/app/src/main/assets/EMDKConfig.xml
new file mode 100644
index 00000000..abffcc02
--- /dev/null
+++ b/app/src/main/assets/EMDKConfig.xml
@@ -0,0 +1,244 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/it/integry/integrywmsnative/MainActivity.java b/app/src/main/java/it/integry/integrywmsnative/MainActivity.java
index da6f1864..018ab5a8 100644
--- a/app/src/main/java/it/integry/integrywmsnative/MainActivity.java
+++ b/app/src/main/java/it/integry/integrywmsnative/MainActivity.java
@@ -147,10 +147,11 @@ public class MainActivity extends AppCompatActivity
} else if (id == R.id.nav_free_picking) {
fragment = PickingLiberoFragment.newInstance();
this.adaptViewToFragment(fragment);
- } else if (id == R.id.nav_resi_cliente) {
- fragment = UltimeConsegneClienteFragment.newInstance();
- this.adaptViewToFragment(fragment);
}
+// else if (id == R.id.nav_resi_cliente) {
+// fragment = UltimeConsegneClienteFragment.newInstance();
+// this.adaptViewToFragment(fragment);
+// }
else if(id == R.id.nav_settings){
fragment = new MainSettingsFragment();
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 04b234c8..8b9bd2e6 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
@@ -4,9 +4,12 @@ import com.annimon.stream.Stream;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
+import org.jetbrains.annotations.NotNull;
+
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.Iterator;
import java.util.List;
import it.integry.integrywmsnative.core.CommonConst;
@@ -290,6 +293,26 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
});
}
+ public static void getMultipleByTestate(List testate, boolean onlyResiduo, RunnableArgs> onComplete, RunnableArgs onFailed) {
+ ArrayList resultMtbColt = new ArrayList<>();
+ cyclicGetMultipleByTestate(testate.iterator(), onlyResiduo, resultMtbColt, () -> {
+ onComplete.run(resultMtbColt);
+ }, onFailed);
+ }
+
+
+
+
+ private static void cyclicGetMultipleByTestate(@NotNull Iterator sourceMtbColts, boolean onlyResiduo, ArrayList resultMtbColt, Runnable onComplete, RunnableArgs onAbort) {
+ if(sourceMtbColts.hasNext()){
+ getByTestata(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
+ resultMtbColt.add(mtbColt);
+ cyclicGetMultipleByTestate(sourceMtbColts, onlyResiduo, resultMtbColt, onComplete, onAbort);
+ }, onAbort);
+ } else {
+ onComplete.run();
+ }
+ }
public static void getByTestata(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs onComplete, RunnableArgs onFailed) {
String ssccString = null;
diff --git a/app/src/main/java/it/integry/integrywmsnative/core/barcode_reader/BarcodeManager.java b/app/src/main/java/it/integry/integrywmsnative/core/barcode_reader/BarcodeManager.java
index 3b242f38..15b18cd5 100644
--- a/app/src/main/java/it/integry/integrywmsnative/core/barcode_reader/BarcodeManager.java
+++ b/app/src/main/java/it/integry/integrywmsnative/core/barcode_reader/BarcodeManager.java
@@ -11,6 +11,7 @@ import it.integry.integrywmsnative.core.utility.UtilityLogger;
import it.integry.plugins.barcode_base_library.exception.BarcodeAdapterNotFoundException;
import it.integry.plugins.barcode_base_library.interfaces.BarcodeReaderInterface;
import it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader;
+import it.integry.zebrascannerlibrary.ZebraBarcodeReader;
public class BarcodeManager {
@@ -23,7 +24,8 @@ public class BarcodeManager {
private static Class extends BarcodeReaderInterface>[] registeredBarcodeReaderInterfaces = new Class[]{
- PointMobileBarcodeReader.class
+ PointMobileBarcodeReader.class,
+ ZebraBarcodeReader.class
};
diff --git a/app/src/main/java/it/integry/integrywmsnative/core/di/binders/RecyclerViewAdapterBinders.java b/app/src/main/java/it/integry/integrywmsnative/core/di/binders/RecyclerViewAdapterBinders.java
deleted file mode 100644
index 891010cd..00000000
--- a/app/src/main/java/it/integry/integrywmsnative/core/di/binders/RecyclerViewAdapterBinders.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package it.integry.integrywmsnative.core.di.binders;
-
-import androidx.databinding.BindingAdapter;
-import androidx.databinding.ObservableArrayList;
-
-public class RecyclerViewAdapterBinders {
-
-
-
-// @BindingAdapter("app:adapter")
-// public static void setItems(RecyclerView recyclerView, Class clazz) {
-// setItems(recyclerView, null, clazz);
-// }
-//
-// @BindingAdapter("app:items")
-// public static void setItems(RecyclerView recyclerView, ObservableArrayList entries) {
-// setItems(recyclerView, entries, null);
-// }
-//
-// @BindingAdapter({"app:items", "app:adapter"})
-// public static void setItems(RecyclerView recyclerView,
-// ObservableArrayList entries, Class clazz) {
-//
-//// recyclerView.removeAllViews();
-//// if (entries != null) {
-//// LayoutInflater inflater = (LayoutInflater)
-//// viewGroup.getContext()
-//// .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-//// for (int i = 0; i < entries.size(); i++) {
-//// T entry = entries.get(i);
-//// ViewDataBinding bindings = DataBindingUtil
-//// .inflate(inflater, layoutId, viewGroup, true);
-//// bindings.setVariable(BR.data, entry);
-//// }
-//// }
-// }
-
-
-}
diff --git a/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityBarcode.java b/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityBarcode.java
index 7cf6e6eb..615ff2e3 100644
--- a/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityBarcode.java
+++ b/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityBarcode.java
@@ -107,7 +107,7 @@ public class UtilityBarcode {
for (int i = 0; i < 12; i++) {
tot = tot + (Long.parseLong(String.valueOf(ean.charAt(i))) * (i % 2 == 0 ? 1 : 3));
}
- return tot % 10 == 0 ? "0" : "" +(10-(tot % 10));
+ return tot % 10 == 0 ? "0" : "" + ( 10 - ( tot % 10));
}
}
diff --git a/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityDate.java b/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityDate.java
index f72d8466..2494a6b0 100644
--- a/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityDate.java
+++ b/app/src/main/java/it/integry/integrywmsnative/core/utility/UtilityDate.java
@@ -16,6 +16,7 @@ public class UtilityDate {
public static final String YMD_TIME_SLASH = YMD_SLASH + " hh:mm";
+ public static final String DM_HUMAN = "dd MMM";
public static final String DMY_HUMAN = "dd MMM yyyy";
public static final String DMY_HUMAN_LONG = "dd MMMM yyyy";
}
diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/UltimeConsegneClienteFragment.java b/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/UltimeConsegneClienteFragment.java
index d653b108..f867a612 100644
--- a/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/UltimeConsegneClienteFragment.java
+++ b/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/UltimeConsegneClienteFragment.java
@@ -1,7 +1,6 @@
package it.integry.integrywmsnative.gest.ultime_consegne_cliente;
-import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
@@ -12,16 +11,16 @@ import androidx.appcompat.widget.AppCompatTextView;
import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.Fragment;
import it.integry.integrywmsnative.R;
+import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
-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.databinding.FragmentMainUltimeConsegneClienteBinding;
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.viewmodel.UltimeConsegneClienteViewModel;
-import it.integry.integrywmsnative.gest.vendita.rest.UltimeConsegneClienteRESTConsumer;
+import it.integry.integrywmsnative.ui.ElevatedToolbar;
-public class UltimeConsegneClienteFragment extends Fragment implements ITitledFragment {
+public class UltimeConsegneClienteFragment extends Fragment implements ITitledFragment, IScrollableFragment {
+ private Runnable mOnPreDestroy;
+ private ElevatedToolbar mToolbar;
public UltimeConsegneClienteFragment() {
// Required empty public constructor
@@ -42,14 +41,32 @@ public class UltimeConsegneClienteFragment extends Fragment implements ITitledFr
FragmentMainUltimeConsegneClienteBinding mBinding = DataBindingUtil.inflate(LayoutInflater.from(getActivity()), R.layout.fragment_main_ultime_consegne_cliente, container, false);
- mBinding.setViewmodel(new UltimeConsegneClienteViewModel(getActivity()));
+ mBinding.setViewmodel(new UltimeConsegneClienteViewModel(getActivity(), mBinding));
+
+ mToolbar.setRecyclerView(mBinding.recyclerView);
// Inflate the layout for this fragment
return mBinding.getRoot();
}
+ @Override
+ public void onDestroy() {
+ if(mOnPreDestroy != null) mOnPreDestroy.run();
+ super.onDestroy();
+ }
+
@Override
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
titleText.setText(context.getText(R.string.fragment_ultime_consegne_cliente_title).toString());
}
+
+ @Override
+ public void setScrollToolbar(ElevatedToolbar toolbar) {
+ mToolbar = toolbar;
+ }
+
+ @Override
+ public void setOnPreDestroy(Runnable onPreDestroy) {
+ mOnPreDestroy = onPreDestroy;
+ }
}
diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/dto/CheckableConsegnaClienteDTO.java b/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/dto/CheckableConsegnaClienteDTO.java
new file mode 100644
index 00000000..c85fff50
--- /dev/null
+++ b/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/dto/CheckableConsegnaClienteDTO.java
@@ -0,0 +1,48 @@
+package it.integry.integrywmsnative.gest.ultime_consegne_cliente.dto;
+
+import androidx.databinding.Observable;
+
+import it.integry.integrywmsnative.core.di.BindableBoolean;
+import it.integry.integrywmsnative.gest.vendita.rest.model.ConsegnaClienteDTO;
+
+public class CheckableConsegnaClienteDTO {
+
+ private ConsegnaClienteDTO mItem;
+ private BindableBoolean checked = new BindableBoolean(false);
+
+ public CheckableConsegnaClienteDTO(ConsegnaClienteDTO item) {
+ this.mItem = item;
+ }
+
+ public ConsegnaClienteDTO getItem() {
+ return mItem;
+ }
+
+ public CheckableConsegnaClienteDTO setItem(ConsegnaClienteDTO item) {
+ this.mItem = item;
+ return this;
+ }
+
+ public BindableBoolean getChecked() {
+ return checked;
+ }
+
+ public boolean isChecked() {
+ return checked.get();
+ }
+
+ public CheckableConsegnaClienteDTO setChecked(BindableBoolean checked) {
+ this.checked = checked;
+ return this;
+ }
+
+ public CheckableConsegnaClienteDTO setCheckedValue(boolean value) {
+ this.checked.set(value);
+ return this;
+ }
+
+ public void toggleCheck() {
+ this.checked.set(!this.checked.get());
+ }
+
+}
diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/vendita/rest/UltimeConsegneClienteRESTConsumer.java b/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/rest/UltimeConsegneClienteRESTConsumer.java
similarity index 83%
rename from app/src/main/java/it/integry/integrywmsnative/gest/vendita/rest/UltimeConsegneClienteRESTConsumer.java
rename to app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/rest/UltimeConsegneClienteRESTConsumer.java
index 8e27b687..0f80c12a 100644
--- a/app/src/main/java/it/integry/integrywmsnative/gest/vendita/rest/UltimeConsegneClienteRESTConsumer.java
+++ b/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/rest/UltimeConsegneClienteRESTConsumer.java
@@ -1,4 +1,4 @@
-package it.integry.integrywmsnative.gest.vendita.rest;
+package it.integry.integrywmsnative.gest.ultime_consegne_cliente.rest;
import com.google.gson.reflect.TypeToken;
@@ -15,7 +15,7 @@ import it.integry.integrywmsnative.gest.vendita.rest.model.ConsegnaClienteDTO;
public class UltimeConsegneClienteRESTConsumer {
- public static void getUltimeConsegneClienti(String codMdep, String codAnag, String codMart, RunnableArgs> onComplete, RunnableArgs onFailed) {
+ public static void getUltimeConsegneClienti(String codMdep, String codAnag, String codMart, RunnableArgs> onComplete, RunnableArgs onFailed) {
int numberOfConsegnePerCli = 10;
int numberOfDayToAnalyze = 90;
@@ -29,14 +29,14 @@ public class UltimeConsegneClienteRESTConsumer {
UtilityDB.valueToString(codMdep) + ", " +
UtilityDB.valueToString(numberOfDayToAnalyze) + ") consegne " +
"LEFT OUTER JOIN gtb_anag ON consegne.cod_anag = gtb_anag.cod_anag " +
- "ORDER BY consegne.cod_anag, " +
+ "ORDER BY rag_soc, " +
" counter_consegna ";
Type typeOfObjectsList = new TypeToken>() {}.getType();
- SystemRESTConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback>() {
+ SystemRESTConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback>() {
@Override
- public void onSuccess(List value) {
+ public void onSuccess(ArrayList value) {
if(onComplete != null) onComplete.run(value);
}
diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/viewmodel/UltimeConsegneClienteViewModel.java b/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/viewmodel/UltimeConsegneClienteViewModel.java
index e074a59a..b5b542dd 100644
--- a/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/viewmodel/UltimeConsegneClienteViewModel.java
+++ b/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/viewmodel/UltimeConsegneClienteViewModel.java
@@ -2,24 +2,36 @@ package it.integry.integrywmsnative.gest.ultime_consegne_cliente.viewmodel;
import android.app.ProgressDialog;
import android.content.Context;
+import android.widget.Toast;
+
+import androidx.databinding.ObservableArrayList;
+import androidx.recyclerview.widget.LinearLayoutManager;
+
+import java.util.ArrayList;
+import java.util.List;
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.vendita.rest.UltimeConsegneClienteRESTConsumer;
+import it.integry.integrywmsnative.databinding.FragmentMainUltimeConsegneClienteBinding;
+import it.integry.integrywmsnative.gest.ultime_consegne_cliente.rest.UltimeConsegneClienteRESTConsumer;
+import it.integry.integrywmsnative.gest.vendita.rest.model.ConsegnaClienteDTO;
public class UltimeConsegneClienteViewModel {
private Context mContext;
+ private FragmentMainUltimeConsegneClienteBinding mBinding;
- public UltimeConsegneClienteViewModel(Context context) {
+ public UltimeConsegneClienteViewModel(Context context, FragmentMainUltimeConsegneClienteBinding binding) {
this.mContext = context;
+ this.mBinding = binding;
this.initList();
}
private void initList() {
+
ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
UltimeConsegneClienteRESTConsumer.getUltimeConsegneClienti(
@@ -27,10 +39,29 @@ public class UltimeConsegneClienteViewModel {
null,
null,
consegne -> {
+ this.initDataAdapter(consegne);
+
progressDialog.dismiss();
}, ex -> {
UtilityExceptions.defaultException(mContext, ex, progressDialog);
});
}
+ private void initDataAdapter(ArrayList dataset) {
+ UltimeConsegneMainListAdapter adapter = new UltimeConsegneMainListAdapter(mContext, dataset);
+ adapter.setOnItemClickListener(consegna -> {
+ Toast.makeText(mContext, String.format("Selezionato doc n° %d del %s", consegna.getNumDoc(), consegna.getDataDoc()), Toast.LENGTH_SHORT).show();
+ });
+
+ mBinding.recyclerView.setHasFixedSize(true);
+
+ mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
+
+ mBinding.recyclerView.setAdapter(adapter);
+
+ mBinding.fastscroll.setRecyclerView(mBinding.recyclerView);
+
+ }
+
+
}
diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/viewmodel/UltimeConsegneMainListAdapter.java b/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/viewmodel/UltimeConsegneMainListAdapter.java
new file mode 100644
index 00000000..b46b3285
--- /dev/null
+++ b/app/src/main/java/it/integry/integrywmsnative/gest/ultime_consegne_cliente/viewmodel/UltimeConsegneMainListAdapter.java
@@ -0,0 +1,210 @@
+package it.integry.integrywmsnative.gest.ultime_consegne_cliente.viewmodel;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.core.content.ContextCompat;
+import androidx.core.content.res.ResourcesCompat;
+import androidx.databinding.DataBindingUtil;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.amulyakhare.textdrawable.TextDrawable;
+import com.annimon.stream.Stream;
+import com.zhukic.sectionedrecyclerview.SectionedRecyclerViewAdapter;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.TimeZone;
+
+import it.integry.integrywmsnative.R;
+import it.integry.integrywmsnative.core.utility.UtilityDate;
+import it.integry.integrywmsnative.core.utility.UtilityExceptions;
+import it.integry.integrywmsnative.core.utility.UtilityString;
+import it.integry.integrywmsnative.databinding.FragmentMainUltimeConsegneClienteListHeaderBinding;
+import it.integry.integrywmsnative.databinding.FragmentMainUltimeConsegneClienteListSingleItemBinding;
+import it.integry.integrywmsnative.gest.ultime_consegne_cliente.dto.CheckableConsegnaClienteDTO;
+import it.integry.integrywmsnative.gest.vendita.rest.model.ConsegnaClienteDTO;
+import it.integry.integrywmsnative.ui.fastscroll.SectionTitleProvider;
+
+public class UltimeConsegneMainListAdapter extends SectionedRecyclerViewAdapter implements SectionTitleProvider {
+
+ private Context mContext;
+ private ArrayList mDataset;
+ private ArrayList mSectionTitleItems;
+
+ private OnItemClickListener onItemClickListener;
+
+ private TextDrawable.IShapeBuilder smallIconBuilder;
+ private TextDrawable.IShapeBuilder mediumIconBuilder;
+ private TextDrawable.IShapeBuilder largeIconBuilder;
+
+ @Override
+ public String getSectionTitle(int position) {
+ return this.mSectionTitleItems.get(position);
+ }
+
+
+ public interface OnItemClickListener {
+ void onItemClicked(ConsegnaClienteDTO consegna);
+ }
+
+
+ static class SubheaderHolder extends RecyclerView.ViewHolder {
+
+ FragmentMainUltimeConsegneClienteListHeaderBinding mBinding;
+
+ SubheaderHolder(FragmentMainUltimeConsegneClienteListHeaderBinding binding) {
+ super(binding.getRoot());
+ this.mBinding = binding;
+ }
+
+ }
+
+ static class SingleItemViewHolder extends RecyclerView.ViewHolder {
+
+ FragmentMainUltimeConsegneClienteListSingleItemBinding mBinding;
+
+ SingleItemViewHolder(FragmentMainUltimeConsegneClienteListSingleItemBinding binding) {
+ super(binding.getRoot());
+ this.mBinding = binding;
+ }
+ }
+
+
+
+
+ public UltimeConsegneMainListAdapter(Context context, ArrayList dataset) {
+ super();
+ this.mContext = context;
+ this.mDataset = new ArrayList<>();
+ this.mSectionTitleItems = new ArrayList<>();
+
+ Stream.of(dataset)
+ .map(x -> x.getRagSoc())
+ .distinct()
+ .forEach(x -> {
+ this.mSectionTitleItems.add(String.valueOf(x.charAt(0)));
+
+ Stream.of(dataset)
+ .filter(y -> y.getRagSoc().equalsIgnoreCase(x))
+ .forEach(y -> {
+ this.mSectionTitleItems.add(String.valueOf(x.charAt(0)));
+ });
+ });
+
+
+ this.mDataset = dataset;
+
+ smallIconBuilder = TextDrawable.builder()
+ .beginConfig()
+ .width(40)
+ .height(40)
+ .fontSize(24)
+ .useFont(ResourcesCompat.getFont(mContext, R.font.product_sans_regular))
+ .endConfig();
+
+ mediumIconBuilder = TextDrawable.builder()
+ .beginConfig()
+ .width(40)
+ .height(40)
+ .fontSize(20)
+ .useFont(ResourcesCompat.getFont(mContext, R.font.product_sans_regular))
+ .endConfig();
+
+ largeIconBuilder = TextDrawable.builder()
+ .beginConfig()
+ .width(40)
+ .height(40)
+ .fontSize(16)
+ .useFont(ResourcesCompat.getFont(mContext, R.font.product_sans_regular))
+ .endConfig();
+
+ }
+
+
+ @Override
+ public SingleItemViewHolder onCreateItemViewHolder(ViewGroup parent, int viewType) {
+ FragmentMainUltimeConsegneClienteListSingleItemBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.fragment_main_ultime_consegne_cliente__list_single_item, parent, false);
+ return new SingleItemViewHolder(binding);
+ }
+
+ @Override
+ public SubheaderHolder onCreateSubheaderViewHolder(ViewGroup parent, int viewType) {
+ FragmentMainUltimeConsegneClienteListHeaderBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.fragment_main_ultime_consegne_cliente__list_header, parent, false);
+ return new SubheaderHolder(binding);
+ }
+
+ @Override
+ public void onBindItemViewHolder(final SingleItemViewHolder holder, final int position) {
+ final ConsegnaClienteDTO consegna = this.mDataset.get(position);
+
+ holder.mBinding.descriptionMain.setText(UtilityString.isNullOrEmpty(consegna.getRifOrd()) ? "" : consegna.getRifOrd());
+
+ String numDoc = "" + consegna.getNumDoc();
+
+ if(numDoc.length() <= 2) {
+ holder.mBinding.startIcon.setImageDrawable(smallIconBuilder.buildRound(numDoc, ContextCompat.getColor(mContext, R.color.colorPrimary)));
+ } else if(numDoc.length() == 3) {
+ holder.mBinding.startIcon.setImageDrawable(mediumIconBuilder.buildRound(numDoc, ContextCompat.getColor(mContext, R.color.colorPrimary)));
+ } else if(numDoc.length() == 4) {
+ holder.mBinding.startIcon.setImageDrawable(largeIconBuilder.buildRound(numDoc, ContextCompat.getColor(mContext, R.color.colorPrimary)));
+ }
+
+ try {
+ Date dataDoc = UtilityDate.recognizeDate(consegna.getDataDoc());
+
+ Calendar calendarNow = Calendar.getInstance(TimeZone.getDefault());
+ Calendar calendarDataDoc = Calendar.getInstance(TimeZone.getDefault());
+ calendarDataDoc.setTime(dataDoc);
+
+ String dataDocString = "";
+
+ if(calendarDataDoc.get(Calendar.YEAR) == calendarNow.get(Calendar.YEAR)) {
+ dataDocString = UtilityDate.formatDate(dataDoc, UtilityDate.COMMONS_DATE_FORMATS.DM_HUMAN);
+ } else {
+ dataDocString = UtilityDate.formatDate(dataDoc, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN);
+ }
+
+ holder.mBinding.date.setText(dataDocString);
+
+
+ holder.mBinding.compilatoDa.setText(consegna.getCompilatoDa());
+ holder.mBinding.compilatoDa.setVisibility(UtilityString.isNullOrEmpty(consegna.getCompilatoDa()) ? View.GONE : View.VISIBLE);
+ } catch (Exception ex) {
+ UtilityExceptions.defaultException(mContext, ex);
+ }
+
+ holder.mBinding.getRoot().setOnClickListener(l -> {
+ if(onItemClickListener != null) onItemClickListener.onItemClicked(consegna);
+ });
+ }
+
+ @Override
+ public void onBindSubheaderViewHolder(SubheaderHolder subheaderHolder, int nextItemPosition) {
+ subheaderHolder.mBinding.title.setText(this.mDataset.get(nextItemPosition).getRagSoc());
+ }
+
+ @Override
+ public boolean onPlaceSubheaderBetweenItems(int position) {
+
+ if(!this.mDataset.get(position).getCodAnag().equalsIgnoreCase(this.mDataset.get(position+1).getCodAnag())) {
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ public int getItemSize() {
+ return this.mDataset.size();
+ }
+
+ public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
+ this.onItemClickListener = onItemClickListener;
+ }
+
+}
diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/vendita/rest/model/ConsegnaClienteDTO.java b/app/src/main/java/it/integry/integrywmsnative/gest/vendita/rest/model/ConsegnaClienteDTO.java
index 70d8d9db..b09a29f3 100644
--- a/app/src/main/java/it/integry/integrywmsnative/gest/vendita/rest/model/ConsegnaClienteDTO.java
+++ b/app/src/main/java/it/integry/integrywmsnative/gest/vendita/rest/model/ConsegnaClienteDTO.java
@@ -9,6 +9,9 @@ public class ConsegnaClienteDTO {
private String serDoc;
private int numDoc;
private String ragSoc;
+ private String compilatoDa;
+ private String rifOrd;
+ private String dataord;
public String getCodAnag() {
return codAnag;
@@ -72,4 +75,31 @@ public class ConsegnaClienteDTO {
this.ragSoc = ragSoc;
return this;
}
+
+ public String getCompilatoDa() {
+ return compilatoDa;
+ }
+
+ public ConsegnaClienteDTO setCompilatoDa(String compilatoDa) {
+ this.compilatoDa = compilatoDa;
+ return this;
+ }
+
+ public String getRifOrd() {
+ return rifOrd;
+ }
+
+ public ConsegnaClienteDTO setRifOrd(String rifOrd) {
+ this.rifOrd = rifOrd;
+ return this;
+ }
+
+ public String getDataord() {
+ return dataord;
+ }
+
+ public ConsegnaClienteDTO setDataord(String dataord) {
+ this.dataord = dataord;
+ return this;
+ }
}
diff --git a/app/src/main/java/it/integry/integrywmsnative/gest/vendita_ordine_inevaso/viewmodel/VenditaOrdineInevasoViewModel.java b/app/src/main/java/it/integry/integrywmsnative/gest/vendita_ordine_inevaso/viewmodel/VenditaOrdineInevasoViewModel.java
index 60a94b95..b03fb305 100644
--- a/app/src/main/java/it/integry/integrywmsnative/gest/vendita_ordine_inevaso/viewmodel/VenditaOrdineInevasoViewModel.java
+++ b/app/src/main/java/it/integry/integrywmsnative/gest/vendita_ordine_inevaso/viewmodel/VenditaOrdineInevasoViewModel.java
@@ -697,30 +697,6 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
private void loadMatchedRows(List matchedRows) {
if(matchedRows == null || matchedRows.size() == 0) {
DialogCommon.showNoArtFoundDialog(mActivity, null);
- } else if(matchedRows.size() == 1) {
-
-
- if(matchedRows.get(0).getTempPickData() != null &&
- matchedRows.get(0).getTempPickData().getSourceMtbColt() != null) {
-
- MtbColt tempSourceMtbColt = matchedRows.get(0).getTempPickData().getSourceMtbColt();
-
- if(tempSourceMtbColt.getGestione().equals(matchedRows.get(0).getGestione()) &&
- tempSourceMtbColt.getNumCollo() == matchedRows.get(0).getNumCollo() &&
- tempSourceMtbColt.getSerCollo().equals(matchedRows.get(0).getSerCollo()) &&
- tempSourceMtbColt.getDataColloS().equals(matchedRows.get(0).getDataColloS())) {
-
- onOrdineRowDispatch(matchedRows.get(0));
- } else {
- //Se sto pickando da una UL diversa da quella suggerita allora non te la apro in
- //automatico ma ti mostro il filtro
- applyFilter("");
- refreshOrderBy(false);
- }
-
- } else {
- onOrdineRowDispatch(matchedRows.get(0));
- }
} else {
for(int i = 0; i < mPickingList.size(); i++) {
if(!matchedRows.contains(mPickingList.get(i))) {
@@ -728,10 +704,34 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
}
}
+ if(matchedRows.size() == 1) {
+ if (matchedRows.get(0).getTempPickData() != null &&
+ matchedRows.get(0).getTempPickData().getSourceMtbColt() != null) {
- applyFilter("");
- refreshOrderBy(false);
+ MtbColt tempSourceMtbColt = matchedRows.get(0).getTempPickData().getSourceMtbColt();
+
+ if (tempSourceMtbColt.getGestione().equals(matchedRows.get(0).getGestione()) &&
+ tempSourceMtbColt.getNumCollo() == matchedRows.get(0).getNumCollo() &&
+ tempSourceMtbColt.getSerCollo().equals(matchedRows.get(0).getSerCollo()) &&
+ tempSourceMtbColt.getDataColloS().equals(matchedRows.get(0).getDataColloS())) {
+
+ onOrdineRowDispatch(matchedRows.get(0));
+ } else {
+ //Se sto pickando da una UL diversa da quella suggerita allora non te la apro in
+ //automatico ma ti mostro il filtro
+ applyFilter("");
+ refreshOrderBy(false);
+ }
+
+ } else {
+ onOrdineRowDispatch(matchedRows.get(0));
+ }
+ } else {
+
+ applyFilter("");
+ refreshOrderBy(false);
+ }
}
}
@@ -867,8 +867,15 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
IOrdiniVendita ordiniVendita = ClassRouter.getIstance(ClassRouter.PATH.ORDINI_VENDITA);
ordiniVendita.distribuisciCollo(progress, cloneMtbColt, mTestateOrdini, mtbColts -> {
+
if(mtbColtSessionID != null) ColliDataRecover.closeSession(mtbColtSessionID);
- onComplete.run(mtbColts);
+
+ ColliMagazzinoRESTConsumer.getMultipleByTestate(mtbColts, true, mtbColtsReloaded -> {
+ onComplete.run(mtbColtsReloaded);
+ }, ex -> {
+ UtilityExceptions.defaultException(mActivity, ex, progress);
+ });
+
}, ex -> {
UtilityExceptions.defaultException(mActivity, ex, progress);
});
@@ -981,26 +988,15 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
isFabVisible.set(true);
- if(mtbColt != null && mtbColt.getMtbColr() != null) {
- List mtbColrs = mtbColt.getMtbColr();
+ for(int i = 0; i < this.mPickingList.size(); i++) {
- for (int i = 0; i < mtbColrs.size(); i++) {
+ for(int k = 0; k < this.mPickingList.get(i).getWithdrawRows().size(); k++) {
- MtbColr x = mtbColt.getMtbColr().get(i);
+ MtbColr withdrawRow = this.mPickingList.get(i).getWithdrawRows().get(k);
- Stream.of(this.mPickingList)
- .filter(currentRow ->
- x.getCodMart().equalsIgnoreCase(currentRow.getCodMart()) &&
- ((x.getCodJcom() == null && currentRow.getCodJcom() == null) || (x.getCodJcom() != null && x.getCodJcom().equalsIgnoreCase(currentRow.getCodJcom()))) &&
- (!SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV() || (SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV() && ((x.getPartitaMag() == null && currentRow.getPartitaMag() == null) || (x.getPartitaMag() != null && x.getPartitaMag().equalsIgnoreCase(currentRow.getPartitaMag()))))) &&
- ((x.getNumColloRif() == null && currentRow.getNumCollo() == null) || (x.getNumColloRif() != null && x.getNumColloRif().equals(currentRow.getNumCollo())))
- )
-
- .forEach(currentRow -> {
- currentRow.setQtaCollo(currentRow.getQtaCollo().subtract(x.getQtaCol()));
- currentRow.setQtaOrd(currentRow.getQtaOrd().subtract(x.getQtaCol()));
- });
+ this.mPickingList.get(i).setQtaCollo(this.mPickingList.get(i).getQtaCollo().subtract(withdrawRow.getQtaCol()));
+ this.mPickingList.get(i).setQtaOrd(this.mPickingList.get(i).getQtaOrd().subtract(withdrawRow.getQtaCol()));
}
}
diff --git a/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/FastScroller.java b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/FastScroller.java
new file mode 100644
index 00000000..1d772dbf
--- /dev/null
+++ b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/FastScroller.java
@@ -0,0 +1,294 @@
+package it.integry.integrywmsnative.ui.fastscroll;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.view.View;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import androidx.core.graphics.drawable.DrawableCompat;
+import androidx.core.widget.TextViewCompat;
+import androidx.recyclerview.widget.RecyclerView;
+
+import it.integry.integrywmsnative.R;
+import it.integry.integrywmsnative.ui.fastscroll.viewprovider.DefaultScrollerViewProvider;
+import it.integry.integrywmsnative.ui.fastscroll.viewprovider.ScrollerViewProvider;
+
+/**
+ * Created by mklimczak on 28/07/15.
+ */
+public class FastScroller extends LinearLayout {
+
+ private static final int STYLE_NONE = -1;
+ private final RecyclerViewScrollListener scrollListener = new RecyclerViewScrollListener(this);
+ private RecyclerView recyclerView;
+
+ private View bubble;
+ private View handle;
+ private TextView bubbleTextView;
+
+ private int bubbleOffset;
+ private int handleColor;
+ private int bubbleColor;
+ private int bubbleTextAppearance;
+ private int scrollerOrientation;
+
+ //TODO the name should be fixed, also check if there is a better way of handling the visibility, because this is somewhat convoluted
+ private int maxVisibility;
+
+ private boolean manuallyChangingPosition;
+
+ private ScrollerViewProvider viewProvider;
+ private SectionTitleProvider titleProvider;
+
+ public FastScroller(Context context) {
+ this(context, null);
+ }
+
+ public FastScroller(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public FastScroller(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ setClipChildren(false);
+ TypedArray style = context.obtainStyledAttributes(attrs, R.styleable.fastscroll__fastScroller, R.attr.fastscroll__style, 0);
+ try {
+ bubbleColor = style.getColor(R.styleable.fastscroll__fastScroller_fastscroll__bubbleColor, STYLE_NONE);
+ handleColor = style.getColor(R.styleable.fastscroll__fastScroller_fastscroll__handleColor, STYLE_NONE);
+ bubbleTextAppearance = style.getResourceId(R.styleable.fastscroll__fastScroller_fastscroll__bubbleTextAppearance, STYLE_NONE);
+ } finally {
+ style.recycle();
+ }
+ maxVisibility = getVisibility();
+ setViewProvider(new DefaultScrollerViewProvider());
+ }
+
+ /**
+ * Enables custom layout for {@link FastScroller}.
+ * @param viewProvider A {@link ScrollerViewProvider} for the {@link FastScroller} to use when building layout.
+ */
+ public void setViewProvider(ScrollerViewProvider viewProvider) {
+ removeAllViews();
+ this.viewProvider = viewProvider;
+ viewProvider.setFastScroller(this);
+ bubble = viewProvider.provideBubbleView(this);
+ handle = viewProvider.provideHandleView(this);
+ bubbleTextView = viewProvider.provideBubbleTextView();
+ addView(bubble);
+ addView(handle);
+ }
+
+ /**
+ * Attach the {@link FastScroller} to {@link RecyclerView}. Should be used after the adapter is set
+ * to the {@link RecyclerView}. If the adapter implements SectionTitleProvider, the FastScroller
+ * will show a bubble with title.
+ * @param recyclerView A {@link RecyclerView} to attach the {@link FastScroller} to.
+ */
+ public void setRecyclerView(RecyclerView recyclerView) {
+ this.recyclerView = recyclerView;
+ if(recyclerView.getAdapter() instanceof SectionTitleProvider) titleProvider = (SectionTitleProvider) recyclerView.getAdapter();
+ recyclerView.addOnScrollListener(scrollListener);
+ invalidateVisibility();
+ recyclerView.setOnHierarchyChangeListener(new OnHierarchyChangeListener() {
+ @Override
+ public void onChildViewAdded(View parent, View child) {
+ invalidateVisibility();
+ }
+
+ @Override
+ public void onChildViewRemoved(View parent, View child) {
+ invalidateVisibility();
+ }
+ });
+ }
+
+ /**
+ * Set the orientation of the {@link FastScroller}. The orientation of the {@link FastScroller}
+ * should generally match the orientation of connected {@link RecyclerView} for good UX but it's not enforced.
+ * Note: This method is overridden from {@link LinearLayout#setOrientation(int)} but for {@link FastScroller}
+ * it has a totally different meaning.
+ * @param orientation of the {@link FastScroller}. {@link #VERTICAL} or {@link #HORIZONTAL}
+ */
+ @Override
+ public void setOrientation(int orientation) {
+ scrollerOrientation = orientation;
+ //switching orientation, because orientation in linear layout
+ //is something different than orientation of fast scroller
+ super.setOrientation(orientation == HORIZONTAL ? VERTICAL : HORIZONTAL);
+ }
+
+ /**
+ * Set the background color of the bubble.
+ * @param color Color in hex notation with alpha channel, e.g. 0xFFFFFFFF
+ */
+ public void setBubbleColor(int color) {
+ bubbleColor = color;
+ invalidate();
+ }
+
+ /**
+ * Set the background color of the handle.
+ * @param color Color in hex notation with alpha channel, e.g. 0xFFFFFFFF
+ */
+ public void setHandleColor(int color) {
+ handleColor = color;
+ invalidate();
+ }
+
+ /**
+ * Sets the text appearance of the bubble.
+ * @param textAppearanceResourceId The id of the resource to be used as text appearance of the bubble.
+ */
+ public void setBubbleTextAppearance(int textAppearanceResourceId){
+ bubbleTextAppearance = textAppearanceResourceId;
+ invalidate();
+ }
+
+ /**
+ * Add a {@link it.integry.integrywmsnative.ui.fastscroll.RecyclerViewScrollListener.ScrollerListener}
+ * to be notified of user scrolling
+ * @param listener
+ */
+ public void addScrollerListener(RecyclerViewScrollListener.ScrollerListener listener){
+ scrollListener.addScrollerListener(listener);
+ }
+
+ @Override
+ protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ super.onLayout(changed, l, t, r, b);
+
+ initHandleMovement();
+ bubbleOffset = viewProvider.getBubbleOffset();
+
+ applyStyling(); //TODO this doesn't belong here, even if it works
+
+ if (!isInEditMode()) {
+ //sometimes recycler starts with a defined scroll (e.g. when coming from saved state)
+ scrollListener.updateHandlePosition(recyclerView);
+ }
+
+ }
+
+ private void applyStyling() {
+ if(bubbleColor!=STYLE_NONE) setBackgroundTint(bubbleTextView, bubbleColor);
+ if(handleColor!=STYLE_NONE) setBackgroundTint(handle, handleColor);
+ if(bubbleTextAppearance!=STYLE_NONE) TextViewCompat.setTextAppearance(bubbleTextView, bubbleTextAppearance);
+ }
+
+ private void setBackgroundTint(View view, int color) {
+ final Drawable background = DrawableCompat.wrap(view.getBackground());
+ if(background==null) return;
+ DrawableCompat.setTint(background.mutate(), color);
+ Utils.setBackground(view, background);
+ }
+
+ private void initHandleMovement() {
+ handle.setOnTouchListener(new OnTouchListener() {
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ requestDisallowInterceptTouchEvent(true);
+ if (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_MOVE) {
+ if(titleProvider!=null && event.getAction() == MotionEvent.ACTION_DOWN) viewProvider.onHandleGrabbed();
+ manuallyChangingPosition = true;
+ float relativePos = getRelativeTouchPosition(event);
+ setScrollerPosition(relativePos);
+ setRecyclerViewPosition(relativePos);
+ return true;
+ } else if (event.getAction() == MotionEvent.ACTION_UP) {
+ manuallyChangingPosition = false;
+ if(titleProvider!=null) viewProvider.onHandleReleased();
+ return true;
+ }
+ return false;
+ }
+ });
+ }
+
+ private float getRelativeTouchPosition(MotionEvent event){
+ if(isVertical()){
+ float yInParent = event.getRawY() - Utils.getViewRawY(handle);
+ return yInParent / (getHeight() - handle.getHeight());
+ } else {
+ float xInParent = event.getRawX() - Utils.getViewRawX(handle);
+ return xInParent / (getWidth() - handle.getWidth());
+ }
+ }
+
+ @Override
+ public void setVisibility(int visibility) {
+ maxVisibility = visibility;
+ invalidateVisibility();
+ }
+
+ private void invalidateVisibility() {
+ if(
+ recyclerView.getAdapter()==null ||
+ recyclerView.getAdapter().getItemCount()==0 ||
+ recyclerView.getChildAt(0)==null ||
+ isRecyclerViewNotScrollable() ||
+ maxVisibility != View.VISIBLE
+ ){
+ super.setVisibility(INVISIBLE);
+ } else {
+ super.setVisibility(VISIBLE);
+ }
+ }
+
+ private boolean isRecyclerViewNotScrollable() {
+ if(isVertical()) {
+ return recyclerView.getChildAt(0).getHeight() * recyclerView.getAdapter().getItemCount() <= recyclerView.getHeight();
+ } else {
+ return recyclerView.getChildAt(0).getWidth() * recyclerView.getAdapter().getItemCount() <= recyclerView.getWidth();
+ }
+ }
+
+ private void setRecyclerViewPosition(float relativePos) {
+ if (recyclerView == null) return;
+ int itemCount = recyclerView.getAdapter().getItemCount();
+ int targetPos = (int) Utils.getValueInRange(0, itemCount - 1, (int) (relativePos * (float) itemCount));
+ recyclerView.scrollToPosition(targetPos);
+ if(titleProvider!=null && bubbleTextView!=null) bubbleTextView.setText(titleProvider.getSectionTitle(targetPos));
+ }
+
+ void setScrollerPosition(float relativePos) {
+ if(isVertical()) {
+ bubble.setY(Utils.getValueInRange(
+ 0,
+ getHeight() - bubble.getHeight(),
+ relativePos * (getHeight() - handle.getHeight()) + bubbleOffset)
+ );
+ handle.setY(Utils.getValueInRange(
+ 0,
+ getHeight() - handle.getHeight(),
+ relativePos * (getHeight() - handle.getHeight()))
+ );
+ } else {
+ bubble.setX(Utils.getValueInRange(
+ 0,
+ getWidth() - bubble.getWidth(),
+ relativePos * (getWidth() - handle.getWidth()) + bubbleOffset)
+ );
+ handle.setX(Utils.getValueInRange(
+ 0,
+ getWidth() - handle.getWidth(),
+ relativePos * (getWidth() - handle.getWidth()))
+ );
+ }
+ }
+
+ public boolean isVertical(){
+ return scrollerOrientation == VERTICAL;
+ }
+
+ boolean shouldUpdateHandlePosition() {
+ return handle!=null && !manuallyChangingPosition && recyclerView.getChildCount() > 0;
+ }
+
+ ScrollerViewProvider getViewProvider() {
+ return viewProvider;
+ }
+}
diff --git a/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/RecyclerViewScrollListener.java b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/RecyclerViewScrollListener.java
new file mode 100644
index 00000000..9d70508f
--- /dev/null
+++ b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/RecyclerViewScrollListener.java
@@ -0,0 +1,71 @@
+package it.integry.integrywmsnative.ui.fastscroll;
+
+import androidx.recyclerview.widget.RecyclerView;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Michal on 04/08/16.
+ * Responsible for updating the handle / bubble position when user scrolls the {@link android.support.v7.widget.RecyclerView}.
+ */
+public class RecyclerViewScrollListener extends RecyclerView.OnScrollListener {
+
+ private final FastScroller scroller;
+ List listeners = new ArrayList<>();
+ int oldScrollState = RecyclerView.SCROLL_STATE_IDLE;
+
+ public RecyclerViewScrollListener(FastScroller scroller) {
+ this.scroller = scroller;
+ }
+
+ public void addScrollerListener(ScrollerListener listener){
+ listeners.add(listener);
+ }
+
+ @Override
+ public void onScrollStateChanged(RecyclerView recyclerView, int newScrollState) {
+ super.onScrollStateChanged(recyclerView, newScrollState);
+ if(newScrollState==RecyclerView.SCROLL_STATE_IDLE && oldScrollState!=RecyclerView.SCROLL_STATE_IDLE){
+ scroller.getViewProvider().onScrollFinished();
+ } else if(newScrollState!=RecyclerView.SCROLL_STATE_IDLE && oldScrollState==RecyclerView.SCROLL_STATE_IDLE){
+ scroller.getViewProvider().onScrollStarted();
+ }
+ oldScrollState = newScrollState;
+ }
+
+ @Override
+ public void onScrolled(RecyclerView rv, int dx, int dy) {
+ if(scroller.shouldUpdateHandlePosition()) {
+ updateHandlePosition(rv);
+ }
+ }
+
+ void updateHandlePosition(RecyclerView rv) {
+ float relativePos;
+ if(rv != null) {
+ if (scroller.isVertical()) {
+ int offset = rv.computeVerticalScrollOffset();
+ int extent = rv.computeVerticalScrollExtent();
+ int range = rv.computeVerticalScrollRange();
+ relativePos = offset / (float) (range - extent);
+ } else {
+ int offset = rv.computeHorizontalScrollOffset();
+ int extent = rv.computeHorizontalScrollExtent();
+ int range = rv.computeHorizontalScrollRange();
+ relativePos = offset / (float) (range - extent);
+ }
+ scroller.setScrollerPosition(relativePos);
+ notifyListeners(relativePos);
+ }
+ }
+
+ public void notifyListeners(float relativePos){
+ for(ScrollerListener listener : listeners) listener.onScroll(relativePos);
+ }
+
+ public interface ScrollerListener {
+ void onScroll(float relativePos);
+ }
+
+}
diff --git a/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/SectionTitleProvider.java b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/SectionTitleProvider.java
new file mode 100644
index 00000000..a4ed50c2
--- /dev/null
+++ b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/SectionTitleProvider.java
@@ -0,0 +1,17 @@
+package it.integry.integrywmsnative.ui.fastscroll;
+
+/**
+ * Created by mklimczak on 31/07/15.
+ */
+public interface SectionTitleProvider{
+
+ /**
+ * Should be implemented by the adapter of the RecyclerView.
+ * Provides a text to be shown by the bubble, when RecyclerView reaches
+ * the position. Usually the first letter of the text shown by the item
+ * at this position.
+ * @param position Position of the row in adapter
+ * @return The text to be shown in the bubble
+ */
+ String getSectionTitle(int position);
+}
diff --git a/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/Utils.java b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/Utils.java
new file mode 100644
index 00000000..dfc34420
--- /dev/null
+++ b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/Utils.java
@@ -0,0 +1,41 @@
+package it.integry.integrywmsnative.ui.fastscroll;
+
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.view.View;
+
+/**
+ * Created by mklimczak on 31/07/15.
+ */
+public class Utils {
+
+ public static float getViewRawY(View view) {
+ int[] location = new int[2];
+ location[0] = 0;
+ location[1] = (int) view.getY();
+ ((View)view.getParent()).getLocationInWindow(location);
+ return location[1];
+ }
+
+ public static float getViewRawX(View view) {
+ int[] location = new int[2];
+ location[0] = (int) view.getX();
+ location[1] = 0;
+ ((View)view.getParent()).getLocationInWindow(location);
+ return location[0];
+ }
+
+ public static float getValueInRange(float min, float max, float value) {
+ float minimum = Math.max(min, value);
+ return Math.min(minimum, max);
+ }
+
+ public static void setBackground(View view, Drawable drawable){
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
+ view.setBackground(drawable);
+ } else {
+ view.setBackgroundDrawable(drawable);
+ }
+ }
+
+}
diff --git a/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/DefaultBubbleBehavior.java b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/DefaultBubbleBehavior.java
new file mode 100644
index 00000000..63cc97e7
--- /dev/null
+++ b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/DefaultBubbleBehavior.java
@@ -0,0 +1,34 @@
+package it.integry.integrywmsnative.ui.fastscroll.viewprovider;
+
+/**
+ * Created by Michal on 11/08/16.
+ */
+public class DefaultBubbleBehavior implements ViewBehavior {
+
+ private final VisibilityAnimationManager animationManager;
+
+ public DefaultBubbleBehavior(VisibilityAnimationManager animationManager) {
+ this.animationManager = animationManager;
+ }
+
+ @Override
+ public void onHandleGrabbed() {
+ animationManager.show();
+ }
+
+ @Override
+ public void onHandleReleased() {
+ animationManager.hide();
+ }
+
+ @Override
+ public void onScrollStarted() {
+
+ }
+
+ @Override
+ public void onScrollFinished() {
+
+ }
+
+}
diff --git a/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/DefaultScrollerViewProvider.java b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/DefaultScrollerViewProvider.java
new file mode 100644
index 00000000..6bd2ae57
--- /dev/null
+++ b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/DefaultScrollerViewProvider.java
@@ -0,0 +1,66 @@
+package it.integry.integrywmsnative.ui.fastscroll.viewprovider;
+
+import android.graphics.drawable.InsetDrawable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import androidx.core.content.ContextCompat;
+
+import it.integry.integrywmsnative.R;
+import it.integry.integrywmsnative.ui.fastscroll.Utils;
+
+/**
+ * Created by Michal on 05/08/16.
+ */
+public class DefaultScrollerViewProvider extends ScrollerViewProvider {
+
+ protected View bubble;
+ protected View handle;
+
+ @Override
+ public View provideHandleView(ViewGroup container) {
+ handle = new View(getContext());
+
+ int verticalInset = getScroller().isVertical() ? 0 : getContext().getResources().getDimensionPixelSize(R.dimen.fastscroll__handle_inset);
+ int horizontalInset = !getScroller().isVertical() ? 0 : getContext().getResources().getDimensionPixelSize(R.dimen.fastscroll__handle_inset);
+ InsetDrawable handleBg = new InsetDrawable(ContextCompat.getDrawable(getContext(), R.drawable.fastscroll__default_handle), horizontalInset, verticalInset, horizontalInset, verticalInset);
+ Utils.setBackground(handle, handleBg);
+
+ int handleWidth = getContext().getResources().getDimensionPixelSize(getScroller().isVertical() ? R.dimen.fastscroll__handle_clickable_width : R.dimen.fastscroll__handle_height);
+ int handleHeight = getContext().getResources().getDimensionPixelSize(getScroller().isVertical() ? R.dimen.fastscroll__handle_height : R.dimen.fastscroll__handle_clickable_width);
+ ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(handleWidth, handleHeight);
+ handle.setLayoutParams(params);
+
+ return handle;
+ }
+
+ @Override
+ public View provideBubbleView(ViewGroup container) {
+ bubble = LayoutInflater.from(getContext()).inflate(R.layout.fastscroll__default_bubble, container, false);
+ return bubble;
+ }
+
+ @Override
+ public TextView provideBubbleTextView() {
+ return (TextView) bubble;
+ }
+
+ @Override
+ public int getBubbleOffset() {
+ return (int) (getScroller().isVertical() ? ((float)handle.getHeight()/2f)-bubble.getHeight() : ((float)handle.getWidth()/2f)-bubble.getWidth());
+ }
+
+ @Override
+ protected ViewBehavior provideHandleBehavior() {
+ return null;
+ }
+
+ @Override
+ protected ViewBehavior provideBubbleBehavior() {
+ return new DefaultBubbleBehavior(new VisibilityAnimationManager.Builder(bubble).withPivotX(1f).withPivotY(1f).build());
+ }
+
+
+}
diff --git a/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/ScrollerViewProvider.java b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/ScrollerViewProvider.java
new file mode 100644
index 00000000..60316f4f
--- /dev/null
+++ b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/ScrollerViewProvider.java
@@ -0,0 +1,95 @@
+package it.integry.integrywmsnative.ui.fastscroll.viewprovider;
+
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import androidx.annotation.Nullable;
+
+import it.integry.integrywmsnative.ui.fastscroll.FastScroller;
+
+/**
+ * Created by Michal on 05/08/16.
+ * Provides {@link View}s and their behaviors for the handle and bubble of the fastscroller.
+ */
+public abstract class ScrollerViewProvider {
+
+ private FastScroller scroller;
+ private ViewBehavior handleBehavior;
+ private ViewBehavior bubbleBehavior;
+
+ public void setFastScroller(FastScroller scroller){
+ this.scroller = scroller;
+ }
+
+ protected Context getContext(){
+ return scroller.getContext();
+ }
+
+ protected FastScroller getScroller() {
+ return scroller;
+ }
+
+ /**
+ * @param container The container {@link FastScroller} for the view to inflate properly.
+ * @return A view which will be by the {@link FastScroller} used as a handle.
+ */
+ public abstract View provideHandleView(ViewGroup container);
+
+ /**
+ * @param container The container {@link FastScroller} for the view to inflate properly.
+ * @return A view which will be by the {@link FastScroller} used as a bubble.
+ */
+ public abstract View provideBubbleView(ViewGroup container);
+
+ /**
+ * Bubble view has to provide a {@link TextView} that will show the index title.
+ * @return A {@link TextView} that will hold the index title.
+ */
+ public abstract TextView provideBubbleTextView();
+
+ /**
+ * To offset the position of the bubble relative to the handle. E.g. in {@link DefaultScrollerViewProvider}
+ * the sharp corner of the bubble is aligned with the center of the handle.
+ * @return the position of the bubble in relation to the handle (according to the orientation).
+ */
+ public abstract int getBubbleOffset();
+
+ @Nullable
+ protected abstract ViewBehavior provideHandleBehavior();
+
+ @Nullable
+ protected abstract ViewBehavior provideBubbleBehavior();
+
+ protected ViewBehavior getHandleBehavior(){
+ if(handleBehavior==null) handleBehavior = provideHandleBehavior();
+ return handleBehavior;
+ }
+
+ protected ViewBehavior getBubbleBehavior(){
+ if(bubbleBehavior==null) bubbleBehavior = provideBubbleBehavior();
+ return bubbleBehavior;
+ }
+
+ public void onHandleGrabbed(){
+ if(getHandleBehavior()!=null) getHandleBehavior().onHandleGrabbed();
+ if(getBubbleBehavior()!=null) getBubbleBehavior().onHandleGrabbed();
+ }
+
+ public void onHandleReleased(){
+ if(getHandleBehavior()!=null) getHandleBehavior().onHandleReleased();
+ if(getBubbleBehavior()!=null) getBubbleBehavior().onHandleReleased();
+ }
+
+ public void onScrollStarted(){
+ if(getHandleBehavior()!=null) getHandleBehavior().onScrollStarted();
+ if(getBubbleBehavior()!=null) getBubbleBehavior().onScrollStarted();
+ }
+
+ public void onScrollFinished(){
+ if(getHandleBehavior()!=null) getHandleBehavior().onScrollFinished();
+ if(getBubbleBehavior()!=null) getBubbleBehavior().onScrollFinished();
+ }
+
+}
diff --git a/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/ViewBehavior.java b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/ViewBehavior.java
new file mode 100644
index 00000000..61780057
--- /dev/null
+++ b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/ViewBehavior.java
@@ -0,0 +1,14 @@
+package it.integry.integrywmsnative.ui.fastscroll.viewprovider;
+
+/**
+ * Created by Michal on 11/08/16.
+ * Extending classes should use this interface to get notified about events that occur to the
+ * fastscroller elements (handle and bubble) and react accordingly. See {@link DefaultBubbleBehavior}
+ * for an example.
+ */
+public interface ViewBehavior {
+ void onHandleGrabbed();
+ void onHandleReleased();
+ void onScrollStarted();
+ void onScrollFinished();
+}
diff --git a/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/VisibilityAnimationManager.java b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/VisibilityAnimationManager.java
new file mode 100644
index 00000000..5ce233a1
--- /dev/null
+++ b/app/src/main/java/it/integry/integrywmsnative/ui/fastscroll/viewprovider/VisibilityAnimationManager.java
@@ -0,0 +1,130 @@
+package it.integry.integrywmsnative.ui.fastscroll.viewprovider;
+
+import android.animation.Animator;
+import android.animation.AnimatorInflater;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.AnimatorSet;
+import android.view.View;
+
+import androidx.annotation.AnimatorRes;
+
+import it.integry.integrywmsnative.R;
+
+/**
+ * Created by Michal on 05/08/16.
+ * Animates showing and hiding elements of the {@link it.integry.integrywmsnative.ui.fastscroll.FastScroller} (handle and bubble).
+ * The decision when to show/hide the element should be implemented via {@link ViewBehavior}.
+ */
+public class VisibilityAnimationManager {
+
+ protected final View view;
+
+ protected AnimatorSet hideAnimator;
+ protected AnimatorSet showAnimator;
+
+ private float pivotXRelative;
+ private float pivotYRelative;
+
+ protected VisibilityAnimationManager(final View view, @AnimatorRes int showAnimator, @AnimatorRes int hideAnimator, float pivotXRelative, float pivotYRelative, int hideDelay){
+ this.view = view;
+ this.pivotXRelative = pivotXRelative;
+ this.pivotYRelative = pivotYRelative;
+ this.hideAnimator = (AnimatorSet) AnimatorInflater.loadAnimator(view.getContext(), hideAnimator);
+ this.hideAnimator.setStartDelay(hideDelay);
+ this.hideAnimator.setTarget(view);
+ this.showAnimator = (AnimatorSet) AnimatorInflater.loadAnimator(view.getContext(), showAnimator);
+ this.showAnimator.setTarget(view);
+ this.hideAnimator.addListener(new AnimatorListenerAdapter() {
+
+ //because onAnimationEnd() goes off even for canceled animations
+ boolean wasCanceled;
+
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ super.onAnimationEnd(animation);
+ if(!wasCanceled) view.setVisibility(View.INVISIBLE);
+ wasCanceled = false;
+ }
+
+ @Override
+ public void onAnimationCancel(Animator animation) {
+ super.onAnimationCancel(animation);
+ wasCanceled = true;
+ }
+ });
+
+ updatePivot();
+ }
+
+ public void show(){
+ hideAnimator.cancel();
+ if (view.getVisibility() == View.INVISIBLE) {
+ view.setVisibility(View.VISIBLE);
+ updatePivot();
+ showAnimator.start();
+ }
+ }
+
+ public void hide(){
+ updatePivot();
+ hideAnimator.start();
+ }
+
+ protected void updatePivot() {
+ view.setPivotX(pivotXRelative*view.getMeasuredWidth());
+ view.setPivotY(pivotYRelative*view.getMeasuredHeight());
+ }
+
+ public static abstract class AbsBuilder {
+ protected final View view;
+ protected int showAnimatorResource = R.animator.fastscroll__default_show;
+ protected int hideAnimatorResource = R.animator.fastscroll__default_hide;
+ protected int hideDelay = 1000;
+ protected float pivotX = 0.5f;
+ protected float pivotY = 0.5f;
+
+ public AbsBuilder(View view) {
+ this.view = view;
+ }
+
+ public AbsBuilder withShowAnimator(@AnimatorRes int showAnimatorResource){
+ this.showAnimatorResource = showAnimatorResource;
+ return this;
+ }
+
+ public AbsBuilder withHideAnimator(@AnimatorRes int hideAnimatorResource){
+ this.hideAnimatorResource = hideAnimatorResource;
+ return this;
+ }
+
+ public AbsBuilder withHideDelay(int hideDelay){
+ this.hideDelay = hideDelay;
+ return this;
+ }
+
+ public AbsBuilder withPivotX(float pivotX){
+ this.pivotX = pivotX;
+ return this;
+ }
+
+ public AbsBuilder withPivotY(float pivotY){
+ this.pivotY = pivotY;
+ return this;
+ }
+
+ public abstract T build();
+ }
+
+ public static class Builder extends AbsBuilder {
+
+ public Builder(View view) {
+ super(view);
+ }
+
+ public VisibilityAnimationManager build(){
+ return new VisibilityAnimationManager(view, showAnimatorResource, hideAnimatorResource, pivotX, pivotY, hideDelay);
+ }
+
+ }
+
+}
diff --git a/app/src/main/res/animator/fastscroll__default_hide.xml b/app/src/main/res/animator/fastscroll__default_hide.xml
new file mode 100644
index 00000000..fa1f1f8f
--- /dev/null
+++ b/app/src/main/res/animator/fastscroll__default_hide.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/animator/fastscroll__default_show.xml b/app/src/main/res/animator/fastscroll__default_show.xml
new file mode 100644
index 00000000..3aeb7970
--- /dev/null
+++ b/app/src/main/res/animator/fastscroll__default_show.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/fast_scroll_thumb.xml b/app/src/main/res/drawable/fast_scroll_thumb.xml
new file mode 100644
index 00000000..0f7e1449
--- /dev/null
+++ b/app/src/main/res/drawable/fast_scroll_thumb.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/fastscroll__default_bubble.xml b/app/src/main/res/drawable/fastscroll__default_bubble.xml
new file mode 100644
index 00000000..665e26bf
--- /dev/null
+++ b/app/src/main/res/drawable/fastscroll__default_bubble.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/fastscroll__default_handle.xml b/app/src/main/res/drawable/fastscroll__default_handle.xml
new file mode 100644
index 00000000..2e0a0ddf
--- /dev/null
+++ b/app/src/main/res/drawable/fastscroll__default_handle.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/gray_detail_background_round4.xml b/app/src/main/res/drawable/gray_detail_background_round4.xml
new file mode 100644
index 00000000..885d9a58
--- /dev/null
+++ b/app/src/main/res/drawable/gray_detail_background_round4.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/font/product_sans_black.ttf b/app/src/main/res/font/product_sans_black.ttf
new file mode 100644
index 00000000..5864e269
Binary files /dev/null and b/app/src/main/res/font/product_sans_black.ttf differ
diff --git a/app/src/main/res/font/product_sans_black_italic.ttf b/app/src/main/res/font/product_sans_black_italic.ttf
new file mode 100644
index 00000000..869037b7
Binary files /dev/null and b/app/src/main/res/font/product_sans_black_italic.ttf differ
diff --git a/app/src/main/res/font/product_sans_bold.ttf b/app/src/main/res/font/product_sans_bold.ttf
new file mode 100644
index 00000000..96619df9
Binary files /dev/null and b/app/src/main/res/font/product_sans_bold.ttf differ
diff --git a/app/src/main/res/font/product_sans_bold_italic.ttf b/app/src/main/res/font/product_sans_bold_italic.ttf
new file mode 100644
index 00000000..bdd22b04
Binary files /dev/null and b/app/src/main/res/font/product_sans_bold_italic.ttf differ
diff --git a/app/src/main/res/font/product_sans_italic.ttf b/app/src/main/res/font/product_sans_italic.ttf
new file mode 100644
index 00000000..5b44037b
Binary files /dev/null and b/app/src/main/res/font/product_sans_italic.ttf differ
diff --git a/app/src/main/res/font/product_sans_light.ttf b/app/src/main/res/font/product_sans_light.ttf
new file mode 100644
index 00000000..33de1c39
Binary files /dev/null and b/app/src/main/res/font/product_sans_light.ttf differ
diff --git a/app/src/main/res/font/product_sans_light_italic.ttf b/app/src/main/res/font/product_sans_light_italic.ttf
new file mode 100644
index 00000000..00c76b8e
Binary files /dev/null and b/app/src/main/res/font/product_sans_light_italic.ttf differ
diff --git a/app/src/main/res/font/product_sans_medium.ttf b/app/src/main/res/font/product_sans_medium.ttf
new file mode 100644
index 00000000..fd818d6f
Binary files /dev/null and b/app/src/main/res/font/product_sans_medium.ttf differ
diff --git a/app/src/main/res/font/product_sans_medium_italic.ttf b/app/src/main/res/font/product_sans_medium_italic.ttf
new file mode 100644
index 00000000..ec70cd38
Binary files /dev/null and b/app/src/main/res/font/product_sans_medium_italic.ttf differ
diff --git a/app/src/main/res/font/product_sans_regular.ttf b/app/src/main/res/font/product_sans_regular.ttf
new file mode 100644
index 00000000..e2c69c3f
Binary files /dev/null and b/app/src/main/res/font/product_sans_regular.ttf differ
diff --git a/app/src/main/res/font/product_sans_thin.ttf b/app/src/main/res/font/product_sans_thin.ttf
new file mode 100644
index 00000000..5e046b53
Binary files /dev/null and b/app/src/main/res/font/product_sans_thin.ttf differ
diff --git a/app/src/main/res/font/product_sans_thin_italic.ttf b/app/src/main/res/font/product_sans_thin_italic.ttf
new file mode 100644
index 00000000..7b049551
Binary files /dev/null and b/app/src/main/res/font/product_sans_thin_italic.ttf differ
diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml
index 522ff40a..0398c667 100644
--- a/app/src/main/res/layout/app_bar_main.xml
+++ b/app/src/main/res/layout/app_bar_main.xml
@@ -47,7 +47,6 @@
android:layout_height="wrap_content"
android:text="@string/integry"
android:layout_marginStart="8dp"
- android:letterSpacing="-0.05"
style="@style/AppTheme.NewMaterial.Text.ToolbarTitle"
android:layout_gravity="center"/>
@@ -59,7 +58,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
- android:letterSpacing="-0.05"
android:visibility="gone"
style="@style/AppTheme.NewMaterial.Text.ToolbarTitle"/>
diff --git a/app/src/main/res/layout/dialog_base.xml b/app/src/main/res/layout/dialog_base.xml
index 99ac0787..cb689176 100644
--- a/app/src/main/res/layout/dialog_base.xml
+++ b/app/src/main/res/layout/dialog_base.xml
@@ -129,6 +129,7 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="@id/left_buttons_guideline"
app:layout_constraintEnd_toStartOf="@id/right_buttons_guideline"
+ app:strokeColor="@color/colorPrimary"
android:onClick="@{() -> viewmodel.onNeutralClick()}"
android:text="@string/abort"/>
@@ -171,6 +172,7 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/center_guideline"
+ app:strokeColor="@color/colorPrimary"
android:onClick="@{() -> viewmodel.onNegativeClick()}"
android:text="@string/no"/>
diff --git a/app/src/main/res/layout/fastscroll__default_bubble.xml b/app/src/main/res/layout/fastscroll__default_bubble.xml
new file mode 100644
index 00000000..8eca9cf5
--- /dev/null
+++ b/app/src/main/res/layout/fastscroll__default_bubble.xml
@@ -0,0 +1,13 @@
+
+
diff --git a/app/src/main/res/layout/fragment_articoli_in_collo_bottom_sheet.xml b/app/src/main/res/layout/fragment_articoli_in_collo_bottom_sheet.xml
index 03bbee62..5c256fbc 100644
--- a/app/src/main/res/layout/fragment_articoli_in_collo_bottom_sheet.xml
+++ b/app/src/main/res/layout/fragment_articoli_in_collo_bottom_sheet.xml
@@ -57,19 +57,32 @@
android:textAllCaps="true"
android:textSize="16sp"/>
-