Finish v1_0_47(50)
This commit is contained in:
commit
3ea04384ea
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
29
.idea/codeStyles/Project.xml
generated
29
.idea/codeStyles/Project.xml
generated
@ -1,29 +0,0 @@
|
|||||||
<component name="ProjectCodeStyleConfiguration">
|
|
||||||
<code_scheme name="Project" version="173">
|
|
||||||
<Objective-C-extensions>
|
|
||||||
<file>
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
|
|
||||||
</file>
|
|
||||||
<class>
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
|
|
||||||
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
|
|
||||||
</class>
|
|
||||||
<extensions>
|
|
||||||
<pair source="cpp" header="h" fileNamingConvention="NONE" />
|
|
||||||
<pair source="c" header="h" fileNamingConvention="NONE" />
|
|
||||||
</extensions>
|
|
||||||
</Objective-C-extensions>
|
|
||||||
</code_scheme>
|
|
||||||
</component>
|
|
||||||
4
.idea/encodings.xml
generated
Normal file
4
.idea/encodings.xml
generated
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
|
||||||
|
</project>
|
||||||
1
.idea/gradle.xml
generated
1
.idea/gradle.xml
generated
@ -13,6 +13,7 @@
|
|||||||
<option value="$PROJECT_DIR$/dynamic__base" />
|
<option value="$PROJECT_DIR$/dynamic__base" />
|
||||||
<option value="$PROJECT_DIR$/dynamic_vgalimenti" />
|
<option value="$PROJECT_DIR$/dynamic_vgalimenti" />
|
||||||
<option value="$PROJECT_DIR$/pointmobilescannerlibrary" />
|
<option value="$PROJECT_DIR$/pointmobilescannerlibrary" />
|
||||||
|
<option value="$PROJECT_DIR$/zebrascannerlibrary" />
|
||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
<option name="resolveModulePerSourceSet" value="false" />
|
<option name="resolveModulePerSourceSet" value="false" />
|
||||||
|
|||||||
1
.idea/modules.xml
generated
1
.idea/modules.xml
generated
@ -8,6 +8,7 @@
|
|||||||
<module fileurl="file://$PROJECT_DIR$/dynamic__base/dynamic__base.iml" filepath="$PROJECT_DIR$/dynamic__base/dynamic__base.iml" />
|
<module fileurl="file://$PROJECT_DIR$/dynamic__base/dynamic__base.iml" filepath="$PROJECT_DIR$/dynamic__base/dynamic__base.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/dynamic_vgalimenti/dynamic_vgalimenti.iml" filepath="$PROJECT_DIR$/dynamic_vgalimenti/dynamic_vgalimenti.iml" />
|
<module fileurl="file://$PROJECT_DIR$/dynamic_vgalimenti/dynamic_vgalimenti.iml" filepath="$PROJECT_DIR$/dynamic_vgalimenti/dynamic_vgalimenti.iml" />
|
||||||
<module fileurl="file://$PROJECT_DIR$/pointmobilescannerlibrary/pointmobilescannerlibrary.iml" filepath="$PROJECT_DIR$/pointmobilescannerlibrary/pointmobilescannerlibrary.iml" />
|
<module fileurl="file://$PROJECT_DIR$/pointmobilescannerlibrary/pointmobilescannerlibrary.iml" filepath="$PROJECT_DIR$/pointmobilescannerlibrary/pointmobilescannerlibrary.iml" />
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/zebrascannerlibrary/zebrascannerlibrary.iml" filepath="$PROJECT_DIR$/zebrascannerlibrary/zebrascannerlibrary.iml" />
|
||||||
</modules>
|
</modules>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
||||||
def appVersionCode = 49
|
def appVersionCode = 50
|
||||||
def appVersionName = '1.0.46'
|
def appVersionName = '1.0.47'
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
@ -102,7 +102,7 @@ dependencies {
|
|||||||
implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
|
implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.1.0-alpha05'
|
implementation 'com.google.android.material:material:1.1.0-alpha05'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha5'
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha04'
|
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha04'
|
||||||
implementation 'androidx.preference:preference:1.1.0-alpha04'
|
implementation 'androidx.preference:preference:1.1.0-alpha04'
|
||||||
@ -140,10 +140,14 @@ dependencies {
|
|||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
implementation 'com.mikhaellopez:lazydatepicker:1.0.0'
|
implementation 'com.mikhaellopez:lazydatepicker:1.0.0'
|
||||||
implementation 'com.github.demoNo:AutoScrollViewPager:v1.0.2'
|
implementation 'com.github.demoNo:AutoScrollViewPager:v1.0.2'
|
||||||
|
implementation 'com.github.zhukic:sectioned-recyclerview:1.2.3'
|
||||||
|
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
|
||||||
|
|
||||||
//AppUpdate
|
//AppUpdate
|
||||||
implementation 'com.github.javiersantos:AppUpdater:2.7'
|
implementation 'com.github.javiersantos:AppUpdater:2.7'
|
||||||
//Barcode
|
//Barcode
|
||||||
implementation project(':pointmobilescannerlibrary')
|
implementation project(':pointmobilescannerlibrary')
|
||||||
|
implementation project(':zebrascannerlibrary')
|
||||||
implementation project(path: ':barcode_base_library')
|
implementation project(path: ':barcode_base_library')
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
244
app/src/main/assets/EMDKConfig.xml
Normal file
244
app/src/main/assets/EMDKConfig.xml
Normal file
@ -0,0 +1,244 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><!--This is an auto generated document. Changes to this document may cause incorrect behavior.--><wap-provisioningdoc>
|
||||||
|
<characteristic type="ProfileInfo">
|
||||||
|
<parm name="created_wizard_version" value="7.3.2"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="Profile">
|
||||||
|
<parm name="ProfileName" value="TC25"/>
|
||||||
|
<parm name="ModifiedDate" value="2019-04-19 17:06:59"/>
|
||||||
|
<parm name="TargetSystemVersion" value="7.1"/>
|
||||||
|
<characteristic type="Barcode" version="6.8">
|
||||||
|
<parm name="emdk_name" value=""/>
|
||||||
|
<parm name="scanner_input_enabled" value="true"/>
|
||||||
|
<parm name="ScannerSelection" value="INTERNAL_LASER1"/>
|
||||||
|
<parm name="use_auto" value="Default"/>
|
||||||
|
<parm name="trigger-wakeup" value="Default"/>
|
||||||
|
<characteristic type="Decoders">
|
||||||
|
<parm name="decoder_upca" value="true"/>
|
||||||
|
<parm name="decoder_upce0" value="Default"/>
|
||||||
|
<parm name="decoder_ean13" value="true"/>
|
||||||
|
<parm name="decoder_ean8" value="true"/>
|
||||||
|
<parm name="decoder_code128" value="true"/>
|
||||||
|
<parm name="decoder_code39" value="Default"/>
|
||||||
|
<parm name="decoder_i2of5" value="true"/>
|
||||||
|
<parm name="decoder_gs1_databar" value="true"/>
|
||||||
|
<parm name="decoder_gs1_databar_lim" value="true"/>
|
||||||
|
<parm name="decoder_gs1_databar_exp" value="Default"/>
|
||||||
|
<parm name="decoder_datamatrix" value="Default"/>
|
||||||
|
<parm name="decoder_qrcode" value="true"/>
|
||||||
|
<parm name="decoder_pdf417" value="Default"/>
|
||||||
|
<parm name="decoder_composite_ab" value="Default"/>
|
||||||
|
<parm name="decoder_composite_c" value="Default"/>
|
||||||
|
<parm name="decoder_microqr" value="Default"/>
|
||||||
|
<parm name="decoder_aztec" value="Default"/>
|
||||||
|
<parm name="decoder_maxicode" value="Default"/>
|
||||||
|
<parm name="decoder_micropdf" value="Default"/>
|
||||||
|
<parm name="decoder_uspostnet" value="Default"/>
|
||||||
|
<parm name="decoder_usplanet" value="Default"/>
|
||||||
|
<parm name="decoder_uk_postal" value="Default"/>
|
||||||
|
<parm name="decoder_japanese_postal" value="Default"/>
|
||||||
|
<parm name="decoder_australian_postal" value="Default"/>
|
||||||
|
<parm name="decoder_canadian_postal" value="Default"/>
|
||||||
|
<parm name="decoder_dutch_postal" value="Default"/>
|
||||||
|
<parm name="decoder_us4state" value="Default"/>
|
||||||
|
<parm name="decoder_us4state_fics" value="Default"/>
|
||||||
|
<parm name="decoder_codabar" value="Default"/>
|
||||||
|
<parm name="decoder_msi" value="Default"/>
|
||||||
|
<parm name="decoder_code93" value="Default"/>
|
||||||
|
<parm name="decoder_trioptic39" value="Default"/>
|
||||||
|
<parm name="decoder_d2of5" value="Default"/>
|
||||||
|
<parm name="decoder_chinese_2of5" value="Default"/>
|
||||||
|
<parm name="decoder_korean_3of5" value="Default"/>
|
||||||
|
<parm name="decoder_code11" value="Default"/>
|
||||||
|
<parm name="decoder_tlc39" value="Default"/>
|
||||||
|
<parm name="decoder_mailmark" value="Default"/>
|
||||||
|
<parm name="decoder_hanxin" value="Default"/>
|
||||||
|
<parm name="decoder_signature" value="Default"/>
|
||||||
|
<parm name="decoder_webcode" value="Default"/>
|
||||||
|
<parm name="decoder_matrix_2of5" value="Default"/>
|
||||||
|
<parm name="decoder_upce1" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="DecoderParams">
|
||||||
|
<characteristic type="UPCA">
|
||||||
|
<parm name="decoder_upca_report_check_digit" value="Default"/>
|
||||||
|
<parm name="decoder_upca_preamble" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="UPCE0">
|
||||||
|
<parm name="decoder_upce0_report_check_digit" value="Default"/>
|
||||||
|
<parm name="decoder_upce0_preamble" value="Default"/>
|
||||||
|
<parm name="decoder_upce0_convert_to_upca" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="EAN8">
|
||||||
|
<parm name="decoder_ean8_convert_to_ean13" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="Code128">
|
||||||
|
<parm name="decoder_code128_length1" value="0"/>
|
||||||
|
<parm name="decoder_code128_length2" value="55"/>
|
||||||
|
<parm name="decoder_code128_redundancy" value="Default"/>
|
||||||
|
<parm name="decoder_code128_enable_plain" value="Default"/>
|
||||||
|
<parm name="decoder_code128_enable_ean128" value="Default"/>
|
||||||
|
<parm name="decoder_code128_enable_isbt128" value="Default"/>
|
||||||
|
<parm name="decoder_code128_isbt128_concat_mode" value="Default"/>
|
||||||
|
<parm name="decoder_code128_check_isbt_table" value="Default"/>
|
||||||
|
<parm name="decoder_code128_security_level" value="Default"/>
|
||||||
|
<parm name="code128_enable_marginless_decode" value="Default"/>
|
||||||
|
<parm name="code128_ignore_fnc4" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="Code39">
|
||||||
|
<parm name="decoder_code39_length1" value="0"/>
|
||||||
|
<parm name="decoder_code39_length2" value="55"/>
|
||||||
|
<parm name="decoder_code39_verify_check_digit" value="Default"/>
|
||||||
|
<parm name="decoder_code39_report_check_digit" value="Default"/>
|
||||||
|
<parm name="decoder_code39_full_ascii" value="Default"/>
|
||||||
|
<parm name="decoder_code39_redundancy" value="Default"/>
|
||||||
|
<parm name="decoder_code39_convert_to_code32" value="Default"/>
|
||||||
|
<parm name="decoder_code39_report_code32_prefix" value="Default"/>
|
||||||
|
<parm name="decoder_code39_security_level" value="Default"/>
|
||||||
|
<parm name="code39_enable_marginless_decode" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="Interleaved_2of5">
|
||||||
|
<parm name="decoder_i2of5_length1" value="14"/>
|
||||||
|
<parm name="decoder_i2of5_length2" value="10"/>
|
||||||
|
<parm name="decoder_i2of5_redundancy" value="Default"/>
|
||||||
|
<parm name="decoder_i2of5_check_digit" value="Default"/>
|
||||||
|
<parm name="decoder_i2of5_report_check_digit" value="Default"/>
|
||||||
|
<parm name="decoder_itf14_convert_to_ean13" value="Default"/>
|
||||||
|
<parm name="decoder_i2of5_security_level" value="Default"/>
|
||||||
|
<parm name="i20f5_enable_marginless_decode" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="GS1_Databar_Limited">
|
||||||
|
<parm name="decoder_gs1_lim_security_level" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="Composite_AB">
|
||||||
|
<parm name="decoder_composite_ab_ucc_link_mode" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="US_Postnet">
|
||||||
|
<parm name="decoder_uspostnet_report_check_digit" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="US_Planet">
|
||||||
|
<parm name="decoder_usplanet_report_check_digit" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="UK_Postal">
|
||||||
|
<parm name="decoder_uk_postal_report_check_digit" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="Codabar">
|
||||||
|
<parm name="decoder_codabar_length1" value="6"/>
|
||||||
|
<parm name="decoder_codabar_length2" value="55"/>
|
||||||
|
<parm name="decoder_codabar_redundancy" value="Default"/>
|
||||||
|
<parm name="decoder_codabar_clsi_editing" value="Default"/>
|
||||||
|
<parm name="decoder_codabar_notis_editing" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="MSI">
|
||||||
|
<parm name="decoder_msi_length1" value="4"/>
|
||||||
|
<parm name="decoder_msi_length2" value="55"/>
|
||||||
|
<parm name="decoder_msi_redundancy" value="Default"/>
|
||||||
|
<parm name="decoder_msi_check_digit" value="Default"/>
|
||||||
|
<parm name="decoder_msi_check_digit_scheme" value="Default"/>
|
||||||
|
<parm name="decoder_msi_report_check_digit" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="Code93">
|
||||||
|
<parm name="decoder_code93_length1" value="0"/>
|
||||||
|
<parm name="decoder_code93_length2" value="55"/>
|
||||||
|
<parm name="decoder_code93_redundancy" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="Trioptic_39">
|
||||||
|
<parm name="decoder_trioptic39_redundancy" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="Discrete_2of5">
|
||||||
|
<parm name="decoder_d2of5_length1" value="0"/>
|
||||||
|
<parm name="decoder_d2of5_length2" value="14"/>
|
||||||
|
<parm name="decoder_d2of5_redundancy" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="Code11">
|
||||||
|
<parm name="decoder_code11_length1" value="4"/>
|
||||||
|
<parm name="decoder_code11_length2" value="55"/>
|
||||||
|
<parm name="decoder_code11_redundancy" value="Default"/>
|
||||||
|
<parm name="decoder_code11_verify_check_digit" value="Default"/>
|
||||||
|
<parm name="decoder_code11_report_check_digit" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="Han_Xin">
|
||||||
|
<parm name="decoder_hanxin_inverse" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="Matrix_2of5">
|
||||||
|
<parm name="decoder_matrix_2of5_length1" value="10"/>
|
||||||
|
<parm name="decoder_matrix_2of5_length2" value="0"/>
|
||||||
|
<parm name="decoder_matrix_2of5_redundancy" value="Default"/>
|
||||||
|
<parm name="decoder_matrix_2of5_report_check_digit" value="Default"/>
|
||||||
|
<parm name="decoder_matrix_2of5_verify_check_digit" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="UPCE1">
|
||||||
|
<parm name="decoder_upce1_report_check_digit" value="Default"/>
|
||||||
|
<parm name="decoder_upce1_preamble" value="Default"/>
|
||||||
|
<parm name="decoder_upce1_convert_to_upca" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="UpcEanParams">
|
||||||
|
<parm name="upcean_security_level" value="Default"/>
|
||||||
|
<parm name="upcean_supplemental2" value="Default"/>
|
||||||
|
<parm name="upcean_supplemental5" value="Default"/>
|
||||||
|
<parm name="upcean_supplemental_mode" value="Default"/>
|
||||||
|
<parm name="upcean_retry_count" value="10"/>
|
||||||
|
<parm name="upcean_random_weight_check_digit" value="Default"/>
|
||||||
|
<parm name="upcean_linear_decode" value="Default"/>
|
||||||
|
<parm name="upcean_bookland" value="Default"/>
|
||||||
|
<parm name="upcean_coupon" value="Default"/>
|
||||||
|
<parm name="upcean_coupon_report" value="Default"/>
|
||||||
|
<parm name="upcean_ean_zero_extend" value="Default"/>
|
||||||
|
<parm name="upcean_bookland_format" value="Default"/>
|
||||||
|
<parm name="databar_to_upc_ean" value="Default"/>
|
||||||
|
<parm name="upc_enable_marginless_decode" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="ReaderParams">
|
||||||
|
<parm name="aim_mode" value="Default"/>
|
||||||
|
<parm name="beam_timer" value="5000"/>
|
||||||
|
<parm name="Adaptive_Scanning" value="Default"/>
|
||||||
|
<parm name="Beam_Width" value="Default"/>
|
||||||
|
<parm name="power_mode" value="Default"/>
|
||||||
|
<parm name="mpd_mode" value="Default"/>
|
||||||
|
<parm name="reader_mode" value="Default"/>
|
||||||
|
<parm name="linear_security_level" value="Default"/>
|
||||||
|
<parm name="picklist" value="Default"/>
|
||||||
|
<parm name="aim_type" value="Default"/>
|
||||||
|
<parm name="aim_timer" value="500"/>
|
||||||
|
<parm name="same_barcode_timeout" value="500"/>
|
||||||
|
<parm name="different_barcode_timeout" value="500"/>
|
||||||
|
<parm name="illumination_mode" value="Default"/>
|
||||||
|
<parm name="keep_pairing_info_after_reboot" value="Default"/>
|
||||||
|
<parm name="lcd_mode" value="Default"/>
|
||||||
|
<parm name="low_power_timeout" value="250"/>
|
||||||
|
<parm name="delay_to_low_power_mode" value="Default"/>
|
||||||
|
<parm name="illumination_brightness" value="10"/>
|
||||||
|
<parm name="inverse_1d_mode" value="Default"/>
|
||||||
|
<parm name="viewfinder_size" value="100"/>
|
||||||
|
<parm name="viewfinder_posx" value="0"/>
|
||||||
|
<parm name="viewfinder_posy" value="0"/>
|
||||||
|
<parm name="1d_marginless_decode_effort_level" value="Default"/>
|
||||||
|
<parm name="poor_quality_bcdecode_effort_level" value="Default"/>
|
||||||
|
<parm name="charset_name" value="Default"/>
|
||||||
|
<parm name="viewfinder_mode" value="Default"/>
|
||||||
|
<parm name="scanning_mode" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="ScanParams">
|
||||||
|
<parm name="code_id_type" value="Default"/>
|
||||||
|
<parm name="volume_slider_type" value="Default"/>
|
||||||
|
<parm name="decode_audio_feedback_uri" value="/system/media/audio/notifications/optimized-beep.ogg"/>
|
||||||
|
<parm name="decode_haptic_feedback" value="Default"/>
|
||||||
|
<parm name="bt_disconnect_on_exit" value="Default"/>
|
||||||
|
<parm name="connection_idle_time" value="600"/>
|
||||||
|
<parm name="establish_connection_time" value="45"/>
|
||||||
|
<parm name="remote_scanner_audio_feedback_mode" value="Default"/>
|
||||||
|
<parm name="remote_scanner_led_feedback_mode" value="Default"/>
|
||||||
|
<parm name="display_bt_address_barcode" value="Default"/>
|
||||||
|
<parm name="good_decode_led_timer" value="75"/>
|
||||||
|
<parm name="decoding_led_feedback" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="UDIParams">
|
||||||
|
<parm name="enable_udi_gs1" value="Default"/>
|
||||||
|
<parm name="enable_udi_hibcc" value="Default"/>
|
||||||
|
<parm name="enable_udi_iccbba" value="Default"/>
|
||||||
|
</characteristic>
|
||||||
|
<characteristic type="MultiBarcodeParams">
|
||||||
|
<parm name="multi_barcode_count" value="5"/>
|
||||||
|
</characteristic>
|
||||||
|
</characteristic>
|
||||||
|
</characteristic>
|
||||||
|
</wap-provisioningdoc>
|
||||||
@ -147,10 +147,11 @@ public class MainActivity extends AppCompatActivity
|
|||||||
} else if (id == R.id.nav_free_picking) {
|
} else if (id == R.id.nav_free_picking) {
|
||||||
fragment = PickingLiberoFragment.newInstance();
|
fragment = PickingLiberoFragment.newInstance();
|
||||||
this.adaptViewToFragment(fragment);
|
this.adaptViewToFragment(fragment);
|
||||||
} else if (id == R.id.nav_resi_cliente) {
|
|
||||||
fragment = UltimeConsegneClienteFragment.newInstance();
|
|
||||||
this.adaptViewToFragment(fragment);
|
|
||||||
}
|
}
|
||||||
|
// else if (id == R.id.nav_resi_cliente) {
|
||||||
|
// fragment = UltimeConsegneClienteFragment.newInstance();
|
||||||
|
// this.adaptViewToFragment(fragment);
|
||||||
|
// }
|
||||||
|
|
||||||
else if(id == R.id.nav_settings){
|
else if(id == R.id.nav_settings){
|
||||||
fragment = new MainSettingsFragment();
|
fragment = new MainSettingsFragment();
|
||||||
|
|||||||
@ -4,9 +4,12 @@ import com.annimon.stream.Stream;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.CommonConst;
|
import it.integry.integrywmsnative.core.CommonConst;
|
||||||
@ -290,6 +293,26 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void getMultipleByTestate(List<MtbColt> testate, boolean onlyResiduo, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
ArrayList<MtbColt> resultMtbColt = new ArrayList<>();
|
||||||
|
cyclicGetMultipleByTestate(testate.iterator(), onlyResiduo, resultMtbColt, () -> {
|
||||||
|
onComplete.run(resultMtbColt);
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private static void cyclicGetMultipleByTestate(@NotNull Iterator<MtbColt> sourceMtbColts, boolean onlyResiduo, ArrayList<MtbColt> resultMtbColt, Runnable onComplete, RunnableArgs<Exception> onAbort) {
|
||||||
|
if(sourceMtbColts.hasNext()){
|
||||||
|
getByTestata(sourceMtbColts.next(), onlyResiduo, false, mtbColt -> {
|
||||||
|
resultMtbColt.add(mtbColt);
|
||||||
|
cyclicGetMultipleByTestate(sourceMtbColts, onlyResiduo, resultMtbColt, onComplete, onAbort);
|
||||||
|
}, onAbort);
|
||||||
|
} else {
|
||||||
|
onComplete.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void getByTestata(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getByTestata(MtbColt testata, boolean onlyResiduo, boolean throwExcIfNull, RunnableArgs<MtbColt> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
String ssccString = null;
|
String ssccString = null;
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
|||||||
import it.integry.plugins.barcode_base_library.exception.BarcodeAdapterNotFoundException;
|
import it.integry.plugins.barcode_base_library.exception.BarcodeAdapterNotFoundException;
|
||||||
import it.integry.plugins.barcode_base_library.interfaces.BarcodeReaderInterface;
|
import it.integry.plugins.barcode_base_library.interfaces.BarcodeReaderInterface;
|
||||||
import it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader;
|
import it.integry.pointmobilescannerlibrary.PointMobileBarcodeReader;
|
||||||
|
import it.integry.zebrascannerlibrary.ZebraBarcodeReader;
|
||||||
|
|
||||||
public class BarcodeManager {
|
public class BarcodeManager {
|
||||||
|
|
||||||
@ -23,7 +24,8 @@ public class BarcodeManager {
|
|||||||
|
|
||||||
|
|
||||||
private static Class<? extends BarcodeReaderInterface>[] registeredBarcodeReaderInterfaces = new Class[]{
|
private static Class<? extends BarcodeReaderInterface>[] registeredBarcodeReaderInterfaces = new Class[]{
|
||||||
PointMobileBarcodeReader.class
|
PointMobileBarcodeReader.class,
|
||||||
|
ZebraBarcodeReader.class
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,39 +0,0 @@
|
|||||||
package it.integry.integrywmsnative.core.di.binders;
|
|
||||||
|
|
||||||
import androidx.databinding.BindingAdapter;
|
|
||||||
import androidx.databinding.ObservableArrayList;
|
|
||||||
|
|
||||||
public class RecyclerViewAdapterBinders {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// @BindingAdapter("app:adapter")
|
|
||||||
// public static void setItems(RecyclerView recyclerView, Class clazz) {
|
|
||||||
// setItems(recyclerView, null, clazz);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @BindingAdapter("app:items")
|
|
||||||
// public static <T> void setItems(RecyclerView recyclerView, ObservableArrayList<T> entries) {
|
|
||||||
// setItems(recyclerView, entries, null);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @BindingAdapter({"app:items", "app:adapter"})
|
|
||||||
// public static <T> void setItems(RecyclerView recyclerView,
|
|
||||||
// ObservableArrayList<T> entries, Class clazz) {
|
|
||||||
//
|
|
||||||
//// recyclerView.removeAllViews();
|
|
||||||
//// if (entries != null) {
|
|
||||||
//// LayoutInflater inflater = (LayoutInflater)
|
|
||||||
//// viewGroup.getContext()
|
|
||||||
//// .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
|
||||||
//// for (int i = 0; i < entries.size(); i++) {
|
|
||||||
//// T entry = entries.get(i);
|
|
||||||
//// ViewDataBinding bindings = DataBindingUtil
|
|
||||||
//// .inflate(inflater, layoutId, viewGroup, true);
|
|
||||||
//// bindings.setVariable(BR.data, entry);
|
|
||||||
//// }
|
|
||||||
//// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -107,7 +107,7 @@ public class UtilityBarcode {
|
|||||||
for (int i = 0; i < 12; i++) {
|
for (int i = 0; i < 12; i++) {
|
||||||
tot = tot + (Long.parseLong(String.valueOf(ean.charAt(i))) * (i % 2 == 0 ? 1 : 3));
|
tot = tot + (Long.parseLong(String.valueOf(ean.charAt(i))) * (i % 2 == 0 ? 1 : 3));
|
||||||
}
|
}
|
||||||
return tot % 10 == 0 ? "0" : "" +(10-(tot % 10));
|
return tot % 10 == 0 ? "0" : "" + ( 10 - ( tot % 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,7 @@ public class UtilityDate {
|
|||||||
public static final String YMD_TIME_SLASH = YMD_SLASH + " hh:mm";
|
public static final String YMD_TIME_SLASH = YMD_SLASH + " hh:mm";
|
||||||
|
|
||||||
|
|
||||||
|
public static final String DM_HUMAN = "dd MMM";
|
||||||
public static final String DMY_HUMAN = "dd MMM yyyy";
|
public static final String DMY_HUMAN = "dd MMM yyyy";
|
||||||
public static final String DMY_HUMAN_LONG = "dd MMMM yyyy";
|
public static final String DMY_HUMAN_LONG = "dd MMMM yyyy";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package it.integry.integrywmsnative.gest.ultime_consegne_cliente;
|
package it.integry.integrywmsnative.gest.ultime_consegne_cliente;
|
||||||
|
|
||||||
|
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@ -12,16 +11,16 @@ import androidx.appcompat.widget.AppCompatTextView;
|
|||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|
||||||
import it.integry.integrywmsnative.databinding.FragmentMainUltimeConsegneClienteBinding;
|
import it.integry.integrywmsnative.databinding.FragmentMainUltimeConsegneClienteBinding;
|
||||||
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.viewmodel.UltimeConsegneClienteViewModel;
|
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.viewmodel.UltimeConsegneClienteViewModel;
|
||||||
import it.integry.integrywmsnative.gest.vendita.rest.UltimeConsegneClienteRESTConsumer;
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
|
|
||||||
public class UltimeConsegneClienteFragment extends Fragment implements ITitledFragment {
|
public class UltimeConsegneClienteFragment extends Fragment implements ITitledFragment, IScrollableFragment {
|
||||||
|
|
||||||
|
private Runnable mOnPreDestroy;
|
||||||
|
private ElevatedToolbar mToolbar;
|
||||||
|
|
||||||
public UltimeConsegneClienteFragment() {
|
public UltimeConsegneClienteFragment() {
|
||||||
// Required empty public constructor
|
// Required empty public constructor
|
||||||
@ -42,14 +41,32 @@ public class UltimeConsegneClienteFragment extends Fragment implements ITitledFr
|
|||||||
|
|
||||||
FragmentMainUltimeConsegneClienteBinding mBinding = DataBindingUtil.inflate(LayoutInflater.from(getActivity()), R.layout.fragment_main_ultime_consegne_cliente, container, false);
|
FragmentMainUltimeConsegneClienteBinding mBinding = DataBindingUtil.inflate(LayoutInflater.from(getActivity()), R.layout.fragment_main_ultime_consegne_cliente, container, false);
|
||||||
|
|
||||||
mBinding.setViewmodel(new UltimeConsegneClienteViewModel(getActivity()));
|
mBinding.setViewmodel(new UltimeConsegneClienteViewModel(getActivity(), mBinding));
|
||||||
|
|
||||||
|
mToolbar.setRecyclerView(mBinding.recyclerView);
|
||||||
|
|
||||||
// Inflate the layout for this fragment
|
// Inflate the layout for this fragment
|
||||||
return mBinding.getRoot();
|
return mBinding.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
if(mOnPreDestroy != null) mOnPreDestroy.run();
|
||||||
|
super.onDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
public void onCreateActionBar(AppCompatTextView titleText, Context context) {
|
||||||
titleText.setText(context.getText(R.string.fragment_ultime_consegne_cliente_title).toString());
|
titleText.setText(context.getText(R.string.fragment_ultime_consegne_cliente_title).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||||
|
mToolbar = toolbar;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setOnPreDestroy(Runnable onPreDestroy) {
|
||||||
|
mOnPreDestroy = onPreDestroy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,48 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ultime_consegne_cliente.dto;
|
||||||
|
|
||||||
|
import androidx.databinding.Observable;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.gest.vendita.rest.model.ConsegnaClienteDTO;
|
||||||
|
|
||||||
|
public class CheckableConsegnaClienteDTO {
|
||||||
|
|
||||||
|
private ConsegnaClienteDTO mItem;
|
||||||
|
private BindableBoolean checked = new BindableBoolean(false);
|
||||||
|
|
||||||
|
public CheckableConsegnaClienteDTO(ConsegnaClienteDTO item) {
|
||||||
|
this.mItem = item;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConsegnaClienteDTO getItem() {
|
||||||
|
return mItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckableConsegnaClienteDTO setItem(ConsegnaClienteDTO item) {
|
||||||
|
this.mItem = item;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getChecked() {
|
||||||
|
return checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isChecked() {
|
||||||
|
return checked.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckableConsegnaClienteDTO setChecked(BindableBoolean checked) {
|
||||||
|
this.checked = checked;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CheckableConsegnaClienteDTO setCheckedValue(boolean value) {
|
||||||
|
this.checked.set(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void toggleCheck() {
|
||||||
|
this.checked.set(!this.checked.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package it.integry.integrywmsnative.gest.vendita.rest;
|
package it.integry.integrywmsnative.gest.ultime_consegne_cliente.rest;
|
||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ import it.integry.integrywmsnative.gest.vendita.rest.model.ConsegnaClienteDTO;
|
|||||||
|
|
||||||
public class UltimeConsegneClienteRESTConsumer {
|
public class UltimeConsegneClienteRESTConsumer {
|
||||||
|
|
||||||
public static void getUltimeConsegneClienti(String codMdep, String codAnag, String codMart, RunnableArgs<List<ConsegnaClienteDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
public static void getUltimeConsegneClienti(String codMdep, String codAnag, String codMart, RunnableArgs<ArrayList<ConsegnaClienteDTO>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|
||||||
int numberOfConsegnePerCli = 10;
|
int numberOfConsegnePerCli = 10;
|
||||||
int numberOfDayToAnalyze = 90;
|
int numberOfDayToAnalyze = 90;
|
||||||
@ -29,14 +29,14 @@ public class UltimeConsegneClienteRESTConsumer {
|
|||||||
UtilityDB.valueToString(codMdep) + ", " +
|
UtilityDB.valueToString(codMdep) + ", " +
|
||||||
UtilityDB.valueToString(numberOfDayToAnalyze) + ") consegne " +
|
UtilityDB.valueToString(numberOfDayToAnalyze) + ") consegne " +
|
||||||
"LEFT OUTER JOIN gtb_anag ON consegne.cod_anag = gtb_anag.cod_anag " +
|
"LEFT OUTER JOIN gtb_anag ON consegne.cod_anag = gtb_anag.cod_anag " +
|
||||||
"ORDER BY consegne.cod_anag, " +
|
"ORDER BY rag_soc, " +
|
||||||
" counter_consegna ";
|
" counter_consegna ";
|
||||||
|
|
||||||
|
|
||||||
Type typeOfObjectsList = new TypeToken<ArrayList<ConsegnaClienteDTO>>() {}.getType();
|
Type typeOfObjectsList = new TypeToken<ArrayList<ConsegnaClienteDTO>>() {}.getType();
|
||||||
SystemRESTConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<List<ConsegnaClienteDTO>>() {
|
SystemRESTConsumer.processSql(sql, typeOfObjectsList, new ISimpleOperationCallback<ArrayList<ConsegnaClienteDTO>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<ConsegnaClienteDTO> value) {
|
public void onSuccess(ArrayList<ConsegnaClienteDTO> value) {
|
||||||
if(onComplete != null) onComplete.run(value);
|
if(onComplete != null) onComplete.run(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2,24 +2,36 @@ package it.integry.integrywmsnative.gest.ultime_consegne_cliente.viewmodel;
|
|||||||
|
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.databinding.ObservableArrayList;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||||
import it.integry.integrywmsnative.gest.vendita.rest.UltimeConsegneClienteRESTConsumer;
|
import it.integry.integrywmsnative.databinding.FragmentMainUltimeConsegneClienteBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.rest.UltimeConsegneClienteRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.gest.vendita.rest.model.ConsegnaClienteDTO;
|
||||||
|
|
||||||
public class UltimeConsegneClienteViewModel {
|
public class UltimeConsegneClienteViewModel {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
private FragmentMainUltimeConsegneClienteBinding mBinding;
|
||||||
|
|
||||||
public UltimeConsegneClienteViewModel(Context context) {
|
public UltimeConsegneClienteViewModel(Context context, FragmentMainUltimeConsegneClienteBinding binding) {
|
||||||
this.mContext = context;
|
this.mContext = context;
|
||||||
|
this.mBinding = binding;
|
||||||
|
|
||||||
this.initList();
|
this.initList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initList() {
|
private void initList() {
|
||||||
|
|
||||||
ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||||
|
|
||||||
UltimeConsegneClienteRESTConsumer.getUltimeConsegneClienti(
|
UltimeConsegneClienteRESTConsumer.getUltimeConsegneClienti(
|
||||||
@ -27,10 +39,29 @@ public class UltimeConsegneClienteViewModel {
|
|||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
consegne -> {
|
consegne -> {
|
||||||
|
this.initDataAdapter(consegne);
|
||||||
|
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
UtilityExceptions.defaultException(mContext, ex, progressDialog);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initDataAdapter(ArrayList<ConsegnaClienteDTO> dataset) {
|
||||||
|
UltimeConsegneMainListAdapter adapter = new UltimeConsegneMainListAdapter(mContext, dataset);
|
||||||
|
adapter.setOnItemClickListener(consegna -> {
|
||||||
|
Toast.makeText(mContext, String.format("Selezionato doc n° %d del %s", consegna.getNumDoc(), consegna.getDataDoc()), Toast.LENGTH_SHORT).show();
|
||||||
|
});
|
||||||
|
|
||||||
|
mBinding.recyclerView.setHasFixedSize(true);
|
||||||
|
|
||||||
|
mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
|
||||||
|
|
||||||
|
mBinding.recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
mBinding.fastscroll.setRecyclerView(mBinding.recyclerView);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,210 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ultime_consegne_cliente.viewmodel;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.amulyakhare.textdrawable.TextDrawable;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.zhukic.sectionedrecyclerview.SectionedRecyclerViewAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.databinding.FragmentMainUltimeConsegneClienteListHeaderBinding;
|
||||||
|
import it.integry.integrywmsnative.databinding.FragmentMainUltimeConsegneClienteListSingleItemBinding;
|
||||||
|
import it.integry.integrywmsnative.gest.ultime_consegne_cliente.dto.CheckableConsegnaClienteDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.vendita.rest.model.ConsegnaClienteDTO;
|
||||||
|
import it.integry.integrywmsnative.ui.fastscroll.SectionTitleProvider;
|
||||||
|
|
||||||
|
public class UltimeConsegneMainListAdapter extends SectionedRecyclerViewAdapter<UltimeConsegneMainListAdapter.SubheaderHolder, UltimeConsegneMainListAdapter.SingleItemViewHolder> implements SectionTitleProvider {
|
||||||
|
|
||||||
|
private Context mContext;
|
||||||
|
private ArrayList<ConsegnaClienteDTO> mDataset;
|
||||||
|
private ArrayList<String> mSectionTitleItems;
|
||||||
|
|
||||||
|
private OnItemClickListener onItemClickListener;
|
||||||
|
|
||||||
|
private TextDrawable.IShapeBuilder smallIconBuilder;
|
||||||
|
private TextDrawable.IShapeBuilder mediumIconBuilder;
|
||||||
|
private TextDrawable.IShapeBuilder largeIconBuilder;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getSectionTitle(int position) {
|
||||||
|
return this.mSectionTitleItems.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public interface OnItemClickListener {
|
||||||
|
void onItemClicked(ConsegnaClienteDTO consegna);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static class SubheaderHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
FragmentMainUltimeConsegneClienteListHeaderBinding mBinding;
|
||||||
|
|
||||||
|
SubheaderHolder(FragmentMainUltimeConsegneClienteListHeaderBinding binding) {
|
||||||
|
super(binding.getRoot());
|
||||||
|
this.mBinding = binding;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static class SingleItemViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
FragmentMainUltimeConsegneClienteListSingleItemBinding mBinding;
|
||||||
|
|
||||||
|
SingleItemViewHolder(FragmentMainUltimeConsegneClienteListSingleItemBinding binding) {
|
||||||
|
super(binding.getRoot());
|
||||||
|
this.mBinding = binding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public UltimeConsegneMainListAdapter(Context context, ArrayList<ConsegnaClienteDTO> dataset) {
|
||||||
|
super();
|
||||||
|
this.mContext = context;
|
||||||
|
this.mDataset = new ArrayList<>();
|
||||||
|
this.mSectionTitleItems = new ArrayList<>();
|
||||||
|
|
||||||
|
Stream.of(dataset)
|
||||||
|
.map(x -> x.getRagSoc())
|
||||||
|
.distinct()
|
||||||
|
.forEach(x -> {
|
||||||
|
this.mSectionTitleItems.add(String.valueOf(x.charAt(0)));
|
||||||
|
|
||||||
|
Stream.of(dataset)
|
||||||
|
.filter(y -> y.getRagSoc().equalsIgnoreCase(x))
|
||||||
|
.forEach(y -> {
|
||||||
|
this.mSectionTitleItems.add(String.valueOf(x.charAt(0)));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
this.mDataset = dataset;
|
||||||
|
|
||||||
|
smallIconBuilder = TextDrawable.builder()
|
||||||
|
.beginConfig()
|
||||||
|
.width(40)
|
||||||
|
.height(40)
|
||||||
|
.fontSize(24)
|
||||||
|
.useFont(ResourcesCompat.getFont(mContext, R.font.product_sans_regular))
|
||||||
|
.endConfig();
|
||||||
|
|
||||||
|
mediumIconBuilder = TextDrawable.builder()
|
||||||
|
.beginConfig()
|
||||||
|
.width(40)
|
||||||
|
.height(40)
|
||||||
|
.fontSize(20)
|
||||||
|
.useFont(ResourcesCompat.getFont(mContext, R.font.product_sans_regular))
|
||||||
|
.endConfig();
|
||||||
|
|
||||||
|
largeIconBuilder = TextDrawable.builder()
|
||||||
|
.beginConfig()
|
||||||
|
.width(40)
|
||||||
|
.height(40)
|
||||||
|
.fontSize(16)
|
||||||
|
.useFont(ResourcesCompat.getFont(mContext, R.font.product_sans_regular))
|
||||||
|
.endConfig();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleItemViewHolder onCreateItemViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
FragmentMainUltimeConsegneClienteListSingleItemBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.fragment_main_ultime_consegne_cliente__list_single_item, parent, false);
|
||||||
|
return new SingleItemViewHolder(binding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SubheaderHolder onCreateSubheaderViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
FragmentMainUltimeConsegneClienteListHeaderBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.fragment_main_ultime_consegne_cliente__list_header, parent, false);
|
||||||
|
return new SubheaderHolder(binding);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindItemViewHolder(final SingleItemViewHolder holder, final int position) {
|
||||||
|
final ConsegnaClienteDTO consegna = this.mDataset.get(position);
|
||||||
|
|
||||||
|
holder.mBinding.descriptionMain.setText(UtilityString.isNullOrEmpty(consegna.getRifOrd()) ? "" : consegna.getRifOrd());
|
||||||
|
|
||||||
|
String numDoc = "" + consegna.getNumDoc();
|
||||||
|
|
||||||
|
if(numDoc.length() <= 2) {
|
||||||
|
holder.mBinding.startIcon.setImageDrawable(smallIconBuilder.buildRound(numDoc, ContextCompat.getColor(mContext, R.color.colorPrimary)));
|
||||||
|
} else if(numDoc.length() == 3) {
|
||||||
|
holder.mBinding.startIcon.setImageDrawable(mediumIconBuilder.buildRound(numDoc, ContextCompat.getColor(mContext, R.color.colorPrimary)));
|
||||||
|
} else if(numDoc.length() == 4) {
|
||||||
|
holder.mBinding.startIcon.setImageDrawable(largeIconBuilder.buildRound(numDoc, ContextCompat.getColor(mContext, R.color.colorPrimary)));
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
Date dataDoc = UtilityDate.recognizeDate(consegna.getDataDoc());
|
||||||
|
|
||||||
|
Calendar calendarNow = Calendar.getInstance(TimeZone.getDefault());
|
||||||
|
Calendar calendarDataDoc = Calendar.getInstance(TimeZone.getDefault());
|
||||||
|
calendarDataDoc.setTime(dataDoc);
|
||||||
|
|
||||||
|
String dataDocString = "";
|
||||||
|
|
||||||
|
if(calendarDataDoc.get(Calendar.YEAR) == calendarNow.get(Calendar.YEAR)) {
|
||||||
|
dataDocString = UtilityDate.formatDate(dataDoc, UtilityDate.COMMONS_DATE_FORMATS.DM_HUMAN);
|
||||||
|
} else {
|
||||||
|
dataDocString = UtilityDate.formatDate(dataDoc, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN);
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.mBinding.date.setText(dataDocString);
|
||||||
|
|
||||||
|
|
||||||
|
holder.mBinding.compilatoDa.setText(consegna.getCompilatoDa());
|
||||||
|
holder.mBinding.compilatoDa.setVisibility(UtilityString.isNullOrEmpty(consegna.getCompilatoDa()) ? View.GONE : View.VISIBLE);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
UtilityExceptions.defaultException(mContext, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.mBinding.getRoot().setOnClickListener(l -> {
|
||||||
|
if(onItemClickListener != null) onItemClickListener.onItemClicked(consegna);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindSubheaderViewHolder(SubheaderHolder subheaderHolder, int nextItemPosition) {
|
||||||
|
subheaderHolder.mBinding.title.setText(this.mDataset.get(nextItemPosition).getRagSoc());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onPlaceSubheaderBetweenItems(int position) {
|
||||||
|
|
||||||
|
if(!this.mDataset.get(position).getCodAnag().equalsIgnoreCase(this.mDataset.get(position+1).getCodAnag())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemSize() {
|
||||||
|
return this.mDataset.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
|
||||||
|
this.onItemClickListener = onItemClickListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -9,6 +9,9 @@ public class ConsegnaClienteDTO {
|
|||||||
private String serDoc;
|
private String serDoc;
|
||||||
private int numDoc;
|
private int numDoc;
|
||||||
private String ragSoc;
|
private String ragSoc;
|
||||||
|
private String compilatoDa;
|
||||||
|
private String rifOrd;
|
||||||
|
private String dataord;
|
||||||
|
|
||||||
public String getCodAnag() {
|
public String getCodAnag() {
|
||||||
return codAnag;
|
return codAnag;
|
||||||
@ -72,4 +75,31 @@ public class ConsegnaClienteDTO {
|
|||||||
this.ragSoc = ragSoc;
|
this.ragSoc = ragSoc;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCompilatoDa() {
|
||||||
|
return compilatoDa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConsegnaClienteDTO setCompilatoDa(String compilatoDa) {
|
||||||
|
this.compilatoDa = compilatoDa;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRifOrd() {
|
||||||
|
return rifOrd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConsegnaClienteDTO setRifOrd(String rifOrd) {
|
||||||
|
this.rifOrd = rifOrd;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDataord() {
|
||||||
|
return dataord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConsegnaClienteDTO setDataord(String dataord) {
|
||||||
|
this.dataord = dataord;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -697,30 +697,6 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
private void loadMatchedRows(List<PickingObjectDTO> matchedRows) {
|
private void loadMatchedRows(List<PickingObjectDTO> matchedRows) {
|
||||||
if(matchedRows == null || matchedRows.size() == 0) {
|
if(matchedRows == null || matchedRows.size() == 0) {
|
||||||
DialogCommon.showNoArtFoundDialog(mActivity, null);
|
DialogCommon.showNoArtFoundDialog(mActivity, null);
|
||||||
} else if(matchedRows.size() == 1) {
|
|
||||||
|
|
||||||
|
|
||||||
if(matchedRows.get(0).getTempPickData() != null &&
|
|
||||||
matchedRows.get(0).getTempPickData().getSourceMtbColt() != null) {
|
|
||||||
|
|
||||||
MtbColt tempSourceMtbColt = matchedRows.get(0).getTempPickData().getSourceMtbColt();
|
|
||||||
|
|
||||||
if(tempSourceMtbColt.getGestione().equals(matchedRows.get(0).getGestione()) &&
|
|
||||||
tempSourceMtbColt.getNumCollo() == matchedRows.get(0).getNumCollo() &&
|
|
||||||
tempSourceMtbColt.getSerCollo().equals(matchedRows.get(0).getSerCollo()) &&
|
|
||||||
tempSourceMtbColt.getDataColloS().equals(matchedRows.get(0).getDataColloS())) {
|
|
||||||
|
|
||||||
onOrdineRowDispatch(matchedRows.get(0));
|
|
||||||
} else {
|
|
||||||
//Se sto pickando da una UL diversa da quella suggerita allora non te la apro in
|
|
||||||
//automatico ma ti mostro il filtro
|
|
||||||
applyFilter("");
|
|
||||||
refreshOrderBy(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
onOrdineRowDispatch(matchedRows.get(0));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
for(int i = 0; i < mPickingList.size(); i++) {
|
for(int i = 0; i < mPickingList.size(); i++) {
|
||||||
if(!matchedRows.contains(mPickingList.get(i))) {
|
if(!matchedRows.contains(mPickingList.get(i))) {
|
||||||
@ -728,10 +704,34 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(matchedRows.size() == 1) {
|
||||||
|
|
||||||
|
if (matchedRows.get(0).getTempPickData() != null &&
|
||||||
|
matchedRows.get(0).getTempPickData().getSourceMtbColt() != null) {
|
||||||
|
|
||||||
applyFilter("");
|
MtbColt tempSourceMtbColt = matchedRows.get(0).getTempPickData().getSourceMtbColt();
|
||||||
refreshOrderBy(false);
|
|
||||||
|
if (tempSourceMtbColt.getGestione().equals(matchedRows.get(0).getGestione()) &&
|
||||||
|
tempSourceMtbColt.getNumCollo() == matchedRows.get(0).getNumCollo() &&
|
||||||
|
tempSourceMtbColt.getSerCollo().equals(matchedRows.get(0).getSerCollo()) &&
|
||||||
|
tempSourceMtbColt.getDataColloS().equals(matchedRows.get(0).getDataColloS())) {
|
||||||
|
|
||||||
|
onOrdineRowDispatch(matchedRows.get(0));
|
||||||
|
} else {
|
||||||
|
//Se sto pickando da una UL diversa da quella suggerita allora non te la apro in
|
||||||
|
//automatico ma ti mostro il filtro
|
||||||
|
applyFilter("");
|
||||||
|
refreshOrderBy(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
onOrdineRowDispatch(matchedRows.get(0));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
applyFilter("");
|
||||||
|
refreshOrderBy(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -867,8 +867,15 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
IOrdiniVendita ordiniVendita = ClassRouter.getIstance(ClassRouter.PATH.ORDINI_VENDITA);
|
IOrdiniVendita ordiniVendita = ClassRouter.getIstance(ClassRouter.PATH.ORDINI_VENDITA);
|
||||||
|
|
||||||
ordiniVendita.distribuisciCollo(progress, cloneMtbColt, mTestateOrdini, mtbColts -> {
|
ordiniVendita.distribuisciCollo(progress, cloneMtbColt, mTestateOrdini, mtbColts -> {
|
||||||
|
|
||||||
if(mtbColtSessionID != null) ColliDataRecover.closeSession(mtbColtSessionID);
|
if(mtbColtSessionID != null) ColliDataRecover.closeSession(mtbColtSessionID);
|
||||||
onComplete.run(mtbColts);
|
|
||||||
|
ColliMagazzinoRESTConsumer.getMultipleByTestate(mtbColts, true, mtbColtsReloaded -> {
|
||||||
|
onComplete.run(mtbColtsReloaded);
|
||||||
|
}, ex -> {
|
||||||
|
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||||
|
});
|
||||||
|
|
||||||
}, ex -> {
|
}, ex -> {
|
||||||
UtilityExceptions.defaultException(mActivity, ex, progress);
|
UtilityExceptions.defaultException(mActivity, ex, progress);
|
||||||
});
|
});
|
||||||
@ -981,26 +988,15 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
|||||||
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
|
||||||
isFabVisible.set(true);
|
isFabVisible.set(true);
|
||||||
|
|
||||||
if(mtbColt != null && mtbColt.getMtbColr() != null) {
|
|
||||||
|
|
||||||
List<MtbColr> mtbColrs = mtbColt.getMtbColr();
|
for(int i = 0; i < this.mPickingList.size(); i++) {
|
||||||
|
|
||||||
for (int i = 0; i < mtbColrs.size(); i++) {
|
for(int k = 0; k < this.mPickingList.get(i).getWithdrawRows().size(); k++) {
|
||||||
|
|
||||||
MtbColr x = mtbColt.getMtbColr().get(i);
|
MtbColr withdrawRow = this.mPickingList.get(i).getWithdrawRows().get(k);
|
||||||
|
|
||||||
Stream.of(this.mPickingList)
|
this.mPickingList.get(i).setQtaCollo(this.mPickingList.get(i).getQtaCollo().subtract(withdrawRow.getQtaCol()));
|
||||||
.filter(currentRow ->
|
this.mPickingList.get(i).setQtaOrd(this.mPickingList.get(i).getQtaOrd().subtract(withdrawRow.getQtaCol()));
|
||||||
x.getCodMart().equalsIgnoreCase(currentRow.getCodMart()) &&
|
|
||||||
((x.getCodJcom() == null && currentRow.getCodJcom() == null) || (x.getCodJcom() != null && x.getCodJcom().equalsIgnoreCase(currentRow.getCodJcom()))) &&
|
|
||||||
(!SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV() || (SettingsManager.iDB().isEnableCheckPartitaMagCheckPickingV() && ((x.getPartitaMag() == null && currentRow.getPartitaMag() == null) || (x.getPartitaMag() != null && x.getPartitaMag().equalsIgnoreCase(currentRow.getPartitaMag()))))) &&
|
|
||||||
((x.getNumColloRif() == null && currentRow.getNumCollo() == null) || (x.getNumColloRif() != null && x.getNumColloRif().equals(currentRow.getNumCollo())))
|
|
||||||
)
|
|
||||||
|
|
||||||
.forEach(currentRow -> {
|
|
||||||
currentRow.setQtaCollo(currentRow.getQtaCollo().subtract(x.getQtaCol()));
|
|
||||||
currentRow.setQtaOrd(currentRow.getQtaOrd().subtract(x.getQtaCol()));
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,294 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.fastscroll;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.core.graphics.drawable.DrawableCompat;
|
||||||
|
import androidx.core.widget.TextViewCompat;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.ui.fastscroll.viewprovider.DefaultScrollerViewProvider;
|
||||||
|
import it.integry.integrywmsnative.ui.fastscroll.viewprovider.ScrollerViewProvider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mklimczak on 28/07/15.
|
||||||
|
*/
|
||||||
|
public class FastScroller extends LinearLayout {
|
||||||
|
|
||||||
|
private static final int STYLE_NONE = -1;
|
||||||
|
private final RecyclerViewScrollListener scrollListener = new RecyclerViewScrollListener(this);
|
||||||
|
private RecyclerView recyclerView;
|
||||||
|
|
||||||
|
private View bubble;
|
||||||
|
private View handle;
|
||||||
|
private TextView bubbleTextView;
|
||||||
|
|
||||||
|
private int bubbleOffset;
|
||||||
|
private int handleColor;
|
||||||
|
private int bubbleColor;
|
||||||
|
private int bubbleTextAppearance;
|
||||||
|
private int scrollerOrientation;
|
||||||
|
|
||||||
|
//TODO the name should be fixed, also check if there is a better way of handling the visibility, because this is somewhat convoluted
|
||||||
|
private int maxVisibility;
|
||||||
|
|
||||||
|
private boolean manuallyChangingPosition;
|
||||||
|
|
||||||
|
private ScrollerViewProvider viewProvider;
|
||||||
|
private SectionTitleProvider titleProvider;
|
||||||
|
|
||||||
|
public FastScroller(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FastScroller(Context context, AttributeSet attrs) {
|
||||||
|
this(context, attrs, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FastScroller(Context context, AttributeSet attrs, int defStyle) {
|
||||||
|
super(context, attrs, defStyle);
|
||||||
|
setClipChildren(false);
|
||||||
|
TypedArray style = context.obtainStyledAttributes(attrs, R.styleable.fastscroll__fastScroller, R.attr.fastscroll__style, 0);
|
||||||
|
try {
|
||||||
|
bubbleColor = style.getColor(R.styleable.fastscroll__fastScroller_fastscroll__bubbleColor, STYLE_NONE);
|
||||||
|
handleColor = style.getColor(R.styleable.fastscroll__fastScroller_fastscroll__handleColor, STYLE_NONE);
|
||||||
|
bubbleTextAppearance = style.getResourceId(R.styleable.fastscroll__fastScroller_fastscroll__bubbleTextAppearance, STYLE_NONE);
|
||||||
|
} finally {
|
||||||
|
style.recycle();
|
||||||
|
}
|
||||||
|
maxVisibility = getVisibility();
|
||||||
|
setViewProvider(new DefaultScrollerViewProvider());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables custom layout for {@link FastScroller}.
|
||||||
|
* @param viewProvider A {@link ScrollerViewProvider} for the {@link FastScroller} to use when building layout.
|
||||||
|
*/
|
||||||
|
public void setViewProvider(ScrollerViewProvider viewProvider) {
|
||||||
|
removeAllViews();
|
||||||
|
this.viewProvider = viewProvider;
|
||||||
|
viewProvider.setFastScroller(this);
|
||||||
|
bubble = viewProvider.provideBubbleView(this);
|
||||||
|
handle = viewProvider.provideHandleView(this);
|
||||||
|
bubbleTextView = viewProvider.provideBubbleTextView();
|
||||||
|
addView(bubble);
|
||||||
|
addView(handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attach the {@link FastScroller} to {@link RecyclerView}. Should be used after the adapter is set
|
||||||
|
* to the {@link RecyclerView}. If the adapter implements SectionTitleProvider, the FastScroller
|
||||||
|
* will show a bubble with title.
|
||||||
|
* @param recyclerView A {@link RecyclerView} to attach the {@link FastScroller} to.
|
||||||
|
*/
|
||||||
|
public void setRecyclerView(RecyclerView recyclerView) {
|
||||||
|
this.recyclerView = recyclerView;
|
||||||
|
if(recyclerView.getAdapter() instanceof SectionTitleProvider) titleProvider = (SectionTitleProvider) recyclerView.getAdapter();
|
||||||
|
recyclerView.addOnScrollListener(scrollListener);
|
||||||
|
invalidateVisibility();
|
||||||
|
recyclerView.setOnHierarchyChangeListener(new OnHierarchyChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onChildViewAdded(View parent, View child) {
|
||||||
|
invalidateVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onChildViewRemoved(View parent, View child) {
|
||||||
|
invalidateVisibility();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the orientation of the {@link FastScroller}. The orientation of the {@link FastScroller}
|
||||||
|
* should generally match the orientation of connected {@link RecyclerView} for good UX but it's not enforced.
|
||||||
|
* Note: This method is overridden from {@link LinearLayout#setOrientation(int)} but for {@link FastScroller}
|
||||||
|
* it has a totally different meaning.
|
||||||
|
* @param orientation of the {@link FastScroller}. {@link #VERTICAL} or {@link #HORIZONTAL}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void setOrientation(int orientation) {
|
||||||
|
scrollerOrientation = orientation;
|
||||||
|
//switching orientation, because orientation in linear layout
|
||||||
|
//is something different than orientation of fast scroller
|
||||||
|
super.setOrientation(orientation == HORIZONTAL ? VERTICAL : HORIZONTAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the background color of the bubble.
|
||||||
|
* @param color Color in hex notation with alpha channel, e.g. 0xFFFFFFFF
|
||||||
|
*/
|
||||||
|
public void setBubbleColor(int color) {
|
||||||
|
bubbleColor = color;
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the background color of the handle.
|
||||||
|
* @param color Color in hex notation with alpha channel, e.g. 0xFFFFFFFF
|
||||||
|
*/
|
||||||
|
public void setHandleColor(int color) {
|
||||||
|
handleColor = color;
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the text appearance of the bubble.
|
||||||
|
* @param textAppearanceResourceId The id of the resource to be used as text appearance of the bubble.
|
||||||
|
*/
|
||||||
|
public void setBubbleTextAppearance(int textAppearanceResourceId){
|
||||||
|
bubbleTextAppearance = textAppearanceResourceId;
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a {@link it.integry.integrywmsnative.ui.fastscroll.RecyclerViewScrollListener.ScrollerListener}
|
||||||
|
* to be notified of user scrolling
|
||||||
|
* @param listener
|
||||||
|
*/
|
||||||
|
public void addScrollerListener(RecyclerViewScrollListener.ScrollerListener listener){
|
||||||
|
scrollListener.addScrollerListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||||
|
super.onLayout(changed, l, t, r, b);
|
||||||
|
|
||||||
|
initHandleMovement();
|
||||||
|
bubbleOffset = viewProvider.getBubbleOffset();
|
||||||
|
|
||||||
|
applyStyling(); //TODO this doesn't belong here, even if it works
|
||||||
|
|
||||||
|
if (!isInEditMode()) {
|
||||||
|
//sometimes recycler starts with a defined scroll (e.g. when coming from saved state)
|
||||||
|
scrollListener.updateHandlePosition(recyclerView);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void applyStyling() {
|
||||||
|
if(bubbleColor!=STYLE_NONE) setBackgroundTint(bubbleTextView, bubbleColor);
|
||||||
|
if(handleColor!=STYLE_NONE) setBackgroundTint(handle, handleColor);
|
||||||
|
if(bubbleTextAppearance!=STYLE_NONE) TextViewCompat.setTextAppearance(bubbleTextView, bubbleTextAppearance);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setBackgroundTint(View view, int color) {
|
||||||
|
final Drawable background = DrawableCompat.wrap(view.getBackground());
|
||||||
|
if(background==null) return;
|
||||||
|
DrawableCompat.setTint(background.mutate(), color);
|
||||||
|
Utils.setBackground(view, background);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initHandleMovement() {
|
||||||
|
handle.setOnTouchListener(new OnTouchListener() {
|
||||||
|
@Override
|
||||||
|
public boolean onTouch(View v, MotionEvent event) {
|
||||||
|
requestDisallowInterceptTouchEvent(true);
|
||||||
|
if (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_MOVE) {
|
||||||
|
if(titleProvider!=null && event.getAction() == MotionEvent.ACTION_DOWN) viewProvider.onHandleGrabbed();
|
||||||
|
manuallyChangingPosition = true;
|
||||||
|
float relativePos = getRelativeTouchPosition(event);
|
||||||
|
setScrollerPosition(relativePos);
|
||||||
|
setRecyclerViewPosition(relativePos);
|
||||||
|
return true;
|
||||||
|
} else if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||||
|
manuallyChangingPosition = false;
|
||||||
|
if(titleProvider!=null) viewProvider.onHandleReleased();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private float getRelativeTouchPosition(MotionEvent event){
|
||||||
|
if(isVertical()){
|
||||||
|
float yInParent = event.getRawY() - Utils.getViewRawY(handle);
|
||||||
|
return yInParent / (getHeight() - handle.getHeight());
|
||||||
|
} else {
|
||||||
|
float xInParent = event.getRawX() - Utils.getViewRawX(handle);
|
||||||
|
return xInParent / (getWidth() - handle.getWidth());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setVisibility(int visibility) {
|
||||||
|
maxVisibility = visibility;
|
||||||
|
invalidateVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void invalidateVisibility() {
|
||||||
|
if(
|
||||||
|
recyclerView.getAdapter()==null ||
|
||||||
|
recyclerView.getAdapter().getItemCount()==0 ||
|
||||||
|
recyclerView.getChildAt(0)==null ||
|
||||||
|
isRecyclerViewNotScrollable() ||
|
||||||
|
maxVisibility != View.VISIBLE
|
||||||
|
){
|
||||||
|
super.setVisibility(INVISIBLE);
|
||||||
|
} else {
|
||||||
|
super.setVisibility(VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isRecyclerViewNotScrollable() {
|
||||||
|
if(isVertical()) {
|
||||||
|
return recyclerView.getChildAt(0).getHeight() * recyclerView.getAdapter().getItemCount() <= recyclerView.getHeight();
|
||||||
|
} else {
|
||||||
|
return recyclerView.getChildAt(0).getWidth() * recyclerView.getAdapter().getItemCount() <= recyclerView.getWidth();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setRecyclerViewPosition(float relativePos) {
|
||||||
|
if (recyclerView == null) return;
|
||||||
|
int itemCount = recyclerView.getAdapter().getItemCount();
|
||||||
|
int targetPos = (int) Utils.getValueInRange(0, itemCount - 1, (int) (relativePos * (float) itemCount));
|
||||||
|
recyclerView.scrollToPosition(targetPos);
|
||||||
|
if(titleProvider!=null && bubbleTextView!=null) bubbleTextView.setText(titleProvider.getSectionTitle(targetPos));
|
||||||
|
}
|
||||||
|
|
||||||
|
void setScrollerPosition(float relativePos) {
|
||||||
|
if(isVertical()) {
|
||||||
|
bubble.setY(Utils.getValueInRange(
|
||||||
|
0,
|
||||||
|
getHeight() - bubble.getHeight(),
|
||||||
|
relativePos * (getHeight() - handle.getHeight()) + bubbleOffset)
|
||||||
|
);
|
||||||
|
handle.setY(Utils.getValueInRange(
|
||||||
|
0,
|
||||||
|
getHeight() - handle.getHeight(),
|
||||||
|
relativePos * (getHeight() - handle.getHeight()))
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
bubble.setX(Utils.getValueInRange(
|
||||||
|
0,
|
||||||
|
getWidth() - bubble.getWidth(),
|
||||||
|
relativePos * (getWidth() - handle.getWidth()) + bubbleOffset)
|
||||||
|
);
|
||||||
|
handle.setX(Utils.getValueInRange(
|
||||||
|
0,
|
||||||
|
getWidth() - handle.getWidth(),
|
||||||
|
relativePos * (getWidth() - handle.getWidth()))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isVertical(){
|
||||||
|
return scrollerOrientation == VERTICAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean shouldUpdateHandlePosition() {
|
||||||
|
return handle!=null && !manuallyChangingPosition && recyclerView.getChildCount() > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollerViewProvider getViewProvider() {
|
||||||
|
return viewProvider;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.fastscroll;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Michal on 04/08/16.
|
||||||
|
* Responsible for updating the handle / bubble position when user scrolls the {@link android.support.v7.widget.RecyclerView}.
|
||||||
|
*/
|
||||||
|
public class RecyclerViewScrollListener extends RecyclerView.OnScrollListener {
|
||||||
|
|
||||||
|
private final FastScroller scroller;
|
||||||
|
List<ScrollerListener> listeners = new ArrayList<>();
|
||||||
|
int oldScrollState = RecyclerView.SCROLL_STATE_IDLE;
|
||||||
|
|
||||||
|
public RecyclerViewScrollListener(FastScroller scroller) {
|
||||||
|
this.scroller = scroller;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addScrollerListener(ScrollerListener listener){
|
||||||
|
listeners.add(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onScrollStateChanged(RecyclerView recyclerView, int newScrollState) {
|
||||||
|
super.onScrollStateChanged(recyclerView, newScrollState);
|
||||||
|
if(newScrollState==RecyclerView.SCROLL_STATE_IDLE && oldScrollState!=RecyclerView.SCROLL_STATE_IDLE){
|
||||||
|
scroller.getViewProvider().onScrollFinished();
|
||||||
|
} else if(newScrollState!=RecyclerView.SCROLL_STATE_IDLE && oldScrollState==RecyclerView.SCROLL_STATE_IDLE){
|
||||||
|
scroller.getViewProvider().onScrollStarted();
|
||||||
|
}
|
||||||
|
oldScrollState = newScrollState;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onScrolled(RecyclerView rv, int dx, int dy) {
|
||||||
|
if(scroller.shouldUpdateHandlePosition()) {
|
||||||
|
updateHandlePosition(rv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateHandlePosition(RecyclerView rv) {
|
||||||
|
float relativePos;
|
||||||
|
if(rv != null) {
|
||||||
|
if (scroller.isVertical()) {
|
||||||
|
int offset = rv.computeVerticalScrollOffset();
|
||||||
|
int extent = rv.computeVerticalScrollExtent();
|
||||||
|
int range = rv.computeVerticalScrollRange();
|
||||||
|
relativePos = offset / (float) (range - extent);
|
||||||
|
} else {
|
||||||
|
int offset = rv.computeHorizontalScrollOffset();
|
||||||
|
int extent = rv.computeHorizontalScrollExtent();
|
||||||
|
int range = rv.computeHorizontalScrollRange();
|
||||||
|
relativePos = offset / (float) (range - extent);
|
||||||
|
}
|
||||||
|
scroller.setScrollerPosition(relativePos);
|
||||||
|
notifyListeners(relativePos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void notifyListeners(float relativePos){
|
||||||
|
for(ScrollerListener listener : listeners) listener.onScroll(relativePos);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface ScrollerListener {
|
||||||
|
void onScroll(float relativePos);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.fastscroll;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mklimczak on 31/07/15.
|
||||||
|
*/
|
||||||
|
public interface SectionTitleProvider{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Should be implemented by the adapter of the RecyclerView.
|
||||||
|
* Provides a text to be shown by the bubble, when RecyclerView reaches
|
||||||
|
* the position. Usually the first letter of the text shown by the item
|
||||||
|
* at this position.
|
||||||
|
* @param position Position of the row in adapter
|
||||||
|
* @return The text to be shown in the bubble
|
||||||
|
*/
|
||||||
|
String getSectionTitle(int position);
|
||||||
|
}
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.fastscroll;
|
||||||
|
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mklimczak on 31/07/15.
|
||||||
|
*/
|
||||||
|
public class Utils {
|
||||||
|
|
||||||
|
public static float getViewRawY(View view) {
|
||||||
|
int[] location = new int[2];
|
||||||
|
location[0] = 0;
|
||||||
|
location[1] = (int) view.getY();
|
||||||
|
((View)view.getParent()).getLocationInWindow(location);
|
||||||
|
return location[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static float getViewRawX(View view) {
|
||||||
|
int[] location = new int[2];
|
||||||
|
location[0] = (int) view.getX();
|
||||||
|
location[1] = 0;
|
||||||
|
((View)view.getParent()).getLocationInWindow(location);
|
||||||
|
return location[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static float getValueInRange(float min, float max, float value) {
|
||||||
|
float minimum = Math.max(min, value);
|
||||||
|
return Math.min(minimum, max);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setBackground(View view, Drawable drawable){
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
||||||
|
view.setBackground(drawable);
|
||||||
|
} else {
|
||||||
|
view.setBackgroundDrawable(drawable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.fastscroll.viewprovider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Michal on 11/08/16.
|
||||||
|
*/
|
||||||
|
public class DefaultBubbleBehavior implements ViewBehavior {
|
||||||
|
|
||||||
|
private final VisibilityAnimationManager animationManager;
|
||||||
|
|
||||||
|
public DefaultBubbleBehavior(VisibilityAnimationManager animationManager) {
|
||||||
|
this.animationManager = animationManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onHandleGrabbed() {
|
||||||
|
animationManager.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onHandleReleased() {
|
||||||
|
animationManager.hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onScrollStarted() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onScrollFinished() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,66 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.fastscroll.viewprovider;
|
||||||
|
|
||||||
|
import android.graphics.drawable.InsetDrawable;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.ui.fastscroll.Utils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Michal on 05/08/16.
|
||||||
|
*/
|
||||||
|
public class DefaultScrollerViewProvider extends ScrollerViewProvider {
|
||||||
|
|
||||||
|
protected View bubble;
|
||||||
|
protected View handle;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View provideHandleView(ViewGroup container) {
|
||||||
|
handle = new View(getContext());
|
||||||
|
|
||||||
|
int verticalInset = getScroller().isVertical() ? 0 : getContext().getResources().getDimensionPixelSize(R.dimen.fastscroll__handle_inset);
|
||||||
|
int horizontalInset = !getScroller().isVertical() ? 0 : getContext().getResources().getDimensionPixelSize(R.dimen.fastscroll__handle_inset);
|
||||||
|
InsetDrawable handleBg = new InsetDrawable(ContextCompat.getDrawable(getContext(), R.drawable.fastscroll__default_handle), horizontalInset, verticalInset, horizontalInset, verticalInset);
|
||||||
|
Utils.setBackground(handle, handleBg);
|
||||||
|
|
||||||
|
int handleWidth = getContext().getResources().getDimensionPixelSize(getScroller().isVertical() ? R.dimen.fastscroll__handle_clickable_width : R.dimen.fastscroll__handle_height);
|
||||||
|
int handleHeight = getContext().getResources().getDimensionPixelSize(getScroller().isVertical() ? R.dimen.fastscroll__handle_height : R.dimen.fastscroll__handle_clickable_width);
|
||||||
|
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(handleWidth, handleHeight);
|
||||||
|
handle.setLayoutParams(params);
|
||||||
|
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View provideBubbleView(ViewGroup container) {
|
||||||
|
bubble = LayoutInflater.from(getContext()).inflate(R.layout.fastscroll__default_bubble, container, false);
|
||||||
|
return bubble;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TextView provideBubbleTextView() {
|
||||||
|
return (TextView) bubble;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getBubbleOffset() {
|
||||||
|
return (int) (getScroller().isVertical() ? ((float)handle.getHeight()/2f)-bubble.getHeight() : ((float)handle.getWidth()/2f)-bubble.getWidth());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ViewBehavior provideHandleBehavior() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ViewBehavior provideBubbleBehavior() {
|
||||||
|
return new DefaultBubbleBehavior(new VisibilityAnimationManager.Builder(bubble).withPivotX(1f).withPivotY(1f).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,95 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.fastscroll.viewprovider;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.ui.fastscroll.FastScroller;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Michal on 05/08/16.
|
||||||
|
* Provides {@link View}s and their behaviors for the handle and bubble of the fastscroller.
|
||||||
|
*/
|
||||||
|
public abstract class ScrollerViewProvider {
|
||||||
|
|
||||||
|
private FastScroller scroller;
|
||||||
|
private ViewBehavior handleBehavior;
|
||||||
|
private ViewBehavior bubbleBehavior;
|
||||||
|
|
||||||
|
public void setFastScroller(FastScroller scroller){
|
||||||
|
this.scroller = scroller;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Context getContext(){
|
||||||
|
return scroller.getContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected FastScroller getScroller() {
|
||||||
|
return scroller;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param container The container {@link FastScroller} for the view to inflate properly.
|
||||||
|
* @return A view which will be by the {@link FastScroller} used as a handle.
|
||||||
|
*/
|
||||||
|
public abstract View provideHandleView(ViewGroup container);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param container The container {@link FastScroller} for the view to inflate properly.
|
||||||
|
* @return A view which will be by the {@link FastScroller} used as a bubble.
|
||||||
|
*/
|
||||||
|
public abstract View provideBubbleView(ViewGroup container);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bubble view has to provide a {@link TextView} that will show the index title.
|
||||||
|
* @return A {@link TextView} that will hold the index title.
|
||||||
|
*/
|
||||||
|
public abstract TextView provideBubbleTextView();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To offset the position of the bubble relative to the handle. E.g. in {@link DefaultScrollerViewProvider}
|
||||||
|
* the sharp corner of the bubble is aligned with the center of the handle.
|
||||||
|
* @return the position of the bubble in relation to the handle (according to the orientation).
|
||||||
|
*/
|
||||||
|
public abstract int getBubbleOffset();
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
protected abstract ViewBehavior provideHandleBehavior();
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
protected abstract ViewBehavior provideBubbleBehavior();
|
||||||
|
|
||||||
|
protected ViewBehavior getHandleBehavior(){
|
||||||
|
if(handleBehavior==null) handleBehavior = provideHandleBehavior();
|
||||||
|
return handleBehavior;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ViewBehavior getBubbleBehavior(){
|
||||||
|
if(bubbleBehavior==null) bubbleBehavior = provideBubbleBehavior();
|
||||||
|
return bubbleBehavior;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onHandleGrabbed(){
|
||||||
|
if(getHandleBehavior()!=null) getHandleBehavior().onHandleGrabbed();
|
||||||
|
if(getBubbleBehavior()!=null) getBubbleBehavior().onHandleGrabbed();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onHandleReleased(){
|
||||||
|
if(getHandleBehavior()!=null) getHandleBehavior().onHandleReleased();
|
||||||
|
if(getBubbleBehavior()!=null) getBubbleBehavior().onHandleReleased();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onScrollStarted(){
|
||||||
|
if(getHandleBehavior()!=null) getHandleBehavior().onScrollStarted();
|
||||||
|
if(getBubbleBehavior()!=null) getBubbleBehavior().onScrollStarted();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onScrollFinished(){
|
||||||
|
if(getHandleBehavior()!=null) getHandleBehavior().onScrollFinished();
|
||||||
|
if(getBubbleBehavior()!=null) getBubbleBehavior().onScrollFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.fastscroll.viewprovider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Michal on 11/08/16.
|
||||||
|
* Extending classes should use this interface to get notified about events that occur to the
|
||||||
|
* fastscroller elements (handle and bubble) and react accordingly. See {@link DefaultBubbleBehavior}
|
||||||
|
* for an example.
|
||||||
|
*/
|
||||||
|
public interface ViewBehavior {
|
||||||
|
void onHandleGrabbed();
|
||||||
|
void onHandleReleased();
|
||||||
|
void onScrollStarted();
|
||||||
|
void onScrollFinished();
|
||||||
|
}
|
||||||
@ -0,0 +1,130 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.fastscroll.viewprovider;
|
||||||
|
|
||||||
|
import android.animation.Animator;
|
||||||
|
import android.animation.AnimatorInflater;
|
||||||
|
import android.animation.AnimatorListenerAdapter;
|
||||||
|
import android.animation.AnimatorSet;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.AnimatorRes;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Michal on 05/08/16.
|
||||||
|
* Animates showing and hiding elements of the {@link it.integry.integrywmsnative.ui.fastscroll.FastScroller} (handle and bubble).
|
||||||
|
* The decision when to show/hide the element should be implemented via {@link ViewBehavior}.
|
||||||
|
*/
|
||||||
|
public class VisibilityAnimationManager {
|
||||||
|
|
||||||
|
protected final View view;
|
||||||
|
|
||||||
|
protected AnimatorSet hideAnimator;
|
||||||
|
protected AnimatorSet showAnimator;
|
||||||
|
|
||||||
|
private float pivotXRelative;
|
||||||
|
private float pivotYRelative;
|
||||||
|
|
||||||
|
protected VisibilityAnimationManager(final View view, @AnimatorRes int showAnimator, @AnimatorRes int hideAnimator, float pivotXRelative, float pivotYRelative, int hideDelay){
|
||||||
|
this.view = view;
|
||||||
|
this.pivotXRelative = pivotXRelative;
|
||||||
|
this.pivotYRelative = pivotYRelative;
|
||||||
|
this.hideAnimator = (AnimatorSet) AnimatorInflater.loadAnimator(view.getContext(), hideAnimator);
|
||||||
|
this.hideAnimator.setStartDelay(hideDelay);
|
||||||
|
this.hideAnimator.setTarget(view);
|
||||||
|
this.showAnimator = (AnimatorSet) AnimatorInflater.loadAnimator(view.getContext(), showAnimator);
|
||||||
|
this.showAnimator.setTarget(view);
|
||||||
|
this.hideAnimator.addListener(new AnimatorListenerAdapter() {
|
||||||
|
|
||||||
|
//because onAnimationEnd() goes off even for canceled animations
|
||||||
|
boolean wasCanceled;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animation) {
|
||||||
|
super.onAnimationEnd(animation);
|
||||||
|
if(!wasCanceled) view.setVisibility(View.INVISIBLE);
|
||||||
|
wasCanceled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationCancel(Animator animation) {
|
||||||
|
super.onAnimationCancel(animation);
|
||||||
|
wasCanceled = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
updatePivot();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void show(){
|
||||||
|
hideAnimator.cancel();
|
||||||
|
if (view.getVisibility() == View.INVISIBLE) {
|
||||||
|
view.setVisibility(View.VISIBLE);
|
||||||
|
updatePivot();
|
||||||
|
showAnimator.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void hide(){
|
||||||
|
updatePivot();
|
||||||
|
hideAnimator.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void updatePivot() {
|
||||||
|
view.setPivotX(pivotXRelative*view.getMeasuredWidth());
|
||||||
|
view.setPivotY(pivotYRelative*view.getMeasuredHeight());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static abstract class AbsBuilder<T extends VisibilityAnimationManager> {
|
||||||
|
protected final View view;
|
||||||
|
protected int showAnimatorResource = R.animator.fastscroll__default_show;
|
||||||
|
protected int hideAnimatorResource = R.animator.fastscroll__default_hide;
|
||||||
|
protected int hideDelay = 1000;
|
||||||
|
protected float pivotX = 0.5f;
|
||||||
|
protected float pivotY = 0.5f;
|
||||||
|
|
||||||
|
public AbsBuilder(View view) {
|
||||||
|
this.view = view;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AbsBuilder<T> withShowAnimator(@AnimatorRes int showAnimatorResource){
|
||||||
|
this.showAnimatorResource = showAnimatorResource;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AbsBuilder<T> withHideAnimator(@AnimatorRes int hideAnimatorResource){
|
||||||
|
this.hideAnimatorResource = hideAnimatorResource;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AbsBuilder<T> withHideDelay(int hideDelay){
|
||||||
|
this.hideDelay = hideDelay;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AbsBuilder<T> withPivotX(float pivotX){
|
||||||
|
this.pivotX = pivotX;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AbsBuilder<T> withPivotY(float pivotY){
|
||||||
|
this.pivotY = pivotY;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract T build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Builder extends AbsBuilder<VisibilityAnimationManager> {
|
||||||
|
|
||||||
|
public Builder(View view) {
|
||||||
|
super(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
public VisibilityAnimationManager build(){
|
||||||
|
return new VisibilityAnimationManager(view, showAnimatorResource, hideAnimatorResource, pivotX, pivotY, hideDelay);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
28
app/src/main/res/animator/fastscroll__default_hide.xml
Normal file
28
app/src/main/res/animator/fastscroll__default_hide.xml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:ordering="together"
|
||||||
|
android:interpolator="@android:anim/accelerate_interpolator"
|
||||||
|
>
|
||||||
|
|
||||||
|
<objectAnimator
|
||||||
|
android:propertyName="scaleX"
|
||||||
|
android:valueFrom="1.0"
|
||||||
|
android:valueTo="0.0"
|
||||||
|
android:duration="200"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<objectAnimator
|
||||||
|
android:propertyName="scaleY"
|
||||||
|
android:valueFrom="1.0"
|
||||||
|
android:valueTo="0.0"
|
||||||
|
android:duration="200"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<objectAnimator
|
||||||
|
android:propertyName="alpha"
|
||||||
|
android:valueFrom="1.0"
|
||||||
|
android:valueTo="0.0"
|
||||||
|
android:duration="200"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</set>
|
||||||
24
app/src/main/res/animator/fastscroll__default_show.xml
Normal file
24
app/src/main/res/animator/fastscroll__default_show.xml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:ordering="together"
|
||||||
|
android:interpolator="@android:anim/decelerate_interpolator">
|
||||||
|
|
||||||
|
<objectAnimator
|
||||||
|
android:propertyName="scaleX"
|
||||||
|
android:valueFrom="0.0"
|
||||||
|
android:valueTo="1.0"
|
||||||
|
android:duration="200"/>
|
||||||
|
|
||||||
|
<objectAnimator
|
||||||
|
android:propertyName="scaleY"
|
||||||
|
android:valueFrom="0.0"
|
||||||
|
android:valueTo="1.0"
|
||||||
|
android:duration="200"/>
|
||||||
|
|
||||||
|
<objectAnimator
|
||||||
|
android:propertyName="alpha"
|
||||||
|
android:valueFrom="0.0"
|
||||||
|
android:valueTo="1.0"
|
||||||
|
android:duration="200"/>
|
||||||
|
|
||||||
|
</set>
|
||||||
10
app/src/main/res/drawable/fast_scroll_thumb.xml
Normal file
10
app/src/main/res/drawable/fast_scroll_thumb.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<solid android:color="@color/colorAccent"/>
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="50dp"
|
||||||
|
android:bottomRightRadius="0dp"
|
||||||
|
android:topLeftRadius="50dp"
|
||||||
|
android:topRightRadius="50dp"/>
|
||||||
|
</shape>
|
||||||
10
app/src/main/res/drawable/fastscroll__default_bubble.xml
Normal file
10
app/src/main/res/drawable/fastscroll__default_bubble.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<corners
|
||||||
|
android:topLeftRadius="@dimen/fastscroll__bubble_corner"
|
||||||
|
android:topRightRadius="@dimen/fastscroll__bubble_corner"
|
||||||
|
android:bottomLeftRadius="@dimen/fastscroll__bubble_corner"
|
||||||
|
android:bottomRightRadius="0dp" />
|
||||||
|
<solid android:color="@android:color/white" />
|
||||||
|
</shape>
|
||||||
5
app/src/main/res/drawable/fastscroll__default_handle.xml
Normal file
5
app/src/main/res/drawable/fastscroll__default_handle.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
<corners android:radius="@dimen/fastscroll__handle_corner" />
|
||||||
|
<solid android:color="@android:color/darker_gray" />
|
||||||
|
</shape>
|
||||||
12
app/src/main/res/drawable/gray_detail_background_round4.xml
Normal file
12
app/src/main/res/drawable/gray_detail_background_round4.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
|
|
||||||
|
<solid android:color="#ebebeb" />
|
||||||
|
|
||||||
|
<padding
|
||||||
|
android:left="1dp"
|
||||||
|
android:right="1dp"
|
||||||
|
android:top="1dp" />
|
||||||
|
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
BIN
app/src/main/res/font/product_sans_black.ttf
Normal file
BIN
app/src/main/res/font/product_sans_black.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/product_sans_black_italic.ttf
Normal file
BIN
app/src/main/res/font/product_sans_black_italic.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/product_sans_bold.ttf
Normal file
BIN
app/src/main/res/font/product_sans_bold.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/product_sans_bold_italic.ttf
Normal file
BIN
app/src/main/res/font/product_sans_bold_italic.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/product_sans_italic.ttf
Normal file
BIN
app/src/main/res/font/product_sans_italic.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/product_sans_light.ttf
Normal file
BIN
app/src/main/res/font/product_sans_light.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/product_sans_light_italic.ttf
Normal file
BIN
app/src/main/res/font/product_sans_light_italic.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/product_sans_medium.ttf
Normal file
BIN
app/src/main/res/font/product_sans_medium.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/product_sans_medium_italic.ttf
Normal file
BIN
app/src/main/res/font/product_sans_medium_italic.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/product_sans_regular.ttf
Normal file
BIN
app/src/main/res/font/product_sans_regular.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/product_sans_thin.ttf
Normal file
BIN
app/src/main/res/font/product_sans_thin.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/product_sans_thin_italic.ttf
Normal file
BIN
app/src/main/res/font/product_sans_thin_italic.ttf
Normal file
Binary file not shown.
@ -47,7 +47,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/integry"
|
android:text="@string/integry"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:letterSpacing="-0.05"
|
|
||||||
style="@style/AppTheme.NewMaterial.Text.ToolbarTitle"
|
style="@style/AppTheme.NewMaterial.Text.ToolbarTitle"
|
||||||
android:layout_gravity="center"/>
|
android:layout_gravity="center"/>
|
||||||
|
|
||||||
@ -59,7 +58,6 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/app_name"
|
android:text="@string/app_name"
|
||||||
android:letterSpacing="-0.05"
|
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
style="@style/AppTheme.NewMaterial.Text.ToolbarTitle"/>
|
style="@style/AppTheme.NewMaterial.Text.ToolbarTitle"/>
|
||||||
|
|
||||||
|
|||||||
@ -129,6 +129,7 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="@id/left_buttons_guideline"
|
app:layout_constraintStart_toStartOf="@id/left_buttons_guideline"
|
||||||
app:layout_constraintEnd_toStartOf="@id/right_buttons_guideline"
|
app:layout_constraintEnd_toStartOf="@id/right_buttons_guideline"
|
||||||
|
app:strokeColor="@color/colorPrimary"
|
||||||
android:onClick="@{() -> viewmodel.onNeutralClick()}"
|
android:onClick="@{() -> viewmodel.onNeutralClick()}"
|
||||||
android:text="@string/abort"/>
|
android:text="@string/abort"/>
|
||||||
|
|
||||||
@ -171,6 +172,7 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/center_guideline"
|
app:layout_constraintEnd_toStartOf="@id/center_guideline"
|
||||||
|
app:strokeColor="@color/colorPrimary"
|
||||||
android:onClick="@{() -> viewmodel.onNegativeClick()}"
|
android:onClick="@{() -> viewmodel.onNegativeClick()}"
|
||||||
android:text="@string/no"/>
|
android:text="@string/no"/>
|
||||||
|
|
||||||
|
|||||||
13
app/src/main/res/layout/fastscroll__default_bubble.xml
Normal file
13
app/src/main/res/layout/fastscroll__default_bubble.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="64dp"
|
||||||
|
android:layout_height="64dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:background="@drawable/fastscroll__default_bubble"
|
||||||
|
android:visibility="invisible"
|
||||||
|
android:elevation="2dp"
|
||||||
|
android:layout_margin="1dp"
|
||||||
|
tools:text="A"
|
||||||
|
tools:visibility="visible" />
|
||||||
@ -57,19 +57,32 @@
|
|||||||
android:textAllCaps="true"
|
android:textAllCaps="true"
|
||||||
android:textSize="16sp"/>
|
android:textSize="16sp"/>
|
||||||
|
|
||||||
<Button
|
<!--<Button-->
|
||||||
|
<!--android:id="@+id/articoli_in_collo_close_collo"-->
|
||||||
|
<!--android:layout_width="wrap_content"-->
|
||||||
|
<!--android:layout_height="wrap_content"-->
|
||||||
|
<!--android:text="@string/action_close_ul"-->
|
||||||
|
<!--android:textSize="16sp"-->
|
||||||
|
<!--android:layout_alignParentEnd="true"-->
|
||||||
|
<!--android:theme="@style/white_button"-->
|
||||||
|
<!--android:drawableEnd="@drawable/ic_close_red_24dp"-->
|
||||||
|
<!--android:drawablePadding="8dp"-->
|
||||||
|
<!--android:onClick="@{() -> viewModel.closeCurrentUL()}"-->
|
||||||
|
<!--android:drawableTint="@color/red_600"-->
|
||||||
|
<!--android:textColor="@color/red_600"/>-->
|
||||||
|
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/articoli_in_collo_close_collo"
|
android:id="@+id/articoli_in_collo_close_collo"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/action_close_ul"
|
style="@style/Button.DangerOutline"
|
||||||
android:textSize="16sp"
|
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:theme="@style/white_button"
|
android:layout_marginLeft="8dp"
|
||||||
android:drawableEnd="@drawable/ic_close_red_24dp"
|
android:layout_marginRight="8dp"
|
||||||
android:drawablePadding="8dp"
|
android:text="@string/action_close_ul"
|
||||||
android:onClick="@{() -> viewModel.closeCurrentUL()}"
|
android:onClick="@{() -> viewModel.closeCurrentUL()}"
|
||||||
android:drawableTint="@color/red_600"
|
app:strokeColor="@color/red_600"/>
|
||||||
android:textColor="@color/red_600"/>
|
|
||||||
|
|
||||||
<!--<android.support.v7.widget.AppCompatButton-->
|
<!--<android.support.v7.widget.AppCompatButton-->
|
||||||
<!--android:id="@+id/articoli_in_collo_close_collo"-->
|
<!--android:id="@+id/articoli_in_collo_close_collo"-->
|
||||||
|
|||||||
@ -436,266 +436,6 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
<!---->
|
|
||||||
<!--<androidx.cardview.widget.CardView-->
|
|
||||||
<!--app:cardBackgroundColor="@android:color/white"-->
|
|
||||||
<!--app:cardCornerRadius="4dp"-->
|
|
||||||
<!--android:layout_marginLeft="10dp"-->
|
|
||||||
<!--android:layout_marginRight="10dp"-->
|
|
||||||
<!--android:layout_marginBottom="10dp"-->
|
|
||||||
<!--android:layout_marginTop="10dp"-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content">-->
|
|
||||||
|
|
||||||
<!--<LinearLayout-->
|
|
||||||
<!--android:orientation="vertical"-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content">-->
|
|
||||||
|
|
||||||
<!--<TextView-->
|
|
||||||
<!--android:textColor="@android:color/black"-->
|
|
||||||
<!--android:layout_marginTop="10dp"-->
|
|
||||||
<!--android:layout_marginLeft="10dp"-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:text="Informazioni generali"-->
|
|
||||||
<!--android:textAllCaps="true"-->
|
|
||||||
<!--android:textStyle="bold"/>-->
|
|
||||||
|
|
||||||
<!--<LinearLayout-->
|
|
||||||
<!--android:padding="15dp"-->
|
|
||||||
<!--android:orientation="vertical"-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content">-->
|
|
||||||
|
|
||||||
<!--<androidx.constraintlayout.widget.ConstraintLayout-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content">-->
|
|
||||||
|
|
||||||
<!--<androidx.constraintlayout.widget.Guideline-->
|
|
||||||
<!--android:id="@+id/guideline_username"-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:orientation="vertical"-->
|
|
||||||
<!--app:layout_constraintGuide_percent="0.40"/>-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--</androidx.constraintlayout.widget.ConstraintLayout>-->
|
|
||||||
|
|
||||||
<!--<androidx.constraintlayout.widget.ConstraintLayout-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content">-->
|
|
||||||
|
|
||||||
<!--<androidx.constraintlayout.widget.Guideline-->
|
|
||||||
<!--android:id="@+id/guideline1"-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:orientation="vertical"-->
|
|
||||||
<!--app:layout_constraintGuide_percent="0.40"/>-->
|
|
||||||
|
|
||||||
<!--<TextView-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:layout_marginStart="8dp"-->
|
|
||||||
<!--android:text="Segnale WI-FI"-->
|
|
||||||
<!--android:textColor="@android:color/black"-->
|
|
||||||
<!--app:layout_constraintEnd_toStartOf="@+id/guideline"-->
|
|
||||||
<!--app:layout_constraintStart_toStartOf="parent" />-->
|
|
||||||
|
|
||||||
<!--<TextView-->
|
|
||||||
<!--android:id="@+id/wifi_power"-->
|
|
||||||
<!--android:layout_width="0dp"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:layout_marginEnd="0dp"-->
|
|
||||||
<!--android:layout_marginStart="0dp"-->
|
|
||||||
<!--android:text="N/A"-->
|
|
||||||
<!--android:textSize="16sp"-->
|
|
||||||
<!--app:layout_constraintStart_toStartOf="@+id/guideline1"-->
|
|
||||||
<!--app:layout_constraintEnd_toEndOf="parent" />-->
|
|
||||||
|
|
||||||
<!--</androidx.constraintlayout.widget.ConstraintLayout>-->
|
|
||||||
|
|
||||||
<!--</LinearLayout>-->
|
|
||||||
|
|
||||||
<!--</LinearLayout>-->
|
|
||||||
<!--</androidx.cardview.widget.CardView>-->
|
|
||||||
|
|
||||||
<!--<androidx.cardview.widget.CardView-->
|
|
||||||
<!--app:cardBackgroundColor="@android:color/white"-->
|
|
||||||
<!--app:cardCornerRadius="4dp"-->
|
|
||||||
<!--android:layout_marginLeft="10dp"-->
|
|
||||||
<!--android:layout_marginRight="10dp"-->
|
|
||||||
<!--android:layout_marginBottom="10dp"-->
|
|
||||||
<!--android:layout_marginTop="10dp"-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content">-->
|
|
||||||
|
|
||||||
<!--<LinearLayout-->
|
|
||||||
<!--android:orientation="vertical"-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content">-->
|
|
||||||
|
|
||||||
<!--<TextView-->
|
|
||||||
<!--android:textColor="@android:color/black"-->
|
|
||||||
<!--android:layout_marginTop="10dp"-->
|
|
||||||
<!--android:layout_marginLeft="10dp"-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:text="Azioni rapide"-->
|
|
||||||
<!--android:textAllCaps="true"-->
|
|
||||||
<!--android:textStyle="bold"/>-->
|
|
||||||
|
|
||||||
<!--<LinearLayout-->
|
|
||||||
<!--android:layout_margin="15dp"-->
|
|
||||||
<!--android:orientation="vertical"-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content">-->
|
|
||||||
|
|
||||||
<!--<LinearLayout-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:orientation="horizontal"-->
|
|
||||||
<!--android:weightSum="1">-->
|
|
||||||
|
|
||||||
<!--<LinearLayout-->
|
|
||||||
<!--android:id="@+id/fast_button_accettazione"-->
|
|
||||||
<!--android:layout_width="0dp"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:orientation="vertical"-->
|
|
||||||
<!--android:layout_weight="0.5"-->
|
|
||||||
<!--android:gravity="center">-->
|
|
||||||
|
|
||||||
<!--<androidx.appcompat.widget.AppCompatImageView-->
|
|
||||||
<!--android:layout_width="36dp"-->
|
|
||||||
<!--android:layout_height="36dp"-->
|
|
||||||
<!--android:layout_margin="8dp"-->
|
|
||||||
<!--android:background="@android:color/white"-->
|
|
||||||
<!--android:src="@drawable/ic_download_black_24dp"-->
|
|
||||||
<!--android:tint="@color/mainGreen" />-->
|
|
||||||
|
|
||||||
<!--<androidx.appcompat.widget.AppCompatTextView-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:text="Accettazione"-->
|
|
||||||
<!--android:gravity="center_horizontal"/>-->
|
|
||||||
|
|
||||||
<!--</LinearLayout>-->
|
|
||||||
|
|
||||||
<!--<LinearLayout-->
|
|
||||||
<!--android:id="@+id/fast_button_spedizione"-->
|
|
||||||
<!--android:layout_width="0dp"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:orientation="vertical"-->
|
|
||||||
<!--android:layout_weight="0.5"-->
|
|
||||||
<!--android:gravity="center">-->
|
|
||||||
|
|
||||||
<!--<androidx.appcompat.widget.AppCompatImageView-->
|
|
||||||
<!--android:layout_width="36dp"-->
|
|
||||||
<!--android:layout_height="36dp"-->
|
|
||||||
<!--android:layout_margin="8dp"-->
|
|
||||||
<!--android:background="@android:color/white"-->
|
|
||||||
<!--android:src="@drawable/ic_upload_black_24dp"-->
|
|
||||||
<!--android:tint="@color/mainOrange" />-->
|
|
||||||
|
|
||||||
<!--<androidx.appcompat.widget.AppCompatTextView-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:text="Spedizione"-->
|
|
||||||
<!--android:gravity="center_horizontal"/>-->
|
|
||||||
|
|
||||||
<!--</LinearLayout>-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--</LinearLayout>-->
|
|
||||||
|
|
||||||
<!--<LinearLayout-->
|
|
||||||
<!--android:layout_width="match_parent"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:orientation="horizontal"-->
|
|
||||||
<!--android:layout_marginTop="16dp"-->
|
|
||||||
<!--android:weightSum="0.9">-->
|
|
||||||
|
|
||||||
<!--<LinearLayout-->
|
|
||||||
<!--android:id="@+id/fast_button_rettifica_giacenze"-->
|
|
||||||
<!--android:layout_width="0dp"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:orientation="vertical"-->
|
|
||||||
<!--android:layout_weight="0.3"-->
|
|
||||||
<!--android:gravity="center">-->
|
|
||||||
|
|
||||||
<!--<androidx.appcompat.widget.AppCompatImageView-->
|
|
||||||
<!--android:layout_width="36dp"-->
|
|
||||||
<!--android:layout_height="36dp"-->
|
|
||||||
<!--android:layout_margin="8dp"-->
|
|
||||||
<!--android:background="@android:color/white"-->
|
|
||||||
<!--android:src="@drawable/ic_empty_box_96"-->
|
|
||||||
<!--android:tint="@color/brown_500" />-->
|
|
||||||
|
|
||||||
<!--<androidx.appcompat.widget.AppCompatTextView-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:text="Rettifica Giacenze"-->
|
|
||||||
<!--android:gravity="center_horizontal"/>-->
|
|
||||||
|
|
||||||
<!--</LinearLayout>-->
|
|
||||||
|
|
||||||
<!--<LinearLayout-->
|
|
||||||
<!--android:id="@+id/fast_button_versamento"-->
|
|
||||||
<!--android:layout_width="0dp"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:orientation="vertical"-->
|
|
||||||
<!--android:layout_weight="0.3"-->
|
|
||||||
<!--android:gravity="center">-->
|
|
||||||
|
|
||||||
<!--<androidx.appcompat.widget.AppCompatImageView-->
|
|
||||||
<!--android:layout_width="36dp"-->
|
|
||||||
<!--android:layout_height="36dp"-->
|
|
||||||
<!--android:layout_margin="8dp"-->
|
|
||||||
<!--android:background="@android:color/white"-->
|
|
||||||
<!--android:src="@drawable/ic_load_shelf_96"-->
|
|
||||||
<!--android:tint="@color/teal_500" />-->
|
|
||||||
|
|
||||||
<!--<androidx.appcompat.widget.AppCompatTextView-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:gravity="center_horizontal"-->
|
|
||||||
<!--android:text="Versamento Merce"/>-->
|
|
||||||
|
|
||||||
<!--</LinearLayout>-->
|
|
||||||
|
|
||||||
<!--<LinearLayout-->
|
|
||||||
<!--android:id="@+id/fast_button_picking_libero"-->
|
|
||||||
<!--android:layout_width="0dp"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:orientation="vertical"-->
|
|
||||||
<!--android:layout_weight="0.3"-->
|
|
||||||
<!--android:gravity="center">-->
|
|
||||||
|
|
||||||
<!--<androidx.appcompat.widget.AppCompatImageView-->
|
|
||||||
<!--android:layout_width="36dp"-->
|
|
||||||
<!--android:layout_height="36dp"-->
|
|
||||||
<!--android:layout_margin="8dp"-->
|
|
||||||
<!--android:adjustViewBounds="true"-->
|
|
||||||
<!--android:scaleType="centerInside"-->
|
|
||||||
<!--android:background="@android:color/white"-->
|
|
||||||
<!--android:src="@drawable/ic_barcode_96"-->
|
|
||||||
<!--android:tint="@color/colorPrimary" />-->
|
|
||||||
|
|
||||||
<!--<androidx.appcompat.widget.AppCompatTextView-->
|
|
||||||
<!--android:layout_width="wrap_content"-->
|
|
||||||
<!--android:layout_height="wrap_content"-->
|
|
||||||
<!--android:text="@string/free_picking"-->
|
|
||||||
<!--android:gravity="center_horizontal"/>-->
|
|
||||||
|
|
||||||
<!--</LinearLayout>-->
|
|
||||||
|
|
||||||
|
|
||||||
<!--</LinearLayout>-->
|
|
||||||
|
|
||||||
<!--</LinearLayout>-->
|
|
||||||
|
|
||||||
<!--</LinearLayout>-->
|
|
||||||
<!--</androidx.cardview.widget.CardView>-->
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|||||||
@ -10,60 +10,28 @@
|
|||||||
</data>
|
</data>
|
||||||
|
|
||||||
|
|
||||||
<FrameLayout
|
<RelativeLayout
|
||||||
android:background="@android:color/white"
|
android:background="@android:color/white"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".gest.ultime_consegne_cliente.UltimeConsegneClienteFragment">
|
tools:context=".gest.ultime_consegne_cliente.UltimeConsegneClienteFragment">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:background="@android:color/white"
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/card_view"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
card_view:cardUseCompatPadding="true"
|
android:id="@+id/recyclerView"
|
||||||
card_view:cardCornerRadius="4dp"
|
android:scrollbars="none"
|
||||||
card_view:cardElevation="4dp">
|
android:paddingStart="4dp"
|
||||||
|
android:paddingEnd="4dp"/>
|
||||||
|
|
||||||
<LinearLayout
|
<it.integry.integrywmsnative.ui.fastscroll.FastScroller
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/fastscroll"
|
||||||
android:layout_height="match_parent"
|
android:orientation="vertical"
|
||||||
android:orientation="vertical">
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
<LinearLayout
|
android:layout_alignParentEnd="true"/>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@color/white"
|
|
||||||
android:padding="8dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/cardview_title"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textColor="@android:color/black"
|
|
||||||
android:textStyle="bold"
|
|
||||||
style="@android:style/TextAppearance.Medium"
|
|
||||||
android:text="NOME GRUPPO"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
</RelativeLayout>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:id="@+id/accettazione_main_list_group_item_container">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
</layout>
|
</layout>
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:orientation="vertical" android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<!--<androidx.cardview.widget.CardView-->
|
||||||
|
<!--xmlns:card_view="http://schemas.android.com/apk/res-auto"-->
|
||||||
|
<!--android:id="@+id/card_view"-->
|
||||||
|
<!--android:layout_width="match_parent"-->
|
||||||
|
<!--android:layout_height="wrap_content"-->
|
||||||
|
<!--card_view:cardUseCompatPadding="true"-->
|
||||||
|
<!--card_view:cardCornerRadius="4dp"-->
|
||||||
|
<!--card_view:cardElevation="4dp">-->
|
||||||
|
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:paddingBottom="4dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.ListDivider"
|
||||||
|
android:textAllCaps="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
tools:text="Title here"/>
|
||||||
|
|
||||||
|
<!--<com.google.android.material.button.MaterialButton-->
|
||||||
|
<!--android:id="@+id/select_all_button"-->
|
||||||
|
<!--android:layout_width="wrap_content"-->
|
||||||
|
<!--android:layout_height="wrap_content"-->
|
||||||
|
<!--style="@style/Button.PrimaryOutline"-->
|
||||||
|
<!--app:strokeColor="@color/colorPrimary"-->
|
||||||
|
<!--android:layout_alignParentEnd="true"-->
|
||||||
|
<!--android:textSize="13sp"-->
|
||||||
|
<!--android:text="@string/action_select_all"/>-->
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<!--</androidx.cardview.widget.CardView>-->
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</layout>
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<import type="it.integry.integrywmsnative.R" />
|
||||||
|
<variable
|
||||||
|
name="checkableItem"
|
||||||
|
type="it.integry.integrywmsnative.gest.ultime_consegne_cliente.dto.CheckableConsegnaClienteDTO" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="2dp"
|
||||||
|
android:layout_marginStart="4dp"
|
||||||
|
android:layout_marginBottom="2dp"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/start_icon"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/description_main"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@android:color/black"
|
||||||
|
android:textStyle="italic"
|
||||||
|
style="@android:style/TextAppearance.Medium"
|
||||||
|
tools:text="TITLE"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/date"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text"
|
||||||
|
android:textColor="@color/colorPrimaryGray"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:textSize="14sp"
|
||||||
|
tools:text="13 Apr"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/compilato_da"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Badge"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:layout_below="@id/date"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:textSize="12sp"
|
||||||
|
tools:text="Nome Cognome"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</layout>
|
||||||
@ -26,10 +26,10 @@
|
|||||||
android:id="@+id/nav_free_picking"
|
android:id="@+id/nav_free_picking"
|
||||||
android:icon="@drawable/ic_barcode_96"
|
android:icon="@drawable/ic_barcode_96"
|
||||||
android:title="@string/free_picking" />
|
android:title="@string/free_picking" />
|
||||||
<item
|
<!--<item-->
|
||||||
android:id="@+id/nav_resi_cliente"
|
<!--android:id="@+id/nav_resi_cliente"-->
|
||||||
android:icon="@drawable/ic_barcode_96"
|
<!--android:icon="@drawable/ic_barcode_96"-->
|
||||||
android:title="@string/fragment_ultime_consegne_cliente_title" />
|
<!--android:title="@string/fragment_ultime_consegne_cliente_title" />-->
|
||||||
</group>
|
</group>
|
||||||
<!--
|
<!--
|
||||||
<item android:title="Communicate">
|
<item android:title="Communicate">
|
||||||
|
|||||||
@ -199,4 +199,6 @@
|
|||||||
<string name="fragment_ultime_consegne_cliente_title">Ultime consegne</string>
|
<string name="fragment_ultime_consegne_cliente_title">Ultime consegne</string>
|
||||||
|
|
||||||
<string name="exception_printer_not_found">Stampante non trovata</string>
|
<string name="exception_printer_not_found">Stampante non trovata</string>
|
||||||
|
|
||||||
|
<string name="action_select_all">Seleziona tutto</string>
|
||||||
</resources>
|
</resources>
|
||||||
9
app/src/main/res/values/attr.xml
Normal file
9
app/src/main/res/values/attr.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<attr name="fastscroll__style" format="reference" />
|
||||||
|
<declare-styleable name="fastscroll__fastScroller">
|
||||||
|
<attr name="fastscroll__bubbleColor" format="color" />
|
||||||
|
<attr name="fastscroll__handleColor" format="color" />
|
||||||
|
<attr name="fastscroll__bubbleTextAppearance" format="reference" />
|
||||||
|
</declare-styleable>
|
||||||
|
</resources>
|
||||||
@ -3,17 +3,16 @@
|
|||||||
|
|
||||||
|
|
||||||
<style name="Button.PrimaryOutline" parent="Widget.MaterialComponents.Button.OutlinedButton">
|
<style name="Button.PrimaryOutline" parent="Widget.MaterialComponents.Button.OutlinedButton">
|
||||||
<item name="fontFamily">@font/open_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
<item name="fontFamily">@font/product_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
||||||
<item name="android:textStyle">bold</item>
|
<item name="android:textStyle">bold</item>
|
||||||
<item name="android:textAllCaps">false</item>
|
<item name="android:textAllCaps">false</item>
|
||||||
<item name="android:paddingTop">8dp</item>
|
<item name="android:paddingTop">8dp</item>
|
||||||
<item name="android:paddingBottom">8dp</item>
|
<item name="android:paddingBottom">8dp</item>
|
||||||
<item name="backgroundTint">@android:color/white</item>
|
|
||||||
<item name="iconTint">@color/colorPrimary</item>
|
<item name="iconTint">@color/colorPrimary</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Button.PrimaryFull" parent="Widget.MaterialComponents.Button.UnelevatedButton">
|
<style name="Button.PrimaryFull" parent="Widget.MaterialComponents.Button.UnelevatedButton">
|
||||||
<item name="fontFamily">@font/open_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
<item name="fontFamily">@font/product_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
||||||
<item name="android:textStyle">bold</item>
|
<item name="android:textStyle">bold</item>
|
||||||
<item name="android:textAllCaps">false</item>
|
<item name="android:textAllCaps">false</item>
|
||||||
<item name="android:paddingTop">8dp</item>
|
<item name="android:paddingTop">8dp</item>
|
||||||
@ -27,7 +26,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<style name="Button.DangerOutline" parent="Widget.MaterialComponents.Button.OutlinedButton">
|
<style name="Button.DangerOutline" parent="Widget.MaterialComponents.Button.OutlinedButton">
|
||||||
<item name="fontFamily">@font/open_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
<item name="fontFamily">@font/product_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
||||||
<item name="android:textStyle">bold</item>
|
<item name="android:textStyle">bold</item>
|
||||||
<item name="android:textAllCaps">false</item>
|
<item name="android:textAllCaps">false</item>
|
||||||
<item name="android:textColor">@color/red_400</item>
|
<item name="android:textColor">@color/red_400</item>
|
||||||
@ -38,7 +37,7 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Button.DangerFull" parent="Widget.MaterialComponents.Button.UnelevatedButton">
|
<style name="Button.DangerFull" parent="Widget.MaterialComponents.Button.UnelevatedButton">
|
||||||
<item name="fontFamily">@font/open_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
<item name="fontFamily">@font/product_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
||||||
<item name="android:textStyle">bold</item>
|
<item name="android:textStyle">bold</item>
|
||||||
<item name="android:textAllCaps">false</item>
|
<item name="android:textAllCaps">false</item>
|
||||||
<item name="android:paddingTop">8dp</item>
|
<item name="android:paddingTop">8dp</item>
|
||||||
|
|||||||
@ -8,4 +8,20 @@
|
|||||||
<dimen name="bottom_sheet_round16">16dp</dimen>
|
<dimen name="bottom_sheet_round16">16dp</dimen>
|
||||||
|
|
||||||
<dimen name="standard_rounc">16dp</dimen>
|
<dimen name="standard_rounc">16dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="fastscroll__bubble_corner">20dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="fastscroll__bubble_size">50dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="fastscroll__handle_corner">3dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="fastscroll__handle_height">30dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="fastscroll__handle_width">6dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="fastscroll__handle_inset">9dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="fastscroll__handle_clickable_width">24dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="fastscroll__handle_padding">2dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@ -204,6 +204,8 @@
|
|||||||
|
|
||||||
<string name="exception_printer_not_found">Printer not found</string>
|
<string name="exception_printer_not_found">Printer not found</string>
|
||||||
|
|
||||||
|
<string name="action_select_all">Select all</string>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
<item name="colorAccent">@color/colorAccent</item>
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
|
|
||||||
<item name="fontFamily">@font/open_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
<item name="fontFamily">@font/product_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@ -18,18 +18,33 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.NewMaterial">
|
<style name="AppTheme.NewMaterial">
|
||||||
<item name="android:fontFamily">@font/open_sans_regular</item>
|
<item name="android:fontFamily">@font/product_sans_regular</item>
|
||||||
</style>
|
</style>
|
||||||
<style name="AppTheme.NewMaterial.Text" parent = "AppTheme.NewMaterial">
|
<style name="AppTheme.NewMaterial.Text" parent = "AppTheme.NewMaterial">
|
||||||
<item name="android:fontFamily">@font/open_sans_regular</item>
|
<item name="android:fontFamily">@font/product_sans_regular</item>
|
||||||
<item name="android:textStyle">normal</item>
|
<item name="android:textStyle">normal</item>
|
||||||
</style>
|
</style>
|
||||||
|
<style name="AppTheme.NewMaterial.Text.Badge" parent = "AppTheme.NewMaterial">
|
||||||
|
<item name="android:fontFamily">@font/product_sans_regular</item>
|
||||||
|
<item name="android:textStyle">normal</item>
|
||||||
|
<item name="android:background">@drawable/gray_detail_background_round4</item>
|
||||||
|
<item name="android:paddingStart">8dp</item>
|
||||||
|
<item name="android:paddingEnd">8dp</item>
|
||||||
|
<item name="android:paddingTop">2dp</item>
|
||||||
|
<item name="android:paddingBottom">2dp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.NewMaterial.Text.ToolbarTitle" parent="AppTheme.NewMaterial.Text">
|
<style name="AppTheme.NewMaterial.Text.ToolbarTitle" parent="AppTheme.NewMaterial.Text">
|
||||||
<item name="android:textSize">20sp</item>
|
<item name="android:textSize">20sp</item>
|
||||||
<item name="android:textColor">#5F6368</item>
|
<item name="android:textColor">#5F6368</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="AppTheme.NewMaterial.Text.ListDivider" parent="AppTheme.NewMaterial.Text">
|
||||||
|
<item name="android:textSize">16sp</item>
|
||||||
|
<item name="android:textColor">#5F6368</item>
|
||||||
|
<item name="android:letterSpacing">+0.03</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
<style name="AppTheme.NewMaterial.Text.TextBoxDashboard" parent="AppTheme.NewMaterial.Text">
|
<style name="AppTheme.NewMaterial.Text.TextBoxDashboard" parent="AppTheme.NewMaterial.Text">
|
||||||
<item name="android:textColor">@android:color/white</item>
|
<item name="android:textColor">@android:color/white</item>
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<style name="TextInputLayout.OutlinePrimary" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
|
<style name="TextInputLayout.OutlinePrimary" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
|
||||||
<item name="fontFamily">@font/open_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
<item name="fontFamily">@font/product_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
||||||
<item name="android:textColorHint">@color/colorPrimary</item>
|
<item name="android:textColorHint">@color/colorPrimary</item>
|
||||||
<item name="boxStrokeColor">@color/colorPrimary</item>
|
<item name="boxStrokeColor">@color/colorPrimary</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TextInputEditText.OutlinePrimary" parent="ThemeOverlay.MaterialComponents.TextInputEditText.OutlinedBox.Dense">
|
<style name="TextInputEditText.OutlinePrimary" parent="ThemeOverlay.MaterialComponents.TextInputEditText.OutlinedBox.Dense">
|
||||||
<item name="fontFamily">@font/open_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
<item name="fontFamily">@font/product_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
||||||
<item name="android:textColor">@android:color/black</item>
|
<item name="android:textColor">@android:color/black</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="TextViewMaterial">
|
<style name="TextViewMaterial">
|
||||||
<item name="fontFamily">@font/open_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
<item name="fontFamily">@font/product_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TextViewMaterial.DialogTitle">
|
<style name="TextViewMaterial.DialogTitle">
|
||||||
|
|||||||
@ -10,6 +10,8 @@ public interface BarcodeReaderInterface {
|
|||||||
|
|
||||||
void init() throws BarcodeAdapterNotFoundException;
|
void init() throws BarcodeAdapterNotFoundException;
|
||||||
|
|
||||||
|
void deinit();
|
||||||
|
|
||||||
void register(RunnableArgs<BarcodeScanDTO> onScanSuccessfull, RunnableArgs<Exception> onScanFailed);
|
void register(RunnableArgs<BarcodeScanDTO> onScanSuccessfull, RunnableArgs<Exception> onScanFailed);
|
||||||
|
|
||||||
String getAdapterName();
|
String getAdapterName();
|
||||||
|
|||||||
@ -14,7 +14,7 @@ buildscript {
|
|||||||
google()
|
google()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.3.2'
|
classpath 'com.android.tools.build:gradle:3.4.0'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath 'com.google.gms:google-services:4.2.0'
|
classpath 'com.google.gms:google-services:4.2.0'
|
||||||
classpath 'com.google.firebase:firebase-plugins:1.1.5'
|
classpath 'com.google.firebase:firebase-plugins:1.1.5'
|
||||||
|
|||||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
#Wed Jan 16 12:23:01 CET 2019
|
#Thu Apr 18 18:31:44 CEST 2019
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
|
||||||
|
|||||||
@ -58,6 +58,11 @@ public class PointMobileBarcodeReader implements BarcodeReaderInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deinit() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void register(RunnableArgs<BarcodeScanDTO> onScanSuccessfull, RunnableArgs<Exception> onScanFailed) {
|
public void register(RunnableArgs<BarcodeScanDTO> onScanSuccessfull, RunnableArgs<Exception> onScanFailed) {
|
||||||
mOnScanSuccessfull = onScanSuccessfull;
|
mOnScanSuccessfull = onScanSuccessfull;
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
include ':app', ':pointmobilescannerlibrary', ':barcode_base_library', ':dynamic_vgalimenti', ':dynamic__base'
|
include ':app', ':pointmobilescannerlibrary', ':barcode_base_library', ':dynamic_vgalimenti', ':dynamic__base', ':zebrascannerlibrary'
|
||||||
|
|||||||
1
zebrascannerlibrary/.gitignore
vendored
Normal file
1
zebrascannerlibrary/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/build
|
||||||
35
zebrascannerlibrary/build.gradle
Normal file
35
zebrascannerlibrary/build.gradle
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 28
|
||||||
|
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdkVersion 21
|
||||||
|
targetSdkVersion 28
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.0"
|
||||||
|
|
||||||
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
|
||||||
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.0.2'
|
||||||
|
testImplementation 'junit:junit:4.12'
|
||||||
|
androidTestImplementation 'androidx.test:runner:1.1.1'
|
||||||
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
|
||||||
|
implementation project(path: ':barcode_base_library')
|
||||||
|
}
|
||||||
21
zebrascannerlibrary/proguard-rules.pro
vendored
Normal file
21
zebrascannerlibrary/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# You can control the set of applied configuration files using the
|
||||||
|
# proguardFiles setting in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Uncomment this to preserve the line number information for
|
||||||
|
# debugging stack traces.
|
||||||
|
#-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
|
# If you keep the line number information, uncomment this to
|
||||||
|
# hide the original source file name.
|
||||||
|
#-renamesourcefileattribute SourceFile
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package it.integry.zebrascannerlibrary;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.test.InstrumentationRegistry;
|
||||||
|
import androidx.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instrumented test, which will execute on an Android device.
|
||||||
|
*
|
||||||
|
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||||
|
*/
|
||||||
|
@RunWith(AndroidJUnit4.class)
|
||||||
|
public class ExampleInstrumentedTest {
|
||||||
|
@Test
|
||||||
|
public void useAppContext() {
|
||||||
|
// Context of the app under test.
|
||||||
|
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||||
|
|
||||||
|
assertEquals("it.integry.zebrascannerlibrary.test", appContext.getPackageName());
|
||||||
|
}
|
||||||
|
}
|
||||||
2
zebrascannerlibrary/src/main/AndroidManifest.xml
Normal file
2
zebrascannerlibrary/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="it.integry.zebrascannerlibrary" />
|
||||||
@ -0,0 +1,101 @@
|
|||||||
|
package it.integry.zebrascannerlibrary;
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.IntentFilter;
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
|
import it.integry.plugins.barcode_base_library.exception.BarcodeAdapterNotFoundException;
|
||||||
|
import it.integry.plugins.barcode_base_library.extension.RunnableArgs;
|
||||||
|
import it.integry.plugins.barcode_base_library.interfaces.BarcodeReaderInterface;
|
||||||
|
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||||
|
|
||||||
|
public class ZebraBarcodeReader implements BarcodeReaderInterface {
|
||||||
|
|
||||||
|
private final Context mContext;
|
||||||
|
|
||||||
|
private static RunnableArgs<BarcodeScanDTO> mOnScanSuccessfull;
|
||||||
|
private static RunnableArgs<Exception> mOnScanFailed;
|
||||||
|
|
||||||
|
private static final String TAG = ZebraBarcodeReader.class.getName();
|
||||||
|
private static final String INTENT_FILTER_STRING = "it.integry.scan_filter";
|
||||||
|
|
||||||
|
public ZebraBarcodeReader(Context context) {
|
||||||
|
this.mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isRightAdapter() {
|
||||||
|
String model = Build.MODEL;
|
||||||
|
if(model.equalsIgnoreCase("TC700H")) {
|
||||||
|
return true;
|
||||||
|
} else return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() throws BarcodeAdapterNotFoundException {
|
||||||
|
if(isRightAdapter()) {
|
||||||
|
IntentFilter filter = new IntentFilter();
|
||||||
|
filter.addCategory(Intent.CATEGORY_DEFAULT);
|
||||||
|
filter.addAction(INTENT_FILTER_STRING);
|
||||||
|
mContext.registerReceiver(myBroadcastReceiver, filter);
|
||||||
|
} else {
|
||||||
|
throw new BarcodeAdapterNotFoundException(getAdapterName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deinit() {
|
||||||
|
mContext.unregisterReceiver(myBroadcastReceiver);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void register(RunnableArgs<BarcodeScanDTO> onScanSuccessfull, RunnableArgs<Exception> onScanFailed) {
|
||||||
|
mOnScanSuccessfull = onScanSuccessfull;
|
||||||
|
mOnScanFailed = onScanFailed;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getAdapterName() {
|
||||||
|
return "Zebra";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private BroadcastReceiver myBroadcastReceiver = new BroadcastReceiver() {
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
String action = intent.getAction();
|
||||||
|
|
||||||
|
if (action.equals(INTENT_FILTER_STRING)) {
|
||||||
|
try {
|
||||||
|
dispatchEvent(intent);
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
private void dispatchEvent(Intent initiatingIntent)
|
||||||
|
{
|
||||||
|
|
||||||
|
String decodedSource = initiatingIntent.getStringExtra(mContext.getResources().getString(R.string.datawedge_intent_key_source));
|
||||||
|
String decodedData = initiatingIntent.getStringExtra(mContext.getResources().getString(R.string.datawedge_intent_key_data));
|
||||||
|
String decodedLabelType = initiatingIntent.getStringExtra(mContext.getResources().getString(R.string.datawedge_intent_key_label_type));
|
||||||
|
|
||||||
|
BarcodeScanDTO barcodeScanDTO = new BarcodeScanDTO()
|
||||||
|
.setByteValue(decodedData.getBytes())
|
||||||
|
.setStringValue(decodedData)
|
||||||
|
.setType(ZebraBarcodeTypeMapper.map(decodedLabelType))
|
||||||
|
.setName(decodedLabelType);
|
||||||
|
// .setDecodingTime(mDecodeResult.decodeTimeMillisecond);
|
||||||
|
|
||||||
|
mOnScanSuccessfull.run(barcodeScanDTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
package it.integry.zebrascannerlibrary;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import it.integry.plugins.barcode_base_library.model.BarcodeType;
|
||||||
|
|
||||||
|
public class ZebraBarcodeTypeMapper {
|
||||||
|
|
||||||
|
|
||||||
|
public static BarcodeType map(String inputType) {
|
||||||
|
|
||||||
|
switch (inputType) {
|
||||||
|
case "LABEL-TYPE-CODE11":
|
||||||
|
return BarcodeType.CODE11;
|
||||||
|
case "LABEL-TYPE-CODE128":
|
||||||
|
return BarcodeType.CODE128;
|
||||||
|
case "LABEL-TYPE-CODE39":
|
||||||
|
return BarcodeType.CODE39;
|
||||||
|
|
||||||
|
case "LABEL-TYPE-EAN13":
|
||||||
|
return BarcodeType.EAN13;
|
||||||
|
case "LABEL-TYPE-EAN8":
|
||||||
|
return BarcodeType.EAN8;
|
||||||
|
|
||||||
|
case "LABEL-TYPE-UPCA":
|
||||||
|
return BarcodeType.UPCA;
|
||||||
|
case "LABEL-TYPE-UPCE0":
|
||||||
|
return BarcodeType.UPCE;
|
||||||
|
case "LABEL-TYPE-UPCE1":
|
||||||
|
return BarcodeType.UPCE1;
|
||||||
|
default:
|
||||||
|
Log.d("SCAN TYPE", inputType);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
7
zebrascannerlibrary/src/main/res/values/strings.xml
Normal file
7
zebrascannerlibrary/src/main/res/values/strings.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="app_name">Zebra ScannerLibrary</string>
|
||||||
|
|
||||||
|
<string name="datawedge_intent_key_source">com.symbol.datawedge.source</string>
|
||||||
|
<string name="datawedge_intent_key_label_type">com.symbol.datawedge.label_type</string>
|
||||||
|
<string name="datawedge_intent_key_data">com.symbol.datawedge.data_string</string>
|
||||||
|
</resources>
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
package it.integry.zebrascannerlibrary;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Example local unit test, which will execute on the development machine (host).
|
||||||
|
*
|
||||||
|
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||||
|
*/
|
||||||
|
public class ExampleUnitTest {
|
||||||
|
@Test
|
||||||
|
public void addition_isCorrect() {
|
||||||
|
assertEquals(4, 2 + 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user