Compare commits
No commits in common. "master" and "version7.5.1" have entirely different histories.
master
...
version7.5
|
@ -1,7 +1,4 @@
|
||||||
*.iml
|
*.iml
|
||||||
*.apk
|
|
||||||
*.ap_
|
|
||||||
*.aab
|
|
||||||
.gradle
|
.gradle
|
||||||
/local.properties
|
/local.properties
|
||||||
/.idea/caches
|
/.idea/caches
|
||||||
|
@ -10,13 +7,8 @@
|
||||||
/.idea/workspace.xml
|
/.idea/workspace.xml
|
||||||
/.idea/navEditor.xml
|
/.idea/navEditor.xml
|
||||||
/.idea/assetWizardSettings.xml
|
/.idea/assetWizardSettings.xml
|
||||||
/.idea/inspectionProfiles/Project_Default.xml
|
|
||||||
/app/.idea/workspace.xml
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/build
|
/build
|
||||||
/app/release
|
|
||||||
/app/beta
|
|
||||||
/captures
|
/captures
|
||||||
.externalNativeBuild
|
.externalNativeBuild
|
||||||
.cxx
|
.cxx
|
||||||
*.jar
|
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="AppInsightsSettings">
|
|
||||||
<option name="selectedTabId" value="Firebase Crashlytics" />
|
|
||||||
<option name="tabSettings">
|
|
||||||
<map>
|
|
||||||
<entry key="Android Vitals">
|
|
||||||
<value>
|
|
||||||
<InsightsFilterSettings>
|
|
||||||
<option name="connection">
|
|
||||||
<ConnectionSetting>
|
|
||||||
<option name="appId" value="com.verdnatura.verdnaturaventas" />
|
|
||||||
</ConnectionSetting>
|
|
||||||
</option>
|
|
||||||
<option name="failureTypes">
|
|
||||||
<list>
|
|
||||||
<option value="FATAL" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
|
||||||
<option name="timeIntervalDays" value="ONE_DAY" />
|
|
||||||
<option name="visibilityType" value="ALL" />
|
|
||||||
</InsightsFilterSettings>
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
<entry key="Firebase Crashlytics">
|
|
||||||
<value>
|
|
||||||
<InsightsFilterSettings>
|
|
||||||
<option name="connection">
|
|
||||||
<ConnectionSetting>
|
|
||||||
<option name="appId" value="es.verdnatura.sfusion" />
|
|
||||||
<option name="mobileSdkAppId" value="1:975691769093:android:83eff0dadf5ca9d3e3c36c" />
|
|
||||||
<option name="projectId" value="picking-2b9a0" />
|
|
||||||
<option name="projectNumber" value="975691769093" />
|
|
||||||
</ConnectionSetting>
|
|
||||||
</option>
|
|
||||||
<option name="signal" value="SIGNAL_UNSPECIFIED" />
|
|
||||||
<option name="timeIntervalDays" value="SIXTY_DAYS" />
|
|
||||||
<option name="versions">
|
|
||||||
<list>
|
|
||||||
<VersionSetting>
|
|
||||||
<option name="buildVersion" value="324" />
|
|
||||||
<option name="displayName" value="24.32 (324)" />
|
|
||||||
<option name="displayVersion" value="24.32" />
|
|
||||||
</VersionSetting>
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
<option name="visibilityType" value="ALL" />
|
|
||||||
</InsightsFilterSettings>
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,37 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="WizardSettings">
|
|
||||||
<option name="children">
|
|
||||||
<map>
|
|
||||||
<entry key="imageWizard">
|
|
||||||
<value>
|
|
||||||
<PersistentState />
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
<entry key="vectorWizard">
|
|
||||||
<value>
|
|
||||||
<PersistentState>
|
|
||||||
<option name="children">
|
|
||||||
<map>
|
|
||||||
<entry key="vectorAssetStep">
|
|
||||||
<value>
|
|
||||||
<PersistentState>
|
|
||||||
<option name="values">
|
|
||||||
<map>
|
|
||||||
<entry key="assetSourceType" value="FILE" />
|
|
||||||
<entry key="outputName" value="ic_troncales" />
|
|
||||||
<entry key="sourceFile" value="C:\Users\sergiodt\Downloads\ic_troncales.svg" />
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
</PersistentState>
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
</PersistentState>
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -117,9 +117,6 @@
|
||||||
</codeStyleSettings>
|
</codeStyleSettings>
|
||||||
<codeStyleSettings language="kotlin">
|
<codeStyleSettings language="kotlin">
|
||||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||||
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
|
|
||||||
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
|
|
||||||
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
|
|
||||||
</codeStyleSettings>
|
</codeStyleSettings>
|
||||||
</code_scheme>
|
</code_scheme>
|
||||||
</component>
|
</component>
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="CompilerConfiguration">
|
<component name="CompilerConfiguration">
|
||||||
<bytecodeTargetLevel target="21" />
|
<bytecodeTargetLevel target="11" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -1,10 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="deploymentTargetDropDown">
|
|
||||||
<value>
|
|
||||||
<entry key="app">
|
|
||||||
<State />
|
|
||||||
</entry>
|
|
||||||
</value>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,18 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="deploymentTargetSelector">
|
|
||||||
<selectionStates>
|
|
||||||
<SelectionState runConfigName="app">
|
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
|
||||||
<DropdownSelection timestamp="2024-07-24T04:57:28.186915600Z">
|
|
||||||
<Target type="DEFAULT_BOOT">
|
|
||||||
<handle>
|
|
||||||
<DeviceId pluginId="PhysicalDevice" identifier="serial=21114523025303" />
|
|
||||||
</handle>
|
|
||||||
</Target>
|
|
||||||
</DropdownSelection>
|
|
||||||
<DialogSelection />
|
|
||||||
</SelectionState>
|
|
||||||
</selectionStates>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -4,17 +4,17 @@
|
||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
<option name="testRunner" value="CHOOSE_PER_TEST" />
|
<option name="testRunner" value="GRADLE" />
|
||||||
|
<option name="disableWrapperSourceDistributionNotification" value="true" />
|
||||||
|
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="gradleHome" value="$PROJECT_DIR$/../../../../gradle/gradle-7.5" />
|
|
||||||
<option name="gradleJvm" value="jbr-17" />
|
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
<option value="$PROJECT_DIR$/app" />
|
<option value="$PROJECT_DIR$/app" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
<option name="resolveExternalAnnotations" value="false" />
|
<option name="resolveModulePerSourceSet" value="false" />
|
||||||
</GradleProjectSettings>
|
</GradleProjectSettings>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
<component name="InspectionProjectProfileManager">
|
<component name="InspectionProjectProfileManager">
|
||||||
<profile version="1.0">
|
<profile version="1.0">
|
||||||
<option name="myName" value="Project Default" />
|
<option name="myName" value="Project Default" />
|
||||||
<inspection_tool class="DeprecatedCallableAddReplaceWith" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
||||||
<inspection_tool class="RedundantSamConstructor" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
|
|
||||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||||
<option name="processCode" value="true" />
|
<option name="processCode" value="true" />
|
||||||
<option name="processLiterals" value="true" />
|
<option name="processLiterals" value="true" />
|
||||||
<option name="processComments" value="true" />
|
<option name="processComments" value="true" />
|
||||||
</inspection_tool>
|
</inspection_tool>
|
||||||
<inspection_tool class="UnusedSymbol" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
||||||
</profile>
|
</profile>
|
||||||
</component>
|
</component>
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="KotlinJpsPluginSettings">
|
|
||||||
<option name="version" value="2.0.20" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,10 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectMigrations">
|
|
||||||
<option name="MigrateToGradleLocalJavaHome">
|
|
||||||
<set>
|
|
||||||
<option value="$PROJECT_DIR$" />
|
|
||||||
</set>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
236
.idea/misc.xml
236
.idea/misc.xml
|
@ -3,35 +3,16 @@
|
||||||
<component name="DesignSurface">
|
<component name="DesignSurface">
|
||||||
<option name="filePathToZoomLevelMap">
|
<option name="filePathToZoomLevelMap">
|
||||||
<map>
|
<map>
|
||||||
<entry key="..\:/Users/sergiodt/.gradle/caches/transforms-3/e9164bf73e63cfbbe0209ceba1baaefb/transformed/jetified-android-image-picker-3.0.0-beta5/res/layout/ef_fragment_image_picker.xml" value="0.13508771929824562" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable-v24/background_gradient.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable-v24/background_gradient.xml" value="0.1" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable-v24/background_round_corner.xml" value="0.2205" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable-v24/ic_history_orange_24dp.xml" value="0.38229166666666664" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable-v24/ic_collection.xml" value="0.1705" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable-v24/ic_history_orang.xml" value="0.22037037037037038" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable-v24/ic_history_orange_24dp.xml" value="0.16666666666666666" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable-v24/ic_launcher_foreground.xml" value="0.13541666666666666" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable-v24/ic_launcher_foreground.xml" value="0.13541666666666666" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable-v24/selector_bottombar_text.xml" value="0.13541666666666666" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable-v24/selector_bottombar_text.xml" value="0.13541666666666666" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/alpha_b_circle_outline.xml" value="0.2359375" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/alpha_b_circle_outline.xml" value="0.2359375" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/alpha_f_circle_outline.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/alpha_f_circle_outline.xml" value="0.1" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_and_round.xml" value="0.2185" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_and_round_collection_fragment.xml" value="0.269" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_item_color.xml" value="0.1" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_oval_checked.xml" value="0.2359375" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_oval_checked.xml" value="0.2359375" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_oval_unchecked.xml" value="0.30052083333333335" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_round.xml" value="0.2555" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_round_corner.xml" value="0.2205" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_round_square.xml" value="0.2205" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_roundl.xml" value="0.232" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/background_test.xml" value="0.269" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/barcode.xml" value="0.2359375" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/barcode.xml" value="0.2359375" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/barcode_scan.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/barcode_scan.xml" value="0.1" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/border.xml" value="0.27447916666666666" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/border_parental.xml" value="0.11979166666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/border_parental.xml" value="0.11979166666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/btn_blue.xml" value="0.27447916666666666" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/btn_green.xml" value="0.2205" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/btn_ios_like.xml" value="0.2635" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/btn_orange.xml" value="0.2635" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/btn_white_transparent.xml" value="0.2635" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_accumulate.xml" value="0.18489583333333334" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_accumulate.xml" value="0.18489583333333334" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_accumulation.xml" value="0.19814814814814816" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_accumulation.xml" value="0.19814814814814816" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_desactivate.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_desactivate.xml" value="0.1" />
|
||||||
|
@ -39,23 +20,15 @@
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_fill.xml" value="0.19814814814814816" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_fill.xml" value="0.19814814814814816" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_flejado.xml" value="0.2916666666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_flejado.xml" value="0.2916666666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_full.xml" value="0.18489583333333334" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_full.xml" value="0.18489583333333334" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_load.xml" value="0.14666666666666667" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_off.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_off.xml" value="0.1" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_outline.xml" value="0.22407407407407406" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/buffer_outline.xml" value="0.22407407407407406" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/car.xml" value="0.30052083333333335" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/car_control.xml" value="0.22407407407407406" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/car_control.xml" value="0.22407407407407406" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/car_info.xml" value="0.2916666666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/car_info.xml" value="0.2916666666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/check.xml" value="0.1305" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/circleshape.xml" value="0.11979166666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/circleshape.xml" value="0.11979166666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/component_progress.xml" value="0.11979166666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/component_progress.xml" value="0.11979166666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/crane.xml" value="0.23802083333333332" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/crane.xml" value="0.23802083333333332" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/custom_ripple.xml" value="0.2175" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/custom_ripple_nomenuinit.xml" value="0.213" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/day_of_sale.xml" value="0.184375" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/day_of_sale.xml" value="0.184375" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/delete.xml" value="0.19166666666666668" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/delete.xml" value="0.19166666666666668" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/drawable_white_circle.xml" value="0.1775" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/emoticon_error.xml" value="0.27447916666666666" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/emoticon_error_fragment.xml" value="0.26" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/eraser.xml" value="0.26564102564102565" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/eraser.xml" value="0.26564102564102565" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/face_man_outline.xml" value="0.22708333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/face_man_outline.xml" value="0.22708333333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/filter_outline.xml" value="0.22239583333333332" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/filter_outline.xml" value="0.22239583333333332" />
|
||||||
|
@ -63,35 +36,12 @@
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_add_black_24dp.xml" value="0.22708333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_add_black_24dp.xml" value="0.22708333333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_arrow_back_black_24dp.xml" value="0.22708333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_arrow_back_black_24dp.xml" value="0.22708333333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_arrow_drop_down_black_24dp.xml" value="0.22708333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_arrow_drop_down_black_24dp.xml" value="0.22708333333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_autorenew_black_24dp.xml" value="0.1775" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_barcode_ui_selected.xml" value="0.212" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_baseline_star_24.xml" value="0.1775" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_build_black_24dp.xml" value="0.22708333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_build_black_24dp.xml" value="0.22708333333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_chevron_left.xml" value="0.215" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_chevron_right_black_24dp.xml" value="0.1775" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_claim_ui.xml" value="0.186" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_claims.xml" value="0.2425" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_cmr.xml" value="0.267" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_collectionTicket.xml" value="0.1905" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_controller_ui.xml" value="0.212" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_controller_ui_selected.xml" value="0.212" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_corridor_ui.xml" value="0.186" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_dashboard_black_24dp.xml" value="0.1775" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_delete_black_24dp.xml" value="0.15052083333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_delete_black_24dp.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_delete_forever_black_24dp.xml" value="0.15052083333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_delete_forever_black_24dp.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_device_hub_black_24dp.xml" value="0.22" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_device_hub_black_24dp_selected.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_device_hub_black_24dp_selected.xml" value="0.22" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_eye_ui.xml" value="0.2015" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_eye_ui_selected.xml" value="0.212" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_flash_auto_black_24dp.xml" value="0.15052083333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_flash_auto_black_24dp.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_history_black_24dp.xml" value="0.15052083333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_history_black_24dp.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_history_orange.xml" value="0.22037037037037038" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_icon_configuracion.xml" value="0.26" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_init.xml" value="0.186" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_init_selected.xml" value="0.26" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_init_ui.xml" value="0.212" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_init_ui_selected.xml" value="0.212" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_item.xml" value="0.1" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_launcher_background.xml" value="0.24010416666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_launcher_background.xml" value="0.24010416666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_local_florist_black_24dp.xml" value="0.15052083333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_local_florist_black_24dp.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_local_florist_black_24dp_selected.xml" value="0.21041666666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_local_florist_black_24dp_selected.xml" value="0.21041666666666667" />
|
||||||
|
@ -99,241 +49,109 @@
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_local_parking_orange_24dp.xml" value="0.21041666666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_local_parking_orange_24dp.xml" value="0.21041666666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_local_shipping_black_24dp.xml" value="0.11979166666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_local_shipping_black_24dp.xml" value="0.11979166666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_local_shipping_black_24dp_selected.xml" value="0.11979166666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_local_shipping_black_24dp_selected.xml" value="0.11979166666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_logo.xml" value="0.266" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_logo_salix.xml" value="0.266" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_loyalty_black_24dp.xml" value="0.21041666666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_loyalty_black_24dp.xml" value="0.21041666666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_mode_edit_black_24dp.xml" value="0.15052083333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_mode_edit_black_24dp.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_more_vert_black_24dp.xml" value="0.26" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_move_to_inbox_black_24dp.xml" value="0.15052083333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_move_to_inbox_black_24dp.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_packaging.xml" value="0.258" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_packing_mistake.xml" value="0.1315" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_pallet_scan_expedition.xml" value="0.1005" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_pallet_ui.xml" value="0.212" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_parking_ui.xml" value="0.212" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_parking_ui_selected.xml" value="0.212" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_picker_ui.xml" value="0.186" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_playlist_add_black_24dp.xml" value="0.15052083333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_playlist_add_black_24dp.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_print_black_24dp.xml" value="0.15052083333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_print_black_24dp.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_qr_ui.xml" value="0.212" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_reubication.xml" value="0.138" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_send_black_24dp.xml" value="0.134375" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_send_black_24dp.xml" value="0.134375" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_setting_ui.xml" value="0.26" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_setting_ui_selected.xml" value="0.26" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_settings.xml" value="0.26" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_settings_selected.xml" value="0.26" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_spa_black_24dp.xml" value="0.15052083333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_spa_black_24dp.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_spa_black_launcher.xml" value="0.19479166666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_spa_black_launcher.xml" value="0.19479166666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_star_ko.xml" value="0.15052083333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_star_ko.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_start_ok.xml" value="0.15052083333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_start_ok.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_streetview_black_24dp.xml" value="0.15052083333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_streetview_black_24dp.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_swap_horiz_black_24dp.xml" value="0.11979166666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_swap_horiz_black_24dp.xml" value="0.11979166666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_ticket.xml" value="0.1705" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_transaction.xml" value="0.22708333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_transaction.xml" value="0.22708333333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_ubicator_check.xml" value="0.2295" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_verified_user_black_24dp.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_verified_user_black_24dp.xml" value="0.1" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_verified_user_black_24dp_selected.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_verified_user_black_24dp_selected.xml" value="0.1" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_visibility.xml" value="0.1775" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_visibility_black_24dp.xml" value="0.2546875" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_visibility_black_24dp.xml" value="0.2546875" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_visibility_black_24dp_white.xml" value="0.2546875" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_visibility_black_24dp_white.xml" value="0.2546875" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_visibility_white_24dp.xml" value="0.2546875" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_visibility_white_24dp.xml" value="0.2546875" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_vn_logo_negativo_app_warehouse.xml" value="0.18" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/ic_worker.xml" value="0.265" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/init_icon.xml" value="0.2635" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/init_selected_icon.xml" value="0.2635" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/lift.xml" value="0.1925" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/list_divider_items.xml" value="0.1985" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/movie_plus_outline.xml" value="0.134375" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/movie_plus_outline.xml" value="0.134375" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping.xml" value="0.1" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping_black.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping_black.xml" value="0.1" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping_selected.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/pallet_shipping_selected.xml" value="0.1" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/phone_call.xml" value="0.26145833333333335" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/phone_call.xml" value="0.26145833333333335" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/previous_delete.xml" value="0.27447916666666666" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/qrcode_scan.xml" value="0.17395833333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/qrcode_scan.xml" value="0.17395833333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/rectangle.xml" value="0.31979166666666664" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/rectangle.xml" value="0.31979166666666664" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/revision_icon.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/revision_icon.xml" value="0.1" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/round.xml" value="0.1915" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/round_av_timer_24.xml" value="0.15052083333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/round_av_timer_24.xml" value="0.15052083333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/round_outline.xml" value="0.11979166666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/round_outline.xml" value="0.11979166666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/settings_icon.xml" value="0.2635" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/settings_icon_selected.xml" value="0.2635" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/walk.xml" value="0.10885416666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/walk.xml" value="0.10885416666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/worker.xml" value="0.12" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_imageview.xml" value="0.134375" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/drawable/worker_mistake.xml" value="0.15364583333333334" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_login.xml" value="0.134375" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_imageview.xml" value="0.22" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_login.xml" value="0.1" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_main.xml" value="0.17916666666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/activity_main.xml" value="0.17916666666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/buyers_fragment.xml" value="0.18333333333333332" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/buyers_fragment.xml" value="0.18333333333333332" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_dialog.xml" value="0.3333333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_dialog.xml" value="0.1490036231884058" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_edit_dialog.xml" value="0.3333333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_edit_dialog.xml" value="0.10208333333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_edit_dialog_three_values.xml" value="0.2" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_list_dialog.xml" value="0.1490036231884058" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_edit_dialog_two_values.xml" value="0.2203125" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_three_dialog.xml" value="0.12817028985507245" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_hour.xml" value="0.3333333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_ajustes.xml" value="0.3333333333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_list_dialog.xml" value="0.3333333333333333" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_three_dialog.xml" value="0.3333333333333333" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_two_dialog.xml" value="0.3333333333333333" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/component_custom_ubicador_dialog.xml" value="0.2453125" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_ajustes.xml" value="0.24166666666666667" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_automatic_add_item.xml" value="0.20625" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_automatic_add_item.xml" value="0.20625" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer.xml" value="0.1408514492753623" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer.xml" value="0.1408514492753623" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer_load.xml" value="0.20923913043478262" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer_load.xml" value="0.20923913043478262" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer_loadexpedition.xml" value="0.1398176291793313" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buffer_loadexpedition.xml" value="0.1398176291793313" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buscar_item.xml" value="0.21014492753623187" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buscar_item.xml" value="0.21014492753623187" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buscar_item_all.xml" value="0.3333333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_buscar_item_all.xml" value="0.3333333333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_collection.xml" value="0.3333333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_collection.xml" value="0.23007246376811594" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_controlador.xml" value="0.22" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_controlador.xml" value="0.20153985507246377" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expedition_pallet.xml" value="0.1793478260869565" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expedition_pallet_detail.xml" value="0.15579710144927536" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expedition_scan.xml" value="0.21666666666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expedition_scan.xml" value="0.21666666666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expedition_truck_list.xml" value="0.15579710144927536" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expeditionscan_sorter.xml" value="0.196875" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expeditionscan_sorter.xml" value="0.196875" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expeditionstate.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_expeditionstate.xml" value="0.1" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_faltas.xml" value="0.1793478260869565" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_general_black.xml" value="0.264" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_historico.xml" value="0.1734375" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_historico.xml" value="0.1734375" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_historicovehiculo.xml" value="0.23052536231884058" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_historicovehiculo.xml" value="0.23052536231884058" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_inventary.xml" value="0.264" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_inventary.xml" value="0.11271529888551166" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_inventary_old.xml" value="0.22604166666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_inventary_old.xml" value="0.22604166666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_item_card.xml" value="0.22" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_item_card.xml" value="0.16666666666666666" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_itemdayofsale_card.xml" value="0.22" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_itemdayofsale_card.xml" value="0.1693840579710145" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_itemexpeditionstate_card.xml" value="0.22" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_itemexpeditionstate_card.xml" value="0.22" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_itemproposal.xml" value="0.22" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_itemproposal.xml" value="0.22" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_itemshelvingdayofsale.xml" value="0.3333333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_itemshelvingdayofsale.xml" value="0.3333333333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_itemshelvinglog.xml" value="0.28169014084507044" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_itemshelvinglog.xml" value="0.3333333333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_login.xml" value="0.22" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_login.xml" value="0.22" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_packaging.xml" value="0.1956140350877193" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_packaging_count.xml" value="0.23229166666666667" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_packaging_obs.xml" value="0.1" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_packaging_summary.xml" value="0.2" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_packaging_supplier.xml" value="0.2515625" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_paletizador_menu.xml" value="0.13829787234042554" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_paletizador_menu.xml" value="0.13829787234042554" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_parking.xml" value="0.16666666666666666" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_parking.xml" value="0.5" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_pasillero.xml" value="0.21" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_pasillero.xml" value="0.13829787234042554" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_pre_sacador.xml" value="0.29809358752166376" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_pre_sacador.xml" value="0.3333333333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_qr.xml" value="0.19882246376811594" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_qr.xml" value="0.19882246376811594" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_reubication_collection.xml" value="0.22083333333333333" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_sacador.xml" value="0.12952898550724637" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_sacador.xml" value="0.12952898550724637" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_sacador_associatesmarttag.xml" value="0.22" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_sacador_associatesmarttag.xml" value="0.22" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_shelving_parking.xml" value="0.1793478260869565" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_shelvinglog.xml" value="0.13269927536231885" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_shelvinglog.xml" value="0.3333333333333333" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_smarttag_register.xml" value="0.3118811881188119" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_smarttag_register.xml" value="0.3118811881188119" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_testing_print.xml" value="0.12462006079027356" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_transferencia.xml" value="0.10666666666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_transferencia.xml" value="0.10666666666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_ubicador.xml" value="0.22" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_ubicador.xml" value="0.22" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_vehiclecontrol.xml" value="0.3333333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_vehiclecontrol.xml" value="0.1546875" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_vehiclecontrol_user.xml" value="0.23052536231884058" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_vehiclecontrol_user.xml" value="0.23052536231884058" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_web.xml" value="0.2463768115942029" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_web.xml" value="0.2463768115942029" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/fragment_workermistake.xml" value="0.2265625" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_ajustes_row.xml" value="0.10009057971014493" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/ic_packing_mistake.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row.xml" value="0.4466666666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_ajustes_row.xml" value="0.16666666666666666" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row_presacador.xml" value="0.4466666666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row.xml" value="0.3333333333333333" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row_fragment.xml" value="0.3275862068965517" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row_presacador.xml" value="0.4" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_article_row_reubication_fragment.xml" value="0.36614583333333334" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_barcode_row.xml" value="0.15579710144927536" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_buyer_row.xml" value="0.1793478260869565" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_card_row.xml" value="0.2269021739130435" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_card_row.xml" value="0.2269021739130435" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_collection_row.xml" value="0.1793478260869565" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_escaner_row.xml" value="0.15353260869565216" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expedition_view_row.xml" value="0.1793478260869565" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expeditionpallet_row.xml" value="0.1793478260869565" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expeditionscan_row.xml" value="0.1793478260869565" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expeditionstate_row.xml" value="0.23489583333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expeditionstate_row.xml" value="0.23489583333333333" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_expeditiontruck_row.xml" value="0.1793478260869565" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_faltas_row.xml" value="0.1793478260869565" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_general_row.xml" value="0.13360507246376813" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_general_row_image.xml" value="0.2131578947368421" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_historico_row.xml" value="0.15353260869565216" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_historicovehiculo_row.xml" value="0.18795289855072464" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_historicovehiculo_row.xml" value="0.18795289855072464" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_image_row.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_inventary_row.xml" value="0.22604166666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_inventary_row.xml" value="0.15163934426229508" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_itemshelvingdayofsale_row.xml" value="0.18206521739130435" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_itemshelvingdayofsale_row.xml" value="0.18206521739130435" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_itemsupplier_row.xml" value="0.1" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_location_all_row.xml" value="0.12259371833839919" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_location_all_row.xml" value="0.12259371833839919" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_location_row.xml" value="0.16875" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_location_row.xml" value="0.16875" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_main_menu.xml" value="0.3333333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_pasilleros_main_menu.xml" value="0.13829787234042554" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_pasilleros_main_menu.xml" value="0.33" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_placement_reubication_row.xml" value="0.27447916666666666" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_placement_row.xml" value="0.3333333333333333" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_proposal_row.xml" value="0.22604166666666667" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_proposal_row.xml" value="0.22604166666666667" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_reposicion.xml" value="0.1" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_reposicion.xml" value="0.1" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_shelvingdayofsale_row.xml" value="0.2375" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_shelvingdayofsale_row.xml" value="0.2375" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_shelvinglog_row.xml" value="0.3333333333333333" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_shelvinglog_row.xml" value="0.21739130434782608" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_shelvingparking_row.xml" value="0.1793478260869565" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_smarttag_row.xml" value="0.20153985507246377" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_smarttag_row.xml" value="0.20153985507246377" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_toolbar_row.xml" value="0.15307971014492755" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_toolbar_row.xml" value="0.15307971014492755" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_ubication_row.xml" value="0.11822916666666666" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_ubication_row.xml" value="0.11822916666666666" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_work_forms_row.xml" value="0.1" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_worker_image.xml" value="0.23177083333333334" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_worker_image.xml" value="0.23177083333333334" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/item_workermistake_row.xml" value="0.4466666666666667" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/qauality_fragment.xml" value="0.15353260869565216" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/reposicion_fragment.xml" value="0.15353260869565216" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/shelvinglog_row.xml" value="0.18385416666666668" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/shelvinglog_row.xml" value="0.18385416666666668" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/testing_print.xml" value="0.1802536231884058" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/toolbar.xml" value="0.15353260869565216" />
|
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/toolbar.xml" value="0.15353260869565216" />
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/toolbarUI.xml" value="0.29846014492753625" />
|
|
||||||
<entry key="..\:/Users/sergiodt/AndroidStudioProjects/vn-warehouseManager/app/src/main/res/layout/toolbar_fragment.xml" value="0.22" />
|
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="NullableNotNullManager">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<option name="myDefaultNullable" value="androidx.annotation.Nullable" />
|
|
||||||
<option name="myDefaultNotNull" value="androidx.annotation.NonNull" />
|
|
||||||
<option name="myNullables">
|
|
||||||
<value>
|
|
||||||
<list size="16">
|
|
||||||
<item index="0" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
|
|
||||||
<item index="1" class="java.lang.String" itemvalue="org.jspecify.nullness.Nullable" />
|
|
||||||
<item index="2" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
|
|
||||||
<item index="3" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
|
|
||||||
<item index="4" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
|
||||||
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
|
|
||||||
<item index="6" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.Nullable" />
|
|
||||||
<item index="7" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
|
||||||
<item index="8" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
|
||||||
<item index="9" class="java.lang.String" itemvalue="jakarta.annotation.Nullable" />
|
|
||||||
<item index="10" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
|
|
||||||
<item index="11" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
|
||||||
<item index="12" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
|
|
||||||
<item index="13" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
|
|
||||||
<item index="14" class="java.lang.String" itemvalue="android.annotation.Nullable" />
|
|
||||||
<item index="15" class="java.lang.String" itemvalue="org.jspecify.annotations.Nullable" />
|
|
||||||
</list>
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
<option name="myNotNulls">
|
|
||||||
<value>
|
|
||||||
<list size="15">
|
|
||||||
<item index="0" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
|
|
||||||
<item index="1" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
|
|
||||||
<item index="2" class="java.lang.String" itemvalue="jakarta.annotation.Nonnull" />
|
|
||||||
<item index="3" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
|
|
||||||
<item index="4" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
|
|
||||||
<item index="5" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
|
||||||
<item index="6" class="java.lang.String" itemvalue="org.jspecify.nullness.NonNull" />
|
|
||||||
<item index="7" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
|
|
||||||
<item index="8" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
|
||||||
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
|
|
||||||
<item index="10" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
|
||||||
<item index="11" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
|
||||||
<item index="12" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.NonNull" />
|
|
||||||
<item index="13" class="java.lang.String" itemvalue="android.annotation.NonNull" />
|
|
||||||
<item index="14" class="java.lang.String" itemvalue="org.jspecify.annotations.NonNull" />
|
|
||||||
</list>
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="jbr-21" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
<option name="id" value="Android" />
|
<option name="id" value="Android" />
|
||||||
</component>
|
</component>
|
||||||
<component name="VisualizationToolProject">
|
|
||||||
<option name="state">
|
|
||||||
<ProjectState>
|
|
||||||
<option name="scale" value="0.2298076923076923" />
|
|
||||||
</ProjectState>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
</project>
|
File diff suppressed because one or more lines are too long
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$/../.." />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
|
@ -1,43 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="navEditor-manualLayoutAlgorithm2">
|
|
||||||
<option name="myPositions">
|
|
||||||
<map>
|
|
||||||
<entry key="nav_graph.xml">
|
|
||||||
<value>
|
|
||||||
<LayoutPositions>
|
|
||||||
<option name="myPositions">
|
|
||||||
<map>
|
|
||||||
<entry key="ajustesFragment">
|
|
||||||
<value>
|
|
||||||
<LayoutPositions>
|
|
||||||
<option name="myPosition">
|
|
||||||
<Point>
|
|
||||||
<option name="x" value="-226" />
|
|
||||||
<option name="y" value="103" />
|
|
||||||
</Point>
|
|
||||||
</option>
|
|
||||||
</LayoutPositions>
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
<entry key="showTicketFragment">
|
|
||||||
<value>
|
|
||||||
<LayoutPositions>
|
|
||||||
<option name="myPosition">
|
|
||||||
<Point>
|
|
||||||
<option name="x" value="-512" />
|
|
||||||
<option name="y" value="86" />
|
|
||||||
</Point>
|
|
||||||
</option>
|
|
||||||
</LayoutPositions>
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
</LayoutPositions>
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
263
.idea/other.xml
263
.idea/other.xml
|
@ -1,263 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="direct_access_persist.xml">
|
|
||||||
<option name="deviceSelectionList">
|
|
||||||
<list>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="27" />
|
|
||||||
<option name="brand" value="DOCOMO" />
|
|
||||||
<option name="codename" value="F01L" />
|
|
||||||
<option name="id" value="F01L" />
|
|
||||||
<option name="manufacturer" value="FUJITSU" />
|
|
||||||
<option name="name" value="F-01L" />
|
|
||||||
<option name="screenDensity" value="360" />
|
|
||||||
<option name="screenX" value="720" />
|
|
||||||
<option name="screenY" value="1280" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="28" />
|
|
||||||
<option name="brand" value="DOCOMO" />
|
|
||||||
<option name="codename" value="SH-01L" />
|
|
||||||
<option name="id" value="SH-01L" />
|
|
||||||
<option name="manufacturer" value="SHARP" />
|
|
||||||
<option name="name" value="AQUOS sense2 SH-01L" />
|
|
||||||
<option name="screenDensity" value="480" />
|
|
||||||
<option name="screenX" value="1080" />
|
|
||||||
<option name="screenY" value="2160" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="31" />
|
|
||||||
<option name="brand" value="samsung" />
|
|
||||||
<option name="codename" value="a51" />
|
|
||||||
<option name="id" value="a51" />
|
|
||||||
<option name="manufacturer" value="Samsung" />
|
|
||||||
<option name="name" value="Galaxy A51" />
|
|
||||||
<option name="screenDensity" value="420" />
|
|
||||||
<option name="screenX" value="1080" />
|
|
||||||
<option name="screenY" value="2400" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="34" />
|
|
||||||
<option name="brand" value="google" />
|
|
||||||
<option name="codename" value="akita" />
|
|
||||||
<option name="id" value="akita" />
|
|
||||||
<option name="manufacturer" value="Google" />
|
|
||||||
<option name="name" value="Pixel 8a" />
|
|
||||||
<option name="screenDensity" value="420" />
|
|
||||||
<option name="screenX" value="1080" />
|
|
||||||
<option name="screenY" value="2400" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="33" />
|
|
||||||
<option name="brand" value="samsung" />
|
|
||||||
<option name="codename" value="b0q" />
|
|
||||||
<option name="id" value="b0q" />
|
|
||||||
<option name="manufacturer" value="Samsung" />
|
|
||||||
<option name="name" value="Galaxy S22 Ultra" />
|
|
||||||
<option name="screenDensity" value="600" />
|
|
||||||
<option name="screenX" value="1440" />
|
|
||||||
<option name="screenY" value="3088" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="32" />
|
|
||||||
<option name="brand" value="google" />
|
|
||||||
<option name="codename" value="bluejay" />
|
|
||||||
<option name="id" value="bluejay" />
|
|
||||||
<option name="manufacturer" value="Google" />
|
|
||||||
<option name="name" value="Pixel 6a" />
|
|
||||||
<option name="screenDensity" value="420" />
|
|
||||||
<option name="screenX" value="1080" />
|
|
||||||
<option name="screenY" value="2400" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="29" />
|
|
||||||
<option name="brand" value="samsung" />
|
|
||||||
<option name="codename" value="crownqlteue" />
|
|
||||||
<option name="id" value="crownqlteue" />
|
|
||||||
<option name="manufacturer" value="Samsung" />
|
|
||||||
<option name="name" value="Galaxy Note9" />
|
|
||||||
<option name="screenDensity" value="420" />
|
|
||||||
<option name="screenX" value="2220" />
|
|
||||||
<option name="screenY" value="1080" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="34" />
|
|
||||||
<option name="brand" value="samsung" />
|
|
||||||
<option name="codename" value="dm3q" />
|
|
||||||
<option name="id" value="dm3q" />
|
|
||||||
<option name="manufacturer" value="Samsung" />
|
|
||||||
<option name="name" value="Galaxy S23 Ultra" />
|
|
||||||
<option name="screenDensity" value="600" />
|
|
||||||
<option name="screenX" value="1440" />
|
|
||||||
<option name="screenY" value="3088" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="33" />
|
|
||||||
<option name="brand" value="google" />
|
|
||||||
<option name="codename" value="felix" />
|
|
||||||
<option name="id" value="felix" />
|
|
||||||
<option name="manufacturer" value="Google" />
|
|
||||||
<option name="name" value="Pixel Fold" />
|
|
||||||
<option name="screenDensity" value="420" />
|
|
||||||
<option name="screenX" value="2208" />
|
|
||||||
<option name="screenY" value="1840" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="33" />
|
|
||||||
<option name="brand" value="google" />
|
|
||||||
<option name="codename" value="felix_camera" />
|
|
||||||
<option name="id" value="felix_camera" />
|
|
||||||
<option name="manufacturer" value="Google" />
|
|
||||||
<option name="name" value="Pixel Fold (Camera-enabled)" />
|
|
||||||
<option name="screenDensity" value="420" />
|
|
||||||
<option name="screenX" value="2208" />
|
|
||||||
<option name="screenY" value="1840" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="33" />
|
|
||||||
<option name="brand" value="samsung" />
|
|
||||||
<option name="codename" value="gts8uwifi" />
|
|
||||||
<option name="id" value="gts8uwifi" />
|
|
||||||
<option name="manufacturer" value="Samsung" />
|
|
||||||
<option name="name" value="Galaxy Tab S8 Ultra" />
|
|
||||||
<option name="screenDensity" value="320" />
|
|
||||||
<option name="screenX" value="1848" />
|
|
||||||
<option name="screenY" value="2960" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="34" />
|
|
||||||
<option name="brand" value="google" />
|
|
||||||
<option name="codename" value="husky" />
|
|
||||||
<option name="id" value="husky" />
|
|
||||||
<option name="manufacturer" value="Google" />
|
|
||||||
<option name="name" value="Pixel 8 Pro" />
|
|
||||||
<option name="screenDensity" value="390" />
|
|
||||||
<option name="screenX" value="1008" />
|
|
||||||
<option name="screenY" value="2244" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="30" />
|
|
||||||
<option name="brand" value="motorola" />
|
|
||||||
<option name="codename" value="java" />
|
|
||||||
<option name="id" value="java" />
|
|
||||||
<option name="manufacturer" value="Motorola" />
|
|
||||||
<option name="name" value="G20" />
|
|
||||||
<option name="screenDensity" value="280" />
|
|
||||||
<option name="screenX" value="720" />
|
|
||||||
<option name="screenY" value="1600" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="33" />
|
|
||||||
<option name="brand" value="google" />
|
|
||||||
<option name="codename" value="lynx" />
|
|
||||||
<option name="id" value="lynx" />
|
|
||||||
<option name="manufacturer" value="Google" />
|
|
||||||
<option name="name" value="Pixel 7a" />
|
|
||||||
<option name="screenDensity" value="420" />
|
|
||||||
<option name="screenX" value="1080" />
|
|
||||||
<option name="screenY" value="2400" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="31" />
|
|
||||||
<option name="brand" value="google" />
|
|
||||||
<option name="codename" value="oriole" />
|
|
||||||
<option name="id" value="oriole" />
|
|
||||||
<option name="manufacturer" value="Google" />
|
|
||||||
<option name="name" value="Pixel 6" />
|
|
||||||
<option name="screenDensity" value="420" />
|
|
||||||
<option name="screenX" value="1080" />
|
|
||||||
<option name="screenY" value="2400" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="33" />
|
|
||||||
<option name="brand" value="google" />
|
|
||||||
<option name="codename" value="panther" />
|
|
||||||
<option name="id" value="panther" />
|
|
||||||
<option name="manufacturer" value="Google" />
|
|
||||||
<option name="name" value="Pixel 7" />
|
|
||||||
<option name="screenDensity" value="420" />
|
|
||||||
<option name="screenX" value="1080" />
|
|
||||||
<option name="screenY" value="2400" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="31" />
|
|
||||||
<option name="brand" value="samsung" />
|
|
||||||
<option name="codename" value="q2q" />
|
|
||||||
<option name="id" value="q2q" />
|
|
||||||
<option name="manufacturer" value="Samsung" />
|
|
||||||
<option name="name" value="Galaxy Z Fold3" />
|
|
||||||
<option name="screenDensity" value="420" />
|
|
||||||
<option name="screenX" value="1768" />
|
|
||||||
<option name="screenY" value="2208" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="34" />
|
|
||||||
<option name="brand" value="samsung" />
|
|
||||||
<option name="codename" value="q5q" />
|
|
||||||
<option name="id" value="q5q" />
|
|
||||||
<option name="manufacturer" value="Samsung" />
|
|
||||||
<option name="name" value="Galaxy Z Fold5" />
|
|
||||||
<option name="screenDensity" value="420" />
|
|
||||||
<option name="screenX" value="1812" />
|
|
||||||
<option name="screenY" value="2176" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="30" />
|
|
||||||
<option name="brand" value="google" />
|
|
||||||
<option name="codename" value="r11" />
|
|
||||||
<option name="id" value="r11" />
|
|
||||||
<option name="manufacturer" value="Google" />
|
|
||||||
<option name="name" value="Pixel Watch" />
|
|
||||||
<option name="screenDensity" value="320" />
|
|
||||||
<option name="screenX" value="384" />
|
|
||||||
<option name="screenY" value="384" />
|
|
||||||
<option name="type" value="WEAR_OS" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="30" />
|
|
||||||
<option name="brand" value="google" />
|
|
||||||
<option name="codename" value="redfin" />
|
|
||||||
<option name="id" value="redfin" />
|
|
||||||
<option name="manufacturer" value="Google" />
|
|
||||||
<option name="name" value="Pixel 5" />
|
|
||||||
<option name="screenDensity" value="440" />
|
|
||||||
<option name="screenX" value="1080" />
|
|
||||||
<option name="screenY" value="2340" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="34" />
|
|
||||||
<option name="brand" value="google" />
|
|
||||||
<option name="codename" value="shiba" />
|
|
||||||
<option name="id" value="shiba" />
|
|
||||||
<option name="manufacturer" value="Google" />
|
|
||||||
<option name="name" value="Pixel 8" />
|
|
||||||
<option name="screenDensity" value="420" />
|
|
||||||
<option name="screenX" value="1080" />
|
|
||||||
<option name="screenY" value="2400" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="33" />
|
|
||||||
<option name="brand" value="google" />
|
|
||||||
<option name="codename" value="tangorpro" />
|
|
||||||
<option name="id" value="tangorpro" />
|
|
||||||
<option name="manufacturer" value="Google" />
|
|
||||||
<option name="name" value="Pixel Tablet" />
|
|
||||||
<option name="screenDensity" value="320" />
|
|
||||||
<option name="screenX" value="1600" />
|
|
||||||
<option name="screenY" value="2560" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
<PersistentDeviceSelectionData>
|
|
||||||
<option name="api" value="29" />
|
|
||||||
<option name="brand" value="samsung" />
|
|
||||||
<option name="codename" value="x1q" />
|
|
||||||
<option name="id" value="x1q" />
|
|
||||||
<option name="manufacturer" value="Samsung" />
|
|
||||||
<option name="name" value="Galaxy S20" />
|
|
||||||
<option name="screenDensity" value="480" />
|
|
||||||
<option name="screenX" value="1440" />
|
|
||||||
<option name="screenY" value="3200" />
|
|
||||||
</PersistentDeviceSelectionData>
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="RenderSettings">
|
|
||||||
<option name="showDecorations" value="true" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="StudioBotProjectSettings">
|
|
||||||
<option name="shareContext" value="OptedOut" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="" vcs="Git" />
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
1518
.idea/workspace.xml
1518
.idea/workspace.xml
File diff suppressed because it is too large
Load Diff
31
CHANGELOG.md
31
CHANGELOG.md
|
@ -1,31 +0,0 @@
|
||||||
# Version XX.XX - XXXX-XX-XX
|
|
||||||
|
|
||||||
### Added 🆕
|
|
||||||
|
|
||||||
- feat: refs #5443 collectionFragmentChecker by:Sergio De la torre
|
|
||||||
- feat: refs#6845 userInterface by:Sergio De la torre
|
|
||||||
- feat: refs #6845 userIterface by:Sergio De la torre
|
|
||||||
- feat: refs #6861 reservas by:Sergio De la torre
|
|
||||||
- feat: refs #6869 itemShelvings (warehouse/dev_6078, warehouse/dev, dev_6078) by:Sergio De la
|
|
||||||
torre
|
|
||||||
- feat: refs #7266 printItem by:Sergio De la torre
|
|
||||||
- feat: refs #7922 scanOrder by:Sergio De la torre
|
|
||||||
- feat: refs #8020 controlVehiculos by:Sergio De la torre
|
|
||||||
- feat: refs #8022 kotlin versionCatalog by:Sergio De la torre
|
|
||||||
- feat: refs #8082 ticketPickup by:Sergio De la torre
|
|
||||||
- feat: refs #8099 addSalarySupplement by:Sergio De la torre
|
|
||||||
- feat: refs #8150 moveExpedition by:Sergio De la torre
|
|
||||||
- feat: refs #8150 moveExpeditions by:Sergio De la torre
|
|
||||||
- feat: refs #8175 crashlyticsAndUpdate by:Sergio De la torre
|
|
||||||
- feat: refs #8175 refactorCode by:Sergio De la torre
|
|
||||||
- feat: refs #8176 refactorSearchDialog by:Sergio De la torre
|
|
||||||
- feat: refs #8182 zoneClickable by:Sergio De la torre
|
|
||||||
- feat: refs#8213 reservas by:Sergio De la torre
|
|
||||||
|
|
||||||
### Changed 📦
|
|
||||||
|
|
||||||
- feat: refs #8175 refactorCode by:Sergio De la torre
|
|
||||||
- feat: refs #8176 refactorSearchDialog by:Sergio De la torre
|
|
||||||
|
|
||||||
### Fixed 🛠️
|
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"version": 3,
|
|
||||||
"artifactType": {
|
|
||||||
"type": "APK",
|
|
||||||
"kind": "Directory"
|
|
||||||
},
|
|
||||||
"applicationId": "es.verdnatura.alpha",
|
|
||||||
"variantName": "alphaRelease",
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"type": "SINGLE",
|
|
||||||
"filters": [],
|
|
||||||
"attributes": [],
|
|
||||||
"versionCode": 200,
|
|
||||||
"versionName": "23.22.1Beta",
|
|
||||||
"outputFile": "app-alpha-release.apk"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"elementType": "File"
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"version": 3,
|
|
||||||
"artifactType": {
|
|
||||||
"type": "APK",
|
|
||||||
"kind": "Directory"
|
|
||||||
},
|
|
||||||
"applicationId": "es.verdnatura.beta",
|
|
||||||
"variantName": "beta",
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"type": "SINGLE",
|
|
||||||
"filters": [],
|
|
||||||
"attributes": [],
|
|
||||||
"versionCode": 144,
|
|
||||||
"versionName": "9.6Beta",
|
|
||||||
"outputFile": "app-beta.apk"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"elementType": "File"
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
{
|
|
||||||
"version": 3,
|
|
||||||
"artifactType": {
|
|
||||||
"type": "APK",
|
|
||||||
"kind": "Directory"
|
|
||||||
},
|
|
||||||
"applicationId": "es.verdnatura.sfusion",
|
|
||||||
"variantName": "betaRelease",
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"type": "SINGLE",
|
|
||||||
"filters": [],
|
|
||||||
"attributes": [],
|
|
||||||
"versionCode": 314,
|
|
||||||
"versionName": "24.28Beta",
|
|
||||||
"outputFile": "app-beta-release.apk"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"elementType": "File",
|
|
||||||
"baselineProfiles": [
|
|
||||||
{
|
|
||||||
"minApi": 28,
|
|
||||||
"maxApi": 30,
|
|
||||||
"baselineProfiles": [
|
|
||||||
"baselineProfiles/1/app-beta-release.dm"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"minApi": 31,
|
|
||||||
"maxApi": 2147483647,
|
|
||||||
"baselineProfiles": [
|
|
||||||
"baselineProfiles/0/app-beta-release.dm"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"minSdkVersionForDexing": 26
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"version": 3,
|
|
||||||
"artifactType": {
|
|
||||||
"type": "APK",
|
|
||||||
"kind": "Directory"
|
|
||||||
},
|
|
||||||
"applicationId": "es.verdnatura.betatesting",
|
|
||||||
"variantName": "betatestingRelease",
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"type": "SINGLE",
|
|
||||||
"filters": [],
|
|
||||||
"attributes": [],
|
|
||||||
"versionCode": 187,
|
|
||||||
"versionName": "23.20Beta",
|
|
||||||
"outputFile": "app-betatesting-release.apk"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"elementType": "File"
|
|
||||||
}
|
|
170
app/build.gradle
170
app/build.gradle
|
@ -1,148 +1,133 @@
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
|
//apply plugin: 'kotlin-android-extensions'//deprecated:sergio
|
||||||
apply plugin: 'kotlin-kapt'
|
apply plugin: 'kotlin-kapt'
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
apply plugin: 'com.google.firebase.crashlytics'
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
apply plugin: 'com.google.devtools.ksp'
|
|
||||||
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "es.verdnatura"
|
compileSdkVersion 29
|
||||||
compileSdk 34
|
// buildToolsVersion "29.0.3"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "es.verdnatura"
|
applicationId "es.verdnatura"
|
||||||
minSdkVersion 26
|
minSdkVersion 21
|
||||||
targetSdkVersion 33 // se deja con target si no Play Protect la bloquea
|
targetSdkVersion 29
|
||||||
versionCode 330
|
versionCode 97
|
||||||
versionName = "24.38"
|
versionName "7.5.1" //VERSION CODE 97. Control de previa, Llamadas ok, menú ok y textos en iconos y imágenes.
|
||||||
|
//versionName "7.5" //VERSION CODE 96. Control de previa, Llamadas ok, menú ok y textos en iconos y imágenes.
|
||||||
|
//versionName "7.4" //VERSION CODE 95. Envio desde App enlaces correctos, un click controladores y llamadas sacador-controlador hecho pero no probado.
|
||||||
|
//versionName "7.3" //VERSION CODE 94. Se ve productos en balda y posibilidad de modificarlo.
|
||||||
|
//versionName "7.2.1" //VERSION CODE 93. Si eliges sector en V no aparece insertar las baldas.
|
||||||
|
//versionName "7.2" //VERSION CODE 92. Ordena sales en presacador por pickingOrder, ya no llama siempre para poner numero de baldas.
|
||||||
|
//versionName "7" //VERSION CODE 88. Se añade llamadas a parkingsales,incorpora poner numero de baldas
|
||||||
|
//versionName "6.6" //VERSION CODE 87. Modificado parking presacador.faltaba ver el ticket y se añade carro al historico de shelving.
|
||||||
|
//versionName "6.5.1" //VERSION CODE 86. Modificado parking presacador.faltaba ver el ticket y se añade carro al historico de shelving.
|
||||||
|
//versionName "6.5" //VERSION CODE 85. Modificado parking presacador. Llama a saleParking.
|
||||||
|
//versionName "6.4" //VERSION CODE 84. Modificados menus buffer y añadido hsitorico carro por items y por carro.
|
||||||
|
//versionName "6.3" //VERSION CODE 83 Nueva funcionalidad Cargar expedición en buffer
|
||||||
|
//versionName "6.2.1" // VERSION CODE 82 Aparece mensaje de error completo en "Error al construir la colección".
|
||||||
|
//versionName "6.2" //VERSION CODE 81, arreglado el null de grouping en ubicador.
|
||||||
|
//versionName "6.1.9.1" //VERSION CODE 80, arreglado el null de grouping en ubicador.
|
||||||
|
//versionName "6.1.9" VERSION CODE 76, añadido grouping, reference, prioridad, controladores vs scadores, boton mensaje error,rocket salix y error al añadir elemento a colección.
|
||||||
|
// Sin subir, Modificado y añadido mensajes de error, añadido opcion Dia de venta y su parking, teclado numerico para controlador
|
||||||
|
//versionName "6.1.8.5" VERSION CODE 75 // 23-10-2021//VERSION CODE 74-75 .Pantalla "Dia de venta y parking" Modificado itemtrash, deprecated preferenceManager, quitados ;,puesto menu general al controlador
|
||||||
|
//versionName "6.1.8.4.1" //VERSION CODE 73 . Modificar itemtrash
|
||||||
|
//versionName "6.1.8.4" //VERSION CODE 72 . Se añade ExpedtionScan para el Sorter, y modificion llamadas itemtrash y collectionGetTicket.
|
||||||
|
//versionName "6.1.8.3.1"//(VERSION CODE 71) Se añade ViewModel.collectionGet cuando se hace un collectionNew y un refresco de adapter
|
||||||
|
//versionName "6.1.8.3" //(VERSION CODE 69) Tres campos más en pantalla cel1,cel2,cel3, obtener artículos similares con filtro, mostrar foto del sacador.
|
||||||
|
//versionName "6.1.8.2" //(VERSIONCODE 68) Menu Operaciones buffer, pantalla mas grande en control vehiculo, deletefragments a todos los menus.
|
||||||
|
//versionName "6.1.8.1" //(VERSIONCODE 67) Control vehiculo , visualizar y filtrar historico
|
||||||
|
// versionName "5.4.4" //version inicial
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
/*debuggable false
|
minifyEnabled false
|
||||||
shrinkResources true
|
|
||||||
minifyEnabled true*/
|
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
|
|
||||||
//package de la app general = "package_name": "es.verdnatura"
|
|
||||||
//package de la app beta = "package_name": "es.verdnatura.sfusion"
|
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
|
||||||
variant.outputs.all { output ->
|
|
||||||
def flavorName = variant.productFlavors[0].name
|
|
||||||
def apkName
|
|
||||||
|
|
||||||
if (flavorName == "beta") {
|
|
||||||
apkName = "vn-pickingBeta.apk"
|
|
||||||
} else if (flavorName == "general") {
|
|
||||||
apkName = "vn-picking.apk"
|
|
||||||
} else {
|
|
||||||
apkName = "vn-picking.apk"
|
|
||||||
}
|
|
||||||
|
|
||||||
output.outputFileName = apkName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
flavorDimensions += "version"
|
|
||||||
productFlavors {
|
|
||||||
create("beta") {
|
|
||||||
applicationIdSuffix = ".sfusion"
|
|
||||||
}
|
|
||||||
create("general") {
|
|
||||||
//versionNameSuffix = "General"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
viewBinding = true
|
viewBinding = true
|
||||||
|
|
||||||
}
|
}
|
||||||
/*kotlinOptions {
|
|
||||||
jvmTarget = "1.8"
|
|
||||||
}
|
|
||||||
buildFeatures {
|
|
||||||
compose = true
|
|
||||||
}
|
|
||||||
kotlin {
|
|
||||||
jvmToolchain(8)
|
|
||||||
}
|
|
||||||
composeOptions {
|
|
||||||
kotlinCompilerExtensionVersion = "1.4.3"
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
dataBinding {
|
dataBinding {
|
||||||
enabled = true
|
enabled = true
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_17
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_17
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
implementation 'com.google.firebase:firebase-crashlytics-ktx:19.0.3'
|
|
||||||
implementation 'com.google.firebase:firebase-analytics-ktx:22.0.2'
|
|
||||||
implementation 'com.google.android.gms:play-services-location:21.3.0'
|
|
||||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7'
|
|
||||||
implementation 'androidx.navigation:navigation-ui-ktx:2.7.7'
|
|
||||||
implementation 'androidx.core:core-ktx:1.13.1'
|
|
||||||
kapt "androidx.room:room-compiler:2.6.1"
|
|
||||||
implementation 'androidx.room:room-ktx:2.6.1'
|
|
||||||
debugImplementation fileTree(dir: 'libs/debug', include: ['*.jar'])
|
debugImplementation fileTree(dir: 'libs/debug', include: ['*.jar'])
|
||||||
releaseImplementation fileTree(dir: 'libs/release', include: ['*.jar'])
|
releaseImplementation fileTree(dir: 'libs/release', include: ['*.jar'])
|
||||||
|
|
||||||
//canvas
|
|
||||||
implementation 'com.simplify:ink:1.0.0'
|
|
||||||
|
|
||||||
// Kotlin and Android
|
// Kotlin and Android
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||||
implementation 'androidx.core:core-ktx:1.13.1'
|
implementation 'androidx.core:core-ktx:1.2.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||||
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
|
||||||
//tests
|
testImplementation 'junit:junit:4.12'
|
||||||
testImplementation 'junit:junit:4.13.2'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
|
implementation 'com.google.android.material:material:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.12.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
|
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
|
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
|
||||||
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
|
||||||
implementation "com.airbnb.android:lottie:$lottieVersion"
|
implementation "com.airbnb.android:lottie:$lottieVersion"
|
||||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
|
||||||
|
|
||||||
|
//preferences
|
||||||
|
implementation 'androidx.preference:preference-ktx:1.1.1'
|
||||||
|
|
||||||
//Fragments
|
//Fragments
|
||||||
implementation("androidx.fragment:fragment-ktx:1.8.2")
|
implementation("androidx.fragment:fragment-ktx:1.3.6")
|
||||||
|
|
||||||
|
|
||||||
// Architecture components
|
// Architecture components
|
||||||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.4"
|
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle"
|
||||||
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.8.4"
|
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle"
|
||||||
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle"
|
||||||
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
|
||||||
|
|
||||||
//Koin new resolve
|
//Koin new resolve
|
||||||
|
//kotlin implementation in mavencentral--> jcenter deprecated
|
||||||
|
|
||||||
implementation "io.insert-koin:koin-core:$koin"
|
implementation "io.insert-koin:koin-core:$koin"
|
||||||
implementation "io.insert-koin:koin-android:$koin"
|
implementation "io.insert-koin:koin-android:$koin"
|
||||||
implementation "io.insert-koin:koin-androidx-scope:$koin"
|
implementation "io.insert-koin:koin-androidx-scope:$koin"
|
||||||
implementation "io.insert-koin:koin-androidx-viewmodel:$koin"
|
implementation "io.insert-koin:koin-androidx-viewmodel:$koin"
|
||||||
|
|
||||||
|
// Koin for DI
|
||||||
|
//implementation "org.koin:koin-core:$koin"
|
||||||
|
//implementation "org.koin:koin-android:$koin"
|
||||||
|
//implementation "org.koin:koin-androidx-scope:$koin"
|
||||||
|
//implementation "org.koin:koin-androidx-viewmodel:$koin"
|
||||||
|
|
||||||
|
|
||||||
// Image libraries
|
// Image libraries
|
||||||
implementation "io.coil-kt:coil:$coil"
|
implementation "io.coil-kt:coil:$coil"
|
||||||
implementation "com.github.bumptech.glide:glide:$glide"
|
implementation "com.github.bumptech.glide:glide:$glide"
|
||||||
implementation "com.github.bumptech.glide:okhttp3-integration:$glide"
|
implementation "com.github.bumptech.glide:okhttp3-integration:$glide"
|
||||||
//kapt "com.github.bumptech.glide:compiler:$glide"
|
kapt "com.github.bumptech.glide:compiler:$glide"
|
||||||
ksp("com.github.bumptech.glide:ksp:$glide")
|
|
||||||
|
|
||||||
// Add the Firebase Crashlytics SDK.
|
// Add the Firebase Crashlytics SDK.
|
||||||
implementation 'com.google.firebase:firebase-analytics:22.0.2'
|
implementation 'com.google.firebase:firebase-analytics:17.5.0'
|
||||||
|
implementation 'com.google.firebase:firebase-crashlytics:17.2.1'
|
||||||
|
|
||||||
//search
|
//search
|
||||||
implementation 'com.github.mirrajabi:search-dialog:1.1'
|
implementation 'com.github.mirrajabi:search-dialog:1.1'
|
||||||
|
@ -150,20 +135,5 @@ dependencies {
|
||||||
//logs
|
//logs
|
||||||
implementation 'com.jakewharton.timber:timber:4.7.1'
|
implementation 'com.jakewharton.timber:timber:4.7.1'
|
||||||
|
|
||||||
//pickerImage
|
|
||||||
implementation 'com.github.esafirm:android-image-picker:3.0.0-beta5'
|
|
||||||
|
|
||||||
//preferences
|
|
||||||
implementation("androidx.datastore:datastore-preferences:1.1.1")
|
|
||||||
implementation 'androidx.datastore:datastore-core:1.1.1'
|
|
||||||
|
|
||||||
|
|
||||||
// Compose
|
|
||||||
/* implementation(platform("androidx.compose:compose-bom:2024.02.01"))
|
|
||||||
implementation("androidx.compose.ui:ui")
|
|
||||||
implementation("androidx.compose.material:material")
|
|
||||||
implementation("androidx.compose.runtime:runtime")
|
|
||||||
implementation("androidx.activity:activity-compose:1.8.2")
|
|
||||||
implementation("androidx.compose.ui:ui-graphics")
|
|
||||||
implementation("androidx.compose.ui:ui-tooling-preview")*/
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,178 +0,0 @@
|
||||||
plugins {
|
|
||||||
id("com.android.application")
|
|
||||||
id("kotlin-android")
|
|
||||||
id("kotlin-kapt")
|
|
||||||
id("com.google.gms.google-services")
|
|
||||||
id("com.google.firebase.crashlytics")
|
|
||||||
id("com.google.devtools.ksp")
|
|
||||||
id("org.jetbrains.kotlin.plugin.compose")
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
|
||||||
namespace = "es.verdnatura"
|
|
||||||
compileSdk = 35
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
applicationId = "es.verdnatura"
|
|
||||||
minSdk = 26
|
|
||||||
targetSdk = 33 // se deja con target si no Play Protect la bloquea
|
|
||||||
versionCode = 405
|
|
||||||
versionName = "25.12" // REvisor para reservas
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
getByName("release") {
|
|
||||||
//debuggable = false
|
|
||||||
//shrinkResources = true
|
|
||||||
//minifyEnabled = true
|
|
||||||
proguardFiles(
|
|
||||||
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
getByName("debug") {
|
|
||||||
isMinifyEnabled = false
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//package de la app general = "package_name": "es.verdnatura"
|
|
||||||
//package de la app beta = "package_name": "es.verdnatura.sfusion"
|
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
|
||||||
variant.outputs.all { output ->
|
|
||||||
val flavorName = variant.productFlavors[0].name
|
|
||||||
val buildTypeName = variant.buildType.name
|
|
||||||
|
|
||||||
val apkName = when (flavorName) {
|
|
||||||
"beta" -> "vn-pickingBeta-${buildTypeName}.apk"
|
|
||||||
else -> "vn-picking-${buildTypeName}.apk"
|
|
||||||
}
|
|
||||||
output.outputFile.renameTo(File(output.outputFile.parentFile, apkName))
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
flavorDimensions += "version"
|
|
||||||
productFlavors {
|
|
||||||
create("beta") {
|
|
||||||
applicationIdSuffix = ".sfusion"
|
|
||||||
}
|
|
||||||
create("general") {}
|
|
||||||
}
|
|
||||||
kapt {
|
|
||||||
correctErrorTypes = true
|
|
||||||
useBuildCache = true
|
|
||||||
|
|
||||||
kotlinOptions {
|
|
||||||
languageVersion = "1.9"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
buildFeatures {
|
|
||||||
viewBinding = true
|
|
||||||
//compose = true
|
|
||||||
|
|
||||||
/*kotlinOptions {
|
|
||||||
jvmTarget = "1.8"
|
|
||||||
}
|
|
||||||
buildFeatures {
|
|
||||||
compose = true
|
|
||||||
}
|
|
||||||
|
|
||||||
composeOptions {
|
|
||||||
kotlinCompilerExtensionVersion = "1.4.3"
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
dataBinding = true
|
|
||||||
|
|
||||||
compose = true
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
compileOptions {
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_21
|
|
||||||
targetCompatibility = JavaVersion.VERSION_21
|
|
||||||
}
|
|
||||||
/* composeOptions {
|
|
||||||
kotlinCompilerExtensionVersion = "1.5.15"
|
|
||||||
}*/
|
|
||||||
/* kotlin {
|
|
||||||
jvmToolchain(17)
|
|
||||||
}
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = "17"
|
|
||||||
}*/
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
|
|
||||||
implementation(libs.firebase.crashlytics.ktx)
|
|
||||||
implementation(libs.firebase.analytics.ktx)
|
|
||||||
implementation(libs.play.services.location)
|
|
||||||
implementation(libs.navigation.fragment.ktx)
|
|
||||||
implementation(libs.androidx.navigation.ui.ktx)
|
|
||||||
implementation(libs.androidx.core.ktx)
|
|
||||||
implementation(libs.androidx.recyclerview)
|
|
||||||
implementation(libs.androidx.room.ktx)
|
|
||||||
//kapt(libs.androidx.room.compiler)
|
|
||||||
ksp(libs.androidx.room.compiler)
|
|
||||||
implementation(libs.androidx.room.runtime)
|
|
||||||
implementation(libs.ink)
|
|
||||||
implementation(libs.kotlin.stdlib.jdk7)
|
|
||||||
implementation(libs.androidx.appcompat)
|
|
||||||
implementation(libs.androidx.core.ktx)
|
|
||||||
implementation(libs.androidx.constraintlayout)
|
|
||||||
implementation(libs.androidx.legacy.support.v4)
|
|
||||||
implementation(libs.androidx.lifecycle.extensions)
|
|
||||||
implementation(libs.material)
|
|
||||||
implementation(libs.retrofit)
|
|
||||||
implementation(libs.converter.gson)
|
|
||||||
implementation(libs.converter.scalars)
|
|
||||||
implementation(libs.lottie)
|
|
||||||
implementation(libs.androidx.swiperefreshlayout)
|
|
||||||
implementation(libs.androidx.fragment.ktx)
|
|
||||||
implementation(libs.androidx.lifecycle.viewmodel.ktx)
|
|
||||||
implementation(libs.androidx.lifecycle.livedata.ktx)
|
|
||||||
implementation(libs.androidx.legacy.support.v4)
|
|
||||||
implementation(libs.koin.core)
|
|
||||||
implementation(libs.koin.android)
|
|
||||||
implementation(libs.koin.androidx.scope)
|
|
||||||
implementation(libs.koin.androidx.viewmodel)
|
|
||||||
implementation(libs.glide)
|
|
||||||
implementation(libs.okhttp3.integration)
|
|
||||||
ksp(libs.glide.ksp)
|
|
||||||
implementation(libs.firebase.analytics)
|
|
||||||
implementation(libs.android.image.picker)
|
|
||||||
implementation(libs.androidx.datastore.preferences)
|
|
||||||
implementation(libs.androidx.datastore.core)
|
|
||||||
implementation(libs.zxing.android.embedded) { isTransitive = false }
|
|
||||||
implementation(libs.core)
|
|
||||||
//implementation(libs.koin.androidx.compose)
|
|
||||||
|
|
||||||
// Compose
|
|
||||||
|
|
||||||
val composeBom = platform("androidx.compose:compose-bom:2024.10.01")
|
|
||||||
implementation(composeBom)
|
|
||||||
androidTestImplementation(composeBom)
|
|
||||||
// Choose one of the following:
|
|
||||||
// Material Design 3
|
|
||||||
implementation(libs.androidx.material3)
|
|
||||||
implementation(libs.androidx.ui)
|
|
||||||
// Android Studio Preview support
|
|
||||||
implementation(libs.androidx.ui.tooling.preview)
|
|
||||||
debugImplementation(libs.androidx.ui.tooling)
|
|
||||||
// UI Tests
|
|
||||||
androidTestImplementation(libs.androidx.ui.test.junit4)
|
|
||||||
debugImplementation(libs.androidx.ui.test.manifest)
|
|
||||||
// custom design system based on Foundation)
|
|
||||||
//implementation(libs.androidx.material.icons.core)
|
|
||||||
// Optional - Add full set of material icons
|
|
||||||
implementation(libs.androidx.material.icons.extended)
|
|
||||||
// Optional - Add window size utils
|
|
||||||
implementation(libs.androidx.adaptive)
|
|
||||||
implementation(libs.androidx.activity.compose)
|
|
||||||
implementation(libs.androidx.lifecycle.viewmodel.compose)
|
|
||||||
implementation(libs.lottie.compose)
|
|
||||||
testImplementation(libs.junit)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"version": 3,
|
|
||||||
"artifactType": {
|
|
||||||
"type": "APK",
|
|
||||||
"kind": "Directory"
|
|
||||||
},
|
|
||||||
"applicationId": "es.verdnatura",
|
|
||||||
"variantName": "debug",
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"type": "SINGLE",
|
|
||||||
"filters": [],
|
|
||||||
"attributes": [],
|
|
||||||
"versionCode": 144,
|
|
||||||
"versionName": "9.6Beta",
|
|
||||||
"outputFile": "app-debug.apk"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"elementType": "File"
|
|
||||||
}
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,91 +1,34 @@
|
||||||
{
|
{
|
||||||
"project_info": {
|
"project_info": {
|
||||||
"project_number": "975691769093",
|
"project_number": "519813071137",
|
||||||
"project_id": "picking-2b9a0",
|
"firebase_url": "https://gestoralmacen-bfa2a.firebaseio.com",
|
||||||
"storage_bucket": "picking-2b9a0.appspot.com"
|
"project_id": "gestoralmacen-bfa2a",
|
||||||
|
"storage_bucket": "gestoralmacen-bfa2a.appspot.com"
|
||||||
},
|
},
|
||||||
"client": [
|
"client": [
|
||||||
{
|
{
|
||||||
"client_info": {
|
"client_info": {
|
||||||
"mobilesdk_app_id": "1:975691769093:android:83eff0dadf5ca9d3e3c36c",
|
"mobilesdk_app_id": "1:519813071137:android:3de54686c580a6f79dfe60",
|
||||||
"android_client_info": {
|
"android_client_info": {
|
||||||
"package_name": "es.verdnatura"
|
"package_name": "es.verdnatura"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oauth_client": [
|
"oauth_client": [
|
||||||
{
|
{
|
||||||
"client_id": "975691769093-j2u5241eac30n2saa1mvbguq670tsvd0.apps.googleusercontent.com",
|
"client_id": "519813071137-5099s9mme9juufnrkm88ajt5n7cmluqh.apps.googleusercontent.com",
|
||||||
"client_type": 3
|
"client_type": 3
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"api_key": [
|
"api_key": [
|
||||||
{
|
{
|
||||||
"current_key": "AIzaSyC3skTw7I7BbOuSS4jOBa373zV5e8wCMDM"
|
"current_key": "AIzaSyA74wQCwDCpCjWs49lCX5m2SsdqcYb_J8s"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"services": {
|
"services": {
|
||||||
"appinvite_service": {
|
"appinvite_service": {
|
||||||
"other_platform_oauth_client": [
|
"other_platform_oauth_client": [
|
||||||
{
|
{
|
||||||
"client_id": "975691769093-j2u5241eac30n2saa1mvbguq670tsvd0.apps.googleusercontent.com",
|
"client_id": "519813071137-5099s9mme9juufnrkm88ajt5n7cmluqh.apps.googleusercontent.com",
|
||||||
"client_type": 3
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"client_info": {
|
|
||||||
"mobilesdk_app_id": "1:975691769093:android:83eff0dadf5ca9d3e3c36c",
|
|
||||||
"android_client_info": {
|
|
||||||
"package_name": "es.verdnatura.sfusion"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oauth_client": [
|
|
||||||
{
|
|
||||||
"client_id": "975691769093-j2u5241eac30n2saa1mvbguq670tsvd0.apps.googleusercontent.com",
|
|
||||||
"client_type": 3
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"api_key": [
|
|
||||||
{
|
|
||||||
"current_key": "AIzaSyC3skTw7I7BbOuSS4jOBa373zV5e8wCMDM"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"services": {
|
|
||||||
"appinvite_service": {
|
|
||||||
"other_platform_oauth_client": [
|
|
||||||
{
|
|
||||||
"client_id": "975691769093-j2u5241eac30n2saa1mvbguq670tsvd0.apps.googleusercontent.com",
|
|
||||||
"client_type": 3
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"client_info": {
|
|
||||||
"mobilesdk_app_id": "1:975691769093:android:83eff0dadf5ca9d3e3c36c",
|
|
||||||
"android_client_info": {
|
|
||||||
"package_name": "es.verdnatura.alpha"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oauth_client": [
|
|
||||||
{
|
|
||||||
"client_id": "975691769093-j2u5241eac30n2saa1mvbguq670tsvd0.apps.googleusercontent.com",
|
|
||||||
"client_type": 3
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"api_key": [
|
|
||||||
{
|
|
||||||
"current_key": "AIzaSyC3skTw7I7BbOuSS4jOBa373zV5e8wCMDM"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"services": {
|
|
||||||
"appinvite_service": {
|
|
||||||
"other_platform_oauth_client": [
|
|
||||||
{
|
|
||||||
"client_id": "975691769093-j2u5241eac30n2saa1mvbguq670tsvd0.apps.googleusercontent.com",
|
|
||||||
"client_type": 3
|
"client_type": 3
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Add project specific ProGuard rules here.
|
# Add project specific ProGuard rules here.
|
||||||
# You can control the set of applied configuration files using the
|
# You can control the set of applied configuration files using the
|
||||||
# proguardFiles setting in build.gradle.kts.
|
# proguardFiles setting in build.gradle.
|
||||||
#
|
#
|
||||||
# For more details, see
|
# For more details, see
|
||||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
@ -19,6 +19,3 @@
|
||||||
# If you keep the line number information, uncomment this to
|
# If you keep the line number information, uncomment this to
|
||||||
# hide the original source file name.
|
# hide the original source file name.
|
||||||
#-renamesourcefileattribute SourceFile
|
#-renamesourcefileattribute SourceFile
|
||||||
|
|
||||||
# Optimize options
|
|
||||||
#-keep class es.verdnatura.** { *; }
|
|
|
@ -4,15 +4,15 @@
|
||||||
"type": "APK",
|
"type": "APK",
|
||||||
"kind": "Directory"
|
"kind": "Directory"
|
||||||
},
|
},
|
||||||
"applicationId": "es.verdnatura.sfusion",
|
"applicationId": "es.verdnatura",
|
||||||
"variantName": "release",
|
"variantName": "release",
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"attributes": [],
|
"attributes": [],
|
||||||
"versionCode": 161,
|
"versionCode": 97,
|
||||||
"versionName": "23.3Beta",
|
"versionName": "7.5.1",
|
||||||
"outputFile": "app-release.apk"
|
"outputFile": "app-release.apk"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
Binary file not shown.
|
@ -1,18 +1,24 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
package="es.verdnatura">
|
||||||
|
|
||||||
<uses-feature
|
|
||||||
android:name="android.hardware.telephony"
|
|
||||||
android:required="false" />
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||||
<uses-permission android:name="android.permission.PREVENT_POWER_KEY" />
|
<uses-permission android:name="android.permission.PREVENT_POWER_KEY" />
|
||||||
<uses-permission android:name="android.permission.LAUNCH_APPS" />
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<!--
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
|
||||||
|
tools:ignore="ProtectedPermissions" />
|
||||||
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
|
<uses-permission android:name="com.zebra.provider.READ"/>-->
|
||||||
|
|
||||||
|
<queries>
|
||||||
|
<provider android:authorities="oem_info" />
|
||||||
|
</queries>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".MobileApplication"
|
android:name=".MobileApplication"
|
||||||
|
@ -23,60 +29,23 @@
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:usesCleartextTraffic="true">
|
android:usesCleartextTraffic="true">
|
||||||
<activity
|
<activity android:name=".presentation.view.feature.imageview.activity.ImageViewActivity" android:configChanges="orientation"
|
||||||
android:name=".presentation.view.feature.articulo.fragment.ImageViewActivity"
|
|
||||||
android:configChanges="orientation"
|
|
||||||
android:screenOrientation="portrait" />
|
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".presentation.composable.ImageViewActivityComposable"
|
|
||||||
android:configChanges="orientation"
|
|
||||||
android:exported="false"
|
|
||||||
android:screenOrientation="portrait" />
|
|
||||||
<activity
|
|
||||||
android:name=".presentation.view.feature.restaurant.RestaurantActivity"
|
|
||||||
android:configChanges="orientation"
|
|
||||||
android:screenOrientation="portrait"/>
|
android:screenOrientation="portrait"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".presentation.view.feature.main.activity.MainActivity"
|
android:name=".presentation.view.feature.main.activity.MainActivity"
|
||||||
|
android:windowSoftInputMode="stateHidden|adjustResize"
|
||||||
android:configChanges="orientation"
|
android:configChanges="orientation"
|
||||||
android:exported="true"
|
android:screenOrientation="portrait"/>
|
||||||
android:screenOrientation="portrait"
|
|
||||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
|
||||||
<activity
|
|
||||||
android:name=".presentation.view.feature.delivery.activity.SignedActivity"
|
|
||||||
android:configChanges="orientation"
|
|
||||||
android:exported="true"
|
|
||||||
android:screenOrientation="portrait"
|
|
||||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".presentation.view.feature.login.activity.LoginActivity"
|
android:name=".presentation.view.feature.login.activity.LoginActivity"
|
||||||
android:configChanges="orientation"
|
android:configChanges="orientation"
|
||||||
android:exported="true"
|
|
||||||
android:screenOrientation="portrait">
|
android:screenOrientation="portrait">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.SEND" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<data android:mimeType="image/*" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<provider
|
|
||||||
android:name="androidx.core.content.FileProvider"
|
|
||||||
android:authorities="${applicationId}.provider"
|
|
||||||
android:exported="false"
|
|
||||||
android:grantUriPermissions="true">
|
|
||||||
<meta-data
|
|
||||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
||||||
android:resource="@xml/file_paths" />
|
|
||||||
</provider>
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
|
@ -1,186 +1,20 @@
|
||||||
package es.verdnatura
|
package es.verdnatura
|
||||||
|
|
||||||
import android.app.Activity
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import android.graphics.Color
|
|
||||||
import android.media.MediaPlayer
|
|
||||||
import android.os.Bundle
|
|
||||||
import android.os.Handler
|
|
||||||
import android.os.Looper
|
|
||||||
import android.widget.Toast
|
|
||||||
import es.verdnatura.dataStore.DataStoreLocal
|
|
||||||
import es.verdnatura.di.viewModelModule
|
import es.verdnatura.di.viewModelModule
|
||||||
import es.verdnatura.domain.ConstAndValues
|
|
||||||
import es.verdnatura.domain.RestClient
|
|
||||||
import es.verdnatura.domain.SalixService
|
|
||||||
import es.verdnatura.domain.toast
|
|
||||||
import es.verdnatura.presentation.common.InteceptorListener
|
|
||||||
import es.verdnatura.presentation.common.LoginListener
|
|
||||||
import es.verdnatura.presentation.common.MainActivityListener
|
|
||||||
import es.verdnatura.presentation.common.SignListener
|
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogMainActivity
|
|
||||||
import es.verdnatura.presentation.view.feature.login.activity.LoginActivity
|
|
||||||
import kotlinx.coroutines.runBlocking
|
|
||||||
import org.koin.android.ext.koin.androidContext
|
import org.koin.android.ext.koin.androidContext
|
||||||
import org.koin.core.context.loadKoinModules
|
import org.koin.core.context.loadKoinModules
|
||||||
import org.koin.core.context.startKoin
|
import org.koin.core.context.startKoin
|
||||||
import java.io.File
|
|
||||||
|
|
||||||
class MobileApplication : Application(), InteceptorListener {
|
|
||||||
private lateinit var interceptoreListener: InteceptorListener
|
|
||||||
private var mainActivityListener: MainActivityListener? = null
|
|
||||||
private var loginListener: LoginListener? = null
|
|
||||||
private var signListener: SignListener? = null
|
|
||||||
private var isActivityLoginRunning = false
|
|
||||||
|
|
||||||
fun setMainListener(listener: MainActivityListener) {
|
|
||||||
mainActivityListener = listener
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setLoginListener(listener: LoginListener) {
|
|
||||||
loginListener = listener
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setSignListener(listener: SignListener) {
|
|
||||||
signListener = listener
|
|
||||||
}
|
|
||||||
|
|
||||||
lateinit var salix: SalixService
|
|
||||||
var userId: Int? = null
|
|
||||||
var userName: String? = null
|
|
||||||
var renewPeriod: Long = 0
|
|
||||||
var renewInterval: Long = 0
|
|
||||||
var userPassword: String? = null
|
|
||||||
var hasNetwork: Boolean = true
|
|
||||||
var serialNumber: String? = ""
|
|
||||||
var versionName: String = ""
|
|
||||||
var androidId: String = ""
|
|
||||||
var mperror: MediaPlayer? = null
|
|
||||||
var mpok: MediaPlayer? = null
|
|
||||||
var dataStoreApp = DataStoreLocal(this)
|
|
||||||
private lateinit var customDialog: CustomDialogMainActivity
|
|
||||||
private val handler = Handler(Looper.getMainLooper())
|
|
||||||
|
|
||||||
|
class MobileApplication: Application() {
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
mperror = MediaPlayer.create((this), R.raw.error)
|
|
||||||
mpok = MediaPlayer.create((this), R.raw.ok)
|
startKoin { androidContext(this@MobileApplication)
|
||||||
startKoin {
|
|
||||||
androidContext(this@MobileApplication)
|
|
||||||
val moduleList = listOf(viewModelModule)
|
val moduleList = listOf(viewModelModule)
|
||||||
loadKoinModules(moduleList)
|
loadKoinModules(moduleList)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
runBlocking {
|
|
||||||
dataStoreApp.editDataStoreKey(
|
|
||||||
ConstAndValues.BASEURLSALIX, ConstAndValues.BASE_URL_SALIX
|
|
||||||
)
|
|
||||||
}
|
|
||||||
val restClient = RestClient(this, this)
|
|
||||||
salix = restClient.salixClient
|
|
||||||
|
|
||||||
registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {
|
|
||||||
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onActivityStarted(activity: Activity) {
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onActivityResumed(activity: Activity) {
|
|
||||||
isActivityLoginRunning = activity.javaClass == LoginActivity::class.java
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onActivityPaused(activity: Activity) {
|
|
||||||
if (activity.javaClass == LoginActivity::class.java) {
|
|
||||||
isActivityLoginRunning = false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityStopped(activity: Activity) {
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onActivityDestroyed(activity: Activity) {
|
|
||||||
isActivityLoginRunning = false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fun messageToast(isError: Boolean, message: String, isToasted: Boolean = false) {
|
|
||||||
when (isError) {
|
|
||||||
false -> mpok
|
|
||||||
true -> mperror
|
|
||||||
}?.start()
|
|
||||||
|
|
||||||
if (isToasted) message.toast(
|
|
||||||
this, color = if (isError) {
|
|
||||||
Color.RED
|
|
||||||
} else {
|
|
||||||
Color.BLUE
|
|
||||||
},
|
|
||||||
duration = if (isError) Toast.LENGTH_LONG else Toast.LENGTH_SHORT
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun isLoginRunning(): Boolean {
|
|
||||||
return isActivityLoginRunning
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onInterceptionResult(visibility: Int) {
|
|
||||||
if (mainActivityListener != null) {
|
|
||||||
handler.post {
|
|
||||||
(this.mainActivityListener)?.onApplicationEventAnimation(visibility)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (loginListener != null) {
|
|
||||||
handler.post {
|
|
||||||
(this.loginListener)?.onApplicationEventAnimation(visibility)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (signListener != null) {
|
|
||||||
handler.post {
|
|
||||||
(this.signListener)?.onApplicationEventAnimation(visibility)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getLanguage(): String {
|
|
||||||
val settings = this.resources.configuration
|
|
||||||
return settings.locales.get(0).language
|
|
||||||
}
|
|
||||||
|
|
||||||
fun clearApplicationData() {
|
|
||||||
try {
|
|
||||||
val cacheDir = this.cacheDir
|
|
||||||
val appDir = File(cacheDir.parent ?: return)
|
|
||||||
if (appDir.exists()) {
|
|
||||||
val children = appDir.list() ?: return
|
|
||||||
for (child in children) {
|
|
||||||
if (child != "lib") {
|
|
||||||
deleteDir(File(appDir, child))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e: Exception) {
|
|
||||||
e.printStackTrace()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun deleteDir(dir: File): Boolean {
|
|
||||||
if (dir.isDirectory) {
|
|
||||||
val children = dir.list() ?: return false
|
|
||||||
for (child in children) {
|
|
||||||
val success = deleteDir(File(dir, child))
|
|
||||||
if (!success) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return dir.delete()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,439 +0,0 @@
|
||||||
package es.verdnatura.dataStore
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import androidx.datastore.core.DataStore
|
|
||||||
import androidx.datastore.preferences.core.Preferences
|
|
||||||
import androidx.datastore.preferences.core.booleanPreferencesKey
|
|
||||||
import androidx.datastore.preferences.core.edit
|
|
||||||
import androidx.datastore.preferences.core.intPreferencesKey
|
|
||||||
import androidx.datastore.preferences.core.longPreferencesKey
|
|
||||||
import androidx.datastore.preferences.core.stringPreferencesKey
|
|
||||||
import androidx.datastore.preferences.preferencesDataStore
|
|
||||||
import com.google.gson.Gson
|
|
||||||
import com.google.gson.reflect.TypeToken
|
|
||||||
import es.verdnatura.MobileApplication
|
|
||||||
import es.verdnatura.R
|
|
||||||
import es.verdnatura.domain.ConstAndValues.BASEURLLILIUM
|
|
||||||
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
|
|
||||||
import es.verdnatura.domain.ConstAndValues.BASE_URL_LILIUM
|
|
||||||
import es.verdnatura.domain.ConstAndValues.BASE_URL_SALIX
|
|
||||||
import es.verdnatura.domain.ConstAndValues.COMPANYFK
|
|
||||||
import es.verdnatura.domain.ConstAndValues.ENTRYID
|
|
||||||
import es.verdnatura.domain.ConstAndValues.ENTRYNUMBERIMAGES
|
|
||||||
import es.verdnatura.domain.ConstAndValues.ENTRYOBSERVATIONORIGINAL
|
|
||||||
import es.verdnatura.domain.ConstAndValues.ENTRYOBSERVATIONS
|
|
||||||
import es.verdnatura.domain.ConstAndValues.ITEMPACKING
|
|
||||||
import es.verdnatura.domain.ConstAndValues.NUMBEROFWAGONS
|
|
||||||
import es.verdnatura.domain.ConstAndValues.PRINTERFK
|
|
||||||
import es.verdnatura.domain.ConstAndValues.PRINTERFKDEFAULT
|
|
||||||
import es.verdnatura.domain.ConstAndValues.PRINTERNAME
|
|
||||||
import es.verdnatura.domain.ConstAndValues.RESERVATIONMODE
|
|
||||||
import es.verdnatura.domain.ConstAndValues.SECTORDESCRIP
|
|
||||||
import es.verdnatura.domain.ConstAndValues.SECTORFK
|
|
||||||
import es.verdnatura.domain.ConstAndValues.SECTORFKDEFAULT
|
|
||||||
import es.verdnatura.domain.ConstAndValues.SECTORISONRESERVATIONMODE
|
|
||||||
import es.verdnatura.domain.ConstAndValues.SUPPLIERID
|
|
||||||
import es.verdnatura.domain.ConstAndValues.SUPPLIERNAME
|
|
||||||
import es.verdnatura.domain.ConstAndValues.TRAINNAME
|
|
||||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFK
|
|
||||||
import es.verdnatura.domain.ConstAndValues.WAREHOUSEFKDEFAULT
|
|
||||||
import es.verdnatura.domain.ConstAndValues.WORKFORMSELECTED
|
|
||||||
import es.verdnatura.presentation.view.feature.login.model.OperatorSalix
|
|
||||||
import es.verdnatura.presentation.view.feature.login.model.WorkForms
|
|
||||||
import es.verdnatura.presentation.view.feature.login.model.WorkerData
|
|
||||||
import kotlinx.coroutines.flow.Flow
|
|
||||||
import kotlinx.coroutines.flow.first
|
|
||||||
import kotlinx.coroutines.flow.map
|
|
||||||
import kotlinx.coroutines.runBlocking
|
|
||||||
import org.json.JSONObject
|
|
||||||
import java.util.Calendar
|
|
||||||
|
|
||||||
val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "settings")
|
|
||||||
val Context.dataStoreWork: DataStore<Preferences> by preferencesDataStore(name = "workForm")
|
|
||||||
|
|
||||||
class DataStoreLocal(var mobileApplication: MobileApplication) {
|
|
||||||
val IMAGES_KEY = stringPreferencesKey("images_key")
|
|
||||||
|
|
||||||
suspend fun saveDataOperator(operator: OperatorSalix) {
|
|
||||||
|
|
||||||
editDataStoreKey(
|
|
||||||
SECTORFK, if (operator.sector != null) {
|
|
||||||
operator.sector.id
|
|
||||||
} else {
|
|
||||||
SECTORFKDEFAULT
|
|
||||||
}
|
|
||||||
)
|
|
||||||
editDataStoreKey(
|
|
||||||
WAREHOUSEFK, if (operator.sector != null) {
|
|
||||||
operator.sector.warehouseFk
|
|
||||||
} else {
|
|
||||||
WAREHOUSEFKDEFAULT
|
|
||||||
}
|
|
||||||
)
|
|
||||||
editDataStoreKey(
|
|
||||||
SECTORDESCRIP, if (operator.sector != null) {
|
|
||||||
operator.sector.description
|
|
||||||
} else {
|
|
||||||
mobileApplication.getString(R.string.Sinsector)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
editDataStoreKey(
|
|
||||||
PRINTERFK, if (operator.printer != null) {
|
|
||||||
operator.printer.id
|
|
||||||
} else {
|
|
||||||
PRINTERFKDEFAULT
|
|
||||||
}
|
|
||||||
)
|
|
||||||
editDataStoreKey(
|
|
||||||
PRINTERNAME, if (operator.printer != null) {
|
|
||||||
operator.printer.name
|
|
||||||
} else {
|
|
||||||
mobileApplication.getString(R.string.printerWithout)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
editDataStoreKey(
|
|
||||||
TRAINNAME, if (operator.train != null) {
|
|
||||||
operator.train.name
|
|
||||||
} else {
|
|
||||||
""
|
|
||||||
}
|
|
||||||
)
|
|
||||||
editDataStoreKey(
|
|
||||||
NUMBEROFWAGONS, operator.numberOfWagons
|
|
||||||
)
|
|
||||||
|
|
||||||
editDataStoreKey(
|
|
||||||
ITEMPACKING,
|
|
||||||
if (operator.itemPackingTypeFk != null) operator.itemPackingTypeFk.toString() else ""
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
editDataStoreKey(
|
|
||||||
RESERVATIONMODE, operator.isOnReservationMode
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//Tarea 6868
|
|
||||||
suspend fun saveWorkerData(operator: WorkerData) {
|
|
||||||
|
|
||||||
editDataStoreKey(
|
|
||||||
SECTORFK, if (operator.sector != null) {
|
|
||||||
operator.sector.id
|
|
||||||
} else {
|
|
||||||
SECTORFKDEFAULT
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (operator.sector?.isOnReservationMode != null) {
|
|
||||||
editDataStoreKey(
|
|
||||||
SECTORISONRESERVATIONMODE,
|
|
||||||
operator.sector.isOnReservationMode
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
mobileApplication.dataStore.edit { preferences ->
|
|
||||||
preferences.remove(stringPreferencesKey(SECTORISONRESERVATIONMODE))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
editDataStoreKey(
|
|
||||||
WAREHOUSEFK, if (operator.sector != null) {
|
|
||||||
operator.sector.warehouseFk
|
|
||||||
} else {
|
|
||||||
WAREHOUSEFKDEFAULT
|
|
||||||
}
|
|
||||||
)
|
|
||||||
editDataStoreKey(
|
|
||||||
SECTORDESCRIP, if (operator.sector != null) {
|
|
||||||
operator.sector.description
|
|
||||||
} else {
|
|
||||||
mobileApplication.getString(R.string.Sinsector)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
editDataStoreKey(
|
|
||||||
PRINTERFK, if (operator.printer != null) {
|
|
||||||
operator.printer.id
|
|
||||||
} else {
|
|
||||||
PRINTERFKDEFAULT
|
|
||||||
}
|
|
||||||
)
|
|
||||||
editDataStoreKey(
|
|
||||||
PRINTERNAME, if (operator.printer != null) {
|
|
||||||
operator.printer.name
|
|
||||||
} else {
|
|
||||||
mobileApplication.getString(R.string.printerWithout)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
editDataStoreKey(
|
|
||||||
TRAINNAME, if (operator.train != null) {
|
|
||||||
operator.train.name
|
|
||||||
} else {
|
|
||||||
""
|
|
||||||
}
|
|
||||||
)
|
|
||||||
editDataStoreKey(
|
|
||||||
NUMBEROFWAGONS, operator.numberOfWagons
|
|
||||||
)
|
|
||||||
editDataStoreKey(
|
|
||||||
RESERVATIONMODE, operator.isOnReservationMode
|
|
||||||
)
|
|
||||||
editDataStoreKey(
|
|
||||||
ITEMPACKING,
|
|
||||||
operator.itemPackingTypeFk
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun isPreferenceExists(key: String): Boolean {
|
|
||||||
val preferencesKey = booleanPreferencesKey(key)
|
|
||||||
val preferences = mobileApplication.dataStore.data.first()
|
|
||||||
return preferences.contains(preferencesKey)
|
|
||||||
}
|
|
||||||
|
|
||||||
inline fun <reified T> readDataStoreKey(key: String): T {
|
|
||||||
|
|
||||||
return when (T::class) {
|
|
||||||
Int::class ->
|
|
||||||
runBlocking {
|
|
||||||
mobileApplication.dataStore.data
|
|
||||||
.map { preferences -> preferences[intPreferencesKey(key)] ?: -1 }
|
|
||||||
.first() as T
|
|
||||||
}
|
|
||||||
|
|
||||||
String::class -> runBlocking {
|
|
||||||
mobileApplication.dataStore.data
|
|
||||||
.map { preferences ->
|
|
||||||
preferences[stringPreferencesKey(key)] ?: if (key == BASEURLSALIX) {
|
|
||||||
BASE_URL_SALIX
|
|
||||||
} else {
|
|
||||||
""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.first() as T
|
|
||||||
}
|
|
||||||
|
|
||||||
Boolean::class -> runBlocking {
|
|
||||||
mobileApplication.dataStore.data
|
|
||||||
.map { preferences -> preferences[booleanPreferencesKey(key)] ?: false }
|
|
||||||
.first() as T
|
|
||||||
}
|
|
||||||
|
|
||||||
Long::class -> runBlocking {
|
|
||||||
mobileApplication.dataStore.data
|
|
||||||
.map { preferences -> preferences[longPreferencesKey(key)] ?: 0 }
|
|
||||||
.first() as T
|
|
||||||
}
|
|
||||||
|
|
||||||
else -> "ERROR" as T
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun editDataStoreKey(key: String, value: Any) {
|
|
||||||
|
|
||||||
mobileApplication.dataStore.edit { preferences ->
|
|
||||||
when (value) {
|
|
||||||
is Int -> preferences[intPreferencesKey(key)] = value
|
|
||||||
is String -> preferences[stringPreferencesKey(key)] = value
|
|
||||||
is Boolean -> preferences[booleanPreferencesKey(key)] = value
|
|
||||||
is Long -> preferences[longPreferencesKey(key)] = value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun saveImages(images: MutableList<com.esafirm.imagepicker.model.Image>?) {
|
|
||||||
val gson = Gson()
|
|
||||||
val imagesJson = gson.toJson(images)
|
|
||||||
mobileApplication.dataStore.edit { preferences ->
|
|
||||||
preferences[IMAGES_KEY] = imagesJson
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getImages(): Flow<List<com.esafirm.imagepicker.model.Image>> {
|
|
||||||
val gson = Gson()
|
|
||||||
return mobileApplication.dataStore.data.map { preferences ->
|
|
||||||
val imagesJson = preferences[IMAGES_KEY]
|
|
||||||
?: return@map emptyList<com.esafirm.imagepicker.model.Image>()
|
|
||||||
val type = object : TypeToken<List<com.esafirm.imagepicker.model.Image>>() {}.type
|
|
||||||
gson.fromJson(imagesJson, type)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun deleteEntryPackaging() {
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(ENTRYID, -1)
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(SUPPLIERID, -1)
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(SUPPLIERNAME, "")
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(ENTRYOBSERVATIONORIGINAL, "")
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(ENTRYOBSERVATIONS, "")
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(ENTRYNUMBERIMAGES, 0)
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(COMPANYFK, -1)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun deleteImages() {
|
|
||||||
mobileApplication.dataStore.edit { preferences ->
|
|
||||||
preferences.remove(IMAGES_KEY)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun deleteWorkForm(nameWorkForm: Preferences.Key<String>) {
|
|
||||||
|
|
||||||
if (nameWorkForm.name == "all") {
|
|
||||||
mobileApplication.dataStoreWork.edit {
|
|
||||||
it.clear()
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
mobileApplication.dataStoreWork.edit { preferences ->
|
|
||||||
preferences.remove(nameWorkForm)
|
|
||||||
}
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
|
||||||
WORKFORMSELECTED, "Producción"
|
|
||||||
)
|
|
||||||
saveWorkForm(
|
|
||||||
WorkForms(
|
|
||||||
"Producción",
|
|
||||||
"https://salix.verdnatura.es"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun getWorkForm(): List<WorkForms> {
|
|
||||||
val listForms: ArrayList<WorkForms> = ArrayList()
|
|
||||||
val preferences = mobileApplication.dataStoreWork.data.first()
|
|
||||||
|
|
||||||
preferences.asMap().forEach { entry ->
|
|
||||||
val key = entry.key
|
|
||||||
val value = entry.value
|
|
||||||
|
|
||||||
val json2 = JSONObject(value.toString())
|
|
||||||
|
|
||||||
listForms.add(
|
|
||||||
WorkForms(
|
|
||||||
key.name,
|
|
||||||
json2.get("urlSalix").toString(),
|
|
||||||
json2.get("isShowDelete").toString().toBoolean(),
|
|
||||||
json2.get("created") as Long
|
|
||||||
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (listForms.isEmpty() || listForms.size == 1) {
|
|
||||||
createWorksDefault()
|
|
||||||
}
|
|
||||||
//createWorksDefault()
|
|
||||||
|
|
||||||
return listForms.sortedBy { it.created }
|
|
||||||
}
|
|
||||||
|
|
||||||
private suspend fun createWorksDefault() {
|
|
||||||
saveWorkForm(
|
|
||||||
WorkForms(
|
|
||||||
"Producción",
|
|
||||||
"https://salix.verdnatura.es"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
saveWorkForm(
|
|
||||||
WorkForms(
|
|
||||||
"Test",
|
|
||||||
urlSalix = "https://test-salix.verdnatura.es"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
saveWorkForm(
|
|
||||||
WorkForms(
|
|
||||||
"Dev",
|
|
||||||
urlSalix = "https://dev-salix.verdnatura.es"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
saveWorkForm(
|
|
||||||
WorkForms(
|
|
||||||
"Aula formación",
|
|
||||||
urlSalix = "http://pc525.samba.verdnatura.es:3000"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
val working_in_test = false
|
|
||||||
if (working_in_test) {
|
|
||||||
saveWorkForm(
|
|
||||||
WorkForms(
|
|
||||||
"TestHome",
|
|
||||||
urlSalix = "https://test-salix.verdnatura.es"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
saveWorkForm(
|
|
||||||
WorkForms(
|
|
||||||
"TestLOCAL",
|
|
||||||
urlSalix = "http://10.1.4.42:3000"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
saveWorkForm(
|
|
||||||
WorkForms(
|
|
||||||
"TestLOCALHOME",
|
|
||||||
urlSalix = "http://192.168.1.139:3000"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
saveWorkForm(
|
|
||||||
WorkForms(
|
|
||||||
"DEV SALIX",
|
|
||||||
urlSalix = "https://dev-salix.verdnatura.es"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
//deleteWorkForm("all")
|
|
||||||
}
|
|
||||||
saveWorkForm(
|
|
||||||
WorkForms(
|
|
||||||
mobileApplication.getString(R.string.addWorkForm),
|
|
||||||
"",
|
|
||||||
isShowDelete = false,
|
|
||||||
created = Calendar.getInstance().timeInMillis + Calendar.getInstance().timeInMillis
|
|
||||||
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun saveWorkForm(workForm: WorkForms) {
|
|
||||||
|
|
||||||
val gson = Gson()
|
|
||||||
val json = gson.toJson(workForm)
|
|
||||||
mobileApplication.dataStoreWork.edit { preferences ->
|
|
||||||
preferences[stringPreferencesKey(workForm.name)] = json
|
|
||||||
}
|
|
||||||
|
|
||||||
runBlocking {
|
|
||||||
|
|
||||||
mobileApplication.dataStoreApp.editDataStoreKey(
|
|
||||||
BASEURLSALIX,
|
|
||||||
workForm.urlSalix
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getServerSalix(): String {
|
|
||||||
|
|
||||||
var url =
|
|
||||||
readDataStoreKey<String>(BASEURLSALIX)
|
|
||||||
if (url.isBlank()) {
|
|
||||||
url = BASE_URL_SALIX
|
|
||||||
}
|
|
||||||
return url
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getServerLilium(): String {
|
|
||||||
|
|
||||||
var url =
|
|
||||||
readDataStoreKey<String>(BASEURLLILIUM)
|
|
||||||
if (url.isBlank()) {
|
|
||||||
url = BASE_URL_LILIUM
|
|
||||||
}
|
|
||||||
return url
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,210 +0,0 @@
|
||||||
package es.verdnatura.db
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import androidx.room.Dao
|
|
||||||
import androidx.room.Database
|
|
||||||
import androidx.room.Delete
|
|
||||||
import androidx.room.Insert
|
|
||||||
import androidx.room.OnConflictStrategy
|
|
||||||
import androidx.room.ProvidedTypeConverter
|
|
||||||
import androidx.room.Query
|
|
||||||
import androidx.room.Room
|
|
||||||
import androidx.room.RoomDatabase
|
|
||||||
import androidx.room.TypeConverter
|
|
||||||
import androidx.room.TypeConverters
|
|
||||||
import com.google.gson.Gson
|
|
||||||
import com.google.gson.reflect.TypeToken
|
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketSalix
|
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoLoadUnload
|
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoPending
|
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.MyLocation
|
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteInfo
|
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteLoaded
|
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.SignedTickets
|
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.Ticket
|
|
||||||
import java.util.Date
|
|
||||||
|
|
||||||
// Clase que representa la base de datos
|
|
||||||
@Database(
|
|
||||||
entities = [ExpeditionInfoLoadUnload::class, ExpeditionInfoPending::class, SignedTickets::class, RouteInfo::class, ClientTicketSalix::class, RouteLoaded::class],
|
|
||||||
version = 1,
|
|
||||||
exportSchema = false
|
|
||||||
|
|
||||||
)
|
|
||||||
@TypeConverters(MapTypeConverter::class)
|
|
||||||
abstract class DeliveryDatabase : RoomDatabase() {
|
|
||||||
abstract fun expedicionDao(): ExpedicionDao
|
|
||||||
abstract fun signedTicketDao(): SignedTicketDao
|
|
||||||
abstract fun routesDao(): RoutesDao
|
|
||||||
|
|
||||||
abstract fun clienTicketDao(): ClientTicketDao
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
@Volatile
|
|
||||||
private var INSTANCE: DeliveryDatabase? = null
|
|
||||||
|
|
||||||
fun getInstance(context: Context): DeliveryDatabase {
|
|
||||||
return INSTANCE ?: synchronized(this) {
|
|
||||||
val instance = Room.databaseBuilder(
|
|
||||||
context.applicationContext, DeliveryDatabase::class.java, "expedition_database"
|
|
||||||
).fallbackToDestructiveMigration(true)
|
|
||||||
.addTypeConverter(MapTypeConverter())
|
|
||||||
.fallbackToDestructiveMigration(true)
|
|
||||||
.build()
|
|
||||||
INSTANCE = instance
|
|
||||||
instance
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Interfaz que define los métodos de acceso a datos para Expedicion
|
|
||||||
@Dao
|
|
||||||
interface ExpedicionDao {
|
|
||||||
@Query("SELECT * FROM expedition e WHERE e.routeFk = :parametro1")
|
|
||||||
suspend fun getAll(parametro1: Int): MutableList<ExpeditionInfoLoadUnload>
|
|
||||||
|
|
||||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
||||||
suspend fun insert(expedition: MutableList<ExpeditionInfoLoadUnload>)
|
|
||||||
|
|
||||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
||||||
suspend fun insertPending(expeditionPending: MutableList<ExpeditionInfoPending>)
|
|
||||||
|
|
||||||
@Query("SELECT * FROM expeditionPending ep WHERE ep.routeFk=:routeFk")
|
|
||||||
suspend fun getAllPending(routeFk: Int): MutableList<ExpeditionInfoLoadUnload>
|
|
||||||
|
|
||||||
@Query("SELECT * FROM expeditionPending")
|
|
||||||
suspend fun getAllPendingExpeditions(): MutableList<ExpeditionInfoPending>
|
|
||||||
|
|
||||||
@Delete
|
|
||||||
fun delete(expedition: ExpeditionInfoLoadUnload)
|
|
||||||
|
|
||||||
@Query("DELETE FROM expeditionPending WHERE code = :codeState")
|
|
||||||
suspend fun getDeleteByState(codeState: String)
|
|
||||||
|
|
||||||
@Query("DELETE FROM expeditionPending")
|
|
||||||
suspend fun getDeleteAllState()
|
|
||||||
}
|
|
||||||
|
|
||||||
@Dao
|
|
||||||
interface SignedTicketDao {
|
|
||||||
@Query("SELECT * FROM signedPending ")
|
|
||||||
suspend fun getAll(): List<SignedTickets>
|
|
||||||
|
|
||||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
||||||
suspend fun insert(signedTicketPending: SignedTickets)
|
|
||||||
|
|
||||||
@Query("DELETE FROM signedPending WHERE fileName = :nameFile")
|
|
||||||
fun deleteByNameFile(nameFile: String)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Dao
|
|
||||||
interface RoutesDao {
|
|
||||||
@Query("SELECT * FROM routes ")
|
|
||||||
suspend fun getAll(): List<RouteInfo>
|
|
||||||
|
|
||||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
||||||
suspend fun insert(routes: List<RouteInfo>)
|
|
||||||
|
|
||||||
@Query("DELETE FROM routes ")
|
|
||||||
suspend fun delete()
|
|
||||||
|
|
||||||
@Query("DELETE FROM routes WHERE id = :routeId")
|
|
||||||
suspend fun deleteByNameFile(routeId: String)
|
|
||||||
|
|
||||||
@Query("SELECT * FROM routesLoaded ")
|
|
||||||
suspend fun getAllLoaded(): List<RouteLoaded>
|
|
||||||
|
|
||||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
||||||
suspend fun insertLoaded(routeLoaded: RouteLoaded)
|
|
||||||
|
|
||||||
@Query("DELETE FROM routes WHERE dated != :today")
|
|
||||||
suspend fun deleteLoaded(today: String)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Dao
|
|
||||||
interface ClientTicketDao {
|
|
||||||
@Query("SELECT * FROM clientTickets ")
|
|
||||||
suspend fun getAll(): List<ClientTicketSalix>
|
|
||||||
|
|
||||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
|
||||||
suspend fun insert(routes: List<ClientTicketSalix>)
|
|
||||||
|
|
||||||
@Query("DELETE FROM clientTickets ")
|
|
||||||
suspend fun delete()
|
|
||||||
|
|
||||||
@Query("DELETE FROM clientTickets WHERE id = :ticketId")
|
|
||||||
suspend fun deleteById(ticketId: Int)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@ProvidedTypeConverter
|
|
||||||
class MapTypeConverter {
|
|
||||||
private val gson = Gson()
|
|
||||||
|
|
||||||
@TypeConverter
|
|
||||||
fun fromMap(map: Map<String, String>): String {
|
|
||||||
return gson.toJson(map)
|
|
||||||
}
|
|
||||||
|
|
||||||
@TypeConverter
|
|
||||||
fun toMap(json: String): Map<String, String> {
|
|
||||||
val type = object : TypeToken<Map<String, String>>() {}.type
|
|
||||||
return gson.fromJson(json, type)
|
|
||||||
}
|
|
||||||
|
|
||||||
@TypeConverter
|
|
||||||
fun fromDate(date: Date): Long {
|
|
||||||
return date.time
|
|
||||||
}
|
|
||||||
|
|
||||||
@TypeConverter
|
|
||||||
fun toDate(timestamp: Long): Date {
|
|
||||||
return Date(timestamp)
|
|
||||||
}
|
|
||||||
|
|
||||||
@TypeConverter
|
|
||||||
fun fromMyLocation(location: MyLocation?): String? {
|
|
||||||
return gson.toJson(location)
|
|
||||||
}
|
|
||||||
|
|
||||||
@TypeConverter
|
|
||||||
fun toMyLocation(json: String?): MyLocation? {
|
|
||||||
val type = object : TypeToken<MyLocation>() {}.type
|
|
||||||
return gson.fromJson(json, type)
|
|
||||||
}
|
|
||||||
|
|
||||||
@TypeConverter
|
|
||||||
fun fromPhones(phones: List<String>): String {
|
|
||||||
return gson.toJson(phones)
|
|
||||||
}
|
|
||||||
|
|
||||||
@TypeConverter
|
|
||||||
fun toPhones(json: String): List<String> {
|
|
||||||
val type = object : TypeToken<List<String>>() {}.type
|
|
||||||
return gson.fromJson(json, type)
|
|
||||||
}
|
|
||||||
|
|
||||||
@TypeConverter
|
|
||||||
fun fromTickets(tickets: MutableList<Ticket>): String? {
|
|
||||||
return gson.toJson(tickets)
|
|
||||||
}
|
|
||||||
|
|
||||||
@TypeConverter
|
|
||||||
fun toTickets(json: String?): MutableList<Ticket> {
|
|
||||||
val type = object : TypeToken<MutableList<Ticket>>() {}.type
|
|
||||||
return gson.fromJson(json, type)
|
|
||||||
}
|
|
||||||
|
|
||||||
@TypeConverter
|
|
||||||
fun fromNullableMap(map: MutableMap<String?, String?>): String {
|
|
||||||
return gson.toJson(map)
|
|
||||||
}
|
|
||||||
|
|
||||||
@TypeConverter
|
|
||||||
fun toNullableMap(json: String): MutableMap<String?, String?> {
|
|
||||||
val type = object : TypeToken<MutableMap<String?, String?>>() {}.type
|
|
||||||
return gson.fromJson(json, type)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,54 +2,38 @@ package es.verdnatura.di
|
||||||
|
|
||||||
import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesViewModel
|
import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesViewModel
|
||||||
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardViewModel
|
import es.verdnatura.presentation.view.feature.articulo.fragment.ItemCardViewModel
|
||||||
import es.verdnatura.presentation.view.feature.boxPicking.BoxPickingViewModel
|
|
||||||
import es.verdnatura.presentation.view.feature.buffer.fragment.BufferFragmentViewModel
|
import es.verdnatura.presentation.view.feature.buffer.fragment.BufferFragmentViewModel
|
||||||
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemComposeViewModel
|
|
||||||
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemViewModel
|
import es.verdnatura.presentation.view.feature.buscaritem.fragment.BuscarItemViewModel
|
||||||
import es.verdnatura.presentation.view.feature.category.ChangeCategoryViewModel
|
import es.verdnatura.presentation.view.feature.calidad.fragment.BuyersViewModel
|
||||||
import es.verdnatura.presentation.view.feature.claim.fragment.ubication.ClaimViewModel
|
import es.verdnatura.presentation.view.feature.calidad.fragment.QaualityViewModel
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionCheckerViewModel
|
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionViewModel
|
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionViewModel
|
||||||
import es.verdnatura.presentation.view.feature.collection.fragment.CollectionViewModelCheckerPreviosNew
|
import es.verdnatura.presentation.view.feature.controlador.fragment.ControladorViewModel
|
||||||
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlVehiculoViewModel
|
import es.verdnatura.presentation.view.feature.controlvehiculo.fragment.ControlVehiculoViewModel
|
||||||
import es.verdnatura.presentation.view.feature.delivery.viewmodels.DeliveryViewModel
|
|
||||||
import es.verdnatura.presentation.view.feature.diadeventa.fragment.DayOfSaleViewModel
|
import es.verdnatura.presentation.view.feature.diadeventa.fragment.DayOfSaleViewModel
|
||||||
import es.verdnatura.presentation.view.feature.diadeventa.fragment.DayOfSaleViewModelCompose
|
import es.verdnatura.presentation.view.feature.faltas.fragment.FaltasViewModel
|
||||||
import es.verdnatura.presentation.view.feature.historicoarticulo.fragment.HistoricoArticuloViewModel
|
import es.verdnatura.presentation.view.feature.historicoarticulo.fragment.HistoricoArticuloViewModel
|
||||||
import es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment.ShelvingLogViewModel
|
import es.verdnatura.presentation.view.feature.historicoshelving.fragment.itemShelvingLogViewModel
|
||||||
|
import es.verdnatura.presentation.view.feature.historicoshelvinglog.fragment.shelvingLogViewModel
|
||||||
|
import es.verdnatura.presentation.view.feature.historicovehiculo.fragment.HistoricoVehiculoViewModel
|
||||||
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
|
import es.verdnatura.presentation.view.feature.inventario.fragment.InventaryViewModel
|
||||||
import es.verdnatura.presentation.view.feature.login.fragment.LoginViewModel
|
import es.verdnatura.presentation.view.feature.login.fragment.LoginViewModel
|
||||||
import es.verdnatura.presentation.view.feature.packaging.fragment.SupplierViewModel
|
import es.verdnatura.presentation.view.feature.paletizador.fragment.*
|
||||||
import es.verdnatura.presentation.view.feature.packingHolland.fragment.PackingHollandViewModel
|
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.CmrExpeditionPalletViewModel
|
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionPalletDetailViewModel
|
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionScanSorterViewModel
|
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionScanSorterViewModelCompose
|
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionScanViewModel
|
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionStateViewModel
|
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.ExpeditionTruckListViewModel
|
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.fragment.PalletScanViewModel
|
|
||||||
import es.verdnatura.presentation.view.feature.parking.fragment.ParkingViewModel
|
import es.verdnatura.presentation.view.feature.parking.fragment.ParkingViewModel
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.fragment.PasilleroViewModel
|
import es.verdnatura.presentation.view.feature.pasillero.fragment.PasilleroViewModel
|
||||||
|
import es.verdnatura.presentation.view.feature.precontrol.ShowTicketViewModel
|
||||||
import es.verdnatura.presentation.view.feature.presacador.fragment.PreSacadorViewModel
|
import es.verdnatura.presentation.view.feature.presacador.fragment.PreSacadorViewModel
|
||||||
import es.verdnatura.presentation.view.feature.qr.QrFragmentViewModel
|
import es.verdnatura.presentation.view.feature.qr.QrFragmentViewModel
|
||||||
import es.verdnatura.presentation.view.feature.roadmap.fragment.RoadMapListViewModel
|
import es.verdnatura.presentation.view.feature.reposicion.fragment.ReposicionViewModel
|
||||||
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorViewModel
|
import es.verdnatura.presentation.view.feature.sacador.fragment.SacadorViewModel
|
||||||
import es.verdnatura.presentation.view.feature.sacador.fragment.showticket.ShowTicketViewModel
|
import es.verdnatura.presentation.view.feature.shelvingparking.fragment.ShelvingParkingViewModel
|
||||||
import es.verdnatura.presentation.view.feature.ticket.fragment.TicketViewModel
|
import es.verdnatura.presentation.view.feature.smarttag.sacador.fragment.SmartTagsViewModel
|
||||||
|
import es.verdnatura.presentation.view.feature.ubicador.fragment.AutomaticAddItemViewModel
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
|
import es.verdnatura.presentation.view.feature.ubicador.fragment.UbicadorViewModel
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.fragment.WorkerMistakeViewModel
|
|
||||||
import org.koin.android.ext.koin.androidApplication
|
|
||||||
import org.koin.android.ext.koin.androidContext
|
import org.koin.android.ext.koin.androidContext
|
||||||
import org.koin.androidx.viewmodel.dsl.viewModel
|
import org.koin.androidx.viewmodel.dsl.viewModel
|
||||||
import org.koin.dsl.module
|
import org.koin.dsl.module
|
||||||
|
|
||||||
val viewModelModule = module {
|
val viewModelModule = module {
|
||||||
|
|
||||||
viewModel {
|
|
||||||
WorkerMistakeViewModel(androidApplication())
|
|
||||||
}
|
|
||||||
|
|
||||||
// Login
|
// Login
|
||||||
viewModel {
|
viewModel {
|
||||||
LoginViewModel(androidContext())
|
LoginViewModel(androidContext())
|
||||||
|
@ -63,9 +47,6 @@ val viewModelModule = module {
|
||||||
viewModel {
|
viewModel {
|
||||||
DayOfSaleViewModel(androidContext())
|
DayOfSaleViewModel(androidContext())
|
||||||
}
|
}
|
||||||
viewModel {
|
|
||||||
DayOfSaleViewModelCompose(androidApplication())
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pasilleros / Item Card
|
// Pasilleros / Item Card
|
||||||
viewModel {
|
viewModel {
|
||||||
|
@ -82,10 +63,6 @@ val viewModelModule = module {
|
||||||
BuscarItemViewModel(androidContext())
|
BuscarItemViewModel(androidContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel {
|
|
||||||
BuscarItemComposeViewModel(androidApplication())
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pasilleros / Buscar Item 2
|
// Pasilleros / Buscar Item 2
|
||||||
|
|
||||||
viewModel {
|
viewModel {
|
||||||
|
@ -96,12 +73,26 @@ val viewModelModule = module {
|
||||||
viewModel {
|
viewModel {
|
||||||
InventaryViewModel(androidContext())
|
InventaryViewModel(androidContext())
|
||||||
}
|
}
|
||||||
|
// Pasilleros / Faltas
|
||||||
|
viewModel {
|
||||||
|
FaltasViewModel(androidContext())
|
||||||
|
}
|
||||||
|
|
||||||
|
// ShelvingParking
|
||||||
|
viewModel {
|
||||||
|
ShelvingParkingViewModel(androidContext())
|
||||||
|
}
|
||||||
|
|
||||||
// Ubicador
|
// Ubicador
|
||||||
viewModel {
|
viewModel {
|
||||||
UbicadorViewModel(androidContext())
|
UbicadorViewModel(androidContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ubicador // Automatic
|
||||||
|
viewModel {
|
||||||
|
AutomaticAddItemViewModel(androidContext())
|
||||||
|
}
|
||||||
|
|
||||||
// Ajustes
|
// Ajustes
|
||||||
viewModel {
|
viewModel {
|
||||||
AjustesViewModel(androidContext())
|
AjustesViewModel(androidContext())
|
||||||
|
@ -113,15 +104,6 @@ val viewModelModule = module {
|
||||||
ExpeditionScanSorterViewModel(androidContext())
|
ExpeditionScanSorterViewModel(androidContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel {
|
|
||||||
ExpeditionScanSorterViewModelCompose(androidApplication())
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
viewModel {
|
|
||||||
CmrExpeditionPalletViewModel(androidContext())
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel {
|
viewModel {
|
||||||
BufferFragmentViewModel(androidContext())
|
BufferFragmentViewModel(androidContext())
|
||||||
}
|
}
|
||||||
|
@ -134,6 +116,10 @@ val viewModelModule = module {
|
||||||
ExpeditionTruckListViewModel(androidContext())
|
ExpeditionTruckListViewModel(androidContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel {
|
||||||
|
ExpeditionPalletViewModel(androidContext())
|
||||||
|
}
|
||||||
|
|
||||||
viewModel {
|
viewModel {
|
||||||
ExpeditionPalletDetailViewModel(androidContext())
|
ExpeditionPalletDetailViewModel(androidContext())
|
||||||
}
|
}
|
||||||
|
@ -153,11 +139,9 @@ val viewModelModule = module {
|
||||||
viewModel {
|
viewModel {
|
||||||
CollectionViewModel(androidContext())
|
CollectionViewModel(androidContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel {
|
viewModel {
|
||||||
CollectionViewModelCheckerPreviosNew(androidContext())
|
ControladorViewModel(androidContext())
|
||||||
}
|
|
||||||
viewModel {
|
|
||||||
CollectionCheckerViewModel(androidContext())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel {
|
viewModel {
|
||||||
|
@ -168,41 +152,33 @@ val viewModelModule = module {
|
||||||
PreSacadorViewModel(androidContext())
|
PreSacadorViewModel(androidContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel {
|
||||||
|
ReposicionViewModel(androidContext())
|
||||||
|
}
|
||||||
|
|
||||||
|
viewModel {
|
||||||
|
BuyersViewModel(androidContext())
|
||||||
|
}
|
||||||
|
|
||||||
|
viewModel {
|
||||||
|
QaualityViewModel(androidContext())
|
||||||
|
}
|
||||||
|
|
||||||
viewModel {
|
viewModel {
|
||||||
ControlVehiculoViewModel(androidContext())
|
ControlVehiculoViewModel(androidContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel {
|
viewModel {
|
||||||
ShelvingLogViewModel(androidContext())
|
HistoricoVehiculoViewModel(androidContext())
|
||||||
}
|
}
|
||||||
viewModel {
|
viewModel {
|
||||||
ClaimViewModel(androidContext())
|
SmartTagsViewModel(androidContext())
|
||||||
|
}
|
||||||
|
viewModel {
|
||||||
|
itemShelvingLogViewModel(androidContext())
|
||||||
|
}
|
||||||
|
viewModel {
|
||||||
|
shelvingLogViewModel(androidContext())
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel {
|
|
||||||
PalletScanViewModel(androidContext())
|
|
||||||
}
|
|
||||||
viewModel {
|
|
||||||
SupplierViewModel(androidContext())
|
|
||||||
}
|
|
||||||
viewModel {
|
|
||||||
DeliveryViewModel(androidContext())
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel {
|
|
||||||
PackingHollandViewModel(androidContext())
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel {
|
|
||||||
TicketViewModel(androidContext())
|
|
||||||
}
|
|
||||||
viewModel {
|
|
||||||
RoadMapListViewModel(androidContext())
|
|
||||||
}
|
|
||||||
viewModel {
|
|
||||||
ChangeCategoryViewModel(androidContext())
|
|
||||||
}
|
|
||||||
viewModel {
|
|
||||||
BoxPickingViewModel(androidContext())
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
import retrofit2.Retrofit
|
||||||
|
import retrofit2.converter.gson.GsonConverterFactory
|
||||||
|
|
||||||
|
class ApiNodeJsUtils {
|
||||||
|
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
//const val BASE_URL:String = "http://192.168.1.108:8000/"
|
||||||
|
const val BASE_URL:String = "http://10.2.2.49:7777"
|
||||||
|
fun getApiService():NodeJsService{
|
||||||
|
val nodeJsRetrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(
|
||||||
|
GsonConverterFactory.create()).build()
|
||||||
|
return nodeJsRetrofit.create(NodeJsService::class.java)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,75 +1,17 @@
|
||||||
package es.verdnatura.domain
|
package es.verdnatura.domain
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import com.google.gson.GsonBuilder
|
|
||||||
import es.verdnatura.MobileApplication
|
|
||||||
import es.verdnatura.domain.ConstAndValues.BASEURLSALIX
|
|
||||||
import es.verdnatura.domain.ConstAndValues.BASE_URL_SALIX
|
|
||||||
import es.verdnatura.presentation.common.InteceptorListener
|
|
||||||
import kotlinx.coroutines.runBlocking
|
|
||||||
import okhttp3.OkHttpClient
|
|
||||||
import retrofit2.Retrofit
|
import retrofit2.Retrofit
|
||||||
import retrofit2.converter.gson.GsonConverterFactory
|
import retrofit2.converter.gson.GsonConverterFactory
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
class ApiSalixUtils {
|
class ApiSalixUtils {
|
||||||
companion object {
|
companion object {
|
||||||
|
//const val BASE_URL:String = "http://192.168.1.108:8000/"
|
||||||
fun getApiService(context: Context, myObserver: InteceptorListener?): SalixService {
|
const val BASE_URL: String = "https://salix.verdnatura.es/api/"
|
||||||
|
fun getApiService(): SalixService {
|
||||||
var salixClient =
|
val salixRetrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(
|
||||||
OkHttpClient.Builder().addInterceptor(SalixInterceptor(context, myObserver))
|
GsonConverterFactory.create()
|
||||||
.connectTimeout(10, TimeUnit.SECONDS).writeTimeout(10, TimeUnit.SECONDS)
|
|
||||||
.readTimeout(40, TimeUnit.SECONDS).build()
|
|
||||||
|
|
||||||
val salixRetrofit =
|
|
||||||
Retrofit.Builder().client(salixClient).baseUrl(getBaseUrlLocal(context = context))
|
|
||||||
.addConverterFactory(
|
|
||||||
GsonConverterFactory.create(GsonBuilder().serializeNulls().create())
|
|
||||||
).build()
|
).build()
|
||||||
|
|
||||||
return salixRetrofit.create(SalixService::class.java)
|
return salixRetrofit.create(SalixService::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getBaseUrlLocal(context: Context): String {
|
|
||||||
var myWorkFormSelected =
|
|
||||||
(context as MobileApplication).dataStoreApp.readDataStoreKey(ConstAndValues.WORKFORMSELECTED) as String
|
|
||||||
if (myWorkFormSelected != "Producción" && myWorkFormSelected.isNotBlank()) {
|
|
||||||
runBlocking {
|
|
||||||
var list = (context).dataStoreApp.getWorkForm()
|
|
||||||
for (l in list) {
|
|
||||||
if (l.name == myWorkFormSelected) {
|
|
||||||
|
|
||||||
context.dataStoreApp.editDataStoreKey(BASEURLSALIX, l.urlSalix)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
runBlocking {
|
|
||||||
|
|
||||||
context.dataStoreApp.editDataStoreKey(
|
|
||||||
BASEURLSALIX,
|
|
||||||
BASE_URL_SALIX
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var url =
|
|
||||||
(context).dataStoreApp.readDataStoreKey<String>(BASEURLSALIX)
|
|
||||||
|
|
||||||
if (url.isNullOrEmpty()) {
|
|
||||||
runBlocking {
|
|
||||||
(context).dataStoreApp.editDataStoreKey(
|
|
||||||
BASEURLSALIX, BASE_URL_SALIX
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!url.contains("http")) {
|
|
||||||
url = "https://$url"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return if (url.isNullOrEmpty()) "$BASE_URL_SALIX/api/" else "$url/api/"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.SharedPreferences
|
||||||
|
//import android.preference.PreferenceManager
|
||||||
|
import androidx.preference.PreferenceManager
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
|
import retrofit2.Retrofit
|
||||||
|
import retrofit2.converter.gson.GsonConverterFactory
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
|
class ApiUtils {
|
||||||
|
companion object {
|
||||||
|
//const val BASE_URL:String = "http://192.168.1.54:8009/"
|
||||||
|
const val BASE_URL: String = "https://app.verdnatura.es/"
|
||||||
|
//const val BASE_URL:String = "https://test-app.verdnatura.es/"
|
||||||
|
|
||||||
|
fun getApiService(context: Context): VerdnaturaService {
|
||||||
|
|
||||||
|
val retrofit = Retrofit.Builder()
|
||||||
|
.baseUrl(getBaseUrlLocal(context))
|
||||||
|
.addConverterFactory(GsonConverterFactory.create())
|
||||||
|
.client(getRequestHeader()!!)
|
||||||
|
.build()
|
||||||
|
return retrofit.create(VerdnaturaService::class.java)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getBaseUrlLocal(context: Context): String {
|
||||||
|
var url = this.getDefaults("base_url", context)
|
||||||
|
if (url.isNullOrEmpty()) {
|
||||||
|
setDefaults("base_url", BASE_URL, context)
|
||||||
|
} else {
|
||||||
|
if (!url.contains("http")) {
|
||||||
|
url = "https://" + url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return if (url.isNullOrEmpty()) BASE_URL else url
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getRequestHeader(): OkHttpClient? {
|
||||||
|
return OkHttpClient.Builder()
|
||||||
|
.connectTimeout(10, TimeUnit.SECONDS)
|
||||||
|
.writeTimeout(10, TimeUnit.SECONDS)
|
||||||
|
.readTimeout(40, TimeUnit.SECONDS)
|
||||||
|
.build()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setDefaults(key: String?, value: String?, context: Context?) {
|
||||||
|
val preferences: SharedPreferences =
|
||||||
|
PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
val editor = preferences.edit()
|
||||||
|
editor.putString(key, value)
|
||||||
|
//editor.commit()
|
||||||
|
editor.apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getDefaults(key: String?, context: Context?): String? {
|
||||||
|
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
return preferences.getString(key, null)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -6,75 +6,13 @@ object ConstAndValues {
|
||||||
const val OK = "OK"
|
const val OK = "OK"
|
||||||
const val PREPARED = "PREPARED"
|
const val PREPARED = "PREPARED"
|
||||||
const val ON_PREPARATION = "ON_PREPARATION"
|
const val ON_PREPARATION = "ON_PREPARATION"
|
||||||
|
//const val CHECKED = "CHECKED"
|
||||||
const val PRESACADOR = "PRESACADOR" //PREITEMPICKER
|
const val PRESACADOR = "PRESACADOR" //PREITEMPICKER
|
||||||
const val PREITEMPICKER = "PREITEMPICKER"
|
|
||||||
const val PREITEMPICKERTEST = "PREITEMPICKERTEST"
|
|
||||||
const val SERIALNUMBER = "SERIALNUMBER"
|
|
||||||
const val ON_CHECKING = "ON_CHECKING"
|
const val ON_CHECKING = "ON_CHECKING"
|
||||||
const val PRECHECKER = "PRECHECKER"
|
const val PRECHECKER = "PRECHECKER"
|
||||||
const val MAINACTIVITY = "MAIN"
|
const val MAINACTIVITY = "MAIN"
|
||||||
const val VERTICKET = "SHOWTICKET"
|
const val VERTICKET = "SHOWTICKET"
|
||||||
const val SECTORFKDEFAULT = -1
|
const val SECTORFKDEFAULT=37
|
||||||
const val PRINTERFKDEFAULT = -1
|
const val WAREHOUSEFKDEFAULT=1
|
||||||
const val WAREHOUSEFKDEFAULT = 60
|
|
||||||
const val SECTORFK = "sectorFk"
|
|
||||||
const val SECTORISONRESERVATIONMODE = "sectorIsOnReservationMode"
|
|
||||||
const val TAG = "VERDNATURA::"
|
|
||||||
const val USERFK = "userFk"
|
|
||||||
const val USER = "user"
|
|
||||||
const val PASSWORD = "password"
|
|
||||||
const val TOKEN = "token"
|
|
||||||
const val TOKENMULTIMEDIA = "tokenMultimedia"
|
|
||||||
const val TTL = "ttl"
|
|
||||||
const val TOKENCREATED = "tokenCreated"
|
|
||||||
const val SECTORDESCRIP = "sectordescrip"
|
|
||||||
const val HOLDPOSITION = "holdPosition"
|
|
||||||
const val NUMBEROFWAGONS = "operatorNumberOfWagons"
|
|
||||||
const val PRINTERNAME = "printername"
|
|
||||||
const val PRINTERFK = "printerFk"
|
|
||||||
const val WAREHOUSEFK = "warehouseFk"
|
|
||||||
const val REMEMBER = "recordar"
|
|
||||||
const val ANDROID_ID = "ANDROID_ID"
|
|
||||||
const val DEVICENAME = "devicename"
|
|
||||||
const val TRAINNAME = "trainName"
|
|
||||||
const val TRAINFK = "trainFk"
|
|
||||||
const val WORKFORMSELECTED = "workFormSelected"
|
|
||||||
const val SUPPLIERID = "SUPPLIERID"
|
|
||||||
const val SUPPLIERNAME = "SUPPLIERNAME"
|
|
||||||
const val ENTRYID = "ENTRYID"
|
|
||||||
const val COMPANYFK = "COMPANYFK"
|
|
||||||
const val ENTRYOBSERVATIONORIGINAL = "ENTRYOBSERVATIONORIGINAL"
|
|
||||||
const val ITEMPACKING = "itemPackingType"
|
|
||||||
const val ITEMPACKINGFK = "itemPackingTypeFk"
|
|
||||||
const val ITEMPACKINGTYPEFILTER = "itemPackingTypeFilter"
|
|
||||||
const val BUYER = "buyernickname"
|
|
||||||
const val BUYERID = "buyerid"
|
|
||||||
const val WAGON = "wagon"
|
|
||||||
const val TAGSTYPE = "tagstype"
|
|
||||||
const val WAREHOUSEFK_DEFAULT = 60
|
|
||||||
const val DATENOVEHICLE = "DATENOVEHICLE"
|
|
||||||
const val DEPARTMENTMISTAKE = "DEPARTMENTMISTAKE"
|
|
||||||
const val DEPARTMENTMISTAKEID = "DEPARTMENTMISTAKEID"
|
|
||||||
const val ENTRYOBSERVATIONS = "ENTRYOBSERVATIONS"
|
|
||||||
const val ENTRYNUMBERIMAGES = "ENTRYNUMBERIMAGES"
|
|
||||||
const val ENTRYTYPE = "ENTRYTYPE"
|
|
||||||
const val BASEURLSALIX = "base_urlSalix"
|
|
||||||
const val BASEURLLILIUM = "base_urlLilium"
|
|
||||||
const val BASE_URL_LILIUM = "https://lilium.verdnatura.es"
|
|
||||||
const val BASE_URL_SALIX = "https://salix.verdnatura.es"
|
|
||||||
const val ENTRY = "ENTRY"
|
|
||||||
const val RENEWINTERVAL = "renewInterval"
|
|
||||||
const val RENEWPERIOD = "renewPeriod"
|
|
||||||
const val MENUBYDEFAULTSELECTED = "MENUBYDEFAULTSELECTED"
|
|
||||||
const val INVENTORYPARKINGTO = "INVENTORYPARKINGTO"
|
|
||||||
const val INVENTORYPARKINGFROM = "INVENTORYPARKINGFROM"
|
|
||||||
const val LIMITRECORDSSHELVINGLOG = 50
|
|
||||||
const val RESERVATIONMODE = "operatorReservationMode"
|
|
||||||
const val MODELWORKERTYPEACTIVITY = "APP"
|
|
||||||
const val FLINGTHRESHOLDVELOCITY = 2000f
|
|
||||||
const val FLINGTHRESHOLDVERTICAL = 500f
|
|
||||||
const val SCANNER_THRESHOLD_SPEED: Int = 60
|
|
||||||
const val HUMAN_CHARACTERS_SECOND: Int = 100
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,121 +1,12 @@
|
||||||
package es.verdnatura.domain
|
package es.verdnatura.domain
|
||||||
|
|
||||||
import android.app.Activity
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Color
|
|
||||||
import android.graphics.drawable.GradientDrawable
|
|
||||||
import android.text.Html
|
|
||||||
import android.view.Gravity
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.widget.EditText
|
|
||||||
import android.widget.FrameLayout
|
|
||||||
import android.widget.TextView
|
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import es.verdnatura.R
|
|
||||||
import java.text.SimpleDateFormat
|
|
||||||
import java.time.ZonedDateTime
|
|
||||||
import java.time.format.DateTimeFormatter
|
|
||||||
import java.util.Date
|
|
||||||
import java.util.Locale
|
|
||||||
|
|
||||||
fun List<Any?>.formatWithQuotes(): String {
|
fun Any.toast(context: Context?, duration: Int = Toast.LENGTH_SHORT): Toast {
|
||||||
return "[" + joinToString(", ") {
|
return Toast.makeText(context, this.toString(), duration).apply { show() }
|
||||||
when {
|
|
||||||
it is String && (it.trim().startsWith("{") && it.trim()
|
|
||||||
.endsWith("}")) -> "\"$it\""
|
|
||||||
|
|
||||||
it is String -> "\"$it\""
|
|
||||||
else -> it.toString()
|
|
||||||
}
|
|
||||||
} + "]"
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Any.toast(
|
|
||||||
context: Context?,
|
|
||||||
duration: Int = Toast.LENGTH_SHORT,
|
|
||||||
color: Int = Color.WHITE
|
|
||||||
): Toast {
|
|
||||||
val toast = Toast.makeText(
|
|
||||||
context,
|
|
||||||
Html.fromHtml("<font color='$color' ><b>$this</b></font>", 0),
|
|
||||||
duration
|
|
||||||
)
|
|
||||||
toast.show()
|
|
||||||
return toast.apply { show() }
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Context.showToastCenterWithBackground(textToShow: String) {
|
|
||||||
(this as? Activity)?.window?.decorView?.let { rootView ->
|
|
||||||
TextView(this).apply {
|
|
||||||
text = textToShow
|
|
||||||
setTextColor(getColor(R.color.verdnatura_orange_salix))
|
|
||||||
textSize = 22f
|
|
||||||
gravity = Gravity.CENTER
|
|
||||||
setPadding(32, 16, 32, 16)
|
|
||||||
background = GradientDrawable().apply {
|
|
||||||
setColor(Color.BLACK)
|
|
||||||
cornerRadius = 16f
|
|
||||||
alpha = 220
|
|
||||||
}
|
|
||||||
layoutParams = FrameLayout.LayoutParams(
|
|
||||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
|
||||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
|
||||||
).apply { gravity = Gravity.CENTER }
|
|
||||||
alpha = 0f
|
|
||||||
|
|
||||||
(rootView as ViewGroup).addView(this)
|
|
||||||
|
|
||||||
animate().alpha(1f).setDuration(300).withEndAction {
|
|
||||||
animate().alpha(0f).setStartDelay(1000).setDuration(300)
|
|
||||||
.withEndAction { (rootView).removeView(this) }
|
|
||||||
.start()
|
|
||||||
}.start()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T : Any> T?.notNull(f: (it: T) -> Unit) {
|
fun <T : Any> T?.notNull(f: (it: T) -> Unit) {
|
||||||
if (this != null) f(this)
|
if (this != null) f(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun EditText.toInt(): Int {
|
|
||||||
return this.text.toString().toInt()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun String.isParking(): Boolean {
|
|
||||||
val regex = Regex("^[^ ]+-[^ ]+$")
|
|
||||||
return this.length > 4 && regex.matches(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun String.isShelving(): Boolean {
|
|
||||||
val regex = Regex("\\S{0,4}")
|
|
||||||
return regex.matches(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun EditText.toLong(): Long {
|
|
||||||
return this.text.toString().toLong()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun toDateString(date: Date): String {
|
|
||||||
val format = SimpleDateFormat("dd-MM-yyyy", Locale.getDefault())
|
|
||||||
return format.format(date)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun String?.isoToString(returnOnlyDate: Boolean = false): String {
|
|
||||||
|
|
||||||
return if (!this.isNullOrEmpty() && this.contains("T")) {
|
|
||||||
val utcZonedDateTime = ZonedDateTime.parse(this, DateTimeFormatter.ISO_OFFSET_DATE_TIME)
|
|
||||||
val myDate = utcZonedDateTime.withZoneSameInstant(ZonedDateTime.now().zone)
|
|
||||||
.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
|
|
||||||
if (returnOnlyDate) {
|
|
||||||
(myDate.format(DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"))).replace("T", " ")
|
|
||||||
.substring(0, 10)
|
|
||||||
} else {
|
|
||||||
(myDate.format(DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm"))).replace("T", " ")
|
|
||||||
}
|
|
||||||
} else if (!this.isNullOrEmpty() && !this.contains("T")) {
|
|
||||||
this
|
|
||||||
} else {
|
|
||||||
""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetAjustesUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
fun getSectors(usuario: String, password: String): Call<List<SectorItemVO>> {
|
||||||
|
return restClient!!.getSectors("json", "1", usuario, password, "application/json")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
//import es.verdnatura.presentation.view.feature.buscaritemall.model.ItemLocationAll
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetBuscarItemAllUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
/* fun searchItemsUbicadorAll(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String
|
||||||
|
): Call<List<ItemLocationAll>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
return restClient!!.searchItemsUbicadorAll(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}*/
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetBuscarItemUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
fun searchItemsUbicador(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String
|
||||||
|
): Call<List<ItemLocationVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
return restClient!!.searchItemsUbicador(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import com.google.gson.JsonObject
|
||||||
|
import es.verdnatura.presentation.view.feature.diadeventa.model.ItemShelvingSaleDate
|
||||||
|
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetDayOfSaleUSerCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
fun itemShelving_updateSpam(usuario: String, password: String,vShelvingFK:String): Call<Boolean> {
|
||||||
|
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vShelvingFK)
|
||||||
|
return restClient!!.itemShelving_updateSpam("json", "1", usuario, password, "application/json",params=params)
|
||||||
|
}
|
||||||
|
/* fun itemShelving_getSaleDateOld(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
expeditionFk: String
|
||||||
|
): Call<JsonObject> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(expeditionFk)
|
||||||
|
return restClient!!.itemShelving_getSaleDate(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}*/
|
||||||
|
|
||||||
|
fun itemShelving_getSaleDate(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vShelvingFk: String
|
||||||
|
): Call<List<ItemShelvingSaleDate>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vShelvingFk)
|
||||||
|
return restClient!!.itemShelving_getSaleDate(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
fun shelvingPark(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
shelving: String,
|
||||||
|
parking: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(shelving)
|
||||||
|
params.add(parking)
|
||||||
|
return restClient!!.shelvingPark("json", "1", usuario, password, "application/json", params)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,87 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||||
|
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
|
||||||
|
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetInventaryUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
/* fun itemShelvingRadar(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
sectorFk: String
|
||||||
|
): Call<List<ItemInventaryVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(sectorFk)
|
||||||
|
return restClient!!.itemShelvingRadar(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}*/
|
||||||
|
|
||||||
|
fun itemShelvingRadarFilterBuyer(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
buyerFk: String,
|
||||||
|
warehouseFk: String
|
||||||
|
): Call<List<ItemInventaryVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(buyerFk)
|
||||||
|
params.add(warehouseFk)
|
||||||
|
return restClient!!.itemShelvingRadarFilterBuyer(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun faultsReview(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
warehouseFk: String
|
||||||
|
): Call<List<ItemFaltasVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(warehouseFk)
|
||||||
|
return restClient!!.faultsReview(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun faultsReview_isChecked(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
warehouseFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(warehouseFk)
|
||||||
|
return restClient!!.faultsReview_isChecked(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingBuyerGet(usuario: String, password: String): Call<List<BuyerVO>> {
|
||||||
|
return restClient!!.itemShelvingBuyerGet("json", "1", usuario, password, "application/json")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,276 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardVO
|
||||||
|
import es.verdnatura.presentation.view.feature.articulo.model.ItemPackingType
|
||||||
|
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
|
||||||
|
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetItemCardUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
fun getItemCard(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
warehouseFk: String
|
||||||
|
): Call<ItemCardVO> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(warehouseFk)
|
||||||
|
return restClient!!.getItemCard(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun item_getSimilar(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
warehouseFk: String,
|
||||||
|
vshipped: String,
|
||||||
|
vIsShowedByType: String
|
||||||
|
): Call<List<ItemProposal>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(warehouseFk)
|
||||||
|
params.add(vshipped)
|
||||||
|
params.add(vIsShowedByType)
|
||||||
|
|
||||||
|
return restClient!!.item_getSimilar(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getItemPackingType(usuario: String, password: String): Call<List<ItemPackingType>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
return restClient!!.getItemPackingType(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemStockUpdate(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
warehouseFk: String,
|
||||||
|
newVisible: String,
|
||||||
|
isTrash: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(warehouseFk)
|
||||||
|
params.add(newVisible)
|
||||||
|
params.add(isTrash)
|
||||||
|
|
||||||
|
//sergio: se modifica por CAU a itemTrash// Faltas también accede a itemStockUpdate ( falta comprobar porque no aparece nada más)
|
||||||
|
//return restClient!!.itemStockUpdate("json","1",usuario,password,"application/json",params = params)
|
||||||
|
return restClient!!.itemTrash(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemTrash(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
warehouseFk: String,
|
||||||
|
newVisible: String,
|
||||||
|
isTrash: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(warehouseFk)
|
||||||
|
params.add(newVisible)
|
||||||
|
params.add(isTrash)
|
||||||
|
return restClient!!.itemTrash(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemPlacementSave(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
warehouseFk: String,
|
||||||
|
value: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(warehouseFk)
|
||||||
|
params.add(value)
|
||||||
|
return restClient!!.itemPlacementSave(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updateGrouping(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
value: String,
|
||||||
|
warehouseFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(value)
|
||||||
|
params.add(warehouseFk)
|
||||||
|
return restClient!!.updateGrouping(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updatePacking(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
value: String,
|
||||||
|
warehouseFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(value)
|
||||||
|
params.add(warehouseFk)
|
||||||
|
return restClient!!.updatePacking(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun updatePackingType(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
ItemPackingType: String
|
||||||
|
): Call<Boolean> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(ItemPackingType)
|
||||||
|
return restClient!!.updatePackingType(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemSaveMin(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
value: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(value)
|
||||||
|
return restClient!!.itemSaveMin(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun item_saveReference(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
value: String
|
||||||
|
): Call<Unit> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(value)
|
||||||
|
return restClient!!.item_saveReference(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun barcodes_edit(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
value: String,
|
||||||
|
delete: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(value)
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(delete)
|
||||||
|
return restClient!!.barcodes_edit(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemDiary(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
warehouseFk: String
|
||||||
|
): Call<List<ItemHistoricoVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(warehouseFk)
|
||||||
|
return restClient!!.itemDiary(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,114 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import es.verdnatura.presentation.view.feature.login.model.*
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetLoginUserCase(context: Context) : RestClient(context)
|
||||||
|
{
|
||||||
|
|
||||||
|
fun login(usuario: String, password: String, androiid: String): Call<String>
|
||||||
|
{
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(usuario)
|
||||||
|
params.add(password)
|
||||||
|
params.add(androiid)
|
||||||
|
return restClient!!.login("json", "1", usuario, password, "application/json", params)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun device_checkLogin(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
android_id: String
|
||||||
|
): Call<LoginDevice>
|
||||||
|
{
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(usuario)
|
||||||
|
params.add(android_id)
|
||||||
|
return restClient!!.device_checkLogin(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun worker_getId(usuario: String, password: String): Call<String>
|
||||||
|
{
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
return restClient!!.worker_getId("json", "1", usuario, password, "application/json", params)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun deviceLog_add(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
app: String,
|
||||||
|
versionApp: String,
|
||||||
|
android_id: String
|
||||||
|
): Call<Void>
|
||||||
|
{
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(app)
|
||||||
|
params.add(versionApp)
|
||||||
|
params.add(android_id)
|
||||||
|
return restClient!!.deviceLog_add(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun salixLogin(usuario: String, password: String): Call<LoginSalixVO>
|
||||||
|
{
|
||||||
|
return salixClient!!.login("application/json", LoginSalixVO(usuario, password))
|
||||||
|
}
|
||||||
|
//NODEJS TEST
|
||||||
|
|
||||||
|
fun nodeJsTest(
|
||||||
|
smarttag: String,
|
||||||
|
wagon: String,
|
||||||
|
shelving: String
|
||||||
|
): Call<NodeJsService.SmartTagNode>
|
||||||
|
{
|
||||||
|
return nodejsClient!!.bindShelving("application/json", "A0A3B8224DBF", "ABC", "2")
|
||||||
|
// return nodejsClient!!.bindShelving("application/json", NodeJsService.SmartTagNode(smarttag, wagon, shelving),"A0A3B8224DBF","ABC","2")
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* fun checkVersion_old(usuario: String, password: String, version: String): Call<Boolean>
|
||||||
|
{
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(version)
|
||||||
|
return restClient!!.version("json", "1", usuario, password, "application/json", params)
|
||||||
|
|
||||||
|
*/
|
||||||
|
//SALIX SERGIO MENSAJE : PARA NO ENVIAR MENSAJES A COMERCIALES PONGO QUE LAS MODIFICACIONES SE ENVIAN AL CANAL CREADO.
|
||||||
|
|
||||||
|
/*fun sendChekingPresence(token:String,workerId:Int,message:String) : Call<Boolean>{
|
||||||
|
return salixClient!!.sendChekingPresence(content_type = "application/json", authorization = token, params = SalixMessageVO(workerId = workerId,message = message))
|
||||||
|
}*/
|
||||||
|
|
||||||
|
// SERGIO: PARA DESARROLLO SE DESCOMENTA ESTAS LÍNEAS Y SE COMENTAN LAS DE ARRIBA
|
||||||
|
|
||||||
|
fun sendChekingPresence(token: String, workerId: Int, message: String): Call<Boolean>
|
||||||
|
{
|
||||||
|
return salixClient!!.sendGroup(
|
||||||
|
content_type = "application/json",
|
||||||
|
authorization = token,
|
||||||
|
params = SalixGrupo(to = "#android-test", message = message)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun checkVersion(usuario: String, password: String, nameApp: String): Call<versionApp>
|
||||||
|
{
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(nameApp)
|
||||||
|
return restClient!!.getVersion("json", "1", usuario, password, "application/json", params)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,275 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import com.google.gson.JsonObject
|
||||||
|
import es.verdnatura.presentation.view.feature.paletizador.model.*
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetPaletizadoresUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
//buffer
|
||||||
|
fun buffer_setTypeByName(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vBufferFk: String,
|
||||||
|
vType: String
|
||||||
|
): Call<Boolean> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vBufferFk)
|
||||||
|
params.add(vType)
|
||||||
|
return restClient!!.buffer_setTypeByName(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
//expeditionScan opciones paletizadores
|
||||||
|
fun expedition_scan(usuario: String, password: String, vExpeditionId: String): Call<Void> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vExpeditionId)
|
||||||
|
return restClient!!.expedition_scan(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
//expedition
|
||||||
|
|
||||||
|
fun expedition_getState(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
expeditionFk: String
|
||||||
|
): Call<itemExpedetionState> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(expeditionFk)
|
||||||
|
return restClient!!.expedition_getState(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun expedition_getStateJSON(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
expeditionFk: String
|
||||||
|
): Call<JsonObject> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(expeditionFk)
|
||||||
|
return restClient!!.expedition_getStateJSON(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun expeditionTruckList(usuario: String, password: String): Call<List<ItemExpeditionTruckVO>> {
|
||||||
|
// val params: ArrayList<String> = ArrayList()
|
||||||
|
return restClient!!.expeditionTruckList("json", "1", usuario, password, "application/json")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun expeditionTruckAdd(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vHour: String,
|
||||||
|
vDescription: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vHour)
|
||||||
|
params.add(vDescription)
|
||||||
|
// //////Log.i("VERDNATURA:"," La hora es $vHour y descrip $vDescription")
|
||||||
|
return restClient!!.expeditionTruckAdd(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun expeditionPallet_List(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vTruckFk: String
|
||||||
|
): Call<List<ItemPalletVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vTruckFk)
|
||||||
|
return restClient!!.expeditionPallet_List(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun expeditionScanAdd(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vPalletFk: String,
|
||||||
|
vTruckFk: String
|
||||||
|
): Call<List<ItemScanVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vPalletFk)
|
||||||
|
params.add(vTruckFk)
|
||||||
|
return restClient!!.expeditionScanAdd(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun expeditionScanPut(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vPalletFk: String,
|
||||||
|
vExpeditionFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vPalletFk)
|
||||||
|
params.add(vExpeditionFk)
|
||||||
|
return restClient!!.expeditionScanPut(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun checkRouteExpeditionScanPut(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vPalletFk: String,
|
||||||
|
vExpeditionFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vPalletFk)
|
||||||
|
params.add(vExpeditionFk)
|
||||||
|
return restClient!!.checkRouteExpeditionScanPut(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun expeditionPalletView(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vPalletFk: String
|
||||||
|
): Call<List<ItemPalletViewVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vPalletFk)
|
||||||
|
return restClient!!.expeditionPalletView(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun expeditionPalletDel(usuario: String, password: String, vPalletFk: String): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vPalletFk)
|
||||||
|
return restClient!!.expeditionPalletDel(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun expeditionScanList(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vPalletFk: String
|
||||||
|
): Call<List<ItemExpeditionScanVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vPalletFk)
|
||||||
|
return restClient!!.expeditionScanList(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun expeditionScanDel(usuario: String, password: String, vScanFk: String): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vScanFk)
|
||||||
|
return restClient!!.expeditionScanDel(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun expeditionPalletPrintSet(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vPalletFk: String,
|
||||||
|
vSectorFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vPalletFk)
|
||||||
|
params.add(vSectorFk)
|
||||||
|
return restClient!!.expeditionPalletPrintSet(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
fun expeditionLoading_add(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vExpeditionFk: String,
|
||||||
|
vBufferFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vExpeditionFk)
|
||||||
|
params.add(vBufferFk)
|
||||||
|
return restClient!!.expeditionLoading_add(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetPreControladorUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
fun collectionTicketGet(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
collectionFk: String,
|
||||||
|
sectorFk: String,
|
||||||
|
print: String,
|
||||||
|
type: String
|
||||||
|
): Call<CollectionVO> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(collectionFk)
|
||||||
|
params.add(sectorFk)
|
||||||
|
params.add(print)
|
||||||
|
params.add(type)
|
||||||
|
return restClient!!.collection_getTickets(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ticket_get(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vParamFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vParamFk)
|
||||||
|
return restClient!!.ticket_get(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import es.verdnatura.presentation.view.feature.presacador.model.PreSacadorItemVO
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetPreSacadorUseCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
fun ticketToPrePrepare(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
ticketFk: String,
|
||||||
|
sectorFk: String
|
||||||
|
): Call<List<PreSacadorItemVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(ticketFk)
|
||||||
|
params.add(sectorFk)
|
||||||
|
return restClient!!.ticketToPrePrepare(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemPlacementSupplyGetOrder(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
sectorFk: String
|
||||||
|
): Call<List<PreSacadorItemVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(sectorFk)
|
||||||
|
return restClient!!.itemPlacementSupplyGetOrder(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemPlacementSupplyCloseOrder(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
id: String,
|
||||||
|
quantity: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(id)
|
||||||
|
params.add(quantity)
|
||||||
|
return restClient!!.itemPlacementSupplyCloseOrder(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetQrReaderUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
fun qr_getCall(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
call: String
|
||||||
|
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(call)
|
||||||
|
return restClient!!.qr_getCall(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params = params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.BuyerVO
|
||||||
|
import es.verdnatura.presentation.view.feature.calidad.model.ItemBuyerVO
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetQualityUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
fun itemShelvingBuyerGet(usuario: String, password: String): Call<List<BuyerVO>> {
|
||||||
|
return restClient!!.itemShelvingBuyerGet("json", "1", usuario, password, "application/json")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingBuyerTask(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
userFk: String
|
||||||
|
): Call<List<ItemBuyerVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(userFk)
|
||||||
|
return restClient!!.itemShelvingBuyerTask(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingStarsUpdate(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vId: String,
|
||||||
|
vStars: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vId)
|
||||||
|
params.add(vStars)
|
||||||
|
return restClient!!.itemShelvingStarsUpdate(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,458 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.MistakeTypeVO
|
||||||
|
import es.verdnatura.presentation.view.feature.sacador.model.PlacementSupplyVO
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetSacadorControladorUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
//sergio: se quita para ir colocando collection_getTickets
|
||||||
|
/* fun collectionTicketGet(usuario:String,password:String,collectionFk:String,sectorFk:String,print:String,type:String) : Call<CollectionVO> {
|
||||||
|
val params:ArrayList<String> = ArrayList()
|
||||||
|
params.add(collectionFk)
|
||||||
|
params.add(sectorFk)
|
||||||
|
params.add(print)
|
||||||
|
params.add(type)
|
||||||
|
return restClient!!.collectionTicketGet("json","1",usuario,password,"application/json",params)
|
||||||
|
}*/
|
||||||
|
//sergio: se cambia llamada a collection_getTickets
|
||||||
|
|
||||||
|
fun collectionTicketGet(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
collectionFk: String,
|
||||||
|
sectorFk: String,
|
||||||
|
print: String,
|
||||||
|
type: String
|
||||||
|
): Call<CollectionVO> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(collectionFk)
|
||||||
|
params.add(sectorFk)
|
||||||
|
params.add(print)
|
||||||
|
params.add(type)
|
||||||
|
return restClient!!.collection_getTickets(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun sip_getExtension(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
WorkerId: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(WorkerId)
|
||||||
|
return restClient!!.sip_getExtension(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
fun ticketOrCollection_checkFullyControlled(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
collectionFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(collectionFk)
|
||||||
|
return restClient!!.ticketOrCollection_checkFullyControlled(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
fun collectionNew(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
sectorFk: String,
|
||||||
|
carros: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(sectorFk)
|
||||||
|
params.add(carros)
|
||||||
|
return restClient!!.collectionNew(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionNew(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
sectorFk: String,
|
||||||
|
carros: String,
|
||||||
|
tagtype: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(sectorFk)
|
||||||
|
params.add(carros)
|
||||||
|
params.add(tagtype)
|
||||||
|
return restClient!!.collectionNew(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionGet(usuario: String, password: String): Call<List<CollectionVO>> {
|
||||||
|
// val params:ArrayList<String> = ArrayList()
|
||||||
|
return restClient!!.collectionGet("json", "1", usuario, password, "application/json")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saleTrackingReplace(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
saleFk: String,
|
||||||
|
vOriginalQuantity: String,
|
||||||
|
vStateFk: String,
|
||||||
|
vIsChecked: String,
|
||||||
|
vBuyFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(saleFk)
|
||||||
|
params.add(vOriginalQuantity)
|
||||||
|
params.add(vStateFk)
|
||||||
|
params.add(vIsChecked)
|
||||||
|
params.add(vBuyFk)
|
||||||
|
return restClient!!.saleTrackingReplace(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemPlacementSupplyAiming(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
shelvingFk: String,
|
||||||
|
quantity: String,
|
||||||
|
itemFk: String
|
||||||
|
): Call<List<PlacementSupplyVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(shelvingFk)
|
||||||
|
params.add(quantity)
|
||||||
|
params.add(itemFk)
|
||||||
|
return restClient!!.itemPlacementSupplyAiming(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingSaleSupplyAdd(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemShelvingFk: String,
|
||||||
|
saleFk: String,
|
||||||
|
quantity: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemShelvingFk)
|
||||||
|
params.add(saleFk)
|
||||||
|
params.add(quantity)
|
||||||
|
return restClient!!.itemShelvingSaleSupplyAdd(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingPlacementSupplyAdd(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemShelvingFk: String,
|
||||||
|
itemPlacementSupplyFk: String,
|
||||||
|
quantity: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemShelvingFk)
|
||||||
|
params.add(itemPlacementSupplyFk)
|
||||||
|
params.add(quantity)
|
||||||
|
return restClient!!.itemShelvingPlacementSupplyAdd(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionStickerPrint(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
collectionFk: String,
|
||||||
|
sectorFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(collectionFk)
|
||||||
|
params.add(sectorFk)
|
||||||
|
return restClient!!.collectionStickerPrint(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun ticketCollection_setUsedShelves(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
ticketFk: String,
|
||||||
|
usedShelves: String
|
||||||
|
): Call<Void> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(ticketFk)
|
||||||
|
params.add(usedShelves)
|
||||||
|
return restClient!!.ticketCollection_setUsedShelves(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun item_updatePackingShelve(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vSelf : String,
|
||||||
|
vPacking : String
|
||||||
|
): Call<Void> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vSelf)
|
||||||
|
params.add(vPacking)
|
||||||
|
return restClient!!.item_updatePackingShelve(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun saleTracking_add(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
saleGroupFk: String
|
||||||
|
): Call<Void> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(saleGroupFk)
|
||||||
|
return restClient!!.saleTracking_add(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* fun itemGetAvailable(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
warehouseFk: String
|
||||||
|
): Call<ItemVO> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(warehouseFk)
|
||||||
|
return restClient!!.itemGetAvailable(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}*/
|
||||||
|
|
||||||
|
fun collectionAddItem(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
quantityFk: String,
|
||||||
|
ticketFk: String,
|
||||||
|
warehouseFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(quantityFk)
|
||||||
|
params.add(ticketFk)
|
||||||
|
params.add(warehouseFk)
|
||||||
|
return restClient!!.collectionAddItem(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saleMove(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
saleFk: String,
|
||||||
|
quantity: String,
|
||||||
|
originalQuantity: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(saleFk)
|
||||||
|
params.add(quantity)
|
||||||
|
params.add(originalQuantity)
|
||||||
|
return restClient!!.saleMove("json", "1", usuario, password, "application/json", params)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionMissingTrash(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
saleFk: String,
|
||||||
|
quantity: String,
|
||||||
|
type: String,
|
||||||
|
warehouseFk: String,
|
||||||
|
originalQuantity: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(saleFk)
|
||||||
|
params.add(quantity)
|
||||||
|
params.add(type)
|
||||||
|
params.add(warehouseFk)
|
||||||
|
params.add(originalQuantity)
|
||||||
|
return restClient!!.collectionMissingTrash(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saleTrackingDel(usuario: String, password: String, saleFk: String): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(saleFk)
|
||||||
|
return restClient!!.saleTrackingDel(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionUpdateState(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
collectionFk: String,
|
||||||
|
state: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(collectionFk)
|
||||||
|
params.add(state)
|
||||||
|
return restClient!!.collectionUpdateState(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getIdFromCode(usuario: String, password: String, code: String): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(code)
|
||||||
|
return restClient!!.getIdFromCode(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun collectionIncreaseQuantity(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
saleFk: String,
|
||||||
|
quantity: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(saleFk)
|
||||||
|
params.add(quantity)
|
||||||
|
return restClient!!.collectionIncreaseQuantity(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saleMistakeAdd(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vSaleFk: String,
|
||||||
|
vUserFk: String,
|
||||||
|
vTypeFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vSaleFk)
|
||||||
|
params.add(vUserFk)
|
||||||
|
params.add(vTypeFk)
|
||||||
|
return restClient!!.saleMistakeAdd(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun mistakeType(usuario: String, password: String): Call<List<MistakeTypeVO>> {
|
||||||
|
// val params:ArrayList<String> = ArrayList()
|
||||||
|
return restClient!!.mistakeType("json", "1", usuario, password, "application/json")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import es.verdnatura.presentation.view.feature.shelvingparking.model.ItemShelvingParkingVO
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetShelvingParkingUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
fun shelvingParking_get(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vShelvingFk: String,
|
||||||
|
vWarehouseFk: String,
|
||||||
|
vDayRange: String
|
||||||
|
): Call<List<ItemShelvingParkingVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vShelvingFk)
|
||||||
|
params.add(vWarehouseFk)
|
||||||
|
params.add(vDayRange)
|
||||||
|
return restClient!!.shelvingParking_get(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetSmarttagsUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
fun workerShelving_add(usuario: String, password: String, shelvingFk: String): Call<Void> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(shelvingFk)
|
||||||
|
return restClient!!.workerShelving_add(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun workerShelving_delete(usuario: String, password: String, vBarcode: String): Call<Void> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vBarcode)
|
||||||
|
return restClient!!.workerShelving_delete(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* fun smartTag_nextLevel(usuario:String,password:String,vShelvingFk :String) : Call<String> {
|
||||||
|
val params:ArrayList<String> = ArrayList();
|
||||||
|
params.add(vShelvingFk)
|
||||||
|
return restClient!!.smartTag_nextLevel("json","1",usuario,password,"application/json",params)
|
||||||
|
}*/
|
||||||
|
}
|
|
@ -0,0 +1,224 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetUbicadorUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
fun itemShelvingList(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vShelvingFk: String
|
||||||
|
): Call<List<ItemUbicadorVO>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vShelvingFk)
|
||||||
|
return restClient!!.itemShelvingList(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingMake(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
shelving: String,
|
||||||
|
item: String,
|
||||||
|
deep: String,
|
||||||
|
quantity: String,
|
||||||
|
packing: String,
|
||||||
|
warehouse: String,
|
||||||
|
level: String,
|
||||||
|
grouping:String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(shelving)
|
||||||
|
params.add(item)
|
||||||
|
params.add(deep)
|
||||||
|
params.add(quantity)
|
||||||
|
params.add(packing)
|
||||||
|
params.add(warehouse)
|
||||||
|
params.add(level)
|
||||||
|
params.add(grouping)
|
||||||
|
return restClient!!.itemShelvingMake(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingMakeEdit(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
shelving: String,
|
||||||
|
item: String,
|
||||||
|
deep: String,
|
||||||
|
quantity: String,
|
||||||
|
packing: String,
|
||||||
|
warehouse: String,
|
||||||
|
level: String,
|
||||||
|
itemShelvingFk: String,
|
||||||
|
grouping:String
|
||||||
|
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(shelving)
|
||||||
|
params.add(item)
|
||||||
|
params.add(deep)
|
||||||
|
params.add(quantity)
|
||||||
|
params.add(packing)
|
||||||
|
params.add(warehouse)
|
||||||
|
params.add(level)
|
||||||
|
params.add(itemShelvingFk)
|
||||||
|
params.add(grouping)
|
||||||
|
return restClient!!.itemShelvingMakeEdit(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingMake_multi(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
shelving: String,
|
||||||
|
items: List<String>,
|
||||||
|
deep: String,
|
||||||
|
warehouse: String,
|
||||||
|
level: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<Any> = ArrayList()
|
||||||
|
params.add(shelving)
|
||||||
|
params.add(items)
|
||||||
|
params.add(deep)
|
||||||
|
params.add(warehouse)
|
||||||
|
params.add(level)
|
||||||
|
return restClient!!.itemShelvingMake_multi(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun shelvingPriorityUpdate(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
priority: String,
|
||||||
|
shelving: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(priority)
|
||||||
|
params.add(shelving)
|
||||||
|
return restClient!!.shelvingPriorityUpdate(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun shelvingPark(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
shelving: String,
|
||||||
|
parking: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(shelving)
|
||||||
|
params.add(parking)
|
||||||
|
return restClient!!.shelvingPark("json", "1", usuario, password, "application/json", params)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saleParking_add(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
sales:List<String>,
|
||||||
|
parking: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<Any> = ArrayList()
|
||||||
|
params.add(sales)
|
||||||
|
params.add(parking)
|
||||||
|
return restClient!!.saleParking_add("json", "1", usuario, password, "application/json", params)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun shelvingChange(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
origen: String,
|
||||||
|
destino: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(origen)
|
||||||
|
params.add(destino)
|
||||||
|
return restClient!!.shelvingChange(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun clearShelvingList(usuario: String, password: String, shelvingFk: String): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(shelvingFk)
|
||||||
|
return restClient!!.clearShelvingList(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingTransfer(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
itemFk: String,
|
||||||
|
shelvingFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
params.add(shelvingFk)
|
||||||
|
return restClient!!.itemShelvingTransfer(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun itemShelvingDelete(usuario: String, password: String, itemFk: String): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(itemFk)
|
||||||
|
return restClient!!.itemShelvingDelete(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,124 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import es.verdnatura.presentation.view.feature.historicovehiculo.model.ItemHistoricoVehiculo
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class GetVehicleControlTimeUserCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
fun machineWorker_add(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
plateNumber: String
|
||||||
|
): Call<Boolean> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(plateNumber)
|
||||||
|
return restClient!!.machineWorker_add(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun machineWorker_update(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
plateNumber: String
|
||||||
|
): Call<Boolean> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(plateNumber)
|
||||||
|
return restClient!!.machineWorker_update(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
fun workerMachinery_isRegistered(
|
||||||
|
usuario: String,
|
||||||
|
password: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
return restClient!!.workerMachinery_isRegistered(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun machine_getWorkerPlate(usuario: String, password: String): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
return restClient!!.machine_getWorkerPlate(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun deviceProductionUser_getWorker(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
userFk: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(userFk)
|
||||||
|
return restClient!!.deviceProductionUser_getWorker(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun deviceProduction_getnameDevice(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
android_id: String
|
||||||
|
): Call<String> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(android_id)
|
||||||
|
return restClient!!.deviceProduction_getnameDevice(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun machineWorker_getHistorical(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
PlateNumber: String
|
||||||
|
): Call<List<ItemHistoricoVehiculo>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(PlateNumber)
|
||||||
|
return restClient!!.machineWorker_getHistorical(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
import retrofit2.Call
|
||||||
|
import retrofit2.http.Header
|
||||||
|
import retrofit2.http.POST
|
||||||
|
import retrofit2.http.Path
|
||||||
|
|
||||||
|
interface NodeJsService {
|
||||||
|
|
||||||
|
/* @POST("/bindShelving")
|
||||||
|
fun bindShelving(@Header("Content-Type") content_type: String,
|
||||||
|
@Body params: SmartTagNode):
|
||||||
|
Call<SmartTagNode>*/
|
||||||
|
|
||||||
|
//NODEJS TEST
|
||||||
|
|
||||||
|
// @FormUrlEncoded
|
||||||
|
@POST("/bindShelving/{Id1}&{Id2}&{Id3}")
|
||||||
|
fun bindShelving(
|
||||||
|
@Header("Content-Type") content_type: String,
|
||||||
|
@Path("Id1") id: String,
|
||||||
|
@Path("Id2") id2: String,
|
||||||
|
@Path("Id3") id3: String
|
||||||
|
|
||||||
|
):
|
||||||
|
Call<SmartTagNode>
|
||||||
|
|
||||||
|
class SmartTagNode(
|
||||||
|
var message: String = "",
|
||||||
|
var smarttag: String = "",
|
||||||
|
var wagon: String = "",
|
||||||
|
var shelving: String = "",
|
||||||
|
var isError: Boolean = false,
|
||||||
|
var errorMessage: String = ""
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
package es.verdnatura.domain
|
package es.verdnatura.domain
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import es.verdnatura.presentation.common.InteceptorListener
|
|
||||||
|
|
||||||
open class RestClient(context: Context, myObserver: InteceptorListener? = null) {
|
open class RestClient(context: Context) {
|
||||||
var salixClient: SalixService
|
var restClient: VerdnaturaService? = null
|
||||||
|
var salixClient: SalixService? = null
|
||||||
|
var nodejsClient: NodeJsService? = null
|
||||||
|
|
||||||
init {
|
init {
|
||||||
salixClient = ApiSalixUtils.getApiService(context, myObserver)
|
restClient = ApiUtils.getApiService(context)
|
||||||
|
salixClient = ApiSalixUtils.getApiService()
|
||||||
|
nodejsClient = ApiNodeJsUtils.getApiService()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,118 +0,0 @@
|
||||||
package es.verdnatura.domain
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.content.Intent
|
|
||||||
import com.google.gson.Gson
|
|
||||||
import com.google.gson.JsonObject
|
|
||||||
import es.verdnatura.MobileApplication
|
|
||||||
import es.verdnatura.R
|
|
||||||
import es.verdnatura.presentation.view.feature.login.activity.LoginActivity
|
|
||||||
import org.json.JSONObject
|
|
||||||
import retrofit2.Call
|
|
||||||
import retrofit2.Callback
|
|
||||||
import retrofit2.Response
|
|
||||||
import kotlin.system.exitProcess
|
|
||||||
|
|
||||||
abstract class SalixCallback<T>(val context: Context) : Callback<T> {
|
|
||||||
|
|
||||||
override fun onResponse(call: Call<T>, response: Response<T>) {
|
|
||||||
if (response.isSuccessful) {
|
|
||||||
onSuccess(response)
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
val errorBodyString = response.errorBody()?.string()
|
|
||||||
if (response.code() == 555) {
|
|
||||||
var message = JSONObject(response.message()).getString("Message")
|
|
||||||
onError(Error(message))
|
|
||||||
} else if (response.code() == 401) {
|
|
||||||
if (!(context as MobileApplication).isLoginRunning()) {
|
|
||||||
val intent = Intent(context, LoginActivity::class.java)
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
||||||
context.startActivity(intent)
|
|
||||||
exitProcess(0)
|
|
||||||
} else {
|
|
||||||
onError(Error(response.message().toString()))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
onError(Error(errorSalixMessage(response, errorBodyString)))
|
|
||||||
}
|
|
||||||
} catch (t: Throwable) {
|
|
||||||
defaultErrorHandler(t)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onFailure(call: Call<T>, t: Throwable) {
|
|
||||||
try {
|
|
||||||
onError(t)
|
|
||||||
} catch (t: Throwable) {
|
|
||||||
defaultErrorHandler(t)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun defaultErrorHandler(t: Throwable) {
|
|
||||||
//println("ErrorSalixx${t.message}")
|
|
||||||
// (nameofFunction((this)) + t.message).toast(context)
|
|
||||||
(context as MobileApplication).messageToast(
|
|
||||||
true,
|
|
||||||
(nameofFunction((this)) + t.message),
|
|
||||||
isToasted = true
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
open fun onSuccess(response: Response<T>) {
|
|
||||||
// (nameofFunction((this)) + context.getString(R.string.operationSuccessful)).toast(context)
|
|
||||||
|
|
||||||
(context as MobileApplication).messageToast(
|
|
||||||
isError = false,
|
|
||||||
message = context.getString(R.string.operationSuccessful)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
open fun onError(t: Throwable) {
|
|
||||||
throw t
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun errorSalixMessage(response: Response<T>, errorBody: String?): String {
|
|
||||||
|
|
||||||
var myErrorCodeBody = errorBody?.let { errorBodyString
|
|
||||||
->
|
|
||||||
JSONObject(errorBodyString).getJSONObject("error").optString("code")
|
|
||||||
}
|
|
||||||
myErrorCodeBody += errorBody?.let { errorBodyString
|
|
||||||
->
|
|
||||||
JSONObject(errorBodyString).getJSONObject("error").optString("message")
|
|
||||||
}
|
|
||||||
return try {
|
|
||||||
val messageResponse = response.errorBody()!!.string()
|
|
||||||
val jsonObject = Gson().fromJson(messageResponse, JsonObject::class.java)
|
|
||||||
var messageJson = jsonObject?.getAsJsonObject("error")?.get("message")?.asString
|
|
||||||
var messageJsonCode = jsonObject?.getAsJsonObject("error")?.get("code")?.asString ?: ""
|
|
||||||
messageJson ?: "${response.message()}.$myErrorCodeBody.$messageJsonCode"
|
|
||||||
} catch (ex: Exception) {
|
|
||||||
response.message() + ".$myErrorCodeBody."
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun nameofFunction(function: Any): String {
|
|
||||||
return try {
|
|
||||||
function.javaClass.enclosingMethod!!.name + "->"
|
|
||||||
} catch (e: Exception) {
|
|
||||||
"ActivityMain->"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getMessageFromAllResponse(callFunction: String, responseMessage: String): String {
|
|
||||||
|
|
||||||
var messageFromError: String = try {
|
|
||||||
val answerError = JSONObject(responseMessage)
|
|
||||||
answerError.get("Message").toString()
|
|
||||||
} catch (e: Exception) {
|
|
||||||
responseMessage
|
|
||||||
}
|
|
||||||
|
|
||||||
return "$messageFromError.\r${"Callback: $callFunction."}"
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
package es.verdnatura.domain
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.view.View
|
|
||||||
import es.verdnatura.MobileApplication
|
|
||||||
import es.verdnatura.domain.ConstAndValues.TOKEN
|
|
||||||
import es.verdnatura.presentation.common.InteceptorListener
|
|
||||||
import okhttp3.Interceptor
|
|
||||||
import okhttp3.Response
|
|
||||||
import java.io.IOException
|
|
||||||
|
|
||||||
class SalixInterceptor(private val context: Context, private val listener: InteceptorListener?) :
|
|
||||||
Interceptor {
|
|
||||||
|
|
||||||
@Throws(IOException::class)
|
|
||||||
override fun intercept(chain: Interceptor.Chain): Response {
|
|
||||||
|
|
||||||
var request = chain.request()
|
|
||||||
//sergio: condición para que añada o no headers según se vaya quitando de las llamadas
|
|
||||||
//no quitar condición hasta que estén quitados
|
|
||||||
if (request.headers().toString().isEmpty()) {
|
|
||||||
val newRequest =
|
|
||||||
request.newBuilder().addHeader("Content-Type", "application/json").addHeader(
|
|
||||||
"Authorization",
|
|
||||||
(context as MobileApplication).dataStoreApp.readDataStoreKey<String>(TOKEN)
|
|
||||||
).addHeader("Accept-Language", context.getLanguage()).build()
|
|
||||||
|
|
||||||
request = newRequest
|
|
||||||
}
|
|
||||||
if (request.url().toString().contains("renew")) {
|
|
||||||
return chain.proceed(request)
|
|
||||||
} else {
|
|
||||||
listener!!.onInterceptionResult(View.VISIBLE)
|
|
||||||
val response = chain.proceed(request)
|
|
||||||
listener.onInterceptionResult(View.INVISIBLE)
|
|
||||||
return response
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,47 @@
|
||||||
|
package es.verdnatura.domain
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import es.verdnatura.presentation.view.feature.historicoshelving.model.ItemShelvingLog
|
||||||
|
import es.verdnatura.presentation.view.feature.historicoshelvinglog.model.ShelvingLog
|
||||||
|
import retrofit2.Call
|
||||||
|
|
||||||
|
class itemShelvingLogUSerCase(context: Context) : RestClient(context) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
fun itemShelvingLog_get(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vShelvingFk: String
|
||||||
|
): Call<List<ItemShelvingLog>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vShelvingFk)
|
||||||
|
return restClient!!.itemShelvingLog_get(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun shelvingLog_get(
|
||||||
|
usuario: String,
|
||||||
|
password: String,
|
||||||
|
vShelvingFk: String
|
||||||
|
): Call<List<ShelvingLog>> {
|
||||||
|
val params: ArrayList<String> = ArrayList()
|
||||||
|
params.add(vShelvingFk)
|
||||||
|
return restClient!!.shelvingLog_get(
|
||||||
|
"json",
|
||||||
|
"1",
|
||||||
|
usuario,
|
||||||
|
password,
|
||||||
|
"application/json",
|
||||||
|
params
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +0,0 @@
|
||||||
package es.verdnatura.domain.model
|
|
||||||
|
|
||||||
data class Filter(
|
|
||||||
val fields: Map<String, Boolean>,
|
|
||||||
val where: Map<String, Map<String, String>>
|
|
||||||
)
|
|
|
@ -1,43 +0,0 @@
|
||||||
package es.verdnatura.domain.userCases
|
|
||||||
|
|
||||||
import es.verdnatura.domain.SalixService
|
|
||||||
import es.verdnatura.presentation.view.feature.packaging.model.NotificationQueue
|
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.WorkerActionSalix
|
|
||||||
import retrofit2.Call
|
|
||||||
|
|
||||||
class GetItemFromBarcodeUseCase(private val salixService: SalixService) {
|
|
||||||
fun execute(barcode: String): Call<Int?> {
|
|
||||||
return salixService.barcodesToItem(barcode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class GetItemPrintItemUseCase(private val salixService: SalixService) {
|
|
||||||
fun execute(params: Any?): Call<Unit> {
|
|
||||||
return salixService.printItem(params)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun executeBuyUltimate(params: Any): Call<Long> {
|
|
||||||
return salixService.buyGetLastWithoutInventory(params)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class NotiticationUseCase(private val salixService: SalixService) {
|
|
||||||
fun executeSendNotification(notificationQueue: NotificationQueue): Call<Void> {
|
|
||||||
return salixService.notificationQueues(notificationQueue)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class WorkerActivityUseCase(private val salixService: SalixService) {
|
|
||||||
fun addWorkerActivity(workerActionSalix: WorkerActionSalix): Call<Any> {
|
|
||||||
return salixService.workerActivityAdd(workerActionSalix)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class OperatorUseCase(private val salixService: SalixService) {
|
|
||||||
fun updateOperator(workerFk: Number, update: HashMap<String, Number>): Call<Unit> {
|
|
||||||
return salixService.updateOperator(
|
|
||||||
id = workerFk,
|
|
||||||
params = update
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,59 +1,24 @@
|
||||||
package es.verdnatura.presentation.base
|
package es.verdnatura.presentation.base
|
||||||
|
|
||||||
import android.Manifest
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.pm.PackageManager
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Looper
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.inputmethod.InputMethodManager
|
import android.view.inputmethod.InputMethodManager
|
||||||
import androidx.annotation.LayoutRes
|
import androidx.annotation.LayoutRes
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.app.ActivityCompat
|
|
||||||
import androidx.core.content.ContextCompat
|
|
||||||
import androidx.databinding.DataBindingUtil
|
import androidx.databinding.DataBindingUtil
|
||||||
import androidx.databinding.ViewDataBinding
|
import androidx.databinding.ViewDataBinding
|
||||||
import com.google.android.gms.location.FusedLocationProviderClient
|
|
||||||
import com.google.android.gms.location.LocationCallback
|
|
||||||
import com.google.android.gms.location.LocationResult
|
|
||||||
import com.google.android.gms.location.Priority
|
|
||||||
import es.verdnatura.MobileApplication
|
|
||||||
import es.verdnatura.domain.toast
|
|
||||||
|
|
||||||
interface LocationUpdateCallback {
|
|
||||||
fun onLocationReceived(location: LocationResult)
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract class BaseActivity<T : ViewDataBinding> : AppCompatActivity() {
|
abstract class BaseActivity<T : ViewDataBinding> : AppCompatActivity() {
|
||||||
|
|
||||||
protected lateinit var mobileApplication: MobileApplication
|
|
||||||
private val locationCallback = object : LocationCallback() {
|
|
||||||
override fun onLocationResult(location: LocationResult) {
|
|
||||||
locationUpdateCallback?.onLocationReceived(location)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var locationUpdateCallback: LocationUpdateCallback? = null
|
|
||||||
|
|
||||||
protected lateinit var binding: T
|
protected lateinit var binding: T
|
||||||
private lateinit var fusedLocationClient: FusedLocationProviderClient
|
|
||||||
private val locationRequest =
|
|
||||||
com.google.android.gms.location.LocationRequest.Builder(
|
|
||||||
Priority.PRIORITY_LOW_POWER,
|
|
||||||
10000L
|
|
||||||
).apply {
|
|
||||||
setMinUpdateIntervalMillis(5000L)
|
|
||||||
}.build()
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(getLayoutId())
|
setContentView(getLayoutId())
|
||||||
try {
|
|
||||||
initDataBinding()
|
initDataBinding()
|
||||||
} catch (ex: Exception) {
|
|
||||||
ex.message!!.toast(context = this)
|
|
||||||
}
|
|
||||||
mobileApplication = application as MobileApplication
|
|
||||||
init()
|
init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +27,7 @@ abstract class BaseActivity<T : ViewDataBinding> : AppCompatActivity() {
|
||||||
open fun addBindingVariables() {}
|
open fun addBindingVariables() {}
|
||||||
abstract fun init()
|
abstract fun init()
|
||||||
|
|
||||||
|
|
||||||
private fun initDataBinding() {
|
private fun initDataBinding() {
|
||||||
binding = DataBindingUtil.setContentView(this, getLayoutId())
|
binding = DataBindingUtil.setContentView(this, getLayoutId())
|
||||||
binding.lifecycleOwner = this
|
binding.lifecycleOwner = this
|
||||||
|
@ -73,50 +39,5 @@ abstract class BaseActivity<T : ViewDataBinding> : AppCompatActivity() {
|
||||||
imm.hideSoftInputFromWindow(view.windowToken, 0)
|
imm.hideSoftInputFromWindow(view.windowToken, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun checkLocationPermission(): Boolean {
|
|
||||||
return ContextCompat.checkSelfPermission(
|
|
||||||
this,
|
|
||||||
Manifest.permission.ACCESS_FINE_LOCATION
|
|
||||||
) == PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(
|
|
||||||
this,
|
|
||||||
Manifest.permission.ACCESS_FINE_LOCATION
|
|
||||||
) == PackageManager.PERMISSION_GRANTED
|
|
||||||
}
|
|
||||||
|
|
||||||
fun requestLocationUpdates(
|
|
||||||
fusedLocationClient: FusedLocationProviderClient
|
|
||||||
) {
|
|
||||||
|
|
||||||
if (ActivityCompat.checkSelfPermission(
|
|
||||||
this,
|
|
||||||
Manifest.permission.ACCESS_FINE_LOCATION
|
|
||||||
) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(
|
|
||||||
this,
|
|
||||||
Manifest.permission.ACCESS_COARSE_LOCATION
|
|
||||||
) != PackageManager.PERMISSION_GRANTED
|
|
||||||
) {
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
fusedLocationClient.requestLocationUpdates(
|
|
||||||
locationRequest,
|
|
||||||
locationCallback,
|
|
||||||
Looper.getMainLooper()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroy() {
|
|
||||||
if (::fusedLocationClient.isInitialized) {
|
|
||||||
fusedLocationClient.removeLocationUpdates(locationCallback)
|
|
||||||
}
|
|
||||||
locationUpdateCallback = null
|
|
||||||
super.onDestroy()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun stopLocationUpdates() {
|
|
||||||
locationCallback?.let {
|
|
||||||
fusedLocationClient.removeLocationUpdates(it)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,44 +1,92 @@
|
||||||
package es.verdnatura.presentation.base
|
package es.verdnatura.presentation.base
|
||||||
|
|
||||||
|
import android.Manifest
|
||||||
|
import android.app.AlarmManager
|
||||||
|
import android.app.PendingIntent
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.pm.PackageInfo
|
import android.content.Intent
|
||||||
import android.content.pm.PackageManager
|
import android.content.SharedPreferences
|
||||||
|
import android.media.AudioManager
|
||||||
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.provider.Settings
|
import android.speech.RecognitionListener
|
||||||
|
import android.speech.RecognizerIntent
|
||||||
|
import android.speech.SpeechRecognizer
|
||||||
|
import android.speech.tts.TextToSpeech
|
||||||
|
import android.speech.tts.UtteranceProgressListener
|
||||||
|
import android.util.Log
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.annotation.LayoutRes
|
import androidx.annotation.LayoutRes
|
||||||
import androidx.databinding.DataBindingUtil
|
import androidx.databinding.DataBindingUtil
|
||||||
import androidx.databinding.ViewDataBinding
|
import androidx.databinding.ViewDataBinding
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.room.Room
|
import com.google.gson.Gson
|
||||||
import es.verdnatura.MobileApplication
|
import com.google.gson.reflect.TypeToken
|
||||||
import es.verdnatura.R
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.ToolbarFragmentBinding
|
import es.verdnatura.domain.toast
|
||||||
import es.verdnatura.db.DeliveryDatabase
|
import es.verdnatura.presentation.common.mediaCurrentVolume
|
||||||
import es.verdnatura.db.MapTypeConverter
|
|
||||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
|
||||||
import org.koin.androidx.viewmodel.ext.android.viewModel
|
import org.koin.androidx.viewmodel.ext.android.viewModel
|
||||||
|
import timber.log.Timber
|
||||||
|
import java.util.*
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(
|
|
||||||
viewModelClass: KClass<V>
|
abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelClass: KClass<V>) :
|
||||||
) : Fragment() {
|
Fragment(), TextToSpeech.OnInitListener, RecognitionListener {
|
||||||
protected lateinit var mobileApplication: MobileApplication
|
|
||||||
|
protected val TAG = "VERDNATURA"
|
||||||
|
protected val TD = "VERDNATURA:"
|
||||||
|
protected val PREFS_USER = "es.verdnatura.user.prefs"
|
||||||
|
protected val USERFK = "userFk"
|
||||||
|
protected val USER = "user"
|
||||||
|
protected val PASSWORD = "password"
|
||||||
|
protected val TOKEN = "token"
|
||||||
|
protected val SECTORDESCRIP = "sectordescrip"
|
||||||
|
protected val SECTORFK = "sectorFk"
|
||||||
|
protected val WAREHOUSEFK = "warehouseFk"
|
||||||
|
protected val RECORDAR = "recordar"
|
||||||
|
protected val ANDROID_ID = "ANDROID_ID"
|
||||||
|
protected val DEVICENAME = "devicename"
|
||||||
|
protected val VOZ = "voz"
|
||||||
|
|
||||||
|
//nuevo campo número carros ajustes y campos para guardar el buyerid y buyernickname
|
||||||
|
protected val BUYER = "buyernickname"
|
||||||
|
protected val BUYERID = "buyerid"
|
||||||
|
protected val WAGON = "wagon"
|
||||||
|
protected val TAGSTYPE = "tagstype"
|
||||||
|
protected val WAREHOUSEFK_DEFAULT = 60
|
||||||
|
|
||||||
protected val viewModel: V by viewModel(viewModelClass)
|
protected val viewModel: V by viewModel(viewModelClass)
|
||||||
protected lateinit var binding: T
|
protected lateinit var binding: T
|
||||||
protected lateinit var ma: MainActivity
|
private var isOnReadyForSpeech = false
|
||||||
|
|
||||||
override fun onAttach(context: Context) {
|
|
||||||
super.onAttach(context)
|
|
||||||
|
|
||||||
if ((requireActivity().componentName).toString().contains("MainActivity")) {
|
private var textToSpeech: TextToSpeech? = null
|
||||||
|
private var mAudioManager: AudioManager? = null
|
||||||
|
protected var mSpeechRecognizer: SpeechRecognizer? = null
|
||||||
|
private var mSpeechRecognizerIntent: Intent? = null
|
||||||
|
|
||||||
|
protected val NEW_COLLECTION = 0
|
||||||
|
protected val LISTO = 1
|
||||||
|
protected val CANCEL = 2
|
||||||
|
protected val VOLVER = 3
|
||||||
|
protected val REPITE = 4
|
||||||
|
protected val OTRO = 5
|
||||||
|
protected val FALTA = 6
|
||||||
|
protected val ERROR = -1
|
||||||
|
|
||||||
|
val allowedStrings =
|
||||||
|
Arrays.asList(
|
||||||
|
"cero", "uno", "dos", "tres", "cuatro", "cinco", "seis", "siete",
|
||||||
|
"ocho", "nueve", "diez", "once", "doce", "trece", "catorce",
|
||||||
|
"quince", "dieziseis", "diezisiete", "dieziocho", "diezinueve", "veinte",
|
||||||
|
"treinta", "cuarenta", "cincuenta", "sesenta", "setenta", "ochenta", "noventa",
|
||||||
|
"cien", "mil"
|
||||||
|
)
|
||||||
|
|
||||||
ma = activity as MainActivity
|
|
||||||
}
|
|
||||||
mobileApplication = requireActivity().application as MobileApplication
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
inflater: LayoutInflater,
|
inflater: LayoutInflater,
|
||||||
|
@ -46,13 +94,29 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(
|
||||||
savedInstanceState: Bundle?
|
savedInstanceState: Bundle?
|
||||||
): View? = inflater.inflate(getLayoutId(), container, false)
|
): View? = inflater.inflate(getLayoutId(), container, false)
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
/*sergio:deprecated. Se inicializa con onViewCreated
|
||||||
|
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||||
|
super.onActivityCreated(savedInstanceState)
|
||||||
|
initDataBinding()
|
||||||
|
getBundleArguments()
|
||||||
|
observeViewModel()
|
||||||
|
runSound()
|
||||||
|
// requestRecordAudioPermission()
|
||||||
|
requestRecordAudioPermissionNew()
|
||||||
|
init()
|
||||||
|
}*/
|
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?)
|
||||||
|
{
|
||||||
super.onViewCreated(view,savedInstanceState)
|
super.onViewCreated(view,savedInstanceState)
|
||||||
initDataBinding()
|
initDataBinding()
|
||||||
getBundleArguments()
|
getBundleArguments()
|
||||||
observeViewModel()
|
observeViewModel()
|
||||||
|
runSound()
|
||||||
|
//requestRecordAudioPermission()
|
||||||
|
requestRecordAudioPermissionNew()
|
||||||
|
requestCallPhonePermissionNew()
|
||||||
init()
|
init()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@LayoutRes
|
@LayoutRes
|
||||||
|
@ -62,6 +126,49 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(
|
||||||
open fun getBundleArguments() {}
|
open fun getBundleArguments() {}
|
||||||
open fun addBindingVariables() {}
|
open fun addBindingVariables() {}
|
||||||
|
|
||||||
|
open fun setSpeak() {
|
||||||
|
//VOZ
|
||||||
|
textToSpeech = TextToSpeech(requireContext(), this)
|
||||||
|
mAudioManager = requireActivity().getSystemService(Context.AUDIO_SERVICE) as AudioManager
|
||||||
|
}
|
||||||
|
|
||||||
|
open fun restartapp(f: Fragment) {
|
||||||
|
val mStartActivity = Intent(context, f::class.java)
|
||||||
|
val mPendingIntentId = 123456
|
||||||
|
val mPendingIntent = PendingIntent.getActivity(
|
||||||
|
context,
|
||||||
|
mPendingIntentId,
|
||||||
|
mStartActivity,
|
||||||
|
PendingIntent.FLAG_CANCEL_CURRENT
|
||||||
|
)
|
||||||
|
val mgr = requireContext().getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
||||||
|
mgr[AlarmManager.RTC, System.currentTimeMillis() + 100] = mPendingIntent
|
||||||
|
System.exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
open fun initialize() {
|
||||||
|
//ESCUCHA
|
||||||
|
try {
|
||||||
|
mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(requireContext())
|
||||||
|
mSpeechRecognizerIntent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
|
||||||
|
mSpeechRecognizerIntent!!.putExtra(
|
||||||
|
RecognizerIntent.EXTRA_LANGUAGE_MODEL,
|
||||||
|
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM
|
||||||
|
)
|
||||||
|
mSpeechRecognizerIntent!!.putExtra(
|
||||||
|
RecognizerIntent.EXTRA_LANGUAGE,
|
||||||
|
Locale.getDefault()
|
||||||
|
)
|
||||||
|
mSpeechRecognizerIntent!!.putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE, false)
|
||||||
|
mSpeechRecognizer?.setRecognitionListener(this)
|
||||||
|
isOnReadyForSpeech = false
|
||||||
|
startListening()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
cancelSpeech()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun initDataBinding() {
|
private fun initDataBinding() {
|
||||||
binding = DataBindingUtil.bind<T>(requireView())!!
|
binding = DataBindingUtil.bind<T>(requireView())!!
|
||||||
binding.lifecycleOwner = viewLifecycleOwner
|
binding.lifecycleOwner = viewLifecycleOwner
|
||||||
|
@ -69,112 +176,447 @@ abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(
|
||||||
lifecycle.addObserver(this@BaseFragment.viewModel)
|
lifecycle.addObserver(this@BaseFragment.viewModel)
|
||||||
addBindingVariables()
|
addBindingVariables()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun textScannedFilterDouble(textScanned: String): String {
|
|
||||||
|
|
||||||
if (textScanned.length > 13) {
|
|
||||||
val size = textScanned.length
|
|
||||||
if (textScanned.substring((size / 2), size) == textScanned.substring(0, size / 2)
|
|
||||||
) {
|
|
||||||
return textScanned.substring(0, size / 2)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return textScanned
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getTooltip(image: Int):String {
|
fun getTooltip(image: Int):String {
|
||||||
|
|
||||||
return when (image) {
|
return when (image) {
|
||||||
//itemCard
|
//itemCard
|
||||||
R.drawable.ic_autorenew_black_24dp -> {
|
R.drawable.ic_autorenew_black_24dp -> "Recarga datos del elemento escaneado/seleccionado"
|
||||||
getString(R.string.reloadItemData)
|
R.drawable.ic_history_black_24dp -> "Ver Histórico del ítem"
|
||||||
}
|
|
||||||
|
|
||||||
R.drawable.ic_history_black_24dp -> getString(R.string.showHistoricalItem)
|
|
||||||
//presacador
|
//presacador
|
||||||
R.drawable.ic_local_parking_black_24dp -> getString(R.string.allowParking)
|
R.drawable.ic_local_parking_black_24dp->"Permite aparcar ticket/carro"
|
||||||
//collection
|
//collection
|
||||||
R.drawable.ic_print_black_24dp -> getString(R.string.printTicket)
|
R.drawable.ic_print_black_24dp->"Imprime ticket"
|
||||||
R.drawable.ic_playlist_add_black_24dp -> getString(R.string.addItem)
|
R.drawable.ic_playlist_add_black_24dp->"Añade ítem"
|
||||||
R.drawable.ic_worker -> getString(R.string.showFacePicker)
|
R.drawable.face_man_outline->"Visualiza la foto del sacador"
|
||||||
R.drawable.car -> getString(R.string.allowSelectVehicle)
|
R.drawable.phone_call->"Realiza llamada al sacador"
|
||||||
R.drawable.car_off -> getString(R.string.allowTakeoffVehicle)
|
R.drawable.car->"Permite coger vehículo"
|
||||||
|
R.drawable.car_off->"Permite dejar el vehículo"
|
||||||
//REPETIDO:R.drawable.ic_history_black_24dp->"Realiza llamada al sacador"
|
//REPETIDO:R.drawable.ic_history_black_24dp->"Realiza llamada al sacador"
|
||||||
//sacador
|
//sacador
|
||||||
R.drawable.ic_add_black_24dp -> getString(R.string.newCollection)
|
R.drawable.ic_add_black_24dp->"Genera colección para sacar"
|
||||||
//REPETIDO: R.drawable.car->"Permite coger vehículo"
|
//REPETIDO: R.drawable.car->"Permite coger vehículo"
|
||||||
//ubicador:
|
//ubicador:
|
||||||
//REPETIDO: R.drawable.ic_add_black_24dp->"Genera colección para sacar"
|
//REPETIDO: R.drawable.ic_add_black_24dp->"Genera colección para sacar"
|
||||||
//REPETIDO: ic_autorenew_black_24dp
|
//REPETIDO: ic_autorenew_black_24dp
|
||||||
//historico articulo
|
//historico articulo
|
||||||
R.drawable.ic_transaction -> getString(R.string.showFilter)
|
R.drawable.ic_transaction->"Ver filtro "
|
||||||
R.drawable.alpha_f_circle_outline -> getString(R.string.showFaults)
|
R.drawable.alpha_f_circle_outline->"Ver movimientos de Faltas"
|
||||||
R.drawable.alpha_b_circle_outline -> getString(R.string.showTrash)
|
R.drawable.alpha_b_circle_outline->"Ver movimientos de Basura"
|
||||||
R.drawable.filter_outline -> getString(R.string.filterFlower)
|
|
||||||
R.drawable.ic_mode_edit_black_24dp -> getString(R.string.allowChangeShelving)
|
else -> {""}
|
||||||
R.drawable.ic_delete_forever_black_24dp -> getString(R.string.deleteAllitems)
|
|
||||||
R.drawable.ic_flash_auto_black_24dp -> getString(R.string.allowAutomaticAddItem)
|
|
||||||
R.drawable.ic_logo_salix -> getString(R.string.accessSalix)
|
|
||||||
R.drawable.ic_eye_ui -> getString(R.string.icViewCollection)
|
|
||||||
R.drawable.ic_collection -> getString(R.string.icViewCollection)
|
|
||||||
R.drawable.ic_ubicator_check -> getString(R.string.checkerUbication)
|
|
||||||
R.drawable.ic_delivery_truck -> getString(R.string.loadRoute)
|
|
||||||
R.drawable.ic_confirm -> getString(R.string.confirmDescription)
|
|
||||||
R.drawable.camion -> getString(R.string.openLoadingConsignee)
|
|
||||||
R.drawable.exit -> getString(R.string.exitScreen)
|
|
||||||
R.drawable.ic_image_upload -> getString(R.string.messageUpload)
|
|
||||||
R.drawable.expedition_find -> getString(R.string.showLogExpedition)
|
|
||||||
R.drawable.ic_info_refresh -> getString(R.string.udpateRoutes)
|
|
||||||
R.drawable.ic_info_delivery -> getString(R.string.info)
|
|
||||||
R.drawable.ic_filter_inventory -> getString(R.string.filterNoReview)
|
|
||||||
R.drawable.ic_remove_checks -> getString(R.string.resetReviewItems)
|
|
||||||
R.drawable.ic_eye_inventory -> getString(R.string.inventoryShowParking)
|
|
||||||
R.drawable.ic_sort -> getString(R.string.sortRouteSalix)
|
|
||||||
R.drawable.ic_sign_ticket -> getString(R.string.signed)
|
|
||||||
R.drawable.ic_send -> getString(R.string.sendDriverRoute)
|
|
||||||
R.drawable.ic_add_multiple -> getString(R.string.addItemMultipleShelvings)
|
|
||||||
R.drawable.ic_clean_shelving -> getString(R.string.activityOrganize)
|
|
||||||
R.drawable.ic_booking -> getString(R.string.bookingNewSalesCollection)
|
|
||||||
else -> {
|
|
||||||
""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hideBackButton(tool: ToolbarFragmentBinding) {
|
override fun onInit(status: Int) {
|
||||||
tool.backButton.visibility = View.INVISIBLE
|
if (status == TextToSpeech.SUCCESS) {
|
||||||
|
val spanish = Locale("es", "ES")
|
||||||
|
textToSpeech!!.language = spanish
|
||||||
|
textToSpeech!!.setOnUtteranceProgressListener(object : UtteranceProgressListener() {
|
||||||
|
override fun onDone(utteranceId: String?) {
|
||||||
|
Log.i("SPEEAK", "on done")
|
||||||
|
requireActivity().runOnUiThread(Runnable {
|
||||||
|
if (mSpeechRecognizer != null) {
|
||||||
|
mSpeechRecognizer!!.destroy()
|
||||||
|
mSpeechRecognizer = null
|
||||||
|
}
|
||||||
|
initialize()
|
||||||
|
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getInfoVersionNameApp(): String {
|
override fun onError(utteranceId: String?) {
|
||||||
val manager: PackageManager = requireContext().packageManager
|
"Error to speak".toast(requireContext())
|
||||||
val info: PackageInfo = manager.getPackageInfo(requireContext().packageName, 0)
|
|
||||||
mobileApplication.versionName = info.versionName.toString()
|
|
||||||
return mobileApplication.versionName
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getDevicePDA(): Int? {
|
override fun onStart(utteranceId: String?) {
|
||||||
return try {
|
Log.i("SPEEAK", "on start")
|
||||||
Settings.Global.getString(
|
runSound()
|
||||||
mobileApplication.contentResolver, Settings.Global.DEVICE_NAME
|
|
||||||
).toInt()
|
}
|
||||||
} catch (ex: Exception) {
|
|
||||||
null
|
})
|
||||||
|
} else {
|
||||||
|
"La voz no se ha podido iniciar".toast(requireContext())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun runSound() {
|
||||||
|
// Get the maximum media/music volume
|
||||||
|
//sergio: se quita por no utilizar
|
||||||
|
// val maxVolume = mAudioManager?.mediaMaxVolume
|
||||||
|
// mAudioManager?.setMediaVolume(maxVolume!!)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun muteSound() {
|
||||||
|
if (mAudioManager?.mediaCurrentVolume != 0) {
|
||||||
|
// mAudioManager?.setMediaVolume(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun speak(frase: String) {
|
||||||
|
textToSpeech!!.speak(frase, TextToSpeech.QUEUE_FLUSH, null, "frase")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun database(myContext: Context): DeliveryDatabase {
|
open fun startListening() {
|
||||||
return Room.databaseBuilder(
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||||
myContext,
|
muteSound()
|
||||||
DeliveryDatabase::class.java, "expediciones.db"
|
}
|
||||||
).addTypeConverter(MapTypeConverter())
|
mSpeechRecognizer!!.startListening(mSpeechRecognizerIntent)
|
||||||
.build()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override fun onReadyForSpeech(params: Bundle?) {
|
||||||
|
isOnReadyForSpeech = true
|
||||||
|
Log.i("Speech", "onReadyForSpeech")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBeginningOfSpeech() {
|
||||||
|
Log.i("Speech", "onBeginningOfSpeech")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onRmsChanged(rmsdB: Float) {}
|
||||||
|
|
||||||
|
override fun onBufferReceived(buffer: ByteArray?) {
|
||||||
|
Log.i("Speech", "onBufferReceived")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onEndOfSpeech() {
|
||||||
|
Log.i("Speech", "onEndOfSpeech")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onError(error: Int) {
|
||||||
|
if (!isOnReadyForSpeech && error == SpeechRecognizer.ERROR_NO_MATCH) {
|
||||||
|
("Problemas con la velocidad de internet. No se puede usar la voz").toast(requireContext())
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
Log.i("Speech", "onError " + error)
|
||||||
|
if (mSpeechRecognizer != null) mSpeechRecognizer!!.destroy()
|
||||||
|
mSpeechRecognizer = null
|
||||||
|
initialize()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResults(results: Bundle) {}
|
||||||
|
|
||||||
|
override fun onPartialResults(partialResults: Bundle?) {
|
||||||
|
Log.i("Speech", "onPartialResults")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onEvent(eventType: Int, params: Bundle?) {
|
||||||
|
Log.i("Speech", "onEvent")
|
||||||
|
}
|
||||||
|
|
||||||
|
open fun checkText(text: String): Int {
|
||||||
|
|
||||||
|
//check for nuevo
|
||||||
|
val nuevo = getMatch(text, "nuevo")
|
||||||
|
|
||||||
|
//check for listo
|
||||||
|
val listo = getMatch(text, "listo")
|
||||||
|
|
||||||
|
//check for cancelar
|
||||||
|
val cancelar = getMatch(text, "cancelar")
|
||||||
|
|
||||||
|
//check for volver
|
||||||
|
val volver = getMatch(text, "volver")
|
||||||
|
|
||||||
|
//check for repite
|
||||||
|
val repite = getMatch(text, "repite")
|
||||||
|
|
||||||
|
//check for siguiente
|
||||||
|
val otro = getMatch(text, "otro")
|
||||||
|
|
||||||
|
//check for FALTA
|
||||||
|
val falta = getMatch(text, "falta")
|
||||||
|
val words = IntArray(7)
|
||||||
|
words[0] = nuevo
|
||||||
|
words[1] = listo
|
||||||
|
words[2] = cancelar
|
||||||
|
words[3] = volver
|
||||||
|
words[4] = repite
|
||||||
|
words[5] = otro
|
||||||
|
words[6] = falta
|
||||||
|
return getMax(words)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getMax(a: IntArray): Int {
|
||||||
|
var max = a[0]
|
||||||
|
var pos = 0
|
||||||
|
for (i in a.indices) {
|
||||||
|
if (a[i] > max) {
|
||||||
|
max = a[i]
|
||||||
|
pos = i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return if (max < 80) {
|
||||||
|
-1
|
||||||
|
} else pos
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getMatch(a: String, b: String): Int {
|
||||||
|
var count = 0
|
||||||
|
val cha = a.toCharArray()
|
||||||
|
val chb = b.toCharArray()
|
||||||
|
for (i in cha) {
|
||||||
|
for (x in chb) {
|
||||||
|
if (x == i) {
|
||||||
|
count += 1
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
val numChar = a.length
|
||||||
|
if (numChar != 0)
|
||||||
|
return count * 100 / numChar
|
||||||
|
else
|
||||||
|
return 100
|
||||||
|
}
|
||||||
|
|
||||||
|
/* private fun requestReadPhoneStatePermission(){
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
val requiredPermission: String = Manifest.permission.READ_PHONE_STATE
|
||||||
|
val res = context!!.checkCallingOrSelfPermission(requiredPermission)
|
||||||
|
if (res == PackageManager.PERMISSION_DENIED) {
|
||||||
|
requestPermissions(arrayOf(requiredPermission), 102)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
/*sergio:deprecated
|
||||||
|
private fun requestRecordAudioPermission() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
val requiredPermission: String = Manifest.permission.RECORD_AUDIO
|
||||||
|
val res = requireContext().checkCallingOrSelfPermission(requiredPermission)
|
||||||
|
// If the user previously denied this permission then show a message explaining why
|
||||||
|
// this permission is needed
|
||||||
|
if (res == PackageManager.PERMISSION_DENIED) {
|
||||||
|
requestPermissions(arrayOf(requiredPermission), 101)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
private fun requestCallPhonePermission(){
|
||||||
|
val permissionLauncher = registerForActivityResult(
|
||||||
|
ActivityResultContracts.RequestPermission()
|
||||||
|
)
|
||||||
|
{ isGranted ->
|
||||||
|
if (isGranted) {
|
||||||
|
Timber.i("permisos ok")
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
Timber.i("Denegados permisos")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
permissionLauncher.launch(Manifest.permission.CALL_PHONE)
|
||||||
|
}
|
||||||
|
private fun requestRecordAudioPermissionNew() {
|
||||||
|
|
||||||
|
val permissionLauncher = registerForActivityResult(
|
||||||
|
ActivityResultContracts.RequestPermission()
|
||||||
|
)
|
||||||
|
{ isGranted ->
|
||||||
|
if (isGranted) {
|
||||||
|
Timber.i("permisos ok")
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
Timber.i("Denegados permisos")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
permissionLauncher.launch(Manifest.permission.RECORD_AUDIO)
|
||||||
|
}
|
||||||
|
private fun requestCallPhonePermissionNew() {
|
||||||
|
|
||||||
|
val permissionLauncher = registerForActivityResult(
|
||||||
|
ActivityResultContracts.RequestPermission()
|
||||||
|
)
|
||||||
|
{ isGranted ->
|
||||||
|
if (isGranted) {
|
||||||
|
Timber.i("permisos ok")
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
Timber.i("Denegados permisos")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
permissionLauncher.launch(Manifest.permission.CALL_PHONE)
|
||||||
|
}
|
||||||
|
fun cancelSpeech() {
|
||||||
|
if (mSpeechRecognizer != null) {
|
||||||
|
mSpeechRecognizer!!.destroy()
|
||||||
|
mSpeechRecognizer = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saveBuyer(buyernickname: String) {
|
||||||
|
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||||
|
val editor = prefs.edit()
|
||||||
|
editor.putString(BUYER, buyernickname)
|
||||||
|
editor.apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saveBuyerId(buyerid: String) {
|
||||||
|
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||||
|
val editor = prefs.edit()
|
||||||
|
editor.putString(BUYERID, buyerid)
|
||||||
|
editor.apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getIMEI(): String {
|
||||||
|
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||||
|
val imei = prefs.getString("IMEI", "0")
|
||||||
|
return imei.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getANDROIDID(): String {
|
||||||
|
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||||
|
val androidid = prefs.getString(ANDROID_ID, "0")
|
||||||
|
return androidid.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getWagons(): Int {
|
||||||
|
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||||
|
val wagons = prefs.getInt(WAGON, 2)
|
||||||
|
return wagons
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getTagsType(): String {
|
||||||
|
val prefs: SharedPreferences = requireActivity().getSharedPreferences(PREFS_USER, 0)
|
||||||
|
val tagstype = prefs.getString(TAGSTYPE, "Stickers")
|
||||||
|
return tagstype.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getMessageFromJSON(json: String): String {
|
||||||
|
val gson = Gson()
|
||||||
|
var message = ""
|
||||||
|
// val mapType = object : TypeToken<Map<String, Any>>() {}.type
|
||||||
|
|
||||||
|
var tutorialMap: Map<String, Any> =
|
||||||
|
gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
|
||||||
|
tutorialMap.forEach {
|
||||||
|
if (it.key.equals("Message")) {
|
||||||
|
message = it.value.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return message
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getListFromJSON(json: String): List<String> {
|
||||||
|
val gson = Gson()
|
||||||
|
var list = mutableListOf<String>()
|
||||||
|
|
||||||
|
// val mapType = object : TypeToken<Map<String, Any>>() {}.type
|
||||||
|
|
||||||
|
var tutorialMap: Map<String, Any> =
|
||||||
|
gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
|
||||||
|
tutorialMap.forEach {
|
||||||
|
|
||||||
|
list.add(it.key +":"+ it.value)
|
||||||
|
|
||||||
|
}
|
||||||
|
return list
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*open fun wordToNumber(input: String?): Int {
|
||||||
|
var input = input
|
||||||
|
var isValidInput = true
|
||||||
|
var result = 0
|
||||||
|
var finalResult = 0
|
||||||
|
if (input != null && input.length > 0) {
|
||||||
|
input = input.replace("-".toRegex(), " ")
|
||||||
|
input = input.toLowerCase().replace(" and".toRegex(), " ")
|
||||||
|
val splittedParts =
|
||||||
|
input.trim { it <= ' ' }.split("\\s+".toRegex()).toTypedArray()
|
||||||
|
for (str in splittedParts) {
|
||||||
|
if (!es.verdnatura.warehouse.UTILS.Utils.allowedStrings.contains(str)) {
|
||||||
|
isValidInput = false
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isValidInput) {
|
||||||
|
for (str in splittedParts) {
|
||||||
|
if (str.equals("cero", ignoreCase = true)) {
|
||||||
|
result += 0
|
||||||
|
} else if (str.equals("uno", ignoreCase = true)) {
|
||||||
|
result += 1
|
||||||
|
} else if (str.equals("dos", ignoreCase = true)) {
|
||||||
|
result += 2
|
||||||
|
} else if (str.equals("tres", ignoreCase = true)) {
|
||||||
|
result += 3
|
||||||
|
} else if (str.equals("cuatro", ignoreCase = true)) {
|
||||||
|
result += 4
|
||||||
|
} else if (str.equals("cinco", ignoreCase = true)) {
|
||||||
|
result += 5
|
||||||
|
} else if (str.equals("seis", ignoreCase = true)) {
|
||||||
|
result += 6
|
||||||
|
} else if (str.equals("siete", ignoreCase = true)) {
|
||||||
|
result += 7
|
||||||
|
} else if (str.equals("ocho", ignoreCase = true)) {
|
||||||
|
result += 8
|
||||||
|
} else if (str.equals("nueve", ignoreCase = true)) {
|
||||||
|
result += 9
|
||||||
|
} else if (str.equals("diez", ignoreCase = true)) {
|
||||||
|
result += 10
|
||||||
|
} else if (str.equals("once", ignoreCase = true)) {
|
||||||
|
result += 11
|
||||||
|
} else if (str.equals("doce", ignoreCase = true)) {
|
||||||
|
result += 12
|
||||||
|
} else if (str.equals("trece", ignoreCase = true)) {
|
||||||
|
result += 13
|
||||||
|
} else if (str.equals("catorce", ignoreCase = true)) {
|
||||||
|
result += 14
|
||||||
|
} else if (str.equals("quince", ignoreCase = true)) {
|
||||||
|
result += 15
|
||||||
|
} else if (str.equals("dieziseis", ignoreCase = true)) {
|
||||||
|
result += 16
|
||||||
|
} else if (str.equals("diezisiete", ignoreCase = true)) {
|
||||||
|
result += 17
|
||||||
|
} else if (str.equals("dieziocho", ignoreCase = true)) {
|
||||||
|
result += 18
|
||||||
|
} else if (str.equals("diezinueve", ignoreCase = true)) {
|
||||||
|
result += 19
|
||||||
|
} else if (str.equals("veinte", ignoreCase = true)) {
|
||||||
|
result += 20
|
||||||
|
} else if (str.equals("treinta", ignoreCase = true)) {
|
||||||
|
result += 30
|
||||||
|
} else if (str.equals("cuarenta", ignoreCase = true)) {
|
||||||
|
result += 40
|
||||||
|
} else if (str.equals("cincuenta", ignoreCase = true)) {
|
||||||
|
result += 50
|
||||||
|
} else if (str.equals("sesenta", ignoreCase = true)) {
|
||||||
|
result += 60
|
||||||
|
} else if (str.equals("setenta", ignoreCase = true)) {
|
||||||
|
result += 70
|
||||||
|
} else if (str.equals("ochenta", ignoreCase = true)) {
|
||||||
|
result += 80
|
||||||
|
} else if (str.equals("noventa", ignoreCase = true)) {
|
||||||
|
result += 90
|
||||||
|
} else if (str.equals("cien", ignoreCase = true)) {
|
||||||
|
result *= 100
|
||||||
|
} else if (str.equals("mil", ignoreCase = true)) {
|
||||||
|
result *= 1000
|
||||||
|
finalResult += result
|
||||||
|
result = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finalResult += result
|
||||||
|
return finalResult
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return finalResult
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,75 @@
|
||||||
package es.verdnatura.presentation.base
|
package es.verdnatura.presentation.base
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import androidx.lifecycle.LifecycleObserver
|
import androidx.lifecycle.LifecycleObserver
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import es.verdnatura.MobileApplication
|
import org.json.JSONObject
|
||||||
import es.verdnatura.domain.SalixService
|
|
||||||
|
|
||||||
abstract class BaseViewModel : ViewModel, LifecycleObserver {
|
abstract class BaseViewModel : ViewModel(), LifecycleObserver
|
||||||
lateinit var app: MobileApplication
|
|
||||||
lateinit var salix: SalixService
|
|
||||||
|
|
||||||
constructor() : super()
|
|
||||||
constructor(context: Context) : super() {
|
|
||||||
app = context as MobileApplication
|
fun nameofFunction(function: Any): String
|
||||||
salix = app.salix
|
{
|
||||||
|
|
||||||
|
// return Thread.currentThread().stackTrace[1].methodName
|
||||||
|
|
||||||
|
return function.javaClass.enclosingMethod!!.name
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getMessageFromResponse(ResponseMessage: String): String
|
||||||
|
{
|
||||||
|
return try
|
||||||
|
{
|
||||||
|
val answerError = JSONObject(ResponseMessage)
|
||||||
|
answerError.get("Message").toString()
|
||||||
|
} catch (e: Exception)
|
||||||
|
{
|
||||||
|
ResponseMessage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getMessageError(callFunction: String): String
|
||||||
|
{
|
||||||
|
|
||||||
|
return when (callFunction)
|
||||||
|
{
|
||||||
|
"collection_getTickets" -> "No hay tickets para sacar. Llamada $callFunction."
|
||||||
|
"collection_new_wagon" -> "No hay tickets para sacar. Llamada $callFunction."
|
||||||
|
else ->
|
||||||
|
{
|
||||||
|
"Error en la llamada $callFunction."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getMessageFromAllResponse(callFunction: String, ResponseMessage: String): String
|
||||||
|
{
|
||||||
|
|
||||||
|
var messageFromError: String
|
||||||
|
var returnMessage: String
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
val answerError = JSONObject(ResponseMessage)
|
||||||
|
messageFromError = answerError.get("Message").toString()
|
||||||
|
} catch (e: Exception)
|
||||||
|
{
|
||||||
|
messageFromError = ResponseMessage
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (messageFromError.isEmpty()) {
|
||||||
|
|
||||||
|
//sergio:para personalizar los mensajes de respuesta según la llamada.
|
||||||
|
when (callFunction)
|
||||||
|
{
|
||||||
|
"collection_getTickets" -> returnMessage ="No hay tickets para sacar. Llamada $callFunction."
|
||||||
|
else ->
|
||||||
|
{
|
||||||
|
returnMessage = "Llamada $callFunction."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//}
|
||||||
|
return "$messageFromError.$returnMessage"
|
||||||
|
|
||||||
|
}
|
|
@ -1,13 +0,0 @@
|
||||||
package es.verdnatura.presentation.base
|
|
||||||
|
|
||||||
import android.app.Application
|
|
||||||
import androidx.lifecycle.LifecycleObserver
|
|
||||||
import androidx.lifecycle.ViewModel
|
|
||||||
import es.verdnatura.MobileApplication
|
|
||||||
import es.verdnatura.domain.SalixService
|
|
||||||
|
|
||||||
abstract class BaseViewModelCompose(application: Application) : ViewModel(), LifecycleObserver {
|
|
||||||
protected val app: MobileApplication = application as MobileApplication
|
|
||||||
protected val salix: SalixService = app.salix
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,63 +0,0 @@
|
||||||
package es.verdnatura.presentation.common
|
|
||||||
|
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
|
||||||
import es.verdnatura.databinding.ItemGeneralRowBinding
|
|
||||||
|
|
||||||
class GeneralAdapter(
|
|
||||||
private var items: List<GeneralItem>,
|
|
||||||
private val onDeleteItemRowClickListener: OnGeneralItemRowClickListener? = null,
|
|
||||||
private var showDelete: Boolean = false,
|
|
||||||
private val onRowClickListener: OnGeneralRowClickListener? = null
|
|
||||||
) : RecyclerView.Adapter<GeneralAdapter.ItemHolder>() {
|
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemHolder {
|
|
||||||
return ItemHolder(
|
|
||||||
ItemGeneralRowBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getItemCount() = items.size
|
|
||||||
|
|
||||||
override fun onBindViewHolder(holder: ItemHolder, position: Int) {
|
|
||||||
holder.bind(items[position])
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
inner class ItemHolder(
|
|
||||||
val binding: ItemGeneralRowBinding
|
|
||||||
) : RecyclerView.ViewHolder(binding.root) {
|
|
||||||
//private val res = binding.root.context.resources
|
|
||||||
fun bind(item: GeneralItem) {
|
|
||||||
binding.apply {
|
|
||||||
this.item = item
|
|
||||||
if (showDelete) itemImage.visibility = View.VISIBLE
|
|
||||||
else itemImage.visibility = View.GONE
|
|
||||||
|
|
||||||
itemCode.visibility = View.GONE
|
|
||||||
}
|
|
||||||
binding.itemImage.setOnClickListener {
|
|
||||||
onDeleteItemRowClickListener?.onGeneralItemRowClickListener(item)
|
|
||||||
}
|
|
||||||
binding.itemCode.setOnClickListener {
|
|
||||||
onRowClickListener?.onRowClickListener(item)
|
|
||||||
}
|
|
||||||
binding.itemTitle.setOnClickListener {
|
|
||||||
onRowClickListener?.onRowClickListener(item)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun updateItems(list: List<GeneralItem>) {
|
|
||||||
items = list
|
|
||||||
notifyDataSetChanged()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setShowDelete(hasVisibility: Boolean) {
|
|
||||||
showDelete = hasVisibility
|
|
||||||
notifyDataSetChanged()
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package es.verdnatura.presentation.common
|
|
||||||
|
|
||||||
import android.graphics.Rect
|
|
||||||
import android.view.View
|
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
|
||||||
|
|
||||||
|
|
||||||
class ItemDescorationCustomized(private val verticalSpaceHeight: Int) : RecyclerView.ItemDecoration() {
|
|
||||||
|
|
||||||
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
|
|
||||||
outRect.bottom = verticalSpaceHeight
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
package es.verdnatura.presentation.common
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.net.ConnectivityManager
|
|
||||||
import android.net.Network
|
|
||||||
import android.net.NetworkCapabilities
|
|
||||||
import android.net.NetworkRequest
|
|
||||||
import es.verdnatura.MobileApplication
|
|
||||||
import es.verdnatura.R
|
|
||||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
|
||||||
|
|
||||||
class NetworkUtilsApp(context: Context, applicationContext: MobileApplication) {
|
|
||||||
|
|
||||||
private val connectivityManager: ConnectivityManager =
|
|
||||||
context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
|
||||||
|
|
||||||
private val networkCallback: ConnectivityManager.NetworkCallback =
|
|
||||||
object : ConnectivityManager.NetworkCallback() {
|
|
||||||
override fun onAvailable(network: Network) {
|
|
||||||
applicationContext.hasNetwork = true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onLost(network: Network) {
|
|
||||||
applicationContext.hasNetwork = false
|
|
||||||
(context as MainActivity).messageWithSound(
|
|
||||||
context.getString(R.string.sin_internet),
|
|
||||||
true,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun registerNetworkCallback() {
|
|
||||||
val networkRequest = NetworkRequest.Builder()
|
|
||||||
.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
|
|
||||||
.build()
|
|
||||||
connectivityManager.registerNetworkCallback(networkRequest, networkCallback)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun unregisterNetworkCallback() {
|
|
||||||
connectivityManager.unregisterNetworkCallback(networkCallback)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,102 +0,0 @@
|
||||||
package es.verdnatura.presentation.common
|
|
||||||
|
|
||||||
import android.app.AlertDialog
|
|
||||||
import android.content.Context
|
|
||||||
import android.text.InputType
|
|
||||||
import android.view.View
|
|
||||||
import android.view.inputmethod.EditorInfo
|
|
||||||
import es.verdnatura.R
|
|
||||||
import es.verdnatura.domain.toast
|
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogInput
|
|
||||||
import es.verdnatura.presentation.view.component.CustomDialogList
|
|
||||||
|
|
||||||
class PrinterDialogManager(private val context: Context) {
|
|
||||||
fun showPrintDialog(
|
|
||||||
item: Long,
|
|
||||||
itemName: String,
|
|
||||||
onPrintClick: (Long, String, Int?, Int) -> Unit,
|
|
||||||
onPrintChange: (String) -> Unit
|
|
||||||
) {
|
|
||||||
val customDialogList = CustomDialogList(context)
|
|
||||||
customDialogList.getEditText().setRawInputType(InputType.TYPE_CLASS_NUMBER)
|
|
||||||
customDialogList.getEditTextThree().setRawInputType(InputType.TYPE_CLASS_NUMBER)
|
|
||||||
|
|
||||||
customDialogList.setTitle(context.getString(R.string.itemName, item, itemName))
|
|
||||||
.setOkButton(context.getString(R.string.printQr)) {
|
|
||||||
handlePrintClick(item, customDialogList, onPrintClick, "qr")
|
|
||||||
customDialogList.dismiss()
|
|
||||||
}.setOkTwoButton(context.getString(R.string.printBarcode)) {
|
|
||||||
handlePrintClick(item, customDialogList, onPrintClick, "barcode")
|
|
||||||
customDialogList.dismiss()
|
|
||||||
//Tarea 7823
|
|
||||||
}.setOkThreeButton(context.getString(R.string.changePrinter)) {
|
|
||||||
readQrPrinter(onPrintChange)
|
|
||||||
}.setKoButton(context.getString(R.string.cancel)) {
|
|
||||||
customDialogList.dismiss()
|
|
||||||
}.setHintValueThree(context.getString(R.string.labelNumber))
|
|
||||||
.setHintValue(context.getString(R.string.optionalPacking)).setTextThree(View.VISIBLE)
|
|
||||||
.show()
|
|
||||||
customDialogList.getFocusThree()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun readQrPrinter(onPrintChange: (String) -> Unit) {
|
|
||||||
val customDialogInput = CustomDialogInput(context)
|
|
||||||
|
|
||||||
customDialogInput.setTitle(context.getString(R.string.changePrinter))
|
|
||||||
.setDescription(context.getString(R.string.scanQrPrinter))
|
|
||||||
.setOkButton(context.getString(R.string.save)) {
|
|
||||||
onPrintChange(customDialogInput.getValue())
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
|
|
||||||
}.setKoButton(context.getString(R.string.cancel)) {
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
}.setValue("").show()
|
|
||||||
customDialogInput.getEditText().requestFocus()
|
|
||||||
customDialogInput.getEditText().setOnEditorActionListener { _, actionId, _ ->
|
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
|
||||||
onPrintChange(customDialogInput.getValue())
|
|
||||||
println("printerrr ${customDialogInput.getValue()}")
|
|
||||||
customDialogInput.dismiss()
|
|
||||||
return@setOnEditorActionListener true
|
|
||||||
}
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun handlePrintClick(
|
|
||||||
item: Long,
|
|
||||||
customDialogList: CustomDialogList,
|
|
||||||
onPrintClick: (Long, String, Int?, Int) -> Unit,
|
|
||||||
labelType: String
|
|
||||||
) {
|
|
||||||
try {
|
|
||||||
onPrintClick(
|
|
||||||
item,
|
|
||||||
labelType,
|
|
||||||
if (customDialogList.getValue().isEmpty()) null else customDialogList.getValue()
|
|
||||||
.toInt(),
|
|
||||||
if (customDialogList.getValueOptional()
|
|
||||||
.isEmpty()
|
|
||||||
) 1 else customDialogList.getValueOptional().toInt()
|
|
||||||
)
|
|
||||||
customDialogList.dismiss()
|
|
||||||
} catch (ex: Exception) {
|
|
||||||
context.getString(R.string.errorInput).toast(context)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class LabelDialogHelper(private val context: Context) {
|
|
||||||
fun showLabelDialog(
|
|
||||||
onItemSelected: (Int) -> Unit,
|
|
||||||
) {
|
|
||||||
val builder = AlertDialog.Builder(context)
|
|
||||||
builder.setTitle(context.getString(R.string.selectLabeltoPrint))
|
|
||||||
val labelCount = Array(10) { (it + 1).toString() }
|
|
||||||
builder.setItems(labelCount) { _, which ->
|
|
||||||
onItemSelected(which + 1)
|
|
||||||
}
|
|
||||||
builder.create().show()
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,50 +3,20 @@ package es.verdnatura.presentation.common
|
||||||
class ResponseItemVO(
|
class ResponseItemVO(
|
||||||
var response: String = "",
|
var response: String = "",
|
||||||
var isError: Boolean = false,
|
var isError: Boolean = false,
|
||||||
var errorMessage: String = "",
|
var errorMessage: String = ""
|
||||||
var codeError: Int = 0,
|
|
||||||
var routine: String = "",
|
|
||||||
var data: Any? = null
|
|
||||||
)
|
|
||||||
|
|
||||||
data class ResponseSign(
|
|
||||||
val fileToSign: String = "",
|
|
||||||
val isError: Boolean = false,
|
|
||||||
val message: String = ""
|
|
||||||
)
|
|
||||||
|
|
||||||
class ResponseHasOlder(
|
|
||||||
var shelvingFkIn: String,
|
|
||||||
var parking: String? = null,
|
|
||||||
var shelvingFkOut: String? = null,
|
|
||||||
var itemFk: Int? = null,
|
|
||||||
var action: Action,
|
|
||||||
var hasOlder: Boolean = false
|
|
||||||
)
|
|
||||||
|
|
||||||
class ResponseItemExistsItemShelvingSale(
|
|
||||||
var exists: Boolean,
|
|
||||||
var position: Int,
|
|
||||||
var quantity: Int
|
|
||||||
)
|
|
||||||
|
|
||||||
class ResponseItemNumber(
|
|
||||||
var response: Int? = null,
|
|
||||||
var isError: Boolean = false,
|
|
||||||
var errorMessage: String = "",
|
|
||||||
var codeError: Int = 0
|
|
||||||
)
|
)
|
||||||
|
|
||||||
class ResponseItemMachineControl(
|
class ResponseItemMachineControl(
|
||||||
var response: String = "",
|
var response: String = "",
|
||||||
|
var isError: Boolean = false,
|
||||||
|
var errorMessage: String = "",
|
||||||
var type: String
|
var type: String
|
||||||
)
|
)
|
||||||
|
|
||||||
class GeneralItem(
|
class DataMessageSalix(
|
||||||
var code: String? = "",
|
var ticket: String = "",
|
||||||
var text: String? = ""
|
var item: String = "",
|
||||||
)
|
var quantity: String = "",
|
||||||
|
var personSale: String = ""
|
||||||
|
|
||||||
enum class Action {
|
)
|
||||||
PARKINEAR, TRANSFERIR
|
|
||||||
}
|
|
|
@ -1,118 +0,0 @@
|
||||||
package es.verdnatura.presentation.common
|
|
||||||
|
|
||||||
class ItemBarCodeSalix(
|
|
||||||
var itemFk: Int,
|
|
||||||
var code: String
|
|
||||||
)
|
|
||||||
|
|
||||||
data class SaleTrackingReplaceSalix(
|
|
||||||
var saleFk: Int,
|
|
||||||
var originalQuantity: Int,
|
|
||||||
var code: String,
|
|
||||||
var isChecked: Boolean,
|
|
||||||
var buyFk: Long,
|
|
||||||
var isScanned: Boolean,
|
|
||||||
)
|
|
||||||
|
|
||||||
data class SaleTrackingSalix(
|
|
||||||
var saleFk: Int,
|
|
||||||
var originalQuantity: Int,
|
|
||||||
var code: String,
|
|
||||||
var isChecked: Boolean,
|
|
||||||
var buyFk: Long,
|
|
||||||
var isScanned: Boolean?,
|
|
||||||
var quantity: Int,
|
|
||||||
var itemShelvingFk: Int
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
data class PackingSiteSalix(
|
|
||||||
val ticketFk: Number,
|
|
||||||
val workerFk: Number
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
data class ItemShelvingSaleSalix(
|
|
||||||
var id: Int,
|
|
||||||
var quantity: Int,
|
|
||||||
var isItemShelvingSaleEmpty: Boolean?
|
|
||||||
)
|
|
||||||
|
|
||||||
data class ItemShelving(
|
|
||||||
var id: Int,
|
|
||||||
var itemFk: Int,
|
|
||||||
var shelvingFk: String,
|
|
||||||
var position: Int,
|
|
||||||
var quantity: Int,
|
|
||||||
var visible: Int? = null,
|
|
||||||
var available: Int? = null
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
data class ItemShelvingSalix(
|
|
||||||
var visible: Int,
|
|
||||||
var packing: Int?,
|
|
||||||
var grouping: Int?,
|
|
||||||
var available: Int?
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
data class ItemDiscardSalixShortage(
|
|
||||||
var itemFk: Int,
|
|
||||||
var warehouseFk: Int,
|
|
||||||
var quantity: Int,
|
|
||||||
var addressFk: Int?
|
|
||||||
)
|
|
||||||
|
|
||||||
data class BackSalixCall(
|
|
||||||
var schema: String = "vn",
|
|
||||||
var params: ArrayList<Any?>
|
|
||||||
)
|
|
||||||
|
|
||||||
data class CollectionItemSalix(
|
|
||||||
var barcode: String,
|
|
||||||
var quantity: Int,
|
|
||||||
var ticketFk: Int,
|
|
||||||
var warehouseFk: Int
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
//Tarea 6889
|
|
||||||
data class ItemAddSale(
|
|
||||||
var barcode: String,
|
|
||||||
var quantity: Int,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
data class TicketState(
|
|
||||||
val ticketFk: Int = 0,
|
|
||||||
val code: String = "",
|
|
||||||
val user: UserSalix = UserSalix()
|
|
||||||
) {
|
|
||||||
data class UserSalix(
|
|
||||||
val id: Int = 0,
|
|
||||||
val username: String = ""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
data class ExpeditionPrintOut(
|
|
||||||
val expeditionFk: Long,
|
|
||||||
val itemFk: Int,
|
|
||||||
val isChecked: Boolean
|
|
||||||
)
|
|
||||||
|
|
||||||
data class TicketPickupResponse(
|
|
||||||
val id: Int,
|
|
||||||
val agencyMode: AgencyMode?
|
|
||||||
)
|
|
||||||
|
|
||||||
data class AgencyMode(
|
|
||||||
val id: Int,
|
|
||||||
val deliveryMethodFk: Int,
|
|
||||||
val deliveryMethod: DeliveryMethod?
|
|
||||||
)
|
|
||||||
|
|
||||||
data class DeliveryMethod(
|
|
||||||
val id: Int,
|
|
||||||
val code: String?
|
|
||||||
)
|
|
|
@ -1,16 +1,17 @@
|
||||||
package es.verdnatura.presentation.common
|
package es.verdnatura.presentation.common
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import es.verdnatura.R
|
||||||
import es.verdnatura.databinding.ItemToolbarRowBinding
|
import es.verdnatura.databinding.ItemToolbarRowBinding
|
||||||
|
|
||||||
class ToolBarAdapterTooltip (
|
class ToolBarAdapterTooltip (
|
||||||
|
|
||||||
private var items: List<ImageView>,
|
private val items: List<ImageView>,
|
||||||
private val onOptionsSelectedListener: OnOptionsSelectedListener
|
private val onOptionsSelectedListener: OnOptionsSelectedListener
|
||||||
) : RecyclerView.Adapter<ToolBarAdapterTooltip.ItemHolder>() {
|
) : RecyclerView.Adapter<ToolBarAdapterTooltip.ItemHolder>() {
|
||||||
|
|
||||||
|
@ -29,10 +30,6 @@ class ToolBarAdapterTooltip(
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
fun setItemsList(itemsNewList: List<ImageView>) {
|
|
||||||
items = itemsNewList
|
|
||||||
notifyDataSetChanged()
|
|
||||||
}
|
|
||||||
|
|
||||||
inner class ItemHolder(
|
inner class ItemHolder(
|
||||||
val binding: ItemToolbarRowBinding
|
val binding: ItemToolbarRowBinding
|
||||||
|
|
|
@ -1,61 +1,34 @@
|
||||||
package es.verdnatura.presentation.common
|
package es.verdnatura.presentation.common
|
||||||
|
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.view.View
|
|
||||||
import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
|
import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
import es.verdnatura.presentation.view.feature.articulo.model.BarcodeVO
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardRowVO
|
import es.verdnatura.presentation.view.feature.articulo.model.ItemCardRowVO
|
||||||
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
|
import es.verdnatura.presentation.view.feature.articulo.model.ItemProposal
|
||||||
import es.verdnatura.presentation.view.feature.claim.fragment.reubication.model.Reubication
|
import es.verdnatura.presentation.view.feature.buscaritem.model.ItemLocationVO
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ClientTicketSalix
|
import es.verdnatura.presentation.view.feature.faltas.model.ItemFaltasVO
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.ExpeditionInfoSummary
|
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteComplement
|
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.RouteInfo
|
|
||||||
import es.verdnatura.presentation.view.feature.delivery.model.Ticket
|
|
||||||
import es.verdnatura.presentation.view.feature.historicoarticulo.model.ItemHistoricoVO
|
|
||||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventaryVO
|
||||||
import es.verdnatura.presentation.view.feature.inventario.model.ItemInventoryParking
|
|
||||||
import es.verdnatura.presentation.view.feature.login.model.WorkForms
|
|
||||||
import es.verdnatura.presentation.view.feature.packaging.model.ItemSupplier
|
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionScanVO
|
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionScanVO
|
||||||
|
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionStateRow
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
|
import es.verdnatura.presentation.view.feature.paletizador.model.ItemExpeditionTruckVO
|
||||||
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
import es.verdnatura.presentation.view.feature.paletizador.model.ItemPalletVO
|
||||||
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
|
||||||
import es.verdnatura.presentation.view.feature.roadmap.model.RoadMapTruck
|
|
||||||
import es.verdnatura.presentation.view.feature.roadmap.model.RoadStopMapTruck
|
|
||||||
import es.verdnatura.presentation.view.feature.roadmap.model.StopMapTruckPallet
|
|
||||||
import es.verdnatura.presentation.view.feature.roadmap.model.TruckAction
|
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionTicket
|
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
import es.verdnatura.presentation.view.feature.sacador.model.CollectionVO
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.Sale
|
|
||||||
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
import es.verdnatura.presentation.view.feature.sacador.model.SaleVO
|
||||||
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
|
import es.verdnatura.presentation.view.feature.smarttag.model.SmartTag
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemShelving
|
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicador
|
|
||||||
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
import es.verdnatura.presentation.view.feature.ubicador.model.ItemUbicadorVO
|
||||||
import es.verdnatura.presentation.view.feature.workermistake.model.WorkerFromMistake
|
|
||||||
|
|
||||||
interface OnOptionsSelectedListener {
|
interface OnOptionsSelectedListener {
|
||||||
fun onOptionsItemSelected(item: Drawable)
|
fun onOptionsItemSelected(item: Drawable)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
interface OnPasillerosItemClickListener {
|
interface OnPasillerosItemClickListener {
|
||||||
fun onPasillerosItemClickListener(
|
fun onPasillerosItemClickListener(item: PasillerosItemVO,entryPoint:String)
|
||||||
item: PasillerosItemVO,
|
|
||||||
entryPoint: String,
|
|
||||||
param: Any? = null
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnMistakeWorkerClickListener {
|
|
||||||
fun onMistakeWorkerClickListener(item: WorkerFromMistake)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnSalarySupplementClickListener {
|
interface hideBottomNavigation{
|
||||||
fun onSalarySupplementClickListener(item: RouteComplement)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface HideBottomNavigation {
|
|
||||||
fun hideBottomNavigation(entryPoint:String)
|
fun hideBottomNavigation(entryPoint:String)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,80 +36,24 @@ interface OnAjustesItemClickListener {
|
||||||
fun onAjustesItemClickListener(item: AjustesItemVO)
|
fun onAjustesItemClickListener(item: AjustesItemVO)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
interface OnItemCardRowClickListener {
|
interface OnItemCardRowClickListener {
|
||||||
fun onItemCardRowClickListener(item: ItemCardRowVO)
|
fun onItemCardRowClickListener(item: ItemCardRowVO)
|
||||||
}
|
}
|
||||||
|
interface OnItemExpeditionStateRowClickListener {
|
||||||
interface OnItemImageLoadRowClickListener {
|
|
||||||
fun onItemImageLoadRowClickListener(item: ExpeditionInfoSummary)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnItemImageRouteRowClickListener {
|
|
||||||
fun onItemImageRouteRowClickListener(item: RouteInfo, action: String)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnItemButtonTicketRowClickListener {
|
|
||||||
fun onItemButtonTicketRowClickListener(item: ClientTicketSalix, action: String)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnItemButtonRoadMapStopRowClickListener {
|
|
||||||
fun onItemButtonRoadMapStopRowClickListener(item: ClientTicketSalix, action: String)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnItemButtonCMRRowClickListener {
|
|
||||||
fun onItemButtonCMRRowClickListener(item: Ticket)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnAddressRowClickListener {
|
|
||||||
fun onAddressRowClickListener(item: ExpeditionInfoSummary)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*interface OnItemExpeditionStateRowClickListener {
|
|
||||||
fun OnItemExpeditionStateRowClickListener(item: ItemExpeditionStateRow)
|
fun OnItemExpeditionStateRowClickListener(item: ItemExpeditionStateRow)
|
||||||
}*/
|
}
|
||||||
|
|
||||||
interface OnBarcodeRowClickListener {
|
interface OnBarcodeRowClickListener {
|
||||||
fun onBarcodeRowClickListener(item: BarcodeVO)
|
fun onBarcodeRowClickListener(item: BarcodeVO)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnSmartTagRowClickListener {
|
interface OnSmartTagRowClickListener {
|
||||||
fun onSmartTagRowClickListener(item: SmartTag)
|
fun OnSmartTagRowClickListener(item: SmartTag)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnGeneralItemRowClickListener {
|
interface OnLocationRowClickListener {
|
||||||
fun onGeneralItemRowClickListener(item: GeneralItem)
|
fun onLocationRowClickListener(item: ItemLocationVO)
|
||||||
}
|
|
||||||
|
|
||||||
interface OnGeneralRowClickListener {
|
|
||||||
fun onRowClickListener(item: GeneralItem)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnImageTrashClickListener {
|
|
||||||
fun onImageTrashClickListener(item: Any)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnEditSubQuantityListener {
|
|
||||||
fun onEditSubQuantityListener(item: Any, text: String)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface AdapterCallback {
|
|
||||||
fun getPosition(): Int
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnItemClickListener {
|
|
||||||
fun onItemClickListener(item: ItemSupplier)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnImageUpdateClickListener {
|
|
||||||
fun onImageUpdateClickListener(item: Any)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnWorkFormsItemRowClickListener {
|
|
||||||
fun onWorkFormsItemRowClickListener(item: WorkForms)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnTrashItemRowClickListener {
|
|
||||||
fun onTrashItemRowClickListener(item: WorkForms)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnInvetoryNichoClickListener {
|
interface OnInvetoryNichoClickListener {
|
||||||
|
@ -147,155 +64,62 @@ interface OnItemProposalClickListener {
|
||||||
fun onItemProposalClickListener(item: ItemProposal)
|
fun onItemProposalClickListener(item: ItemProposal)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface OnFaltasNichoClickListener {
|
||||||
|
fun onFaltasNichoClickListener(item: ItemFaltasVO)
|
||||||
|
}
|
||||||
|
|
||||||
|
interface OnFaltasReviewClickListener {
|
||||||
|
fun onFaltasReviewClickListener(item: ItemFaltasVO)
|
||||||
|
}
|
||||||
|
|
||||||
interface OnAutomaticItemClickListener {
|
interface OnAutomaticItemClickListener {
|
||||||
fun onAutomaticItemClickListener(position: Int)
|
fun onAutomaticItemClickListener(position: Int)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnClientHistoricItemClickListener {
|
|
||||||
fun onClientHistoricItemClickListener(item: ItemHistoricoVO)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnOutQuantityHistoricItemClickListener {
|
|
||||||
fun onOutQuantityHistoricItemClickListener(item: ItemHistoricoVO)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnVisibleClickListener {
|
interface OnVisibleClickListener {
|
||||||
fun onVisibleClickListener(item: ItemUbicadorVO)
|
fun onVisibleClickListener(item: ItemUbicadorVO)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnVisibleClickListenerNew {
|
|
||||||
fun onVisibleClickListener(item: ItemUbicador)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnVisibleClickListener6869 {
|
|
||||||
fun onVisibleClickListener(item: ItemShelving)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnVisibleInventoryClickListener {
|
|
||||||
fun onVisibleInventoryClickListener(item: ItemInventoryParking)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnMoreClickListener {
|
interface OnMoreClickListener {
|
||||||
fun onMoreClickListener(item: ItemUbicadorVO)
|
fun onMoreClickListener(item: ItemUbicadorVO)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnMoreClickListenerNew {
|
|
||||||
fun onMoreClickListener(item: ItemUbicador)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnMoreClickListener6869 {
|
|
||||||
fun onMoreClickListener(item: ItemShelving)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnTruckClickListener {
|
interface OnTruckClickListener {
|
||||||
fun onTruckClickListener(item: ItemExpeditionTruckVO,entryPoint: String)
|
fun onTruckClickListener(item: ItemExpeditionTruckVO,entryPoint: String)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnRoadMapClickListener {
|
|
||||||
fun onRoadMapClickListener(item: RoadMapTruck, entryPoint: String)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnStopMapClickListener {
|
|
||||||
fun onStopMapClickListener(
|
|
||||||
item: RoadStopMapTruck,
|
|
||||||
entryPoint: String,
|
|
||||||
action: TruckAction,
|
|
||||||
view: View? = null
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnStopMapLoadClickListener {
|
|
||||||
fun onStopMapClickListener(item: RoadStopMapTruck, entryPoint: String)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnStopMapUnloadClickListener {
|
|
||||||
fun onStopMapClickListener(item: RoadStopMapTruck, entryPoint: String)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnPrintClickListener {
|
|
||||||
fun onPrintClickListener(item: StopMapTruckPallet, entryPoint: String)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnPalletClickListener {
|
interface OnPalletClickListener {
|
||||||
fun onPalletClickListener(itemTruck: ItemExpeditionTruckVO,itemPallet: ItemPalletVO)
|
fun onPalletClickListener(itemTruck: ItemExpeditionTruckVO,itemPallet: ItemPalletVO)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnComprobarPalletViewClickListener {
|
interface OnComprobarPalletViewClickListener {
|
||||||
fun onComprobarPalletViewClickListener(
|
fun onComprobarPalletViewClickListener(itemTruck: ItemExpeditionTruckVO,itemPallet: ItemPalletVO)
|
||||||
itemTruck: ItemExpeditionTruckVO,
|
|
||||||
itemPallet: ItemPalletVO
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnScanLongClickListener {
|
interface OnScanLongClickListener {
|
||||||
fun onScanLongClickListener(itemExpeditionScanVO: ItemExpeditionScanVO)
|
fun onScanLongClickListener(ItemExpeditionScanVO: ItemExpeditionScanVO)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnCollectionSelectedListener {
|
interface OnCollectionSelectedListener {
|
||||||
fun onCollectionSelected(collection: CollectionVO,type:String)
|
fun onCollectionSelected(collection: CollectionVO,type:String)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnCollectionTicketSelectedListener {
|
|
||||||
fun onCollectionSelected(
|
|
||||||
collection: CollectionTicket,
|
|
||||||
type: String,
|
|
||||||
hasPicking: Boolean = false,
|
|
||||||
hasToAdd: Boolean = false
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnQuantityClickListener {
|
interface OnQuantityClickListener {
|
||||||
fun onQuantityClick(sale: SaleVO)
|
fun onQuantityClick(sale: SaleVO)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnQuantityClickSaleListener {
|
interface onPackingClickListener {
|
||||||
fun onQuantityClick(sale: Sale)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnPackingClickListener {
|
|
||||||
fun onPackingClick(sale:SaleVO)
|
fun onPackingClick(sale:SaleVO)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnPackingClickSaleListener {
|
|
||||||
fun onPackingClick(sale: Sale)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnSaleClickListener {
|
interface OnSaleClickListener {
|
||||||
fun onSaleClick(sale: SaleVO)
|
fun onSaleClick(sale: SaleVO)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnSaleClickSaleListener {
|
|
||||||
fun onSaleClick(sale: Sale)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnReubicationClickListener {
|
|
||||||
fun onReubicationClick(reubication: Reubication)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnMistakeClickListener {
|
interface OnMistakeClickListener {
|
||||||
fun onMistakeClickListener(sale:SaleVO)
|
fun onMistakeClickListener(sale:SaleVO)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnTicketClickListener {
|
|
||||||
fun onTicketClickListener(sale: SaleVO)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnTicketColorListener {
|
|
||||||
fun onTicketColorListener(sale: SaleVO)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnTicketClickSaleListener {
|
|
||||||
fun onTicketClickListener(sale: Sale)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnSaleReserveClickListener {
|
|
||||||
fun onSaleReserveListener(sale: Sale)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnAddItemClickListener {
|
|
||||||
fun onAddItemClickListener(sale: Sale)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnBuyerSelectedListener {
|
interface OnBuyerSelectedListener {
|
||||||
fun onBuyerSelected(userFk:String)
|
fun onBuyerSelected(userFk:String)
|
||||||
}
|
}
|
||||||
|
@ -304,30 +128,6 @@ interface OnStarSelectedListener {
|
||||||
fun onStarSelected(vId:String, vStars:String)
|
fun onStarSelected(vId:String, vStars:String)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnVehicleSelected {
|
interface onVehicleSelected{
|
||||||
fun onVehicleClick(userFk: String)
|
fun onVehicleClick(userFk: String)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnClickDynamic {
|
|
||||||
fun onClickDynamic(addressFK: Int)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface InteceptorListener {
|
|
||||||
fun onInterceptionResult(visibility: Int)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MainActivityListener {
|
|
||||||
fun onApplicationEventAnimation(visibility: Int)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface LoginListener {
|
|
||||||
fun onApplicationEventAnimation(visibility: Int)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SignListener {
|
|
||||||
fun onApplicationEventAnimation(visibility: Int)
|
|
||||||
}
|
|
||||||
|
|
||||||
interface OnBackPressedListener {
|
|
||||||
fun onBackPressedHandled(): Boolean
|
|
||||||
}
|
|
|
@ -3,20 +3,18 @@ package es.verdnatura.presentation.common
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.PackageInfo
|
|
||||||
import android.content.pm.PackageManager
|
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
import android.media.AudioManager
|
import android.media.AudioManager
|
||||||
import android.os.Build
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Handler
|
import android.text.InputType
|
||||||
import android.os.Looper
|
import android.util.Log
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.ViewTreeObserver
|
import android.view.ViewTreeObserver
|
||||||
import android.view.inputmethod.InputMethodManager
|
import android.view.inputmethod.InputMethodManager
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
import androidx.fragment.app.FragmentManager
|
import androidx.fragment.app.FragmentManager
|
||||||
|
@ -25,19 +23,14 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
import com.bumptech.glide.request.target.CustomTarget
|
import com.bumptech.glide.request.target.CustomTarget
|
||||||
import com.bumptech.glide.request.transition.Transition
|
import com.bumptech.glide.request.transition.Transition
|
||||||
import java.text.DecimalFormat
|
import es.verdnatura.BuildConfig
|
||||||
import java.text.ParseException
|
import java.util.*
|
||||||
import java.text.SimpleDateFormat
|
|
||||||
import java.time.LocalDate
|
|
||||||
import java.time.LocalDateTime
|
|
||||||
import java.time.LocalTime
|
|
||||||
import java.time.format.DateTimeFormatter
|
|
||||||
import java.util.Calendar
|
|
||||||
import java.util.Locale
|
|
||||||
|
|
||||||
inline fun FragmentManager.inTransaction(func: FragmentTransaction.() -> FragmentTransaction) =
|
inline fun FragmentManager.inTransaction(func: FragmentTransaction.() -> FragmentTransaction) =
|
||||||
beginTransaction().func().commit()
|
beginTransaction().func().commit()
|
||||||
|
|
||||||
|
|
||||||
fun <T> Context.openActivity(it: Class<T>, extras: Bundle.() -> Unit = {}) {
|
fun <T> Context.openActivity(it: Class<T>, extras: Bundle.() -> Unit = {}) {
|
||||||
val intent = Intent(this, it)
|
val intent = Intent(this, it)
|
||||||
intent.putExtras(Bundle().apply(extras))
|
intent.putExtras(Bundle().apply(extras))
|
||||||
|
@ -76,14 +69,12 @@ fun View.setDimensions(width: Int, height: Int) {
|
||||||
layoutParams?.height = height
|
layoutParams?.height = height
|
||||||
this.layoutParams = layoutParams
|
this.layoutParams = layoutParams
|
||||||
}
|
}
|
||||||
|
|
||||||
fun View.setMargins(left: Int, top: Int, right: Int, bottom: Int) {
|
fun View.setMargins(left: Int, top: Int, right: Int, bottom: Int) {
|
||||||
val mlp = this.layoutParams as ViewGroup.MarginLayoutParams
|
val mlp = this.layoutParams as ViewGroup.MarginLayoutParams
|
||||||
mlp.setMargins(left, top, right, bottom)
|
mlp.setMargins(left, top, right, bottom)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun ImageView.loadUrl(url: String?) {
|
fun ImageView.loadUrl(url: String) {
|
||||||
if (!url.isNullOrEmpty()) {
|
|
||||||
Glide.with(context)
|
Glide.with(context)
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.load(url)
|
.load(url)
|
||||||
|
@ -96,7 +87,6 @@ fun ImageView.loadUrl(url: String?) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
inline val <reified T> T.TAG: String
|
inline val <reified T> T.TAG: String
|
||||||
get() = T::class.java.canonicalName ?: T::class.simpleName ?: T::class.java.simpleName
|
get() = T::class.java.canonicalName ?: T::class.simpleName ?: T::class.java.simpleName
|
||||||
|
@ -131,13 +121,12 @@ fun Calendar.convertToDateString(): String {
|
||||||
11 -> dayOfMonth = "Dic"
|
11 -> dayOfMonth = "Dic"
|
||||||
}
|
}
|
||||||
|
|
||||||
return "$dayOfWeek $day $dayOfMonth"
|
return dayOfWeek + " " + day + " " + dayOfMonth
|
||||||
}
|
}
|
||||||
|
|
||||||
fun RecyclerView.addViewObserver(function: () -> Unit) {
|
fun RecyclerView.addViewObserver(function: () -> Unit) {
|
||||||
val view = this
|
val view = this
|
||||||
view.viewTreeObserver.addOnGlobalLayoutListener(object :
|
view.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
|
||||||
ViewTreeObserver.OnGlobalLayoutListener {
|
|
||||||
override fun onGlobalLayout() {
|
override fun onGlobalLayout() {
|
||||||
view.viewTreeObserver.removeOnGlobalLayoutListener(this)
|
view.viewTreeObserver.removeOnGlobalLayoutListener(this)
|
||||||
function.invoke()
|
function.invoke()
|
||||||
|
@ -152,23 +141,18 @@ fun Fragment.hideKeyboard() {
|
||||||
fun Activity.hideKeyboard() {
|
fun Activity.hideKeyboard() {
|
||||||
hideKeyboard(currentFocus ?: View(this))
|
hideKeyboard(currentFocus ?: View(this))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Activity.showKeyboardIn() {
|
fun Activity.showKeyboardIn() {
|
||||||
showKeyboardIn(currentFocus ?: View(this))
|
showKeyboardIn(currentFocus ?: View(this))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.hideKeyboard(view: View) {
|
fun Context.hideKeyboard(view: View) {
|
||||||
Handler(Looper.getMainLooper()).postDelayed({
|
val inputMethodManager = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||||
val inputMethodManager =
|
|
||||||
getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
|
|
||||||
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
|
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
|
||||||
}, 100L)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.showKeyboard(){
|
fun Context.showKeyboard(){
|
||||||
val imm = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager?
|
val imm = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager?
|
||||||
imm!!.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0)
|
imm!!.toggleSoftInput(InputType.TYPE_CLASS_NUMBER, 0)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,53 +179,3 @@ val AudioManager.mediaMaxVolume: Int
|
||||||
// Extension property to get media/music current volume index
|
// Extension property to get media/music current volume index
|
||||||
val AudioManager.mediaCurrentVolume:Int
|
val AudioManager.mediaCurrentVolume:Int
|
||||||
get() = this.getStreamVolume(AudioManager.STREAM_MUSIC)
|
get() = this.getStreamVolume(AudioManager.STREAM_MUSIC)
|
||||||
|
|
||||||
fun getHourDay(date: String): String? {
|
|
||||||
return try {
|
|
||||||
val format = SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault())
|
|
||||||
val cal = Calendar.getInstance()
|
|
||||||
|
|
||||||
cal.time = format.parse(date)!!
|
|
||||||
val f = DecimalFormat("00")
|
|
||||||
"" + f.format(cal[Calendar.HOUR_OF_DAY]) + ":" + f.format(cal[Calendar.MINUTE])
|
|
||||||
} catch (e: ParseException) {
|
|
||||||
e.printStackTrace()
|
|
||||||
"00:00"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun addDateToTime(time: String): String {
|
|
||||||
val currentTime = Calendar.getInstance()
|
|
||||||
val dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
|
|
||||||
val currentDate = dateFormat.format(currentTime.time)
|
|
||||||
|
|
||||||
return "$currentDate $time"
|
|
||||||
}
|
|
||||||
|
|
||||||
fun PackageManager.getPackageInfoCompat(packageName: String, flags: Int = 0): PackageInfo =
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
||||||
getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(flags.toLong()))
|
|
||||||
} else {
|
|
||||||
getPackageInfo(packageName, flags)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun convertToDateString(date: String?): String? {
|
|
||||||
|
|
||||||
if (date.isNullOrEmpty()) {
|
|
||||||
return date
|
|
||||||
}
|
|
||||||
val formatoEntrada =
|
|
||||||
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.getDefault()) // Formato de entrada
|
|
||||||
val formatoSalida = SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()) // Formato de salida
|
|
||||||
val dateToConvert = formatoEntrada.parse(date) // Convertir fecha de String a objeto Date
|
|
||||||
return formatoSalida.format(dateToConvert!!) // Convertir fecha a String con formato deseado
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getDayBounds(dateString: String): Pair<LocalDateTime, LocalDateTime> {
|
|
||||||
val formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy")
|
|
||||||
val date = LocalDate.parse(dateString, formatter)
|
|
||||||
val startOfDay = date.atTime(LocalTime.MIN)
|
|
||||||
val endOfDay = date.atTime(LocalTime.MAX)
|
|
||||||
|
|
||||||
return Pair(startOfDay, endOfDay)
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
package es.verdnatura.presentation.common
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import com.google.gson.Gson
|
|
||||||
import com.google.gson.reflect.TypeToken
|
|
||||||
import es.verdnatura.R
|
|
||||||
import java.text.SimpleDateFormat
|
|
||||||
import java.util.Calendar
|
|
||||||
import java.util.Locale
|
|
||||||
|
|
||||||
class FunctionUtils {
|
|
||||||
fun getMessageFromJSON(json: String): String {
|
|
||||||
val gson = Gson()
|
|
||||||
var message = ""
|
|
||||||
val tutorialMap: Map<String, Any> =
|
|
||||||
gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
|
|
||||||
tutorialMap.forEach {
|
|
||||||
if (it.key == "Message") {
|
|
||||||
message = it.value.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return message
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getListFromJSON(json: String): List<String> {
|
|
||||||
val gson = Gson()
|
|
||||||
val list = mutableListOf<String>()
|
|
||||||
// val mapType = object : TypeToken<Map<String, Any>>() {}.type
|
|
||||||
val tutorialMap: Map<String, Any> =
|
|
||||||
gson.fromJson(json, object : TypeToken<Map<String, Any>>() {}.type)
|
|
||||||
tutorialMap.forEach {
|
|
||||||
|
|
||||||
list.add(it.key + ":" + it.value)
|
|
||||||
|
|
||||||
}
|
|
||||||
return list
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getCurdate(date: String, context: Context): String {
|
|
||||||
val c = Calendar.getInstance()
|
|
||||||
val df =
|
|
||||||
SimpleDateFormat(context.getString(R.string.dateCompleteFormat), Locale.getDefault())
|
|
||||||
val df2 = SimpleDateFormat(context.getString(R.string.timeFormat), Locale.getDefault())
|
|
||||||
c.time = df.parse(date)!!
|
|
||||||
return df2.format(c.time)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,75 +0,0 @@
|
||||||
package es.verdnatura.presentation.common
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
import org.json.JSONObject
|
|
||||||
import java.time.format.DateTimeFormatter
|
|
||||||
|
|
||||||
data class ItemScanned(var scanned: JSONObject) {
|
|
||||||
var table: String = scanned.get("table").toString()
|
|
||||||
var id: Int = scanned.get("id").toString().toInt()
|
|
||||||
var company: String = scanned.get("company").toString()
|
|
||||||
var more: String = if (scanned.has("more")) scanned.get("more").toString() else ""
|
|
||||||
var user: Int = scanned.get("user").toString().toInt()
|
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
var created = DateTimeFormatter.ISO_INSTANT.parse(scanned.get("created").toString())
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fun itemScanIsQr(value: String): Boolean {
|
|
||||||
|
|
||||||
return try {
|
|
||||||
ItemScanned(JSONObject(value))
|
|
||||||
true
|
|
||||||
|
|
||||||
} catch (ex: Exception) {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun itemScanValue(value: String, table: Array<String>, field: String): Any {
|
|
||||||
val item: ItemScanned
|
|
||||||
return try {
|
|
||||||
|
|
||||||
try {
|
|
||||||
item = ItemScanned(JSONObject(value))
|
|
||||||
} catch (ex: Exception) {
|
|
||||||
return value
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.company == "vnl" && item.table in table) {
|
|
||||||
when (item.table) {
|
|
||||||
|
|
||||||
"ticket" -> {
|
|
||||||
return item.id
|
|
||||||
}
|
|
||||||
|
|
||||||
"saleGroup" -> {
|
|
||||||
return item.id
|
|
||||||
}
|
|
||||||
|
|
||||||
"buy" -> {
|
|
||||||
when (field) {
|
|
||||||
"id" -> return item.id
|
|
||||||
"more" -> return item.more
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
"expeditionPallet" -> {
|
|
||||||
return item.id
|
|
||||||
}
|
|
||||||
|
|
||||||
"printer" -> {
|
|
||||||
return item.id
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
throw Exception("QR no válido")
|
|
||||||
|
|
||||||
} catch (ex: Exception) {
|
|
||||||
throw ex
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,264 +0,0 @@
|
||||||
package es.verdnatura.presentation.composable
|
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.border
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
|
||||||
import androidx.compose.foundation.layout.Box
|
|
||||||
import androidx.compose.foundation.layout.Column
|
|
||||||
import androidx.compose.foundation.layout.Row
|
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
|
||||||
import androidx.compose.foundation.layout.height
|
|
||||||
import androidx.compose.foundation.layout.padding
|
|
||||||
import androidx.compose.foundation.layout.wrapContentSize
|
|
||||||
import androidx.compose.foundation.lazy.LazyRow
|
|
||||||
import androidx.compose.foundation.lazy.items
|
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
||||||
import androidx.compose.foundation.text.KeyboardActions
|
|
||||||
import androidx.compose.foundation.text.KeyboardOptions
|
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
||||||
import androidx.compose.material3.HorizontalDivider
|
|
||||||
import androidx.compose.material3.Icon
|
|
||||||
import androidx.compose.material3.IconButton
|
|
||||||
import androidx.compose.material3.PlainTooltip
|
|
||||||
import androidx.compose.material3.Switch
|
|
||||||
import androidx.compose.material3.Text
|
|
||||||
import androidx.compose.material3.TextField
|
|
||||||
import androidx.compose.material3.TextFieldDefaults
|
|
||||||
import androidx.compose.material3.TooltipBox
|
|
||||||
import androidx.compose.material3.TooltipDefaults
|
|
||||||
import androidx.compose.material3.rememberTooltipState
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.runtime.getValue
|
|
||||||
import androidx.compose.runtime.mutableStateOf
|
|
||||||
import androidx.compose.runtime.remember
|
|
||||||
import androidx.compose.runtime.setValue
|
|
||||||
import androidx.compose.ui.Alignment
|
|
||||||
import androidx.compose.ui.Alignment.Companion.CenterVertically
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
|
||||||
import androidx.compose.ui.res.colorResource
|
|
||||||
import androidx.compose.ui.res.dimensionResource
|
|
||||||
import androidx.compose.ui.res.painterResource
|
|
||||||
import androidx.compose.ui.res.stringResource
|
|
||||||
import androidx.compose.ui.text.TextStyle
|
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
|
||||||
import androidx.compose.ui.text.input.ImeAction
|
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
import androidx.compose.ui.unit.sp
|
|
||||||
import es.verdnatura.R
|
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
|
||||||
@Composable
|
|
||||||
fun CustomToolbar(
|
|
||||||
title: String,
|
|
||||||
subtitle: String? = null,
|
|
||||||
showBackButton: Boolean = true,
|
|
||||||
showSwitch: Boolean = false,
|
|
||||||
iconList: List<IconToolBar> = emptyList(),
|
|
||||||
onBackClick: () -> Unit = {},
|
|
||||||
onSwitchChange: (Boolean) -> Unit = {},
|
|
||||||
) {
|
|
||||||
Column(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.background(Color.Black)
|
|
||||||
) {
|
|
||||||
|
|
||||||
Row(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.height(56.dp),
|
|
||||||
verticalAlignment = CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.SpaceBetween
|
|
||||||
|
|
||||||
) {
|
|
||||||
if (showBackButton) {
|
|
||||||
IconButton(
|
|
||||||
onClick = { onBackClick() },
|
|
||||||
modifier = Modifier.padding(start = 0.dp),
|
|
||||||
) {
|
|
||||||
Icon(
|
|
||||||
painter = painterResource(id = R.drawable.ic_chevron_left),
|
|
||||||
contentDescription = "Back",
|
|
||||||
tint = Color.White
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Text(
|
|
||||||
modifier = Modifier.weight(1f),
|
|
||||||
text = title,
|
|
||||||
color = Color.White,
|
|
||||||
fontSize = dimensionResource(id = R.dimen.title).value.sp,
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!subtitle.isNullOrEmpty()) {
|
|
||||||
Text(
|
|
||||||
modifier = Modifier.weight(1f),
|
|
||||||
text = subtitle,
|
|
||||||
color = Color.White.copy(alpha = 0.7f),
|
|
||||||
fontSize = dimensionResource(id = R.dimen.subtitle).value.sp
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (iconList.isNotEmpty()) {
|
|
||||||
LazyRow(
|
|
||||||
horizontalArrangement = Arrangement.End, // Esto asegura que los iconos estén a la derecha
|
|
||||||
) {
|
|
||||||
items(iconList) { iconToolBar ->
|
|
||||||
TooltipBox(
|
|
||||||
positionProvider = TooltipDefaults.rememberPlainTooltipPositionProvider(),
|
|
||||||
tooltip = {
|
|
||||||
PlainTooltip {
|
|
||||||
Text(iconToolBar.toolTip)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
state = rememberTooltipState()
|
|
||||||
) {
|
|
||||||
IconButton(
|
|
||||||
onClick = { iconToolBar.onClickIcon() },
|
|
||||||
) {
|
|
||||||
|
|
||||||
Icon(
|
|
||||||
painter = painterResource(id = iconToolBar.idRes),
|
|
||||||
contentDescription = iconToolBar.toolTip,
|
|
||||||
tint = Color.White
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (showSwitch) {
|
|
||||||
var switchState by remember { mutableStateOf(false) }
|
|
||||||
Switch(
|
|
||||||
checked = switchState,
|
|
||||||
onCheckedChange = {
|
|
||||||
switchState = it
|
|
||||||
onSwitchChange(it)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
HorizontalDivider(
|
|
||||||
thickness = 1.dp,
|
|
||||||
color = colorResource(id = R.color.verdnatura_brown_grey)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
data class IconToolBar(
|
|
||||||
val idRes: Int,
|
|
||||||
val toolTip: String = "",
|
|
||||||
val tint: Color = Color.White,
|
|
||||||
val onClickIcon: () -> Unit,
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun ScanLineTextSearch(
|
|
||||||
value: String,
|
|
||||||
onValueChange: (String) -> Unit,
|
|
||||||
onImeAction: () -> Unit,
|
|
||||||
modifier: Modifier = Modifier.wrapContentSize(),
|
|
||||||
) {
|
|
||||||
|
|
||||||
val keyboardController = LocalSoftwareKeyboardController.current
|
|
||||||
|
|
||||||
Box(
|
|
||||||
modifier = Modifier.fillMaxWidth(),
|
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
|
||||||
TextField(
|
|
||||||
value = value,
|
|
||||||
onValueChange = onValueChange,
|
|
||||||
textStyle = TextStyle(
|
|
||||||
color = Color.White,
|
|
||||||
textAlign = TextAlign.Center
|
|
||||||
),
|
|
||||||
placeholder = {
|
|
||||||
Box(
|
|
||||||
modifier = Modifier.fillMaxWidth(),
|
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = stringResource(id = R.string.Escaneaetiqueta),
|
|
||||||
textAlign = TextAlign.Center,
|
|
||||||
color = Color.White,
|
|
||||||
modifier = Modifier.fillMaxWidth()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
singleLine = true,
|
|
||||||
keyboardActions = KeyboardActions(
|
|
||||||
onDone = {
|
|
||||||
onImeAction()
|
|
||||||
keyboardController?.hide()
|
|
||||||
}
|
|
||||||
|
|
||||||
),
|
|
||||||
keyboardOptions = KeyboardOptions.Default.copy(
|
|
||||||
imeAction = ImeAction.Done
|
|
||||||
),
|
|
||||||
colors = TextFieldDefaults.colors(
|
|
||||||
focusedContainerColor = Color.DarkGray, // Fondo cuando está enfocado
|
|
||||||
unfocusedContainerColor = Color.DarkGray, // Fondo cuando NO está enfocado
|
|
||||||
cursorColor = Color.White, // Color del cursor
|
|
||||||
focusedTextColor = Color.White, // Color del texto cuando está enfocado
|
|
||||||
unfocusedTextColor = Color.White, // Color del texto cuando NO está enfocado
|
|
||||||
focusedPlaceholderColor = Color.Black, // Color del placeholder cuando está enfocado
|
|
||||||
unfocusedPlaceholderColor = Color.Black // Color del placeholder cuando NO está enfocado
|
|
||||||
),
|
|
||||||
modifier = modifier
|
|
||||||
.fillMaxWidth(fraction = 0.67f)
|
|
||||||
.border(2.dp, Color.White, RoundedCornerShape(8.dp))
|
|
||||||
.height(52.dp)
|
|
||||||
/* .onFocusEvent {
|
|
||||||
if (it.isFocused) {
|
|
||||||
keyboardController?.hide()
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Preview
|
|
||||||
@Composable
|
|
||||||
fun PreviewToolbar() {
|
|
||||||
CustomToolbar(
|
|
||||||
title = "Mi Toolbar",
|
|
||||||
subtitle = "10/20",
|
|
||||||
showBackButton = true,
|
|
||||||
showSwitch = true,
|
|
||||||
iconList = listOf(
|
|
||||||
IconToolBar(
|
|
||||||
R.drawable.ic_parking_ui, "", tint = Color.Blue,
|
|
||||||
onClickIcon = { }
|
|
||||||
)
|
|
||||||
),
|
|
||||||
onBackClick = { /* Acción de volver atrás */ },
|
|
||||||
onSwitchChange = { /* Acción del switch */ }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Preview
|
|
||||||
@Composable
|
|
||||||
fun PreviewScanLineTextSearch() {
|
|
||||||
ScanLineTextSearch(
|
|
||||||
value = stringResource(R.string.scanLabel),
|
|
||||||
onValueChange = {},
|
|
||||||
onImeAction = {})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
package es.verdnatura.presentation.composable
|
|
||||||
|
|
||||||
import android.os.Bundle
|
|
||||||
import androidx.activity.ComponentActivity
|
|
||||||
import androidx.activity.compose.setContent
|
|
||||||
import es.verdnatura.R
|
|
||||||
|
|
||||||
class ImageViewActivityComposable : ComponentActivity() {
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
super.onCreate(savedInstanceState)
|
|
||||||
setContent {
|
|
||||||
val imageUrl = intent.getStringExtra(getString(R.string.url)) ?: ""
|
|
||||||
val title = intent.getStringExtra(getString(R.string.title)) ?: ""
|
|
||||||
ImageViewScreen(imageUrl = imageUrl, titleToolBar = title, onBackClick = { finish() })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,59 +0,0 @@
|
||||||
package es.verdnatura.presentation.composable
|
|
||||||
|
|
||||||
import android.widget.ImageView
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
|
||||||
import androidx.compose.foundation.layout.Column
|
|
||||||
import androidx.compose.foundation.layout.Spacer
|
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
|
||||||
import androidx.compose.foundation.layout.height
|
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.ui.Alignment
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
import com.bumptech.glide.Glide
|
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
|
||||||
@Composable
|
|
||||||
fun ImageViewScreen(imageUrl: String, titleToolBar:String ="",onBackClick: () -> Unit ) {
|
|
||||||
|
|
||||||
CustomToolbar(
|
|
||||||
title = titleToolBar,
|
|
||||||
subtitle = "",
|
|
||||||
showBackButton = true,
|
|
||||||
showSwitch = false,
|
|
||||||
iconList = listOf(),
|
|
||||||
onBackClick = onBackClick ,
|
|
||||||
onSwitchChange = { }
|
|
||||||
)
|
|
||||||
Column(
|
|
||||||
modifier = Modifier.fillMaxSize(),
|
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
|
||||||
verticalArrangement = Arrangement.Top
|
|
||||||
) {
|
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
|
||||||
GlideImage(imageUrl = imageUrl)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun GlideImage(imageUrl: String) {
|
|
||||||
androidx.compose.ui.viewinterop.AndroidView(
|
|
||||||
factory = { context ->
|
|
||||||
ImageView(context).apply {
|
|
||||||
Glide.with(context)
|
|
||||||
.load(imageUrl)
|
|
||||||
.into(this)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
modifier = Modifier.fillMaxSize()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Preview(showBackground = true)
|
|
||||||
@Composable
|
|
||||||
fun DefaultPreview() {
|
|
||||||
ImageViewScreen(imageUrl = "https://example.com/image.jpg", "titleToolbar") {}
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
package es.verdnatura.presentation.composable
|
|
||||||
|
|
||||||
import androidx.compose.animation.AnimatedVisibility
|
|
||||||
import androidx.compose.animation.fadeIn
|
|
||||||
import androidx.compose.animation.fadeOut
|
|
||||||
import androidx.compose.foundation.layout.height
|
|
||||||
import androidx.compose.foundation.layout.wrapContentWidth
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.runtime.getValue
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.res.dimensionResource
|
|
||||||
import com.airbnb.lottie.compose.LottieAnimation
|
|
||||||
import com.airbnb.lottie.compose.LottieCompositionSpec
|
|
||||||
import com.airbnb.lottie.compose.LottieConstants
|
|
||||||
import com.airbnb.lottie.compose.rememberLottieComposition
|
|
||||||
import es.verdnatura.R
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun LottieLoadingAnimation(isVisible: Boolean = true) {
|
|
||||||
AnimatedVisibility(
|
|
||||||
visible = isVisible,
|
|
||||||
enter = fadeIn(),
|
|
||||||
exit = fadeOut()
|
|
||||||
) {
|
|
||||||
val composition by rememberLottieComposition(
|
|
||||||
spec = LottieCompositionSpec.RawRes(R.raw.orange_loading)
|
|
||||||
)
|
|
||||||
|
|
||||||
LottieAnimation(
|
|
||||||
composition = composition,
|
|
||||||
iterations = LottieConstants.IterateForever,
|
|
||||||
speed = 2f,
|
|
||||||
modifier = Modifier
|
|
||||||
.wrapContentWidth()
|
|
||||||
.height(dimensionResource(id = R.dimen.verdnatura_logo_large_height))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,72 +0,0 @@
|
||||||
package es.verdnatura.presentation.composable.ui
|
|
||||||
|
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
|
|
||||||
object VerdnaturaColors {
|
|
||||||
|
|
||||||
val OrangeSalix = Color(0xFFEC8916)
|
|
||||||
val BlackCustomDialog = Color(0xFF1A1A1A)
|
|
||||||
val BlackTextInput = Color(0xFF666666)
|
|
||||||
val White = Color(0xFFFFFFFF)
|
|
||||||
|
|
||||||
// Colores principales
|
|
||||||
val ColorPrimary = Color(0xFFF7931E)
|
|
||||||
val ColorPrimaryDark = Color(0xFF8B4200)
|
|
||||||
|
|
||||||
// Negros
|
|
||||||
/* val Black = Color(0xFF000000)
|
|
||||||
val Black1 = Color(0xFF1D1D1D)
|
|
||||||
val Black2 = Color(0xFF171717)
|
|
||||||
val Black3 = Color(0xFF292929)
|
|
||||||
val Black4 = Color(0xFF242424)
|
|
||||||
val Black5 = Color(0xFF323232)
|
|
||||||
val Black6 = Color(0xFF333333)
|
|
||||||
val Black7 = Color(0xFF282828)
|
|
||||||
val Black8 = Color(0xFF1A1A1A)
|
|
||||||
val BlackCustomDialog = Color(0xFF464446)
|
|
||||||
val Black8Alpha6 = Color(0x991A1A1A) // Con transparencia
|
|
||||||
|
|
||||||
// Grises
|
|
||||||
val WarmGrey = Color(0xFF707070)
|
|
||||||
val BrownGrey = Color(0xFF8F8F8F)
|
|
||||||
val BrownGreyLight = Color(0xFFB8ADAD)
|
|
||||||
|
|
||||||
// Colores vivos
|
|
||||||
val Red = Color(0xFFE74C3C)
|
|
||||||
val WarmBrown = Color(0xFF8B4200)
|
|
||||||
val PumpkinOrange = Color(0xFFF7931E)
|
|
||||||
val PumpkinLight = Color(0xFFF77956)
|
|
||||||
val PinkSalix = Color(0xFFFF99CC)
|
|
||||||
val SunflowerYellow = Color(0xFFFFD400)
|
|
||||||
val DarkSkyBlue = Color(0xFF4AB4E6)
|
|
||||||
val DarkGreenVerdnatura = Color(0xFFA3D131)
|
|
||||||
val DarkMint = Color(0xFF50BE87)
|
|
||||||
val DarkMintLight = Color(0xFF80BE87)
|
|
||||||
val DarkMintLightPrecontrolled = Color(0xFFB8DABA)
|
|
||||||
val LightTeal = Color(0xFFB8ECD6)
|
|
||||||
val White = Color(0xFFFFFFFF)
|
|
||||||
val RedSalix = Color(0xFFFB5252)
|
|
||||||
val OrangeSalix = Color(0xFFEC8916)
|
|
||||||
|
|
||||||
// Fondos
|
|
||||||
val BackgroundItemPicker = Color(0xFF4D4D4D)
|
|
||||||
val BackgroundSubtitleSettings = Color(0xFF1A1A1A)
|
|
||||||
val BackgroundItemsMenus = Color(0xFF333333)
|
|
||||||
|
|
||||||
// Colores SALIX
|
|
||||||
val SalixSuccessLight = Color(0xFFA3D131)
|
|
||||||
val ColorHeader = Color(0xFF3D3D3D)
|
|
||||||
val ColorMenuHeader = Color(0xFF3D3D3D)
|
|
||||||
val ColorBg = Color(0xFF222222)
|
|
||||||
val ColorBgDark = Color(0xFF222222)
|
|
||||||
val ColorActive = Color(0xFF666666)
|
|
||||||
val ColorActiveFont = Color(0xFFFFFFFF)
|
|
||||||
val ColorBgPanel = Color(0xFF3C3B3B)
|
|
||||||
val ColorMain = ColorPrimary
|
|
||||||
val ColorMarginal = Color(0xFF222222)
|
|
||||||
val ColorSuccess = Color(0xFFA3D131)
|
|
||||||
val ColorNotice = Color(0xFF32B1CE)
|
|
||||||
val ColorAlert = Color(0xFFFA3939)
|
|
||||||
val ColorPink = Color(0xFFFF99CC)
|
|
||||||
val ColorYellow = Color(0xFFFFFF00)*/
|
|
||||||
}
|
|
|
@ -1,168 +0,0 @@
|
||||||
package es.verdnatura.presentation.composable.ui
|
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.border
|
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
|
||||||
import androidx.compose.foundation.layout.height
|
|
||||||
import androidx.compose.foundation.layout.padding
|
|
||||||
import androidx.compose.foundation.text.KeyboardActions
|
|
||||||
import androidx.compose.foundation.text.KeyboardOptions
|
|
||||||
import androidx.compose.material3.Button
|
|
||||||
import androidx.compose.material3.ButtonDefaults
|
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import androidx.compose.material3.Text
|
|
||||||
import androidx.compose.material3.TextField
|
|
||||||
import androidx.compose.material3.TextFieldDefaults
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
|
||||||
import androidx.compose.runtime.mutableStateOf
|
|
||||||
import androidx.compose.runtime.remember
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.focus.FocusRequester
|
|
||||||
import androidx.compose.ui.focus.focusRequester
|
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
|
||||||
import androidx.compose.ui.text.input.ImeAction
|
|
||||||
import androidx.compose.ui.text.input.KeyboardType
|
|
||||||
import androidx.compose.ui.text.input.TextFieldValue
|
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
import androidx.compose.ui.unit.sp
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun DefaultButtonCustomDialog(
|
|
||||||
text: String,
|
|
||||||
onClick: () -> Unit = {},
|
|
||||||
enabled: Boolean = true,
|
|
||||||
leadingIcon: @Composable (() -> Unit)? = null
|
|
||||||
) {
|
|
||||||
Button(
|
|
||||||
modifier = Modifier.fillMaxWidth(),
|
|
||||||
onClick = onClick,
|
|
||||||
enabled = enabled,
|
|
||||||
contentPadding = PaddingValues(
|
|
||||||
start = if (leadingIcon == null) 16.dp else 8.dp,
|
|
||||||
end = 16.dp
|
|
||||||
),
|
|
||||||
shape = MaterialTheme.shapes.small,
|
|
||||||
colors = ButtonDefaults.buttonColors(
|
|
||||||
containerColor = VerdnaturaColors.ColorPrimary,
|
|
||||||
contentColor = VerdnaturaColors.White
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
if (leadingIcon != null) {
|
|
||||||
leadingIcon()
|
|
||||||
}
|
|
||||||
|
|
||||||
Text(
|
|
||||||
text = text.uppercase(),
|
|
||||||
fontSize = 14.sp,
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
textAlign = TextAlign.Center,
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun TitleTextCustomDialog(
|
|
||||||
title: String,
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = title,
|
|
||||||
style = MaterialTheme.typography.titleLarge.copy(
|
|
||||||
fontWeight = FontWeight.Bold
|
|
||||||
),
|
|
||||||
color = VerdnaturaColors.White,
|
|
||||||
textAlign = TextAlign.Center,
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(bottom = 8.dp)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun DescriptionTextCustomDialog(
|
|
||||||
description: String,
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = description,
|
|
||||||
color = VerdnaturaColors.White,
|
|
||||||
style = MaterialTheme.typography.bodyLarge,
|
|
||||||
modifier = Modifier.padding(bottom = 8.dp)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun ScanTextCustomDialog(
|
|
||||||
value: TextFieldValue,
|
|
||||||
onValueChange: (TextFieldValue) -> Unit,
|
|
||||||
hint: String,
|
|
||||||
onEnterPressed: (String) -> Unit = {},
|
|
||||||
focusRequester: FocusRequester
|
|
||||||
) {
|
|
||||||
val keyboardController = LocalSoftwareKeyboardController.current
|
|
||||||
|
|
||||||
TextField(
|
|
||||||
value = value,
|
|
||||||
onValueChange = onValueChange,
|
|
||||||
label = {
|
|
||||||
Text(
|
|
||||||
text = hint,
|
|
||||||
textAlign = TextAlign.Center,
|
|
||||||
color = Color.White,
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(horizontal = 16.dp),
|
|
||||||
)
|
|
||||||
},
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.focusRequester(focusRequester)
|
|
||||||
.border(1.dp, Color.White, shape = MaterialTheme.shapes.small)
|
|
||||||
.background(Color.Transparent)
|
|
||||||
.height(VerdnaturaDimens.minHeight),
|
|
||||||
textStyle = CustomTextStyle,
|
|
||||||
keyboardOptions =
|
|
||||||
KeyboardOptions.Default.copy(
|
|
||||||
imeAction = ImeAction.Done,
|
|
||||||
keyboardType = KeyboardType.Number
|
|
||||||
),
|
|
||||||
singleLine = true,
|
|
||||||
keyboardActions = KeyboardActions(
|
|
||||||
onDone = {
|
|
||||||
onEnterPressed(value.text)
|
|
||||||
onValueChange(TextFieldValue(""))
|
|
||||||
keyboardController?.hide()
|
|
||||||
}
|
|
||||||
),
|
|
||||||
colors = TextFieldDefaults.colors(
|
|
||||||
focusedContainerColor = Color.Transparent,
|
|
||||||
unfocusedContainerColor = Color.Transparent,
|
|
||||||
focusedTextColor = VerdnaturaColors.White,
|
|
||||||
unfocusedTextColor = VerdnaturaColors.White
|
|
||||||
)
|
|
||||||
)
|
|
||||||
LaunchedEffect(Unit) {
|
|
||||||
focusRequester.requestFocus()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Preview(showBackground = true)
|
|
||||||
@Composable
|
|
||||||
fun PreviewCustomTextField() {
|
|
||||||
val sampleText = remember { mutableStateOf(TextFieldValue("Texto de ejemplo")) }
|
|
||||||
val focusRequester = remember { FocusRequester() }
|
|
||||||
ScanTextCustomDialog(
|
|
||||||
value = sampleText.value,
|
|
||||||
onValueChange = { sampleText.value = it },
|
|
||||||
hint = "Escribe algo...",
|
|
||||||
onEnterPressed = { text -> println("Texto ingresado: $text") },
|
|
||||||
focusRequester = focusRequester
|
|
||||||
)
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
package es.verdnatura.presentation.composable.ui
|
|
||||||
|
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
import androidx.compose.ui.unit.sp
|
|
||||||
|
|
||||||
object VerdnaturaDimens {
|
|
||||||
|
|
||||||
/* val h1 = 96.sp
|
|
||||||
val h2 = 60.sp
|
|
||||||
val h3 = 48.sp
|
|
||||||
val h4 = 34.sp
|
|
||||||
val h5 = 24.sp
|
|
||||||
val h6 = 20.sp
|
|
||||||
val h7 = 18.sp
|
|
||||||
val h9 = 14.sp*/
|
|
||||||
|
|
||||||
// Text sizes
|
|
||||||
val fontSizeCustomDialogs = 16.sp
|
|
||||||
|
|
||||||
// Height Scan Text
|
|
||||||
val minHeight = 48.dp
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
package es.verdnatura.presentation.composable.ui
|
|
||||||
|
|
||||||
import androidx.compose.ui.text.TextStyle
|
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
|
||||||
|
|
||||||
val CustomTextStyle = TextStyle(
|
|
||||||
color = VerdnaturaColors.White,
|
|
||||||
fontSize = VerdnaturaDimens.fontSizeCustomDialogs,
|
|
||||||
textAlign = TextAlign.Center
|
|
||||||
)
|
|
|
@ -1,505 +0,0 @@
|
||||||
package es.verdnatura.presentation.testing
|
|
||||||
|
|
||||||
import android.content.ComponentName
|
|
||||||
import android.content.Context
|
|
||||||
import android.content.Intent
|
|
||||||
import android.graphics.Bitmap
|
|
||||||
import android.graphics.Canvas
|
|
||||||
import android.graphics.Color
|
|
||||||
import android.graphics.pdf.PdfRenderer
|
|
||||||
import android.net.Uri
|
|
||||||
import android.os.Build
|
|
||||||
import android.os.Bundle
|
|
||||||
import android.os.Parcel
|
|
||||||
import android.os.ParcelFileDescriptor
|
|
||||||
import android.os.ResultReceiver
|
|
||||||
import android.view.inputmethod.EditorInfo
|
|
||||||
import android.widget.Toast
|
|
||||||
import androidx.lifecycle.Observer
|
|
||||||
import es.verdnatura.R
|
|
||||||
import es.verdnatura.databinding.FragmentTestingPrintBinding
|
|
||||||
import es.verdnatura.domain.ConstAndValues.TOKEN
|
|
||||||
import es.verdnatura.domain.toast
|
|
||||||
import es.verdnatura.presentation.base.BaseFragment
|
|
||||||
import es.verdnatura.presentation.view.component.CustomDialog
|
|
||||||
import es.verdnatura.presentation.view.feature.qr.QrFragmentViewModel
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.withContext
|
|
||||||
import java.io.File
|
|
||||||
import java.io.IOException
|
|
||||||
import java.io.UnsupportedEncodingException
|
|
||||||
|
|
||||||
@Suppress("UNUSED_ANONYMOUS_PARAMETER")
|
|
||||||
class TestPrint(
|
|
||||||
var entryPoint: String = ""
|
|
||||||
) : BaseFragment<FragmentTestingPrintBinding, QrFragmentViewModel>(QrFragmentViewModel::class) {
|
|
||||||
|
|
||||||
private var goBack: Boolean = false
|
|
||||||
override fun getLayoutId(): Int = R.layout.fragment_testing_print
|
|
||||||
private lateinit var customDialog: CustomDialog
|
|
||||||
private var itemscaned = ""
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
fun newInstance(entryPoint: String) = TestPrint(entryPoint)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun init() {
|
|
||||||
|
|
||||||
customDialog = CustomDialog(requireContext())
|
|
||||||
setToolbar()
|
|
||||||
setEvents()
|
|
||||||
val i = Intent()
|
|
||||||
i.setClassName(
|
|
||||||
"verdnatura.es.repartoverdnatura", "verdnatura.es.repartoverdnatura.MainActivity"
|
|
||||||
)
|
|
||||||
i.putExtra(TOKEN, mobileApplication.dataStoreApp.readDataStoreKey<String>(TOKEN))
|
|
||||||
startActivity(i)
|
|
||||||
|
|
||||||
super.init()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setToolbar() {
|
|
||||||
|
|
||||||
binding.mainToolbar.toolbarTitle.text = entryPoint
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onPause() {
|
|
||||||
goBack = true
|
|
||||||
super.onPause()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setEvents() {
|
|
||||||
|
|
||||||
binding.mainToolbar.backButton.setOnClickListener {
|
|
||||||
ma.onMyBackPressed()
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.buttonPrintTemplate.setOnClickListener {
|
|
||||||
|
|
||||||
printTemplate()
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.buttonPrintAll.setOnClickListener {
|
|
||||||
|
|
||||||
printAllData()
|
|
||||||
}
|
|
||||||
binding.buttonPrintZpl.setOnClickListener {
|
|
||||||
|
|
||||||
printZPL()
|
|
||||||
}
|
|
||||||
binding.buttonPrintStatus.setOnClickListener {
|
|
||||||
printStatus()
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.buttonPrintDisconnect.setOnClickListener {
|
|
||||||
printDisconnect()
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.buttonImgToPdf.setOnClickListener {
|
|
||||||
convertImg()
|
|
||||||
}
|
|
||||||
|
|
||||||
binding.scanInput.requestFocus()
|
|
||||||
binding.scanInput.setOnEditorActionListener { v, actionId, event ->
|
|
||||||
|
|
||||||
if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_DONE || actionId == 0) {
|
|
||||||
|
|
||||||
goBack = false
|
|
||||||
if (!binding.scanInput.text.isNullOrEmpty()) {
|
|
||||||
itemscaned = binding.scanInput.text.toString()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
binding.scanInput.setText("")
|
|
||||||
ma.hideKeyboard(binding.scanInput)
|
|
||||||
return@setOnEditorActionListener true
|
|
||||||
}
|
|
||||||
// false
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Throws(IOException::class)
|
|
||||||
fun getFileFromAssets(context: Context, fileName: String): File =
|
|
||||||
File(context.cacheDir, fileName).also {
|
|
||||||
if (!it.exists()) {
|
|
||||||
it.outputStream().use { cache ->
|
|
||||||
context.assets.open(fileName).use { inputStream ->
|
|
||||||
inputStream.copyTo(cache)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun convertImg() {
|
|
||||||
|
|
||||||
val path: Uri = Uri.parse("file://android_asset/raw/test.pdf")
|
|
||||||
|
|
||||||
//val newPath: String = path.toString()
|
|
||||||
val filePath = getFileFromAssets(requireContext(), "test.pdf").absolutePath
|
|
||||||
val input = ParcelFileDescriptor.open(File(filePath), ParcelFileDescriptor.MODE_READ_ONLY)
|
|
||||||
val renderer = PdfRenderer(input)
|
|
||||||
|
|
||||||
val page = renderer.openPage(0)
|
|
||||||
val bitmap = Bitmap.createBitmap(
|
|
||||||
200, (200.toFloat() / page.width * page.height).toInt(), Bitmap.Config.ARGB_8888
|
|
||||||
)
|
|
||||||
page.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
page.close()
|
|
||||||
renderer.close()
|
|
||||||
|
|
||||||
// do something with the bitmap, like putting it on an ImageView
|
|
||||||
binding.imageView.setImageBitmap(bitmap)
|
|
||||||
page.close()
|
|
||||||
renderer.close()
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun renderSinglePage(filePath: String, width: Int) = withContext(Dispatchers.IO) {
|
|
||||||
PdfRenderer(
|
|
||||||
ParcelFileDescriptor.open(
|
|
||||||
File(filePath), ParcelFileDescriptor.MODE_READ_ONLY
|
|
||||||
)
|
|
||||||
).use { renderer ->
|
|
||||||
renderer.openPage(0).renderAndClose(width)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun PdfRenderer.Page.renderAndClose(width: Int) = use {
|
|
||||||
val bitmap = createBitmap(width)
|
|
||||||
render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY)
|
|
||||||
bitmap
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun PdfRenderer.Page.createBitmap(bitmapWidth: Int): Bitmap {
|
|
||||||
val bitmap = Bitmap.createBitmap(
|
|
||||||
bitmapWidth, (bitmapWidth.toFloat() / width * height).toInt(), Bitmap.Config.ARGB_8888
|
|
||||||
)
|
|
||||||
|
|
||||||
val canvas = Canvas(bitmap)
|
|
||||||
canvas.drawColor(Color.WHITE)
|
|
||||||
canvas.drawBitmap(bitmap, 0f, 0f, null)
|
|
||||||
|
|
||||||
return bitmap
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun printZPL() {
|
|
||||||
var variableData = HashMap<String, String>()
|
|
||||||
variableData.put("%PRODUCT_NAME%", "Apples")
|
|
||||||
variableData.put("%MSRP%", "$1.00")
|
|
||||||
variableData.put("%PCT%", "50")
|
|
||||||
variableData.put("%FINAL%", "$0.50")
|
|
||||||
variableData.put("%UPC_CODE%", "12345678")
|
|
||||||
val passthroughData = """
|
|
||||||
CT~~CD,~CC^~CT~
|
|
||||||
^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR4,4~SD10^JUS^LRN^CI0^XZ
|
|
||||||
^XA
|
|
||||||
^MMT
|
|
||||||
^PW591
|
|
||||||
^LL0203
|
|
||||||
^LS0
|
|
||||||
^FT171,82^A0N,27,26^FH\^FDBananas^FS
|
|
||||||
^FT222,107^A0N,17,16^FH\^FD$0.99^FS
|
|
||||||
^FT424,163^A0N,23,24^FB82,1,0,R^FH\^FD10^FS
|
|
||||||
^FT314,167^A0N,28,28^FH\^FD$0.89^FS
|
|
||||||
^FT367,107^A0N,17,16^FH\^FD8424245^FS
|
|
||||||
^FT471,138^A0N,14,14^FH\^FDYou saved:^FS
|
|
||||||
^FO451,119^GB103,54,2^FS
|
|
||||||
^FT171,20^A0N,17,16^FH\^FDPrintConnect Template Print Example^FS
|
|
||||||
^FT171,167^A0N,28,28^FH\^FDFinal Price:^FS
|
|
||||||
^FT171,51^A0N,17,16^FH\^FDProduct:^FS
|
|
||||||
^FT171,107^A0N,17,16^FH\^FDMSRP:^FS
|
|
||||||
^FT508,163^A0N,23,24^FH\^FD%^FS
|
|
||||||
^FT328,107^A0N,17,16^FH\^FDUPC:^FS
|
|
||||||
^FO171,119^GB259,0,2^FS
|
|
||||||
^PQ1,0,1,Y^XZ
|
|
||||||
|
|
||||||
""".trimIndent()
|
|
||||||
|
|
||||||
var passthroughDataBytes: ByteArray? = null
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Convert template ZPL string to a UTF-8 encoded byte array, which will be sent as an extra with the intent
|
|
||||||
//templateBytes = templateData.getBytes("UTF-8");
|
|
||||||
passthroughDataBytes = passthroughData.toByteArray()
|
|
||||||
} catch (e: UnsupportedEncodingException) {
|
|
||||||
// Handle exception
|
|
||||||
}
|
|
||||||
val intent = Intent()
|
|
||||||
intent.component = ComponentName(
|
|
||||||
"com.zebra.printconnect", "com.zebra.printconnect.print.PassthroughService"
|
|
||||||
)
|
|
||||||
|
|
||||||
intent.putExtra(
|
|
||||||
"com.zebra.printconnect.PrintService.PASSTHROUGH_DATA", passthroughDataBytes
|
|
||||||
)
|
|
||||||
intent.putExtra(
|
|
||||||
"com.zebra.printconnect.PrintService.RESULT_RECEIVER",
|
|
||||||
buildIPCSafeReceiver(object : ResultReceiver(null) {
|
|
||||||
|
|
||||||
override fun onReceiveResult(resultCode: Int, resultData: Bundle?) {
|
|
||||||
super.onReceiveResult(resultCode, resultData)
|
|
||||||
|
|
||||||
if (resultCode == 0) {
|
|
||||||
// Result code 0 indicates success
|
|
||||||
} else {
|
|
||||||
// Handle unsuccessful print
|
|
||||||
// Error message (null on successful print)
|
|
||||||
val errorMessage =
|
|
||||||
resultData?.getString("com.zebra.printconnect.PrintService.ERROR_MESSAGE")
|
|
||||||
Toast.makeText(context, errorMessage, Toast.LENGTH_LONG).show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
requireContext().startService(intent)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun printAllData() {
|
|
||||||
|
|
||||||
var variableData = HashMap<String, String>()
|
|
||||||
variableData.put("%PRODUCT_NAME%", "Apples")
|
|
||||||
variableData.put("%MSRP%", "$1.00")
|
|
||||||
variableData.put("%PCT%", "50")
|
|
||||||
variableData.put("%FINAL%", "$0.50")
|
|
||||||
variableData.put("%UPC_CODE%", "12345678")
|
|
||||||
|
|
||||||
val templateData = """
|
|
||||||
CT~~CD,~CC^~CT~
|
|
||||||
^XA~TA000~JSN^LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR4,4~SD10^JUS^LRN^CI0^XZ
|
|
||||||
^XA
|
|
||||||
^MMT
|
|
||||||
^PW591
|
|
||||||
^LL0203
|
|
||||||
^LS0
|
|
||||||
^FT171,82^A0N,27,26^FH\^FD%PRODUCT_NAME%^FS
|
|
||||||
^FT222,107^A0N,17,16^FH\^FD%MSRP%^FS
|
|
||||||
^FT424,163^A0N,23,24^FB82,1,0,R^FH\^FD%PCT%^FS
|
|
||||||
^FT314,167^A0N,28,28^FH\^FD%FINAL%^FS
|
|
||||||
^FT367,107^A0N,17,16^FH\^FD%UPC_CODE%^FS
|
|
||||||
^FT471,138^A0N,14,14^FH\^FDYou saved:^FS
|
|
||||||
^FO451,119^GB103,54,2^FS
|
|
||||||
^FT171,20^A0N,17,16^FH\^FDPrintConnect Template Print Example^FS
|
|
||||||
^FT171,167^A0N,28,28^FH\^FDFinal Price:^FS
|
|
||||||
^FT171,51^A0N,17,16^FH\^FDProduct:^FS
|
|
||||||
^FT171,107^A0N,17,16^FH\^FDMSRP:^FS
|
|
||||||
^FT508,163^A0N,23,24^FH\^FD%^FS
|
|
||||||
^FT328,107^A0N,17,16^FH\^FDUPC:^FS
|
|
||||||
^FO171,119^GB259,0,2^FS
|
|
||||||
^PQ1,0,1,Y^XZ
|
|
||||||
|
|
||||||
""".trimIndent()
|
|
||||||
|
|
||||||
var templateBytes: ByteArray? = null
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Convert template ZPL string to a UTF-8 encoded byte array, which will be sent as an extra with the intent
|
|
||||||
//templateBytes = templateData.getBytes("UTF-8");
|
|
||||||
templateBytes = templateData.toByteArray()
|
|
||||||
} catch (ex: UnsupportedEncodingException) {
|
|
||||||
// Handle exception
|
|
||||||
ex.toast(requireContext())
|
|
||||||
}
|
|
||||||
val intent = Intent()
|
|
||||||
intent.component = ComponentName(
|
|
||||||
"com.zebra.printconnect", "com.zebra.printconnect.print.TemplatePrintWithContentService"
|
|
||||||
)
|
|
||||||
|
|
||||||
intent.putExtra(
|
|
||||||
"com.zebra.printconnect.PrintService.TEMPLATE_DATA", templateBytes
|
|
||||||
)
|
|
||||||
intent.putExtra("com.zebra.printconnect.PrintService.VARIABLE_DATA", variableData)
|
|
||||||
intent.putExtra(
|
|
||||||
"com.zebra.printconnect.PrintService.RESULT_RECEIVER",
|
|
||||||
buildIPCSafeReceiver(object : ResultReceiver(null) {
|
|
||||||
|
|
||||||
override fun onReceiveResult(resultCode: Int, resultData: Bundle?) {
|
|
||||||
super.onReceiveResult(resultCode, resultData)
|
|
||||||
|
|
||||||
if (resultCode == 0) {
|
|
||||||
// Result code 0 indicates success
|
|
||||||
} else {
|
|
||||||
// Handle unsuccessful print
|
|
||||||
// Error message (null on successful print)
|
|
||||||
val errorMessage =
|
|
||||||
resultData?.getString("com.zebra.printconnect.PrintService.ERROR_MESSAGE")
|
|
||||||
Toast.makeText(context, errorMessage, Toast.LENGTH_LONG).show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
requireContext().startService(intent)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun printTemplate() {
|
|
||||||
// Define a hash map of variable data
|
|
||||||
// Strings used for keys will be replaced by their corresponding values in your template file's ZPL
|
|
||||||
var variableData = HashMap<String, String>()
|
|
||||||
variableData.put("%PRODUCT_NAME%", "Bananas")
|
|
||||||
variableData.put("%MSRP%", "$1.00")
|
|
||||||
variableData.put("%PCT%", "50")
|
|
||||||
variableData.put("%FINAL%", "$0.50")
|
|
||||||
variableData.put("%UPC_CODE%", "12345678")
|
|
||||||
val intent = Intent()
|
|
||||||
intent.component = ComponentName(
|
|
||||||
"com.zebra.printconnect", "com.zebra.printconnect.print.TemplatePrintService"
|
|
||||||
)
|
|
||||||
|
|
||||||
intent.putExtra(
|
|
||||||
"com.zebra.printconnect.PrintService.TEMPLATE_FILE_NAME", "PriceTagTemplate.zpl"
|
|
||||||
)
|
|
||||||
intent.putExtra("com.zebra.printconnect.PrintService.VARIABLE_DATA", variableData)
|
|
||||||
intent.putExtra(
|
|
||||||
"com.zebra.printconnect.PrintService.RESULT_RECEIVER",
|
|
||||||
buildIPCSafeReceiver(object : ResultReceiver(null) {
|
|
||||||
|
|
||||||
override fun onReceiveResult(resultCode: Int, resultData: Bundle?) {
|
|
||||||
super.onReceiveResult(resultCode, resultData)
|
|
||||||
|
|
||||||
if (resultCode == 0) {
|
|
||||||
// Result code 0 indicates success
|
|
||||||
} else {
|
|
||||||
// Handle unsuccessful print
|
|
||||||
// Error message (null on successful print)
|
|
||||||
val errorMessage =
|
|
||||||
resultData?.getString("com.zebra.printconnect.PrintService.ERROR_MESSAGE")
|
|
||||||
Toast.makeText(context, errorMessage, Toast.LENGTH_LONG).show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
requireContext().startService(intent)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun printStatus() {
|
|
||||||
val intent = Intent()
|
|
||||||
intent.component = ComponentName(
|
|
||||||
"com.zebra.printconnect", "com.zebra.printconnect.print.GetPrinterStatusService"
|
|
||||||
)
|
|
||||||
intent.putExtra(
|
|
||||||
"com.zebra.printconnect.PrintService.RESULT_RECEIVER",
|
|
||||||
buildIPCSafeReceiver(object : ResultReceiver(null) {
|
|
||||||
|
|
||||||
override fun onReceiveResult(resultCode: Int, resultData: Bundle?) {
|
|
||||||
super.onReceiveResult(resultCode, resultData)
|
|
||||||
|
|
||||||
if (resultCode == 0) {
|
|
||||||
// Result code 0 indicates success
|
|
||||||
val printerStatusMap: java.util.HashMap<out Any, out Any>? =
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
||||||
resultData!!.getSerializable(
|
|
||||||
"PrinterStatusMap", HashMap::class.java
|
|
||||||
)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
@Suppress("DEPRECATED")
|
|
||||||
resultData!!.getSerializable("PrinterStatusMap") as? HashMap<String, String>
|
|
||||||
}
|
|
||||||
Toast.makeText(context, printerStatusMap.toString(), Toast.LENGTH_LONG)
|
|
||||||
.show()
|
|
||||||
} else {
|
|
||||||
// Handle unsuccessful print
|
|
||||||
// Error message (null on successful print)
|
|
||||||
val errorMessage =
|
|
||||||
resultData?.getString("com.zebra.printconnect.PrintService.ERROR_MESSAGE")
|
|
||||||
Toast.makeText(context, errorMessage, Toast.LENGTH_LONG).show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
requireContext().startService(intent)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun printDisconnect() {
|
|
||||||
val intent = Intent()
|
|
||||||
intent.component = ComponentName(
|
|
||||||
"com.zebra.printconnect", "com.zebra.printconnect.print.UnselectPrinterService"
|
|
||||||
)
|
|
||||||
|
|
||||||
intent.putExtra(
|
|
||||||
"com.zebra.printconnect.PrintService.RESULT_RECEIVER",
|
|
||||||
buildIPCSafeReceiver(object : ResultReceiver(null) {
|
|
||||||
|
|
||||||
override fun onReceiveResult(resultCode: Int, resultData: Bundle?) {
|
|
||||||
super.onReceiveResult(resultCode, resultData)
|
|
||||||
|
|
||||||
if (resultCode == 0) {
|
|
||||||
// Result code 0 indicates success
|
|
||||||
|
|
||||||
val printerStatusMap =
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
||||||
resultData!!.getSerializable(
|
|
||||||
"PrinterStatusMap", HashMap::class.java
|
|
||||||
)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
@Suppress("DEPRECATED")
|
|
||||||
resultData!!.getSerializable("PrinterStatusMap") as? HashMap<String, String>
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Toast.makeText(context, printerStatusMap.toString(), Toast.LENGTH_LONG)
|
|
||||||
.show()
|
|
||||||
} else {
|
|
||||||
// Handle unsuccessful print
|
|
||||||
// Error message (null on successful print)
|
|
||||||
val errorMessage =
|
|
||||||
resultData?.getString("com.zebra.printconnect.PrintService.ERROR_MESSAGE")
|
|
||||||
Toast.makeText(context, errorMessage, Toast.LENGTH_LONG).show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
requireContext().startService(intent)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun buildIPCSafeReceiver(resultReceiver: ResultReceiver): ResultReceiver? {
|
|
||||||
val parcel = Parcel.obtain()
|
|
||||||
resultReceiver.writeToParcel(parcel, 0)
|
|
||||||
parcel.setDataPosition(0)
|
|
||||||
val receiverForSending = ResultReceiver.CREATOR.createFromParcel(parcel)
|
|
||||||
parcel.recycle()
|
|
||||||
return receiverForSending
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun observeViewModel() {
|
|
||||||
|
|
||||||
with(viewModel) {
|
|
||||||
qrresponse.observe(viewLifecycleOwner, Observer {
|
|
||||||
if (it.isError) {
|
|
||||||
|
|
||||||
ma.messageWithSound(it.errorMessage + " " + itemscaned, true, false)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
customDialog.setTitle(getString(R.string.info)).setDescription(
|
|
||||||
getString(R.string.operation) + itemscaned + "." + getString(
|
|
||||||
R.string.answer
|
|
||||||
) + it.response
|
|
||||||
).setOkButton(getString(R.string.accept)) {
|
|
||||||
customDialog.dismiss()
|
|
||||||
binding.mainToolbar.backButton.performClick()
|
|
||||||
}.show()
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,95 +0,0 @@
|
||||||
package es.verdnatura.presentation.view.commom
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.graphics.Color
|
|
||||||
import android.text.Spannable
|
|
||||||
import android.text.SpannableString
|
|
||||||
import android.text.style.ForegroundColorSpan
|
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.widget.TextView
|
|
||||||
import androidx.appcompat.widget.SearchView
|
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
|
||||||
import es.verdnatura.domain.toast
|
|
||||||
|
|
||||||
class SearchableAdapter(
|
|
||||||
private var listElements: MutableList<NameWithId>,
|
|
||||||
private var context: Context,
|
|
||||||
private val listColorElements: List<Int> = listOf(),
|
|
||||||
private val onItemClick: (NameWithId) -> Unit
|
|
||||||
) : RecyclerView.Adapter<SearchableAdapter.NameViewHolder>() {
|
|
||||||
|
|
||||||
private var listElementsFiltered = listElements.toMutableList()
|
|
||||||
private var currentQuery: String = ""
|
|
||||||
private lateinit var searchView: SearchView
|
|
||||||
|
|
||||||
inner class NameViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
|
||||||
private val nameText: TextView = itemView.findViewById(android.R.id.text1)
|
|
||||||
|
|
||||||
fun bind(nameWithId: NameWithId, query: String) {
|
|
||||||
val spannableString = SpannableString(nameWithId.name)
|
|
||||||
try {
|
|
||||||
if (query.isNotEmpty()) {
|
|
||||||
val startIndex = nameWithId.name.indexOf(query, ignoreCase = true)
|
|
||||||
if (startIndex >= 0) {
|
|
||||||
val endIndex = startIndex + query.length
|
|
||||||
spannableString.setSpan(
|
|
||||||
ForegroundColorSpan(Color.RED),
|
|
||||||
startIndex,
|
|
||||||
endIndex,
|
|
||||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
nameText.text = spannableString
|
|
||||||
itemView.setOnClickListener {
|
|
||||||
onItemClick(nameWithId)
|
|
||||||
}
|
|
||||||
} catch (ex: Exception) {
|
|
||||||
ex.message?.toast(context)
|
|
||||||
}
|
|
||||||
if (listColorElements.isNotEmpty()) {
|
|
||||||
if (nameWithId.id in listColorElements) {
|
|
||||||
nameText.setTextColor(Color.BLACK)
|
|
||||||
} else {
|
|
||||||
nameText.setTextColor(Color.GRAY)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NameViewHolder {
|
|
||||||
val view = LayoutInflater.from(parent.context)
|
|
||||||
.inflate(android.R.layout.simple_list_item_1, parent, false)
|
|
||||||
return NameViewHolder(view)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onBindViewHolder(holder: NameViewHolder, position: Int) {
|
|
||||||
val nameWithId = listElementsFiltered[position]
|
|
||||||
holder.bind(nameWithId, currentQuery)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun filter(query: String) {
|
|
||||||
currentQuery = query
|
|
||||||
listElementsFiltered = if (query.isEmpty()) {
|
|
||||||
listElements.toMutableList()
|
|
||||||
} else {
|
|
||||||
listElements.filter { it.name.contains(query, ignoreCase = true) }
|
|
||||||
.toMutableList()
|
|
||||||
}
|
|
||||||
notifyDataSetChanged()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getItemCount(): Int = listElementsFiltered.size
|
|
||||||
|
|
||||||
fun updateList(newList: MutableList<NameWithId>) {
|
|
||||||
listElements = newList
|
|
||||||
filter("")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
data class NameWithId(
|
|
||||||
val id: Number,
|
|
||||||
val name: String
|
|
||||||
)
|
|
|
@ -1,80 +0,0 @@
|
||||||
package es.verdnatura.presentation.view.commom
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.graphics.Color
|
|
||||||
import android.util.AttributeSet
|
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.View
|
|
||||||
import android.widget.LinearLayout
|
|
||||||
import androidx.appcompat.widget.SearchView
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
|
||||||
import es.verdnatura.R
|
|
||||||
|
|
||||||
class SearchableRecyclerView @JvmOverloads constructor(
|
|
||||||
context: Context,
|
|
||||||
attrs: AttributeSet? = null,
|
|
||||||
defStyleAttr: Int = 0
|
|
||||||
) : LinearLayout(context, attrs, defStyleAttr) {
|
|
||||||
|
|
||||||
val searchView: SearchView
|
|
||||||
private val recyclerView: RecyclerView
|
|
||||||
lateinit var adapter: SearchableAdapter
|
|
||||||
private var allItems: MutableList<NameWithId> = mutableListOf()
|
|
||||||
|
|
||||||
init {
|
|
||||||
LayoutInflater.from(context).inflate(R.layout.component_searchable_dialog, this, true)
|
|
||||||
searchView = findViewById(R.id.search_view)
|
|
||||||
recyclerView = findViewById(R.id.recycler_viewer)
|
|
||||||
recyclerView.layoutManager = LinearLayoutManager(context)
|
|
||||||
recyclerView.setBackgroundColor(Color.WHITE)
|
|
||||||
searchView.setBackgroundColor(Color.WHITE)
|
|
||||||
searchView.setOnCloseListener {
|
|
||||||
visibility = View.GONE
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
|
|
||||||
override fun onQueryTextSubmit(query: String?): Boolean {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onQueryTextChange(newText: String?): Boolean {
|
|
||||||
if (::adapter.isInitialized) adapter.filter(newText ?: "")
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setAdapter(adapter: SearchableAdapter, items: MutableList<NameWithId>) {
|
|
||||||
this.adapter = adapter
|
|
||||||
this.allItems = items
|
|
||||||
recyclerView.adapter = adapter
|
|
||||||
adapter.notifyDataSetChanged()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setOnCloseListener(listener: () -> Boolean) {
|
|
||||||
searchView.setOnCloseListener { listener() }
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setVisibility() {
|
|
||||||
searchView.visibility = View.VISIBLE
|
|
||||||
recyclerView.visibility = View.VISIBLE
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setSearchHint(searchHint: String): SearchableRecyclerView {
|
|
||||||
searchView.queryHint = searchHint
|
|
||||||
searchView.setIconifiedByDefault(true)
|
|
||||||
searchView.isIconified = false
|
|
||||||
searchView.post {
|
|
||||||
searchView.requestFocus()
|
|
||||||
}
|
|
||||||
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setSearchHintWithoutFocus(searchHint: String): SearchableRecyclerView {
|
|
||||||
searchView.queryHint = searchHint
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,174 +0,0 @@
|
||||||
package es.verdnatura.presentation.view.commom.webview
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
|
||||||
import android.graphics.drawable.Drawable
|
|
||||||
import android.os.Bundle
|
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.MotionEvent
|
|
||||||
import android.view.VelocityTracker
|
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.webkit.WebChromeClient
|
|
||||||
import android.webkit.WebResourceRequest
|
|
||||||
import android.webkit.WebView
|
|
||||||
import android.webkit.WebViewClient
|
|
||||||
import android.widget.ImageView
|
|
||||||
import androidx.activity.OnBackPressedCallback
|
|
||||||
import androidx.activity.OnBackPressedDispatcher
|
|
||||||
import androidx.databinding.DataBindingUtil
|
|
||||||
import androidx.fragment.app.Fragment
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
|
||||||
import es.verdnatura.R
|
|
||||||
import es.verdnatura.databinding.FragmentWebBinding
|
|
||||||
import es.verdnatura.domain.ConstAndValues.FLINGTHRESHOLDVELOCITY
|
|
||||||
import es.verdnatura.domain.ConstAndValues.FLINGTHRESHOLDVERTICAL
|
|
||||||
import es.verdnatura.presentation.common.OnBackPressedListener
|
|
||||||
import es.verdnatura.presentation.common.OnOptionsSelectedListener
|
|
||||||
import es.verdnatura.presentation.common.ToolBarAdapterTooltip
|
|
||||||
import es.verdnatura.presentation.view.component.CustomDialog
|
|
||||||
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
|
|
||||||
import org.json.JSONObject
|
|
||||||
import kotlin.math.abs
|
|
||||||
|
|
||||||
class WebFragment(
|
|
||||||
var entryPoint: String = ""
|
|
||||||
) : Fragment(), OnBackPressedListener {
|
|
||||||
fun getLayoutId(): Int = R.layout.fragment_web
|
|
||||||
private lateinit var customDialog: CustomDialog
|
|
||||||
private lateinit var backDispatcher: OnBackPressedDispatcher
|
|
||||||
private lateinit var binding: FragmentWebBinding
|
|
||||||
private var velocityTracker: VelocityTracker? = null
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
fun newInstance(entryPoint: String) = WebFragment(entryPoint)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun init() {
|
|
||||||
customDialog = CustomDialog(requireContext())
|
|
||||||
setToolbar()
|
|
||||||
setWeb()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onCreateView(
|
|
||||||
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
|
|
||||||
): View {
|
|
||||||
binding = DataBindingUtil.inflate(inflater, R.layout.fragment_web, container, false)
|
|
||||||
binding.lifecycleOwner = this
|
|
||||||
return binding.root
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
|
||||||
super.onViewCreated(view, savedInstanceState)
|
|
||||||
|
|
||||||
requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner,
|
|
||||||
object : OnBackPressedCallback(true) {
|
|
||||||
override fun handleOnBackPressed() {
|
|
||||||
if (!onBackPressedHandled()) {
|
|
||||||
isEnabled = false
|
|
||||||
requireActivity().onBackPressedDispatcher
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
init()
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility", "javaScriptEnabled")
|
|
||||||
private fun setWeb() {
|
|
||||||
binding.webView.apply {
|
|
||||||
webChromeClient = WebChromeClient()
|
|
||||||
|
|
||||||
settings.apply {
|
|
||||||
javaScriptEnabled = true
|
|
||||||
domStorageEnabled = true
|
|
||||||
loadWithOverviewMode = true
|
|
||||||
useWideViewPort = true
|
|
||||||
builtInZoomControls = true
|
|
||||||
displayZoomControls = false
|
|
||||||
setSupportZoom(true)
|
|
||||||
allowFileAccess = true
|
|
||||||
}
|
|
||||||
|
|
||||||
setOnTouchListener { _, event ->
|
|
||||||
when (event.actionMasked) {
|
|
||||||
MotionEvent.ACTION_DOWN -> {
|
|
||||||
velocityTracker?.clear()
|
|
||||||
velocityTracker = velocityTracker ?: VelocityTracker.obtain()
|
|
||||||
velocityTracker?.addMovement(event)
|
|
||||||
}
|
|
||||||
|
|
||||||
MotionEvent.ACTION_MOVE -> {
|
|
||||||
velocityTracker?.addMovement(event)
|
|
||||||
}
|
|
||||||
|
|
||||||
MotionEvent.ACTION_UP -> {
|
|
||||||
velocityTracker?.let { tracker ->
|
|
||||||
tracker.computeCurrentVelocity(1000) // velocidad en píxeles por segundo
|
|
||||||
val velocityX = tracker.xVelocity
|
|
||||||
val velocityY = abs(tracker.yVelocity)
|
|
||||||
|
|
||||||
if (velocityX > FLINGTHRESHOLDVELOCITY &&
|
|
||||||
velocityY < FLINGTHRESHOLDVERTICAL
|
|
||||||
) {
|
|
||||||
binding.webView.goBack()
|
|
||||||
return@setOnTouchListener true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MotionEvent.ACTION_CANCEL -> {
|
|
||||||
velocityTracker?.recycle()
|
|
||||||
velocityTracker = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
webViewClient = object : WebViewClient() {
|
|
||||||
override fun shouldOverrideUrlLoading(
|
|
||||||
view: WebView?,
|
|
||||||
request: WebResourceRequest?
|
|
||||||
): Boolean {
|
|
||||||
request?.url?.toString()?.let { loadUrl(it) }
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val dataScanned = JSONObject(entryPoint)
|
|
||||||
binding.webView.loadUrl(dataScanned.get("web").toString())
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setToolbar() {
|
|
||||||
binding.mainToolbar.toolbarTitle.text = buildString {
|
|
||||||
append(getString(R.string.item))
|
|
||||||
append(JSONObject(entryPoint).get("entryPoint").toString())
|
|
||||||
}
|
|
||||||
|
|
||||||
val listIcons: ArrayList<ImageView> = ArrayList()
|
|
||||||
binding.mainToolbar.toolbarIcons.adapter =
|
|
||||||
ToolBarAdapterTooltip(listIcons, object : OnOptionsSelectedListener {
|
|
||||||
override fun onOptionsItemSelected(item: Drawable) {
|
|
||||||
}
|
|
||||||
})
|
|
||||||
binding.mainToolbar.toolbarIcons.layoutManager =
|
|
||||||
LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onBackPressedHandled(): Boolean {
|
|
||||||
if (binding.webView.canGoBack()) {
|
|
||||||
binding.webView.goBack()
|
|
||||||
} else {
|
|
||||||
(context as MainActivity).onMyBackPressed()
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroy() {
|
|
||||||
super.onDestroy()
|
|
||||||
velocityTracker?.recycle()
|
|
||||||
velocityTracker = null
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,180 +0,0 @@
|
||||||
package es.verdnatura.presentation.view.commom.webview
|
|
||||||
|
|
||||||
import android.os.Bundle
|
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.MotionEvent
|
|
||||||
import android.view.VelocityTracker
|
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.webkit.WebResourceRequest
|
|
||||||
import android.webkit.WebView
|
|
||||||
import android.webkit.WebViewClient
|
|
||||||
import androidx.activity.OnBackPressedCallback
|
|
||||||
import androidx.activity.OnBackPressedDispatcher
|
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
|
||||||
import androidx.compose.runtime.getValue
|
|
||||||
import androidx.compose.ui.platform.ComposeView
|
|
||||||
import androidx.fragment.app.Fragment
|
|
||||||
import androidx.fragment.app.viewModels
|
|
||||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
|
||||||
import es.verdnatura.presentation.common.OnBackPressedListener
|
|
||||||
import es.verdnatura.presentation.view.commom.webview.data.WebViewEvent
|
|
||||||
import es.verdnatura.presentation.view.commom.webview.data.WebViewScreen
|
|
||||||
import org.json.JSONObject
|
|
||||||
import kotlin.math.abs
|
|
||||||
|
|
||||||
class WebFragmentCompose(
|
|
||||||
var entryPoint: String = ""
|
|
||||||
) : Fragment(), OnBackPressedListener {
|
|
||||||
private val viewModel: WebViewViewModel by viewModels()
|
|
||||||
private var velocityTracker: VelocityTracker? = null
|
|
||||||
private lateinit var backDispatcher: OnBackPressedDispatcher
|
|
||||||
private var webView: WebView? = null
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
private const val FLING_THRESHOLD_VELOCITY = 2000
|
|
||||||
private const val FLING_THRESHOLD_VERTICAL = 1000
|
|
||||||
fun newInstance(entryPoint: String) = WebFragmentCompose(entryPoint)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onCreateView(
|
|
||||||
inflater: LayoutInflater,
|
|
||||||
container: ViewGroup?,
|
|
||||||
savedInstanceState: Bundle?
|
|
||||||
): View {
|
|
||||||
return ComposeView(requireContext()).apply {
|
|
||||||
setContent {
|
|
||||||
val state by viewModel.state.collectAsStateWithLifecycle()
|
|
||||||
|
|
||||||
// Recolectar acciones del ViewModel
|
|
||||||
LaunchedEffect(Unit) {
|
|
||||||
viewModel.webViewActions.collect { event ->
|
|
||||||
when (event) {
|
|
||||||
is WebViewEvent.OnBackGesture -> {
|
|
||||||
webView?.goBack()
|
|
||||||
}
|
|
||||||
// Manejar otros eventos si es necesario
|
|
||||||
is WebViewEvent.LoadUrl -> println("")
|
|
||||||
is WebViewEvent.OnPageFinished -> println("")
|
|
||||||
is WebViewEvent.OnUrlLoading -> println("")
|
|
||||||
is WebViewEvent.ToggleToolbar -> println("")
|
|
||||||
is WebViewEvent.UpdateTitle -> println("")
|
|
||||||
else -> {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
WebViewScreen(
|
|
||||||
state = state,
|
|
||||||
onWebViewCreated = { webView ->
|
|
||||||
this@WebFragmentCompose.webView = webView
|
|
||||||
setupWebView(webView)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setupWebView(webView: WebView) {
|
|
||||||
webView.webViewClient = object : WebViewClient() {
|
|
||||||
override fun shouldOverrideUrlLoading(
|
|
||||||
view: WebView?,
|
|
||||||
request: WebResourceRequest?
|
|
||||||
): Boolean {
|
|
||||||
request?.url?.toString()?.let {
|
|
||||||
viewModel.processEvent(WebViewEvent.OnUrlLoading(it))
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onPageFinished(view: WebView?, url: String?) {
|
|
||||||
super.onPageFinished(view, url)
|
|
||||||
viewModel.processEvent(WebViewEvent.OnPageFinished(url ?: ""))
|
|
||||||
viewModel.processEvent(WebViewEvent.UpdateTitle(webView.title ?: ""))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
webView.setOnTouchListener { _, event ->
|
|
||||||
handleTouchEvent(event)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cargar URL inicial si existe
|
|
||||||
// if (state.value.initialUrl.isNotEmpty()) {
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun handleTouchEvent(event: MotionEvent): Boolean {
|
|
||||||
when (event.actionMasked) {
|
|
||||||
MotionEvent.ACTION_DOWN -> {
|
|
||||||
velocityTracker?.clear()
|
|
||||||
velocityTracker = velocityTracker ?: VelocityTracker.obtain()
|
|
||||||
velocityTracker?.addMovement(event)
|
|
||||||
}
|
|
||||||
|
|
||||||
MotionEvent.ACTION_MOVE -> {
|
|
||||||
velocityTracker?.addMovement(event)
|
|
||||||
}
|
|
||||||
|
|
||||||
MotionEvent.ACTION_UP -> {
|
|
||||||
velocityTracker?.let { tracker ->
|
|
||||||
tracker.computeCurrentVelocity(1000)
|
|
||||||
val velocityX = tracker.xVelocity
|
|
||||||
val velocityY = abs(tracker.yVelocity)
|
|
||||||
|
|
||||||
if (velocityX > FLING_THRESHOLD_VELOCITY &&
|
|
||||||
velocityY < FLING_THRESHOLD_VERTICAL &&
|
|
||||||
webView?.canGoBack() == true
|
|
||||||
) {
|
|
||||||
viewModel.processEvent(WebViewEvent.OnBackGesture)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MotionEvent.ACTION_CANCEL -> {
|
|
||||||
velocityTracker?.recycle()
|
|
||||||
velocityTracker = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
|
||||||
super.onViewCreated(view, savedInstanceState)
|
|
||||||
|
|
||||||
requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner,
|
|
||||||
object : OnBackPressedCallback(true) {
|
|
||||||
override fun handleOnBackPressed() {
|
|
||||||
if (!onBackPressedHandled()) {
|
|
||||||
isEnabled = false
|
|
||||||
requireActivity().onBackPressedDispatcher
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
val dataScanned = JSONObject(entryPoint)
|
|
||||||
viewModel.setInitialUrl(dataScanned.get("web").toString())
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDestroy() {
|
|
||||||
super.onDestroy()
|
|
||||||
velocityTracker?.recycle()
|
|
||||||
velocityTracker = null
|
|
||||||
webView = null
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onBackPressedHandled(): Boolean {
|
|
||||||
|
|
||||||
viewModel.processEvent(WebViewEvent.OnBackGesture)
|
|
||||||
|
|
||||||
/* if (webView!!.canGoBack()) {
|
|
||||||
webView!!.goBack()
|
|
||||||
} else {
|
|
||||||
(context as MainActivity).onMyBackPressed()
|
|
||||||
}*/
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,64 +0,0 @@
|
||||||
package es.verdnatura.presentation.view.commom.webview
|
|
||||||
|
|
||||||
import androidx.lifecycle.ViewModel
|
|
||||||
import androidx.lifecycle.viewModelScope
|
|
||||||
import es.verdnatura.presentation.view.commom.webview.data.WebViewEvent
|
|
||||||
import es.verdnatura.presentation.view.commom.webview.data.WebViewState
|
|
||||||
import kotlinx.coroutines.channels.Channel
|
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
|
||||||
import kotlinx.coroutines.flow.asStateFlow
|
|
||||||
import kotlinx.coroutines.flow.receiveAsFlow
|
|
||||||
import kotlinx.coroutines.flow.update
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
|
|
||||||
class WebViewViewModel : ViewModel() {
|
|
||||||
private val _state = MutableStateFlow(WebViewState())
|
|
||||||
val state = _state.asStateFlow()
|
|
||||||
|
|
||||||
private val _webViewActions = Channel<WebViewEvent>()
|
|
||||||
val webViewActions = _webViewActions.receiveAsFlow()
|
|
||||||
|
|
||||||
fun processEvent(event: WebViewEvent) {
|
|
||||||
when (event) {
|
|
||||||
is WebViewEvent.LoadUrl -> {
|
|
||||||
_state.update { it.copy(url = event.url, isLoading = true) }
|
|
||||||
viewModelScope.launch {
|
|
||||||
_webViewActions.send(event)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
is WebViewEvent.UpdateTitle -> {
|
|
||||||
_state.update { it.copy(title = event.title) }
|
|
||||||
}
|
|
||||||
|
|
||||||
is WebViewEvent.OnPageFinished -> {
|
|
||||||
_state.update { it.copy(isLoading = false) }
|
|
||||||
}
|
|
||||||
|
|
||||||
is WebViewEvent.ToggleToolbar -> {
|
|
||||||
_state.update { it.copy(showToolbar = event.show) }
|
|
||||||
}
|
|
||||||
|
|
||||||
is WebViewEvent.OnBackGesture -> {
|
|
||||||
viewModelScope.launch {
|
|
||||||
_webViewActions.send(event)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
is WebViewEvent.OnUrlLoading -> {
|
|
||||||
processEvent(WebViewEvent.LoadUrl(event.url))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setInitialUrl(webURL: String) {
|
|
||||||
try {
|
|
||||||
|
|
||||||
println("webURL $webURL")
|
|
||||||
_state.update { it.copy(initialUrl = webURL) }
|
|
||||||
processEvent(WebViewEvent.LoadUrl("https://salix.verdnatura.es"))
|
|
||||||
} catch (e: Exception) {
|
|
||||||
// Manejar error
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,67 +0,0 @@
|
||||||
package es.verdnatura.presentation.view.commom.webview.data
|
|
||||||
|
|
||||||
import android.webkit.WebChromeClient
|
|
||||||
import android.webkit.WebView
|
|
||||||
import androidx.compose.foundation.layout.Box
|
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
|
||||||
import androidx.compose.foundation.layout.statusBarsPadding
|
|
||||||
import androidx.compose.material3.CircularProgressIndicator
|
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
|
||||||
import androidx.compose.material3.Surface
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.ui.Alignment
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.viewinterop.AndroidView
|
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
|
||||||
@Composable
|
|
||||||
fun WebViewScreen(
|
|
||||||
state: WebViewState,
|
|
||||||
onWebViewCreated: (WebView) -> Unit
|
|
||||||
) {
|
|
||||||
Surface(
|
|
||||||
modifier = Modifier.fillMaxSize() // Asegura que ocupe toda la pantalla
|
|
||||||
) {
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.fillMaxSize()
|
|
||||||
.statusBarsPadding() // Evita que la WebView quede debajo de la barra de estado
|
|
||||||
) {
|
|
||||||
AndroidView(
|
|
||||||
modifier = Modifier.fillMaxSize(),
|
|
||||||
factory = { context ->
|
|
||||||
WebView(context).apply {
|
|
||||||
settings.apply {
|
|
||||||
javaScriptEnabled = true
|
|
||||||
domStorageEnabled = true
|
|
||||||
loadWithOverviewMode = true
|
|
||||||
useWideViewPort = true
|
|
||||||
builtInZoomControls = true
|
|
||||||
displayZoomControls = false
|
|
||||||
setSupportZoom(true)
|
|
||||||
allowFileAccess = true
|
|
||||||
}
|
|
||||||
webChromeClient = object : WebChromeClient() {
|
|
||||||
override fun onProgressChanged(view: WebView?, newProgress: Int) {
|
|
||||||
super.onProgressChanged(view, newProgress)
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onWebViewCreated(this)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
update = { webView ->
|
|
||||||
if (state.url.isNotEmpty() && state.url != webView.url) {
|
|
||||||
webView.loadUrl(state.url)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (state.isLoading) {
|
|
||||||
CircularProgressIndicator(
|
|
||||||
modifier = Modifier.align(Alignment.Center)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue