Aggiunto supporto ad Honeywell EDA51
This commit is contained in:
parent
6877cce9ad
commit
0c4a6d5eaf
2
.idea/runConfigurations/app.xml
generated
2
.idea/runConfigurations/app.xml
generated
@ -6,7 +6,7 @@
|
|||||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||||
<option name="ARTIFACT_NAME" value="" />
|
<option name="ARTIFACT_NAME" value="" />
|
||||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||||
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="dynamic__base,dynamic_ime" />
|
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="dynamic_ime,dynamic_vgalimenti" />
|
||||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||||
<option name="MODE" value="default_activity" />
|
<option name="MODE" value="default_activity" />
|
||||||
<option name="CLEAR_LOGCAT" value="true" />
|
<option name="CLEAR_LOGCAT" value="true" />
|
||||||
|
|||||||
@ -9,11 +9,14 @@
|
|||||||
android:background="@color/full_white"
|
android:background="@color/full_white"
|
||||||
tools:context=".gest.main.MainFragment">
|
tools:context=".gest.main.MainFragment">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
|
||||||
<net.cachapa.expandablelayout.ExpandableLayout
|
<net.cachapa.expandablelayout.ExpandableLayout
|
||||||
android:id="@+id/no_connection_top_layout"
|
android:id="@+id/no_connection_top_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -55,12 +58,14 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_margin="12dp"
|
||||||
android:gravity="center_horizontal">
|
app:cardElevation="4dp"
|
||||||
|
app:cardCornerRadius="8dp">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -184,136 +189,13 @@
|
|||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--<androidx.constraintlayout.widget.ConstraintLayout-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:padding="8dp">-->
|
|
||||||
|
|
||||||
<!--<androidx.constraintlayout.widget.Guideline-->
|
|
||||||
<!--android:id="@+id/guide_2"-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:orientation="vertical"-->
|
|
||||||
<!--app:layout_constraintGuide_percent="0.5"/>-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--<TextView-->
|
|
||||||
<!--android:id="@+id/prod_dashboard_group_title"-->
|
|
||||||
<!--style="@style/AppTheme.NewMaterial.Text.TextBoxGroupTitleDashboard"-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--app:layout_constraintTop_toTopOf="parent"-->
|
|
||||||
<!--android:text="@string/production" />-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--<RelativeLayout-->
|
|
||||||
<!--android:id="@+id/fast_button_prod_versamento_materiale"-->
|
|
||||||
<!--android:layout_width="0dp"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--app:layout_constraintTop_toBottomOf="@id/prod_dashboard_group_title"-->
|
|
||||||
<!--app:layout_constraintStart_toStartOf="parent"-->
|
|
||||||
<!--app:layout_constraintEnd_toStartOf="@id/guide_2">-->
|
|
||||||
|
|
||||||
<!--<com.google.android.material.card.MaterialCardView-->
|
|
||||||
<!--style="@style/Widget.MaterialComponents.CardView"-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:layout_margin="8dp"-->
|
|
||||||
<!--app:cardBackgroundColor="@android:color/white"-->
|
|
||||||
<!--app:cardCornerRadius="4dp">-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--<LinearLayout-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:gravity="center_horizontal"-->
|
|
||||||
<!--android:orientation="vertical"-->
|
|
||||||
<!--android:padding="8dp">-->
|
|
||||||
|
|
||||||
<!--<ImageView-->
|
|
||||||
<!--android:layout_width="64sp"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:adjustViewBounds="true"-->
|
|
||||||
<!--android:src="@drawable/ic_dashboard_prod_versamento_materiale" />-->
|
|
||||||
|
|
||||||
<!--<androidx.appcompat.widget.AppCompatTextView-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:layout_marginTop="16dp"-->
|
|
||||||
<!--android:gravity="center_horizontal"-->
|
|
||||||
<!--android:text="@string/prod_versamento_materiale_title_fragment"-->
|
|
||||||
<!--android:textAllCaps="true"-->
|
|
||||||
<!--android:textColor="@color/gray_700"-->
|
|
||||||
<!--android:textStyle="bold" />-->
|
|
||||||
|
|
||||||
<!--</LinearLayout>-->
|
|
||||||
<!--</com.google.android.material.card.MaterialCardView>-->
|
|
||||||
<!--</RelativeLayout>-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--<RelativeLayout-->
|
|
||||||
<!--android:id="@+id/fast_button_prod_recupero_materiale"-->
|
|
||||||
<!--android:layout_width="0dp"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--app:layout_constraintTop_toBottomOf="@id/prod_dashboard_group_title"-->
|
|
||||||
<!--app:layout_constraintStart_toEndOf="@id/guide_2"-->
|
|
||||||
<!--app:layout_constraintEnd_toEndOf="parent">-->
|
|
||||||
|
|
||||||
<!--<com.google.android.material.card.MaterialCardView-->
|
|
||||||
<!--style="@style/Widget.MaterialComponents.CardView"-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:layout_margin="8dp"-->
|
|
||||||
<!--app:cardBackgroundColor="@android:color/white"-->
|
|
||||||
<!--app:cardCornerRadius="4dp">-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--<LinearLayout-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:gravity="center_horizontal"-->
|
|
||||||
<!--android:orientation="vertical"-->
|
|
||||||
<!--android:padding="8dp">-->
|
|
||||||
|
|
||||||
<!--<ImageView-->
|
|
||||||
<!--android:layout_width="64sp"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:adjustViewBounds="true"-->
|
|
||||||
<!--android:src="@drawable/ic_dashboard_prod_recupero_materiale" />-->
|
|
||||||
|
|
||||||
<!--<androidx.appcompat.widget.AppCompatTextView-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:layout_marginTop="16dp"-->
|
|
||||||
<!--android:gravity="center_horizontal"-->
|
|
||||||
<!--android:text="@string/prod_recupero_materiale_title_fragment"-->
|
|
||||||
<!--android:textAllCaps="true"-->
|
|
||||||
<!--android:textColor="@color/gray_700"-->
|
|
||||||
<!--android:textStyle="bold" />-->
|
|
||||||
|
|
||||||
<!--</LinearLayout>-->
|
|
||||||
<!--</com.google.android.material.card.MaterialCardView>-->
|
|
||||||
|
|
||||||
<!--</RelativeLayout>-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--</androidx.constraintlayout.widget.ConstraintLayout>-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
</layout>
|
</layout>
|
||||||
@ -17,7 +17,9 @@ import com.honeywell.aidc.InvalidScannerNameException;
|
|||||||
import com.honeywell.aidc.ScannerUnavailableException;
|
import com.honeywell.aidc.ScannerUnavailableException;
|
||||||
import com.honeywell.aidc.UnsupportedPropertyException;
|
import com.honeywell.aidc.UnsupportedPropertyException;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import it.integry.plugins.barcode_base_library.exception.BarcodeAdapterNotFoundException;
|
import it.integry.plugins.barcode_base_library.exception.BarcodeAdapterNotFoundException;
|
||||||
@ -43,7 +45,11 @@ public class HoneyWellBarcodeReader implements BarcodeReaderInterface {
|
|||||||
@Override
|
@Override
|
||||||
public boolean isRightAdapter() {
|
public boolean isRightAdapter() {
|
||||||
String model = Build.MODEL;
|
String model = Build.MODEL;
|
||||||
if(model.equalsIgnoreCase("EDA50")) {
|
List<String> compatibleModels = new ArrayList<String>();
|
||||||
|
compatibleModels.add("EDA50");
|
||||||
|
compatibleModels.add("EDA51");
|
||||||
|
|
||||||
|
if(compatibleModels.contains(model)) {
|
||||||
return true;
|
return true;
|
||||||
} else return false;
|
} else return false;
|
||||||
}
|
}
|
||||||
@ -52,27 +58,23 @@ public class HoneyWellBarcodeReader implements BarcodeReaderInterface {
|
|||||||
public void init(final Runnable onDeviceReady) throws BarcodeAdapterNotFoundException {
|
public void init(final Runnable onDeviceReady) throws BarcodeAdapterNotFoundException {
|
||||||
if(isRightAdapter()) {
|
if(isRightAdapter()) {
|
||||||
|
|
||||||
AidcManager.create(mContext, new AidcManager.CreatedCallback() {
|
AidcManager.create(mContext, aidcManager -> {
|
||||||
|
|
||||||
@Override
|
manager = aidcManager;
|
||||||
public void onCreated(AidcManager aidcManager) {
|
|
||||||
|
|
||||||
manager = aidcManager;
|
try{
|
||||||
|
barcodeReader = manager.createBarcodeReader();
|
||||||
try{
|
registerListenersInternal();
|
||||||
barcodeReader = manager.createBarcodeReader();
|
|
||||||
registerListenersInternal();
|
|
||||||
}
|
|
||||||
catch (InvalidScannerNameException e){
|
|
||||||
Toast.makeText(mContext, "Invalid Scanner Name Exception: " + e.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
catch (Exception e){
|
|
||||||
Toast.makeText(mContext, "Exception: " + e.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
onDeviceReady.run();
|
|
||||||
}
|
}
|
||||||
|
catch (InvalidScannerNameException e){
|
||||||
|
Toast.makeText(mContext, "Invalid Scanner Name Exception: " + e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
catch (Exception e){
|
||||||
|
Toast.makeText(mContext, "Exception: " + e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onDeviceReady.run();
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user