Commit 864e76ea401009d4a705bf92db0c7a130678f024
1 parent
d1857acb65
Exists in
master
20102020 1600
Showing
90 changed files
with
6377 additions
and
1773 deletions
Show diff stats
.idea/compiler.xml
File was created | 1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <project version="4"> | ||
3 | <component name="CompilerConfiguration"> | ||
4 | <bytecodeTargetLevel target="11" /> | ||
5 | </component> | ||
6 | </project> |
.idea/gradle.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <project version="4"> | 2 | <project version="4"> |
3 | <component name="GradleMigrationSettings" migrationVersion="1" /> | 3 | <component name="GradleMigrationSettings" migrationVersion="1" /> |
4 | <component name="GradleSettings"> | 4 | <component name="GradleSettings"> |
5 | <option name="linkedExternalProjectsSettings"> | 5 | <option name="linkedExternalProjectsSettings"> |
6 | <GradleProjectSettings> | 6 | <GradleProjectSettings> |
7 | <option name="testRunner" value="PLATFORM" /> | 7 | <option name="testRunner" value="PLATFORM" /> |
8 | <option name="distributionType" value="DEFAULT_WRAPPED" /> | 8 | <option name="distributionType" value="DEFAULT_WRAPPED" /> |
9 | <option name="externalProjectPath" value="$PROJECT_DIR$" /> | 9 | <option name="externalProjectPath" value="$PROJECT_DIR$" /> |
10 | <option name="gradleHome" value="C:/Gradle" /> | 10 | <option name="gradleHome" value="C:/Gradle" /> |
11 | <option name="gradleJvm" value="11" /> | 11 | <option name="gradleJvm" value="11" /> |
12 | <option name="modules"> | 12 | <option name="modules"> |
13 | <set> | 13 | <set> |
14 | <option value="$PROJECT_DIR$" /> | 14 | <option value="$PROJECT_DIR$" /> |
15 | <option value="$PROJECT_DIR$/app" /> | 15 | <option value="$PROJECT_DIR$/app" /> |
16 | </set> | 16 | </set> |
17 | </option> | 17 | </option> |
18 | <option name="resolveModulePerSourceSet" value="false" /> | 18 | <option name="resolveModulePerSourceSet" value="false" /> |
19 | <option name="useQualifiedModuleNames" value="true" /> | ||
19 | </GradleProjectSettings> | 20 | </GradleProjectSettings> |
20 | </option> | 21 | </option> |
21 | </component> | 22 | </component> |
22 | </project> | 23 | </project> |
.idea/misc.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <project version="4"> | 2 | <project version="4"> |
3 | <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="11" project-jdk-type="JavaSDK"> | 3 | <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK"> |
4 | <output url="file://$PROJECT_DIR$/build/classes" /> | 4 | <output url="file://$PROJECT_DIR$/build/classes" /> |
5 | </component> | 5 | </component> |
6 | <component name="ProjectType"> | 6 | <component name="ProjectType"> |
7 | <option name="id" value="Android" /> | 7 | <option name="id" value="Android" /> |
8 | </component> | 8 | </component> |
9 | </project> | 9 | </project> |
File was created | 1 | ITOMINVC.EST="T" | |
2 | ITOMINVC.FEC="2020-09-30 12:18:00" fecha de exportacion | ||
3 | |||
4 | |||
5 | ITOMINVD.CON="2" EL VALOR CONTADO EN EL DISPOSITIVO | ||
6 | ITOMINVD.CON="-1" SI NO SE PUSO NINGUN VALOR O SEA SI NO SE CONTO | ||
7 | ITOMINVD.FECTOM="2020-09-30 12:16:00" FECHA Y HORA EN LA QUE SE TOMO | ||
8 | ITOMINVD.FECTOMFIN="2020-09-30 12:16:00" FECHA Y HORA SI SE MODIFICO LO TOMADO | ||
9 | |||
10 | |||
11 | |||
12 |
Guardar Cabecera de Inventarios Sectorizados.docx
No preview for this file type
Guardar Cuerpo de Inventarios Sectorizados.docx
No preview for this file type
Obtener Cabecera de Inventarios Sectorizados.docx
No preview for this file type
Obtener cuerpo de Inventarios Sectorizados.docx
No preview for this file type
[VI_API_ARTICULOS_INVENTARIO].txt
File was created | 1 | USE [ZUCCO_PILOTO_FMT_2B] | |
2 | GO | ||
3 | |||
4 | /****** Object: View [dbo].[VI_API_ARTICULOS_INVENTARIO] Script Date: 10/20/2020 11:15:17 ******/ | ||
5 | SET ANSI_NULLS ON | ||
6 | GO | ||
7 | |||
8 | SET QUOTED_IDENTIFIER ON | ||
9 | GO | ||
10 | |||
11 | CREATE VIEW VI_API_ARTICULOS_INVENTARIO | ||
12 | |||
13 | SELECT A.CODSEC, A.CODART, A.UNIVEN, C.DVE, A.EXIVTA, A.EXIDEP, B.CODBAR, D.COO, A.DETART, | ||
14 | (SELECT PRECIO FROM LISTA_PRECIO_DET AS E INNER JOIN APAREMP AS F ON E.ID=F.LISTA_V WHERE E.SEC=A.CODSEC AND E.ART=A.CODART ) AS PREVEN , | ||
15 | A.COSTO, A.DEPSN, '' AS FOTO | ||
16 | FROM ARTICULOS AS A | ||
17 | LEFT JOIN CODBAR AS B | ||
18 | ON A.CODSEC=B.CODSEC AND A.CODART=B.CODART | ||
19 | INNER JOIN AUNIVTA AS C ON A.UNIVEN=C.ID | ||
20 | LEFT JOIN A_COD_ORI AS D ON D.SEC=A.CODSEC AND D.ART=A.CODART | ||
21 | GO | ||
22 | |||
23 | |||
24 |
app/build.gradle
1 | apply plugin: 'com.android.application' | 1 | apply plugin: 'com.android.application' |
2 | apply plugin: 'kotlin-android' | 2 | apply plugin: 'kotlin-android' |
3 | apply plugin: 'kotlin-android-extensions' | 3 | apply plugin: 'kotlin-android-extensions' |
4 | apply plugin: 'kotlin-kapt' | 4 | apply plugin: 'kotlin-kapt' |
5 | 5 | ||
6 | android { | 6 | android { |
7 | compileSdkVersion 30 | 7 | compileSdkVersion 30 |
8 | buildToolsVersion "29.0.3" | 8 | buildToolsVersion "29.0.3" |
9 | 9 | ||
10 | defaultConfig { | 10 | defaultConfig { |
11 | applicationId "com.focasoftware.deboinventariov20" | 11 | applicationId "com.focasoftware.deboinventariov20" |
12 | minSdkVersion 26 | 12 | minSdkVersion 24 |
13 | targetSdkVersion 30 | 13 | targetSdkVersion 30 |
14 | versionCode 1 | 14 | versionCode 1 |
15 | versionName "1.0" | 15 | versionName "1.0" |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" |
17 | javaCompileOptions { | 17 | javaCompileOptions { |
18 | annotationProcessorOptions { | 18 | annotationProcessorOptions { |
19 | arguments = ["room.incremental":"true"] | 19 | arguments = ["room.incremental":"true"] |
20 | } | 20 | } |
21 | } | 21 | } |
22 | } | 22 | } |
23 | 23 | ||
24 | buildTypes { | 24 | buildTypes { |
25 | release { | 25 | release { |
26 | minifyEnabled false | 26 | minifyEnabled false |
27 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | 27 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
28 | } | 28 | } |
29 | } | 29 | } |
30 | compileOptions { | 30 | compileOptions { |
31 | coreLibraryDesugaringEnabled true | 31 | coreLibraryDesugaringEnabled true |
32 | sourceCompatibility JavaVersion.VERSION_1_8 | 32 | sourceCompatibility JavaVersion.VERSION_1_8 |
33 | targetCompatibility JavaVersion.VERSION_1_8 | 33 | targetCompatibility JavaVersion.VERSION_1_8 |
34 | 34 | ||
35 | } | 35 | } |
36 | kotlinOptions { | 36 | kotlinOptions { |
37 | jvmTarget = '1.8' | 37 | jvmTarget = '1.8' |
38 | } | 38 | } |
39 | } | 39 | } |
40 | 40 | ||
41 | dependencies { | 41 | dependencies { |
42 | implementation fileTree(dir: "libs", include: ["*.jar"]) | 42 | implementation fileTree(dir: "libs", include: ["*.jar"]) |
43 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | 43 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" |
44 | implementation 'androidx.core:core-ktx:1.3.1' | 44 | implementation 'androidx.core:core-ktx:1.3.2' |
45 | implementation 'androidx.appcompat:appcompat:1.2.0' | 45 | implementation 'androidx.appcompat:appcompat:1.2.0' |
46 | implementation 'androidx.legacy:legacy-support-v4:1.0.0' | 46 | implementation 'androidx.legacy:legacy-support-v4:1.0.0' |
47 | implementation 'com.google.android.material:material:1.2.1' | 47 | implementation 'com.google.android.material:material:1.2.1' |
48 | implementation 'androidx.constraintlayout:constraintlayout:2.0.1' | 48 | implementation 'androidx.constraintlayout:constraintlayout:2.0.2' |
49 | implementation 'androidx.navigation:navigation-fragment:2.3.0' | 49 | implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1' |
50 | implementation 'androidx.navigation:navigation-ui:2.3.0' | 50 | implementation 'androidx.navigation:navigation-ui-ktx:2.3.1' |
51 | implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' | 51 | implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' |
52 | implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0' | 52 | implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1' |
53 | implementation 'androidx.navigation:navigation-ui-ktx:2.3.0' | 53 | implementation 'androidx.navigation:navigation-ui-ktx:2.3.1' |
54 | implementation 'androidx.recyclerview:recyclerview:1.1.0' | 54 | implementation 'androidx.recyclerview:recyclerview:1.1.0' |
55 | testImplementation 'junit:junit:4.13' | 55 | testImplementation 'junit:junit:4.13' |
56 | androidTestImplementation 'androidx.test.ext:junit:1.1.2' | 56 | androidTestImplementation 'androidx.test.ext:junit:1.1.2' |
57 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' | 57 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' |
58 | coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10' | 58 | coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10' |
59 | 59 | ||
60 | //Room | 60 | //Room |
61 | implementation 'androidx.room:room-ktx:2.2.5' | 61 | implementation 'androidx.room:room-ktx:2.2.5' |
62 | implementation "androidx.room:room-runtime:2.2.5" | 62 | implementation "androidx.room:room-runtime:2.2.5" |
63 | debugImplementation 'com.idescout.sql:sqlscout-server:4.1' | 63 | debugImplementation 'com.idescout.sql:sqlscout-server:4.1' |
64 | kapt "androidx.room:room-compiler:2.2.5" | 64 | kapt "androidx.room:room-compiler:2.2.5" |
65 | // annotationProcessor 'androidx.room:room-compiler:2.2.5' | 65 | // annotationProcessor 'androidx.room:room-compiler:2.2.5' |
66 | 66 | ||
67 | //Retrofit | 67 | //Retrofit |
68 | implementation 'com.google.code.gson:gson:2.8.6' | 68 | implementation 'com.google.code.gson:gson:2.8.6' |
69 | implementation 'com.squareup.retrofit2:retrofit:2.9.0' | 69 | implementation 'com.squareup.retrofit2:retrofit:2.9.0' |
70 | implementation 'com.squareup.retrofit2:converter-gson:2.9.0' | 70 | implementation 'com.squareup.retrofit2:converter-gson:2.9.0' |
71 | implementation 'com.squareup.okhttp3:logging-interceptor:4.8.1' | 71 | implementation 'com.squareup.okhttp3:logging-interceptor:4.8.1' |
72 | 72 | ||
73 | //Gson library | 73 | //Gson library |
74 | implementation "com.google.code.gson:gson:2.8.6" | 74 | implementation "com.google.code.gson:gson:2.8.6" |
75 | 75 | ||
76 | // ViewModel and LiveData | 76 | // ViewModel and LiveData |
77 | implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' | 77 | implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' |
78 | kapt 'androidx.lifecycle:lifecycle-common-java8:2.2.0' | 78 | kapt 'androidx.lifecycle:lifecycle-common-java8:2.2.0' |
79 | releaseImplementation 'com.idescout.sql:sqlscout-server-noop:4.1' | 79 | releaseImplementation 'com.idescout.sql:sqlscout-server-noop:4.1' |
80 | } | 80 | } |
app/src/main/java/com/focasoftware/deboinventariov20/DB/Constans/Constans.kt
1 | package com.focasoftware.deboinventariov20.DB.Constans | 1 | package com.focasoftware.deboinventariov20.DB.Constans |
2 | 2 | ||
3 | class Constans { | 3 | class Constans { |
4 | 4 | ||
5 | companion object { | 5 | companion object { |
6 | const val DB_NAME="DebInv" | 6 | const val DB_NAME="DebInv" |
7 | const val TABLA_ART="Articles" | 7 | const val TABLA_ART="Articles" |
8 | const val TABLA_INV_H="InvHead" | 8 | const val TABLA_INV_H="InvHead" |
9 | const val TABLA_INV_B="InvBody" | 9 | const val TABLA_INV_B="InvBody" |
10 | const val TABLA_SERV_INV="ServeInv" | 10 | const val TABLA_SERV_INV="ServeInv" |
11 | const val TABLA_INV_SEC_B="InvBodySec" | ||
12 | const val TABLA_INV_SEC_H="InvHeadSec" | ||
11 | } | 13 | } |
12 | 14 | ||
13 | } | 15 | } |
app/src/main/java/com/focasoftware/deboinventariov20/DB/DAO/ArticulosDAO.kt
1 | package com.focasoftware.deboinventariov20.DB.DAO | 1 | package com.focasoftware.deboinventariov20.DB.DAO |
2 | 2 | ||
3 | import androidx.room.Dao | 3 | import androidx.room.Dao |
4 | import androidx.room.Insert | 4 | import androidx.room.Insert |
5 | import androidx.room.OnConflictStrategy | 5 | import androidx.room.OnConflictStrategy |
6 | import androidx.room.Query | 6 | import androidx.room.Query |
7 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_ART | 7 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_ART |
8 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_B | 8 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_B |
9 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_H | 9 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_H |
10 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_SEC_B | ||
11 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_SEC_H | ||
10 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_SERV_INV | 12 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_SERV_INV |
11 | import com.focasoftware.deboinventariov20.Model.Articles | 13 | import com.focasoftware.deboinventariov20.Model.* |
12 | import com.focasoftware.deboinventariov20.Model.InvBody | ||
13 | import com.focasoftware.deboinventariov20.Model.InvHead | ||
14 | import com.focasoftware.deboinventariov20.Model.ServeInv | ||
15 | 14 | ||
16 | @Dao | 15 | @Dao |
17 | interface ArticulosDAO { | 16 | interface ArticulosDAO { |
18 | 17 | ||
19 | // TABLA ARTICULOS | 18 | // TABLA ARTICULOS |
20 | @Insert(onConflict = OnConflictStrategy.REPLACE) | 19 | @Insert(onConflict = OnConflictStrategy.REPLACE) |
21 | suspend fun insertArticulos(articulos: Articles?) | 20 | suspend fun insertArticulos(articulos: Articles?) |
22 | 21 | ||
23 | @Query("SELECT * FROM $TABLA_ART ORDER BY DETART DESC") | 22 | @Query("SELECT * FROM $TABLA_ART ORDER BY DETART DESC") |
24 | suspend fun findAllArticulos(): List<Articles> | 23 | suspend fun findAllArticulos(): List<Articles> |
25 | 24 | ||
26 | @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND DETART LIKE '%' || :description || '%' GROUP BY DETART ORDER BY DETART") | 25 | @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND DETART LIKE '%' || :description || '%' GROUP BY DETART ORDER BY DETART") |
27 | suspend fun findArticuloByDesc(description: String?, dep: Boolean): List<Articles> | 26 | suspend fun findArticuloByDesc(description: String?, dep: Boolean): List<Articles> |
28 | 27 | ||
29 | @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND TRIM(CODBAR) = :codBarra") | 28 | @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND TRIM(CODBAR) = :codBarra") |
30 | suspend fun findArticuloByCodBar(codBarra: String, dep: Boolean): Articles | 29 | suspend fun findArticuloByCodBar(codBarra: String, dep: Boolean): Articles |
31 | 30 | ||
32 | @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND TRIM(COO) LIKE :CodOrigen") | 31 | @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND TRIM(COO) LIKE :CodOrigen") |
33 | suspend fun findArticuloByCodOri(CodOrigen: String?, dep: Boolean): List<Articles> | 32 | suspend fun findArticuloByCodOri(CodOrigen: String?, dep: Boolean): List<Articles> |
34 | 33 | ||
35 | @Query("DELETE FROM $TABLA_ART") | 34 | @Query("DELETE FROM $TABLA_ART") |
36 | suspend fun deleteAllArticulos() | 35 | suspend fun deleteAllArticulos() |
37 | 36 | ||
38 | @Query("SELECT * FROM $TABLA_ART WHERE CODSEC=:sector AND CODART=:codigo") | 37 | @Query("SELECT * FROM $TABLA_ART WHERE CODSEC=:sector AND CODART=:codigo") |
39 | suspend fun fetchArticuloByCodSec(sector: String?, codigo: String?): Articles? | 38 | suspend fun fetchArticuloByCodSec(sector: String?, codigo: String?): Articles? |
40 | } | 39 | } |
41 | 40 | ||
42 | @Dao | 41 | @Dao |
43 | interface InvHeadDAO { | 42 | interface InvHeadDAO { |
44 | @Insert() | 43 | @Insert() |
45 | suspend fun insertInvHead(invHead: InvHead?) | 44 | suspend fun insertInvHead(invHead: InvHead?) |
46 | 45 | ||
47 | @Query("SELECT INV_NUM FROM $TABLA_INV_H ORDER BY INV_NUM DESC") | 46 | @Query("SELECT INV_NUM FROM $TABLA_INV_H ORDER BY INV_NUM DESC") |
48 | suspend fun findLastInv(): Int | 47 | suspend fun findLastInv(): Int |
49 | 48 | ||
50 | @Query("DELETE FROM $TABLA_INV_H") | 49 | @Query("DELETE FROM $TABLA_INV_H") |
51 | suspend fun deleteAllArticulos() | 50 | suspend fun deleteAllArticulos() |
52 | 51 | ||
53 | @Query("DELETE FROM $TABLA_INV_H WHERE INV_NUM=:inven") | 52 | @Query("DELETE FROM $TABLA_INV_H WHERE INV_NUM=:inven") |
54 | suspend fun deleteinvHead(inven: Int) | 53 | suspend fun deleteinvHead(inven: Int) |
55 | 54 | ||
56 | @Query("SELECT * FROM $TABLA_INV_H ORDER BY INV_FEI") | 55 | @Query("SELECT * FROM $TABLA_INV_H ORDER BY INV_FEI") |
57 | suspend fun fetchAllInvHead(): List<InvHead> | 56 | suspend fun fetchAllInvHead(): List<InvHead> |
58 | 57 | ||
59 | @Query("SELECT INV_LUG FROM $TABLA_INV_H WHERE INV_NUM=:inven") | 58 | @Query("SELECT INV_LUG FROM $TABLA_INV_H WHERE INV_NUM=:inven") |
60 | suspend fun fetchAreaInvH (inven: Int): Boolean | 59 | suspend fun fetchAreaInvH (inven: Int): Boolean |
61 | 60 | ||
62 | @Query("SELECT INV_PRODCONT FROM $TABLA_INV_H WHERE INV_NUM=:inven") | 61 | @Query("SELECT INV_PRODCONT FROM $TABLA_INV_H WHERE INV_NUM=:inven") |
63 | suspend fun consultaCantidadInvH (inven: Int): Int | 62 | suspend fun consultaCantidadInvH (inven: Int): Int |
64 | 63 | ||
65 | @Query("UPDATE $TABLA_INV_H SET INV_PRODCONT=:cant WHERE INV_NUM=:inven") | 64 | @Query("UPDATE $TABLA_INV_H SET INV_PRODCONT=:cant WHERE INV_NUM=:inven") |
66 | suspend fun updateInvBody(inven: Int,cant: Int) | 65 | suspend fun updateInvCantHead(inven: Int,cant: Int) |
67 | 66 | ||
68 | @Query("SELECT * FROM $TABLA_INV_H WHERE INV_NUM=:inven") | 67 | @Query("SELECT * FROM $TABLA_INV_H WHERE INV_NUM=:inven") |
69 | suspend fun foundInvHead (inven: Int): InvHead | 68 | suspend fun foundInvHead (inven: Int): InvHead |
70 | } | 69 | } |
71 | 70 | ||
72 | @Dao | 71 | @Dao |
73 | interface InvBodyDAO { | 72 | interface InvBodyDAO { |
74 | @Insert() | 73 | @Insert() |
75 | suspend fun insertInvBody(invBody: InvBody?) | 74 | suspend fun insertInvBody(invBody: InvBody?) |
76 | 75 | ||
77 | @Query("DELETE FROM $TABLA_INV_B") | 76 | @Query("DELETE FROM $TABLA_INV_B") |
78 | suspend fun deleteAllInvBody() | 77 | suspend fun deleteAllInvBody() |
79 | 78 | ||
80 | @Query("DELETE FROM $TABLA_INV_B WHERE INV_NUM =:inven") | 79 | @Query("DELETE FROM $TABLA_INV_B WHERE INV_NUM =:inven") |
81 | suspend fun deleteInvBody(inven: Int) | 80 | suspend fun deleteInvBody(inven: Int) |
82 | 81 | ||
83 | @Query("UPDATE $TABLA_INV_B SET CANT=:cant , INV_FEF=:actFechaHora WHERE SEC=:sec AND COD=:cod") | 82 | @Query("UPDATE $TABLA_INV_B SET CANT=:cant , INV_FEF=:actFechaHora WHERE SEC=:sec AND COD=:cod") |
84 | suspend fun updateInvBody(cant: Float, sec: Long, cod: Long, actFechaHora:String) | 83 | suspend fun updateInvBody(cant: Float, sec: Long, cod: Long, actFechaHora:String) |
85 | 84 | ||
86 | @Query("SELECT * FROM $TABLA_INV_B WHERE INV_NUM =:inven ORDER BY INV_FEI DESC") | 85 | @Query("SELECT * FROM $TABLA_INV_B WHERE INV_NUM =:inven ORDER BY INV_FEI DESC") |
87 | suspend fun fetchAllInvBody(inven: Int): List<InvBody> | 86 | suspend fun fetchAllInvBody(inven: Int): List<InvBody> |
88 | 87 | ||
89 | @Query("SELECT * FROM $TABLA_INV_B WHERE INV_NUM =:numInventario AND SEC=:sector AND COD=:codigo") | 88 | @Query("SELECT * FROM $TABLA_INV_B WHERE INV_NUM =:numInventario AND SEC=:sector AND COD=:codigo") |
90 | suspend fun fetchArtInInvBody(sector: Long, codigo: Long, numInventario: Int): InvBody | 89 | suspend fun fetchArtInInvBody(sector: Long, codigo: Long, numInventario: Int): InvBody |
91 | 90 | ||
92 | @Query("DELETE FROM $TABLA_INV_B WHERE INV_NUM =:numInventario AND SEC=:sector AND COD=:codigo") | 91 | @Query("DELETE FROM $TABLA_INV_B WHERE INV_NUM =:numInventario AND SEC=:sector AND COD=:codigo") |
93 | suspend fun deleteItemFromInvBody(sector: Long, codigo: Long, numInventario: Int): Int | 92 | suspend fun deleteItemFromInvBody(sector: Long, codigo: Long, numInventario: Int): Int |
94 | } | 93 | } |
95 | 94 | ||
96 | @Dao | 95 | @Dao |
97 | interface ServeInvDao { | 96 | interface ServeInvDao { |
98 | @Insert(onConflict = OnConflictStrategy.REPLACE) | 97 | @Insert(onConflict = OnConflictStrategy.REPLACE) |
99 | fun insertServer(servidor: ServeInv) | 98 | fun insertServer(servidor: ServeInv) |
100 | 99 | ||
101 | @Query("SELECT * FROM $TABLA_SERV_INV ORDER BY SER_NUM") | 100 | @Query("SELECT * FROM $TABLA_SERV_INV ORDER BY SER_NUM") |
102 | suspend fun fetchAllServers(): List<ServeInv> | 101 | suspend fun fetchAllServers(): List<ServeInv> |
103 | 102 | ||
104 | @Query("DELETE FROM $TABLA_SERV_INV WHERE SER_DESC LIKE :description AND SER_DIR LIKE :dir") | 103 | @Query("DELETE FROM $TABLA_SERV_INV WHERE SER_DESC LIKE :description AND SER_DIR LIKE :dir") |
105 | suspend fun deleteServer(description: String, dir: String) | 104 | suspend fun deleteServer(description: String, dir: String) |
106 | 105 | ||
107 | @Query("SELECT SER_NUM FROM $TABLA_SERV_INV ORDER BY SER_NUM DESC") | 106 | @Query("SELECT SER_NUM FROM $TABLA_SERV_INV ORDER BY SER_NUM DESC") |
108 | suspend fun findLastServer(): Int | 107 | suspend fun findLastServer(): Int |
109 | 108 | ||
110 | @Query("UPDATE $TABLA_SERV_INV SET SER_PRE=0") | 109 | @Query("UPDATE $TABLA_SERV_INV SET SER_PRE=0") |
111 | suspend fun UpdateServerPreInZero() | 110 | suspend fun UpdateServerPreInZero() |
112 | 111 | ||
113 | @Query("UPDATE $TABLA_SERV_INV SET SER_PRE=1 WHERE SER_NUM = :numero") | 112 | @Query("UPDATE $TABLA_SERV_INV SET SER_PRE=1 WHERE SER_NUM = :numero") |
114 | suspend fun UpdateServerPre(numero: Int) | 113 | suspend fun UpdateServerPre(numero: Int) |
115 | 114 | ||
116 | @Query("SELECT * FROM $TABLA_SERV_INV WHERE SER_PRE= 1") | 115 | @Query("SELECT * FROM $TABLA_SERV_INV WHERE SER_PRE= 1") |
117 | suspend fun fetchServerPreOne(): ServeInv | 116 | suspend fun fetchServerPreOne(): ServeInv |
118 | 117 | ||
119 | @Query("SELECT * FROM $TABLA_SERV_INV WHERE SER_NUM = :numero") | 118 | @Query("SELECT * FROM $TABLA_SERV_INV WHERE SER_NUM = :numero") |
120 | suspend fun fetchServer(numero: Int): ServeInv | 119 | suspend fun fetchServer(numero: Int): ServeInv |
121 | } | ||
120 | } | ||
121 | |||
122 | |||
123 | |||
124 | @Dao | ||
125 | interface InvHeadSecDAO { | ||
126 | @Insert(onConflict = OnConflictStrategy.REPLACE) | ||
127 | fun insertInvHeadSec(Inventario: InvHeadSec) | ||
128 | |||
129 | @Query("DELETE FROM $TABLA_INV_SEC_H WHERE INV_NUM = :inven") | ||
130 | suspend fun deleteAllInvHeadSec(inven: Int) | ||
131 | |||
132 | @Query("SELECT * FROM $TABLA_INV_SEC_H ORDER BY INV_NUM") | ||
133 | suspend fun fetchAllInvSecHead(): List<InvHeadSec> | ||
134 | |||
135 | @Query("UPDATE $TABLA_INV_SEC_H SET CONT=:cant WHERE INV_NUM=:inven") | ||
136 | suspend fun updateCantArtInvSecHead(inven: Int,cant: Int) | ||
137 | |||
138 | @Query("DELETE FROM $TABLA_INV_SEC_H WHERE INV_NUM=:inven") | ||
139 | suspend fun deleteinvSecHead(inven: String) | ||
140 | |||
141 | @Query("SELECT * FROM $TABLA_INV_SEC_H WHERE INV_NUM=:inven") | ||
142 | suspend fun foundInvSecHead (inven: String): InvHeadSec | ||
143 | |||
144 | @Query("UPDATE $TABLA_INV_SEC_H SET FET=:fecha, FEC=:fecha WHERE INV_NUM=:inven") | ||
145 | suspend fun updateFETinvSecHead(inven: String, fecha:String) | ||
146 | |||
147 | @Query("UPDATE $TABLA_INV_SEC_H SET FEC=:fecha WHERE INV_NUM=:inven") | ||
148 | suspend fun updateFECinvSecHead(inven: String, fecha:String) | ||
149 | } | ||
150 | |||
151 | @Dao | ||
152 | interface InvBodySecDAO { | ||
153 | @Insert() | ||
154 | suspend fun insertInvBodySec(invBody: InvBodySec?) | ||
155 | |||
156 | @Query("DELETE FROM $TABLA_INV_SEC_B WHERE INV = :inven") | ||
157 | suspend fun deleteAllInvBodySec(inven: Int) | ||
158 | |||
159 | @Query("SELECT * FROM $TABLA_INV_SEC_B WHERE INV =:inven GROUP BY SEC, ART") | ||
160 | suspend fun buscarInvSecBody(inven: Int): List<InvBodySec> | ||
161 | |||
162 | @Query("UPDATE $TABLA_INV_SEC_B SET CON=:cant , FECTOM=:actFechaHora WHERE INV =:inven AND SEC=:sec AND ART=:cod") | ||
163 | suspend fun updateInvSecBody(inven: String, cant: Float, sec: Long, cod: Long, actFechaHora:String) | ||
164 | |||
165 | @Query("DELETE FROM $TABLA_INV_SEC_B WHERE INV =:inven") | ||
166 | suspend fun deleteInvSecBody(inven: String) | ||
167 | |||
168 | @Query("SELECT * FROM $TABLA_INV_SEC_B WHERE INV =:inven GROUP BY SEC, ART") | ||
169 | suspend fun fetchInvSecBody(inven: String): List<InvBodySec> | ||
170 | |||
171 | @Query("UPDATE $TABLA_INV_SEC_B SET FECTOM=:fecha, FECTOMFIN=:fecha WHERE INV =:inven") | ||
172 | suspend fun updateFECTOMyFECTOMFINinvSecBody(inven: String, fecha:String) | ||
173 | |||
174 | @Query("UPDATE $TABLA_INV_SEC_B SET CON=:cant ,FECTOMFIN=:actFechaHora WHERE INV =:inven AND SEC=:sec AND ART=:cod") | ||
175 | suspend fun updateFECTOMFINinvSecBody(inven: String, cant: Float, sec: Long, cod: Long, actFechaHora:String) | ||
176 | |||
177 | @Query("SELECT * FROM $TABLA_INV_SEC_B WHERE INV =:inven ") | ||
178 | suspend fun verificoExisteInvSec(inven: Int): List<InvBodySec> | ||
179 | |||
180 | @Query("SELECT * FROM $TABLA_INV_SEC_B WHERE INV =:inven AND SEC=:sec AND ART=:cod") | ||
181 | suspend fun fetchArticuloByCodSec(inven: String, sec: String, cod: String):InvBodySec | ||
182 | |||
183 | @Query("SELECT * FROM $TABLA_INV_SEC_B WHERE INV =:inven GROUP BY SEC, ART") | ||
184 | suspend fun fetchInvSecBodyGroup(inven: String): List<InvBodySec> |
app/src/main/java/com/focasoftware/deboinventariov20/DB/DataBase/AppDb.kt
1 | package com.focasoftware.deboinventariov20.DB.DataBase | 1 | package com.focasoftware.deboinventariov20.DB.DataBase |
2 | 2 | ||
3 | import android.content.Context | 3 | import android.content.Context |
4 | import androidx.room.Database | 4 | import androidx.room.Database |
5 | import androidx.room.Room | 5 | import androidx.room.Room |
6 | import androidx.room.RoomDatabase | 6 | import androidx.room.RoomDatabase |
7 | import com.focasoftware.deboinventariov20.DB.Constans.Constans | 7 | import com.focasoftware.deboinventariov20.DB.Constans.Constans |
8 | import com.focasoftware.deboinventariov20.DB.DAO.* | 8 | import com.focasoftware.deboinventariov20.DB.DAO.* |
9 | import com.focasoftware.deboinventariov20.Model.Articles | 9 | import com.focasoftware.deboinventariov20.Model.* |
10 | import com.focasoftware.deboinventariov20.Model.InvBody | ||
11 | import com.focasoftware.deboinventariov20.Model.InvHead | ||
12 | import com.focasoftware.deboinventariov20.Model.ServeInv | ||
13 | 10 | ||
14 | 11 | ||
15 | @Database(entities = [Articles::class, InvHead::class, InvBody::class, ServeInv::class], version = 1, exportSchema = false) | 12 | @Database(entities = [InvBodySec::class, InvHeadSec::class, Articles::class, InvHead::class, InvBody::class, ServeInv::class], version = 1, exportSchema = false) |
16 | abstract class AppDb : RoomDatabase() { | 13 | abstract class AppDb : RoomDatabase() { |
17 | abstract fun ArticulosDAO(): ArticulosDAO? | 14 | abstract fun ArticulosDAO(): ArticulosDAO? |
18 | abstract fun InvHeadDAO(): InvHeadDAO? | 15 | abstract fun InvHeadDAO(): InvHeadDAO? |
19 | abstract fun InvBodyDAO(): InvBodyDAO? | 16 | abstract fun InvBodyDAO(): InvBodyDAO? |
20 | abstract fun ServeInvDao(): ServeInvDao? | 17 | abstract fun ServeInvDao(): ServeInvDao? |
18 | abstract fun InvHeadSecDAO(): InvHeadSecDAO? | ||
19 | abstract fun InvBodySecDAO(): InvBodySecDAO? | ||
21 | 20 | ||
22 | companion object { | 21 | companion object { |
23 | private var INSTANCE: AppDb? = null | 22 | private var INSTANCE: AppDb? = null |
24 | fun getAppDb(context: Context): AppDb? { | 23 | fun getAppDb(context: Context): AppDb? { |
25 | if (INSTANCE == null) { | 24 | if (INSTANCE == null) { |
26 | INSTANCE = Room.databaseBuilder(context.applicationContext, AppDb::class.java, Constans.DB_NAME) | 25 | INSTANCE = Room.databaseBuilder(context.applicationContext, AppDb::class.java, Constans.DB_NAME) |
27 | .allowMainThreadQueries() | 26 | .allowMainThreadQueries() |
28 | .build() | 27 | .build() |
29 | } | 28 | } |
30 | return INSTANCE | 29 | return INSTANCE |
31 | } | 30 | } |
32 | 31 | ||
33 | fun destroyInstance() { | 32 | fun destroyInstance() { |
34 | INSTANCE = null | 33 | INSTANCE = null |
35 | } | 34 | } |
app/src/main/java/com/focasoftware/deboinventariov20/Model/DefaultResponse.kt
File was created | 1 | package com.focasoftware.deboinventariov20.Model | |
2 | |||
3 | import retrofit2.Callback | ||
4 | |||
5 | data class DefaultResponse(val message:String, val success: Boolean, val status:Int) { | ||
6 | |||
7 | } |
app/src/main/java/com/focasoftware/deboinventariov20/Model/ItomInv.kt
File was created | 1 | package com.focasoftware.deboinventariov20.Model | |
2 | |||
3 | import okhttp3.OkHttpClient | ||
4 | import okhttp3.logging.HttpLoggingInterceptor | ||
5 | import retrofit2.Retrofit | ||
6 | import retrofit2.converter.gson.GsonConverterFactory | ||
7 | import java.util.concurrent.TimeUnit | ||
8 | |||
9 | object ItomInv { | ||
10 | |||
11 | private val TIME_OUT: Long | ||
12 | get() { | ||
13 | return 200 | ||
14 | } | ||
15 | private val interceptor = run { | ||
16 | val httpLoggingInterceptor = HttpLoggingInterceptor() | ||
17 | httpLoggingInterceptor.apply { | ||
18 | httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY | ||
19 | } | ||
20 | } | ||
21 | private val okHttpClient = OkHttpClient.Builder() | ||
22 | .addNetworkInterceptor(interceptor) // same for .addInterceptor(...) | ||
23 | .connectTimeout(TIME_OUT, TimeUnit.SECONDS) //Backend is really slow | ||
24 | .writeTimeout(TIME_OUT, TimeUnit.SECONDS) | ||
25 | .readTimeout(TIME_OUT, TimeUnit.SECONDS) | ||
26 | .build() | ||
27 | |||
28 | private val retrofit: Retrofit = Retrofit.Builder() | ||
29 | .client(okHttpClient) | ||
30 | .baseUrl(BASE_URL) | ||
31 | .addConverterFactory(GsonConverterFactory.create()) | ||
32 | .build() | ||
33 | val request: WebServiceApi = retrofit.create(WebServiceApi::class.java) | ||
34 | } |
app/src/main/java/com/focasoftware/deboinventariov20/Model/Tablas.kt
1 | package com.focasoftware.deboinventariov20.Model | 1 | package com.focasoftware.deboinventariov20.Model |
2 | 2 | ||
3 | import androidx.room.ColumnInfo | 3 | import androidx.room.ColumnInfo |
4 | import androidx.room.Entity | 4 | import androidx.room.Entity |
5 | import androidx.room.PrimaryKey | 5 | import androidx.room.PrimaryKey |
6 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_ART | 6 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_ART |
7 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_B | 7 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_B |
8 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_H | 8 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_H |
9 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_SEC_B | ||
10 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_INV_SEC_H | ||
9 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_SERV_INV | 11 | import com.focasoftware.deboinventariov20.DB.Constans.Constans.Companion.TABLA_SERV_INV |
10 | import com.google.gson.annotations.SerializedName | 12 | import com.google.gson.annotations.SerializedName |
11 | import java.io.Serializable | 13 | import java.io.Serializable |
12 | 14 | ||
13 | //data class Productos(@SerializedName("SEC") var sector: String?, | 15 | data class Productos( |
14 | // @SerializedName("COD") var codigo: String?, | 16 | @SerializedName("CODSEC") var sector: String?, |
15 | // @SerializedName("DESC") var descripcion: String?, | 17 | @SerializedName("CODART") var codigo: String?, |
16 | // @SerializedName("CB") var codBar: String?, | 18 | @SerializedName("DETART") var descripcion: String?, |
17 | // @SerializedName("CBC") var codOrigen: String?, | 19 | @SerializedName("CODBAR") var codBar: String?, |
18 | // @SerializedName("PRE_VTA") var precio: String?, | 20 | @SerializedName("COO") var codOrigen: String?, |
19 | // @SerializedName("PRE_COS") var costo: String?, | 21 | @SerializedName("PREVEN") var precio: String?, |
20 | // @SerializedName( "EV") var exiVenta: String?, | 22 | @SerializedName("COSTO") var costo: String?, |
21 | // @SerializedName( "ED") var exiDeposito: String?, | 23 | @SerializedName("EXIVTA") var exiVenta: String?, |
22 | // @SerializedName( "DE") var de: String?, | 24 | @SerializedName("EXIDEP") var exiDeposito: String?, |
23 | // @SerializedName( "BAL") var balanza: Int?, | 25 | @SerializedName("DVE") var de: String?, |
24 | // @SerializedName("DEPSN") var depSn: Int?, | 26 | @SerializedName("UNIVEN") var balanza: Int?, |
25 | // @SerializedName("FOTO") var imagen: String?) | 27 | @SerializedName("DEPSN") var depSn: Boolean?, |
26 | data class Productos(@SerializedName("CODSEC") var sector: String?, | 28 | @SerializedName("FOTO") var imagen: String? |
27 | @SerializedName("CODART") var codigo: String?, | 29 | ) |
28 | @SerializedName("DETART") var descripcion: String?, | 30 | |
29 | @SerializedName("CODBAR") var codBar: String?, | 31 | data class Time( |
30 | @SerializedName("COO") var codOrigen: String?, | 32 | @SerializedName("DIA") var dia: String?, |
31 | @SerializedName("PREVEN") var precio: String?, | 33 | @SerializedName("MES") var mes: String?, |
32 | @SerializedName("COSTO") var costo: String?, | 34 | @SerializedName("ANO") var ano: String?, |
33 | @SerializedName( "EXIVTA") var exiVenta: String?, | 35 | @SerializedName("HORA") var hora: String?, |
34 | @SerializedName( "EXIDEP") var exiDeposito: String?, | 36 | @SerializedName("MIN") var minutos: String?, |
35 | @SerializedName( "DVE") var de: String?, | 37 | @SerializedName("SEG") var segundos: String? |
36 | @SerializedName( "UNIVEN") var balanza: Int?, | 38 | ) |
37 | @SerializedName("DEPSN") var depSn: Boolean?, | 39 | |
38 | @SerializedName("FOTO") var imagen: String?) | 40 | data class InvHeadSecR( |
39 | 41 | @SerializedName("INV_NUM") var invNum: Int, | |
40 | data class InvToSend ( var fechaInicio: String?, | 42 | @SerializedName("DET") var detalle: String, |
41 | var fechaFinal: String?, | 43 | @SerializedName("FET") var fechaInicio: String, |
42 | var lugar: Int?, | 44 | @SerializedName("DEP") var depsn: Int |
43 | var sector: String?, | 45 | ) |
44 | var codigo: String?, | 46 | |
45 | var descripcion: String?, | 47 | data class InvBodySecR( |
46 | var cantTomada: String?, | 48 | @SerializedName("INV") var INV: String, |
47 | var fechaInicioArt: String?, | 49 | @SerializedName("SEC") var SEC: String?, |
48 | var fechaFinArt: String?) | 50 | @SerializedName("ART") var ART: String?, |
49 | //@Entity(tableName = TABLA_ART) | 51 | @SerializedName("DET") var DET: String?, |
50 | //data class Articles(@ColumnInfo(name = "SEC") var sector: String?, | 52 | @SerializedName("PRE") var PRE: String?, |
51 | // @ColumnInfo(name = "COD") var codigo: String?, | 53 | @SerializedName("COS") var COS: String?, |
52 | // @ColumnInfo(name = "DES") var descripcion: String?, | 54 | @SerializedName("DVE") var DVE: String?, |
53 | // @ColumnInfo(name = "CB") var codBar: String?, | 55 | @SerializedName("EXIVTA") var EXIVTA: String?, |
54 | // @ColumnInfo(name = "CBC") var codOrigen: String?, | 56 | @SerializedName("EXIDEP") var EXIDEP: String?, |
55 | // @ColumnInfo(name = "PRE_VTA") var precio: String?, | 57 | @SerializedName("CODBAR") var CODBAR: String?, |
56 | // @ColumnInfo(name = "PRE_COS") var costo: String?, | 58 | @SerializedName("COO") var COO: String?, |
57 | // @ColumnInfo(name = "EV") var exiVenta: String?, | 59 | @SerializedName("DEPSN") var DEPSN: String?, |
58 | // @ColumnInfo(name = "ED") var exiDeposito: String?, | 60 | @SerializedName("UNIVEN") var uniVta: String? |
59 | // @ColumnInfo(name = "DE") var de: String?, | 61 | ) |
60 | // @ColumnInfo(name = "BAL") var balanza: Int?, | 62 | |
61 | // @ColumnInfo(name = "DEPSN") var depSn: Int?, | 63 | data class ItomInvD( |
62 | // @ColumnInfo(name = "FOTO") var imagen: String?) : Serializable { | 64 | var Sector: String?, |
63 | // @PrimaryKey(autoGenerate = true) | 65 | var Codigo: String?, |
64 | // @ColumnInfo(name = "id") | 66 | var Descripcion: String?, |
65 | // var id: Long = 0 | 67 | var CantTomada: String?, |
66 | //} | 68 | var FechaInicioArt: String?, |
69 | var FechaFinArt: String? | ||
70 | ) | ||
71 | |||
72 | data class InvToSend( | ||
73 | var FechaInicio: String?, | ||
74 | var FechaFinal: String?, | ||
75 | var Lugar: Int?, | ||
76 | var Sector: String?, | ||
77 | var Codigo: String?, | ||
78 | var Descripcion: String?, | ||
79 | var CantTomada: String?, | ||
80 | var FechaInicioArt: String?, | ||
81 | var FechaFinArt: String? | ||
82 | ) | ||
83 | |||
84 | data class ItomInvC( | ||
85 | var FechaInicio: String?, | ||
86 | var FechaFinal: String?, | ||
87 | var Lugar: Int?, | ||
88 | ) | ||
89 | |||
90 | data class InvSecHeadToSend( | ||
91 | var ID: String?, | ||
92 | var EST: String?, | ||
93 | var FEC: String? | ||
94 | ) | ||
95 | |||
96 | data class InvSecBodyToSend( | ||
97 | var INV: String?, | ||
98 | var SEC: String?, | ||
99 | var ART: String?, | ||
100 | var CON: String?, | ||
101 | var FECTOM: String?, | ||
102 | var FECTOMFIN: String? | ||
103 | ) | ||
104 | |||
105 | data class NumInvSec(var inv_num: String?) | ||
106 | |||
67 | @Entity(tableName = TABLA_ART) | 107 | @Entity(tableName = TABLA_ART) |
68 | data class Articles(@ColumnInfo(name = "CODSEC") var sector: String?, | 108 | data class Articles( |
69 | @ColumnInfo(name = "CODART") var codigo: String?, | 109 | @ColumnInfo(name = "CODSEC") var sector: String?, |
70 | @ColumnInfo(name = "DETART") var descripcion: String?, | 110 | @ColumnInfo(name = "CODART") var codigo: String?, |
71 | @ColumnInfo(name = "CODBAR") var codBar: String?, | 111 | @ColumnInfo(name = "DETART") var descripcion: String?, |
72 | @ColumnInfo(name = "COO") var codOrigen: String?, | 112 | @ColumnInfo(name = "CODBAR") var codBar: String?, |
73 | @ColumnInfo(name = "PREVEN") var precio: String?, | 113 | @ColumnInfo(name = "COO") var codOrigen: String?, |
74 | @ColumnInfo(name = "COSTO") var costo: String?, | 114 | @ColumnInfo(name = "PREVEN") var precio: String?, |
75 | @ColumnInfo(name = "EXIVTA") var exiVenta: String?, | 115 | @ColumnInfo(name = "COSTO") var costo: String?, |
76 | @ColumnInfo(name = "EXIDEP") var exiDeposito: String?, | 116 | @ColumnInfo(name = "EXIVTA") var exiVenta: String?, |
77 | @ColumnInfo(name = "DVE") var de: String?, | 117 | @ColumnInfo(name = "EXIDEP") var exiDeposito: String?, |
78 | @ColumnInfo(name = "UNIVEN") var balanza: Int?, | 118 | @ColumnInfo(name = "DVE") var de: String?, |
79 | @ColumnInfo(name = "DEPSN") var depSn: Boolean?, | 119 | @ColumnInfo(name = "UNIVEN") var balanza: Int?, |
80 | @ColumnInfo(name = "FOTO") var imagen: String?) : Serializable { | 120 | @ColumnInfo(name = "DEPSN") var depSn: Boolean?, |
121 | @ColumnInfo(name = "FOTO") var imagen: String? | ||
122 | ) : Serializable { | ||
81 | @PrimaryKey(autoGenerate = true) | 123 | @PrimaryKey(autoGenerate = true) |
82 | @ColumnInfo(name = "id") | 124 | @ColumnInfo(name = "id") |
83 | var id: Long = 0 | 125 | var id: Long = 0 |
84 | } | 126 | } |
85 | 127 | ||
128 | |||
86 | @Entity(tableName = TABLA_INV_H) | 129 | @Entity(tableName = TABLA_INV_H) |
87 | data class InvHead(@PrimaryKey(autoGenerate = true) @ColumnInfo(name = "INV_NUM") var invNum: Int, | 130 | data class InvHead( |
131 | @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "INV_NUM") var invNum: Int, | ||
88 | @ColumnInfo(name = "INV_DESC") var descripcion: String?, | 132 | @ColumnInfo(name = "INV_DESC") var descripcion: String?, |
89 | @ColumnInfo(name = "ESTADO") var estado: Int?, | 133 | @ColumnInfo(name = "ESTADO") var estado: Int?, |
90 | @ColumnInfo(name = "INV_FEI") var fechaInicio: String?, | 134 | @ColumnInfo(name = "INV_FEI") var fechaInicio: String?, |
91 | @ColumnInfo(name = "INV_FEF") var fechaFinal: String?, | 135 | @ColumnInfo(name = "INV_FEF") var fechaFinal: String?, |
92 | // productos contados en el inventario | 136 | // productos contados en el inventario |
93 | @ColumnInfo(name = "INV_PRODCONT") var prodContados: Long?, | 137 | @ColumnInfo(name = "INV_PRODCONT") var prodContados: Long?, |
94 | @ColumnInfo(name = "INV_LUG") var lugar: Boolean?, | 138 | @ColumnInfo(name = "INV_LUG") var lugar: Boolean?, |
95 | // Solo se ajustan los productos incluidos en el conteo=0 | 139 | // Solo se ajustan los productos incluidos en el conteo=0 |
96 | // Ajusta productos no incluidos en el conteo con stock en cero=1 | 140 | // Ajusta productos no incluidos en el conteo con stock en cero=1 |
97 | @ColumnInfo(name = "PRO_NO_CONTA") var stDesc: Int?, | 141 | @ColumnInfo(name = "PRO_NO_CONTA") var stDesc: Int?, |
98 | // Mostror stock en el sistema al momento de la descarga del maestro. | 142 | // Mostror stock en el sistema al momento de la descarga del maestro. |
99 | @ColumnInfo(name = "MOSTRAR_STOCK") var proNoCont: Int?) | 143 | @ColumnInfo(name = "MOSTRAR_STOCK") var proNoCont: Int? |
144 | ) | ||
100 | 145 | ||
101 | 146 | ||
102 | @Entity(tableName = TABLA_INV_B) | 147 | @Entity(tableName = TABLA_INV_B) |
103 | data class InvBody(@ColumnInfo(name = "INV_NUM") var invNum: Int, | 148 | data class InvBody( |
104 | @ColumnInfo(name = "SEC") var sector: String?, | 149 | @ColumnInfo(name = "INV_NUM") var invNum: Int, |
105 | @ColumnInfo(name = "COD") var codigo: String?, | 150 | @ColumnInfo(name = "SEC") var sector: String?, |
106 | @ColumnInfo(name = "DES") var descripcion: String?, | 151 | @ColumnInfo(name = "COD") var codigo: String?, |
107 | @ColumnInfo(name = "CANT") var cantTomada: String?, | 152 | @ColumnInfo(name = "DES") var descripcion: String?, |
108 | @ColumnInfo(name = "CB") var codBar: String?, | 153 | @ColumnInfo(name = "CANT") var cantTomada: String?, |
109 | @ColumnInfo(name = "CBC") var codOrigen: String?, | 154 | @ColumnInfo(name = "CB") var codBar: String?, |
110 | @ColumnInfo(name = "PRE_VTA") var precio: String?, | 155 | @ColumnInfo(name = "CBC") var codOrigen: String?, |
111 | @ColumnInfo(name = "PRE_COS") var costo: String?, | 156 | @ColumnInfo(name = "PRE_VTA") var precio: String?, |
112 | @ColumnInfo(name = "BAL") var balanza: Int?, | 157 | @ColumnInfo(name = "PRE_COS") var costo: String?, |
113 | @ColumnInfo(name = "DSN") var depSn: Boolean?, | 158 | @ColumnInfo(name = "BAL") var balanza: Int?, |
114 | @ColumnInfo(name = "INV_FEI") var fechaInicio: String?, | 159 | @ColumnInfo(name = "DSN") var depSn: Boolean?, |
115 | @ColumnInfo(name = "INV_FEF") var fechaFinal: String?) : Serializable { | 160 | @ColumnInfo(name = "INV_FEI") var fechaInicio: String?, |
161 | @ColumnInfo(name = "INV_FEF") var fechaFinal: String? | ||
162 | ) : Serializable { | ||
116 | @PrimaryKey(autoGenerate = true) | 163 | @PrimaryKey(autoGenerate = true) |
117 | @ColumnInfo(name = "id") | 164 | @ColumnInfo(name = "id") |
118 | var id: Long = 0 | 165 | var id: Long = 0 |
119 | } | 166 | } |
120 | 167 | ||
121 | @Entity(tableName = TABLA_SERV_INV) | 168 | @Entity(tableName = TABLA_SERV_INV) |
122 | data class ServeInv( | 169 | data class ServeInv( |
123 | @ColumnInfo(name = "SER_DESC") var descripcion: String?, | 170 | @ColumnInfo(name = "SER_DESC") var descripcion: String?, |
124 | @ColumnInfo(name = "SER_DIR") var direccion: String?, | 171 | @ColumnInfo(name = "SER_DIR") var direccion: String?, |
125 | @ColumnInfo(name = "SER_PUERTO") var puerto: String?, | 172 | @ColumnInfo(name = "SER_PUERTO_SUBIDA") var puertoSubida: String?, |
126 | @ColumnInfo(name = "SER_PRE") var predeterminado: Int?): | 173 | @ColumnInfo(name = "SER_PUERTO_BAJADA") var puertoBajada: String?, |
127 | Serializable { @PrimaryKey(autoGenerate = true) | 174 | @ColumnInfo(name = "SER_PRE") var predeterminado: Int? |
128 | @ColumnInfo(name = "SER_NUM") | 175 | ) : |
129 | var servNum: Int=0 | 176 | Serializable { |
177 | @PrimaryKey(autoGenerate = true) | ||
178 | @ColumnInfo(name = "SER_NUM") | ||
179 | var servNum: Int = 0 | ||
130 | } | 180 | } |
131 | 181 | ||
182 | @Entity(tableName = TABLA_INV_SEC_H) | ||
183 | data class InvHeadSec( | ||
184 | @PrimaryKey() @ColumnInfo(name = "INV_NUM") var invNum: Int, | ||
185 | @ColumnInfo(name = "DET") var detalle: String?, | ||
186 | @ColumnInfo(name = "FET") var fechaInicio: String?, | ||
187 | @ColumnInfo(name = "DEP") var depsn: Boolean?, | ||
188 | @ColumnInfo(name = "EST") var estado: String?, | ||
189 | @ColumnInfo(name = "FEC") var fechaFinal: String?, | ||
190 | @ColumnInfo(name = "CONT") var prodContados: Int? | ||
191 | ) | ||
192 | |||
193 | |||
194 | @Entity(tableName = TABLA_INV_SEC_B) | ||
195 | data class InvBodySec( | ||
196 | @ColumnInfo(name = "INV") var invNum: Int, | ||
197 | @ColumnInfo(name = "SEC") var sector: String?, | ||
198 | @ColumnInfo(name = "ART") var codigo: String?, | ||
199 | @ColumnInfo(name = "DET") var descripcion: String?, | ||
200 | @ColumnInfo(name = "PRE") var precio: String?, | ||
201 | @ColumnInfo(name = "UNIVTA") var uniVenta: String?, | ||
202 | @ColumnInfo(name = "COS") var costo: String?, | ||
203 | @ColumnInfo(name = "CON") var contado: String?, | ||
204 | @ColumnInfo(name = "DSN") var depSn: Boolean?, | ||
205 | @ColumnInfo(name = "EXIVTA") var EXIVTA: String?, | ||
206 | @ColumnInfo(name = "EXIDEP") var EXIDEP: String?, | ||
207 | @ColumnInfo(name = "CODBAR") var CODBAR: String?, | ||
208 | @ColumnInfo(name = "FECTOM") var fechaTomado: String?, | ||
209 | @ColumnInfo(name = "FECTOMFIN") var fechaFinal: String? | ||
210 | ) : | ||
211 | Serializable { | ||
212 | @PrimaryKey(autoGenerate = true) | ||
213 | @ColumnInfo(name = "ID") | ||
214 | var id: Int = 0 | ||
215 | } | ||
132 | 216 | ||
133 | 217 |
app/src/main/java/com/focasoftware/deboinventariov20/Model/WebService.kt
1 | package com.focasoftware.deboinventariov20.Model | 1 | package com.focasoftware.deboinventariov20.Model |
2 | 2 | ||
3 | import com.focasoftware.deboinventariov20.UI.actualizacionMaestros.BASE_URL | 3 | |
4 | import okhttp3.OkHttpClient | 4 | import okhttp3.OkHttpClient |
5 | import okhttp3.logging.HttpLoggingInterceptor | 5 | import okhttp3.logging.HttpLoggingInterceptor |
6 | import retrofit2.Retrofit | 6 | import retrofit2.Retrofit |
7 | import retrofit2.converter.gson.GsonConverterFactory | 7 | import retrofit2.converter.gson.GsonConverterFactory |
8 | import java.util.concurrent.TimeUnit | 8 | import java.util.concurrent.TimeUnit |
9 | 9 | ||
10 | object WebService { | 10 | var BASE_URL: String = "" |
11 | private var instance: WebService? = null | 11 | |
12 | private var retrofit: Retrofit? = null | 12 | class WebService private constructor() { |
13 | private val TIME_OUT: Long | 13 | |
14 | get() { | 14 | private val retrofit: Retrofit |
15 | return 15 | 15 | private val loggingInterceptor: HttpLoggingInterceptor = HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY) |
16 | } | 16 | private val httpClientBuilder: OkHttpClient.Builder |
17 | private val interceptor = run { | 17 | |
18 | val httpLoggingInterceptor = HttpLoggingInterceptor() | 18 | // private val interceptor = run { |
19 | httpLoggingInterceptor.apply { | 19 | // val httpLoggingInterceptor = HttpLoggingInterceptor() |
20 | httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY | 20 | // httpLoggingInterceptor.apply { |
21 | } | 21 | // httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY |
22 | // } | ||
23 | // } | ||
24 | // private val TIME_OUT: Long | ||
25 | // get() { | ||
26 | // return 200 | ||
27 | // } | ||
28 | // private val okHttpClient = OkHttpClient.Builder() | ||
29 | // .addNetworkInterceptor(interceptor) | ||
30 | // .connectTimeout(TIME_OUT, TimeUnit.SECONDS) | ||
31 | // .writeTimeout(TIME_OUT, TimeUnit.SECONDS) | ||
32 | // .readTimeout(TIME_OUT, TimeUnit.SECONDS) | ||
33 | // .build() | ||
34 | |||
35 | fun createService(): WebServiceApi { | ||
36 | return retrofit.create(WebServiceApi::class.java) | ||
22 | } | 37 | } |
23 | private val okHttpClient = OkHttpClient.Builder() | ||
24 | .addNetworkInterceptor(interceptor) | ||
25 | .connectTimeout(TIME_OUT, TimeUnit.SECONDS) | ||
26 | .writeTimeout(TIME_OUT, TimeUnit.SECONDS) | ||
27 | .readTimeout(TIME_OUT, TimeUnit.SECONDS) | ||
28 | .build() | ||
29 | 38 | ||
39 | fun <S> createService(serviceClass: Class<S>): S { | ||
40 | return retrofit.create(serviceClass) | ||
41 | } | ||
42 | |||
43 | companion object { | ||
44 | |||
45 | |||
46 | @get:Synchronized | ||
47 | var instance: WebService? = null | ||
48 | get() { | ||
49 | if (field == null) { | ||
50 | field = WebService() | ||
51 | } | ||
52 | return field | ||
53 | } | ||
54 | private set | ||
55 | } | ||
56 | |||
57 | init { | ||
58 | httpClientBuilder = OkHttpClient.Builder().addInterceptor(loggingInterceptor) | ||
59 | retrofit = Retrofit.Builder() | ||
60 | .baseUrl(BASE_URL) | ||
61 | // .client(okHttpClient) | ||
62 | .client(httpClientBuilder.build()) | ||
63 | .addConverterFactory(GsonConverterFactory.create()) | ||
64 | .build() | ||
65 | } | ||
66 | } | ||
67 | //object WebService2 { | ||
68 | // private var instance: WebService? = null | ||
69 | // private val TIME_OUT: Long | ||
70 | // get() { | ||
71 | // return 15 | ||
72 | // } | ||
73 | // private val interceptor = run { | ||
74 | // val httpLoggingInterceptor = HttpLoggingInterceptor() | ||
75 | // httpLoggingInterceptor.apply { | ||
76 | // httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY | ||
77 | // } | ||
78 | // } | ||
79 | // private val okHttpClient = OkHttpClient.Builder() | ||
80 | // .addNetworkInterceptor(interceptor) | ||
81 | // .connectTimeout(TIME_OUT, TimeUnit.SECONDS) | ||
82 | // .writeTimeout(TIME_OUT, TimeUnit.SECONDS) | ||
83 | // .readTimeout(TIME_OUT, TimeUnit.SECONDS) | ||
84 | // .build() | ||
85 | // | ||
86 | // fun getProductosService(): WebServiceApi { | ||
87 | // return Retrofit.Builder() | ||
88 | // .client(okHttpClient) | ||
89 | // .baseUrl(BASE_URL) | ||
90 | // .addConverterFactory(GsonConverterFactory.create()) | ||
91 | // .build() | ||
92 | // .create(insertarItominvc::class.java) | ||
93 | // } | ||
94 | //} | ||
30 | // private fun WebService() { | 95 | // private fun WebService() { |
31 | // retrofit = Retrofit.Builder() | 96 | // retrofit = Retrofit.Builder() |
32 | // .client(okHttpClient) | 97 | // .client(okHttpClient) |
33 | // .baseUrl(BASE_URL) | 98 | // .baseUrl(BASE_URL) |
34 | // .addConverterFactory(GsonConverterFactory.create()) | 99 | // .addConverterFactory(GsonConverterFactory.create()) |
35 | // .build() | 100 | // .build() |
36 | // } | 101 | // } |
37 | // | 102 | // |
38 | // @Synchronized | 103 | // @Synchronized |
39 | // fun getInstance(): WebService? { | 104 | // fun getInstance(): WebService? { |
40 | // if (instance == null) { | 105 | // if (instance == null) { |
41 | // instance = WebService | 106 | // instance = WebService |
42 | // } | 107 | // } |
43 | // return instance | 108 | // return instance |
44 | // } | 109 | // } |
45 | // fun <S> createService(serviceClass: Class<S>): S { | 110 | // fun <S> createService(serviceClass: Class<S>): S { |
46 | // return retrofit!!.create(serviceClass) | 111 | // return retrofit!!.create(serviceClass) |
47 | // } | 112 | // } |
48 | 113 | ||
49 | // fun getProductosService(): EndPoints { | 114 | // fun getProductosService(): EndPoints { |
50 | // return Retrofit.Builder() | 115 | // return Retrofit.Builder() |
51 | // .client(okHttpClient) | 116 | // .client(okHttpClient) |
52 | // .baseUrl(BASE_URL) | 117 | // .baseUrl(BASE_URL) |
53 | // .addConverterFactory(GsonConverterFactory.create()) | 118 | // .addConverterFactory(GsonConverterFactory.create()) |
app/src/main/java/com/focasoftware/deboinventariov20/Model/WebServiceApi.kt
1 | package com.focasoftware.deboinventariov20.Model | 1 | package com.focasoftware.deboinventariov20.Model |
2 | 2 | ||
3 | import retrofit2.Call | 3 | import retrofit2.Call |
4 | import retrofit2.Response | ||
5 | import retrofit2.http.Body | 4 | import retrofit2.http.Body |
6 | import retrofit2.http.GET | 5 | import retrofit2.http.GET |
7 | import retrofit2.http.POST | 6 | import retrofit2.http.POST |
8 | 7 | ||
9 | |||
10 | interface WebServiceApi { | 8 | interface WebServiceApi { |
11 | 9 | ||
12 | @GET("articulos/articulosCodBarra") | 10 | @GET("articulos/articulosCodBarra") |
13 | fun getProductos(): Call<List<Productos>> | 11 | fun getProductos():Call<List<Productos?>?>? |
12 | |||
13 | @GET("articulos/time") | ||
14 | fun getTime():Call<List<Time?>?>? | ||
15 | |||
16 | @POST("api/insertar-itominvc") | ||
17 | fun insertarItominvc(@Body itomInvC: ItomInvC): Call<DefaultResponse> | ||
18 | |||
19 | @POST("api/insertar-itominvd") | ||
20 | fun insertarItominvd(@Body itominvd: ItomInvD): Call<Void?> | ||
21 | |||
22 | |||
23 | |||
24 | |||
25 | // @POST("api/insertar-inventario") | ||
26 | // fun inventarioToSend(@Body invToSend: InvToSend): Call<Void?> | ||
27 | |||
28 | @GET("api/get-cabecera-inventario") | ||
29 | fun getHeadInvSec():Call<List<InvHeadSecR?>?>? | ||
30 | |||
31 | @POST("api/get-detalle-inventario") | ||
32 | fun getBodyInvSec(@Body inv_num: NumInvSec?): Call<List<InvBodySecR?>?>? | ||
33 | |||
34 | @POST("api/update-cabecera-inventario") | ||
35 | fun inventarioSecToSendHead(@Body invSecHeadToSend: InvSecHeadToSend): Call<Void?> | ||
14 | 36 | ||
37 | @POST("api/update-detalle-inventario") | ||
38 | fun inventarioSecToSendBody(@Body invSecBodyToSend: InvSecBodyToSend): Call<Void?> |
app/src/main/java/com/focasoftware/deboinventariov20/UI/MainActivity.kt
1 | package com.focasoftware.deboinventariov20.UI | 1 | package com.focasoftware.deboinventariov20.UI |
2 | 2 | ||
3 | import android.os.Bundle | 3 | import android.os.Bundle |
4 | import android.view.Menu | 4 | import android.view.Menu |
5 | import com.google.android.material.navigation.NavigationView | 5 | import com.google.android.material.navigation.NavigationView |
6 | import androidx.navigation.findNavController | 6 | import androidx.navigation.findNavController |
7 | import androidx.navigation.ui.AppBarConfiguration | 7 | import androidx.navigation.ui.AppBarConfiguration |
8 | import androidx.navigation.ui.navigateUp | 8 | import androidx.navigation.ui.navigateUp |
9 | import androidx.navigation.ui.setupActionBarWithNavController | 9 | import androidx.navigation.ui.setupActionBarWithNavController |
10 | import androidx.navigation.ui.setupWithNavController | 10 | import androidx.navigation.ui.setupWithNavController |
11 | import androidx.drawerlayout.widget.DrawerLayout | 11 | import androidx.drawerlayout.widget.DrawerLayout |
12 | import androidx.appcompat.app.AppCompatActivity | 12 | import androidx.appcompat.app.AppCompatActivity |
13 | import androidx.appcompat.widget.Toolbar | 13 | import androidx.appcompat.widget.Toolbar |
14 | import com.focasoftware.deboinventariov20.R | 14 | import com.focasoftware.deboinventariov20.R |
15 | 15 | ||
16 | class MainActivity : AppCompatActivity() { | 16 | class MainActivity : AppCompatActivity() { |
17 | 17 | ||
18 | private lateinit var appBarConfiguration: AppBarConfiguration | 18 | private lateinit var appBarConfiguration: AppBarConfiguration |
19 | 19 | ||
20 | override fun onCreate(savedInstanceState: Bundle?) { | 20 | override fun onCreate(savedInstanceState: Bundle?) { |
21 | super.onCreate(savedInstanceState) | 21 | super.onCreate(savedInstanceState) |
22 | setContentView(R.layout.activity_main) | 22 | setContentView(R.layout.activity_main) |
23 | val toolbar: Toolbar = findViewById(R.id.toolbar) | 23 | val toolbar: Toolbar = findViewById(R.id.toolbar) |
24 | setSupportActionBar(toolbar) | 24 | setSupportActionBar(toolbar) |
25 | 25 | ||
26 | 26 | ||
27 | val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout) | 27 | val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout) |
28 | val navView: NavigationView = findViewById(R.id.nav_view) | 28 | val navView: NavigationView = findViewById(R.id.nav_view) |
29 | val navController = findNavController(R.id.nav_host_fragment) | 29 | val navController = findNavController(R.id.nav_host_fragment) |
30 | 30 | ||
31 | appBarConfiguration = AppBarConfiguration(setOf(R.id.mainFragment2, R.id.inventarioFragment, R.id.actuaMaestrosFragment, R.id.configuracionFragment), drawerLayout) | 31 | appBarConfiguration = AppBarConfiguration(setOf(R.id.mainFragment2, R.id.inventarioFragment, R.id.actuaMaestrosFragment, R.id.configuracionFragment), drawerLayout) |
32 | setupActionBarWithNavController(navController, appBarConfiguration) | 32 | setupActionBarWithNavController(navController, appBarConfiguration) |
33 | navView.setupWithNavController(navController) | 33 | navView.setupWithNavController(navController) |
34 | } | 34 | } |
35 | 35 | ||
36 | override fun onCreateOptionsMenu(menu: Menu): Boolean { | 36 | override fun onCreateOptionsMenu(menu: Menu): Boolean { |
37 | // Inflate the menu; this adds items to the action bar if it is present. | 37 | // Inflate the menu; this adds items to the action bar if it is present. |
38 | menuInflater.inflate(R.menu.main, menu) | 38 | menuInflater.inflate(R.menu.main, menu) |
39 | return true | 39 | return true |
40 | } | 40 | } |
41 | 41 | ||
42 | override fun onSupportNavigateUp(): Boolean { | 42 | override fun onSupportNavigateUp(): Boolean { |
43 | val navController = findNavController(R.id.nav_host_fragment) | 43 | val navController = findNavController(R.id.nav_host_fragment) |
44 | return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp() | 44 | return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp() |
45 | } | 45 | } |
46 | |||
46 | } | 47 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/SplashActivity.kt
1 | package com.focasoftware.deboinventariov20.UI | 1 | package com.focasoftware.deboinventariov20.UI |
2 | 2 | ||
3 | import android.app.Activity | 3 | import android.app.Activity |
4 | import android.content.Context | ||
4 | import android.content.Intent | 5 | import android.content.Intent |
6 | import android.content.SharedPreferences | ||
5 | import android.os.Bundle | 7 | import android.os.Bundle |
6 | import com.focasoftware.deboinventariov20.R | 8 | import com.focasoftware.deboinventariov20.R |
7 | 9 | ||
10 | private lateinit var sharedPreferences: SharedPreferences | ||
11 | |||
8 | class SplashActivity : Activity() { | 12 | class SplashActivity : Activity() { |
9 | 13 | ||
10 | override fun onCreate(savedInstanceState: Bundle?) { | 14 | override fun onCreate(savedInstanceState: Bundle?) { |
11 | super.onCreate(savedInstanceState) | 15 | super.onCreate(savedInstanceState) |
12 | setContentView(R.layout.activity_splash) | 16 | setContentView(R.layout.activity_splash) |
13 | //window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | 17 | |
18 | sharedPreferences = baseContext.getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | ||
19 | val editor = sharedPreferences.edit() | ||
20 | editor?.putString("inicio", "inicio") | ||
21 | editor?.apply() | ||
22 | editor.commit() | ||
23 | val bac = object : Thread() { | ||
24 | override fun run() { | ||
25 | try { | ||
26 | sleep(3000) | ||
27 | val intent = Intent(baseContext, MainActivity::class.java) | ||
28 | startActivity(intent) | ||
29 | finish() | ||
30 | } catch (e: Exception) { | ||
31 | e.printStackTrace() | ||
32 | } | ||
33 | } | ||
34 | } | ||
35 | bac.start() | ||
14 | 36 | ||
15 | val bac = object : Thread(){ | 37 | } |
16 | override fun run(){ | ||
17 | try { |
app/src/main/java/com/focasoftware/deboinventariov20/UI/Utils/BaseViewHolder.kt
1 | package com.focasoftware.deboinventariov20.UI.Utils | 1 | package com.focasoftware.deboinventariov20.UI.Utils |
2 | 2 | ||
3 | import android.view.View | 3 | import android.view.View |
4 | import androidx.recyclerview.widget.RecyclerView | 4 | import androidx.recyclerview.widget.RecyclerView |
5 | 5 | ||
6 | abstract class BaseViewHolder<T>(itemView: View):RecyclerView.ViewHolder(itemView) { | 6 | abstract class BaseViewHolder<T>(itemView: View):RecyclerView.ViewHolder(itemView) { |
7 | abstract fun bind(item: T, position: Int) | 7 | abstract fun bind(item: T, position: Int) |
8 | } | 8 | } |
9 | |||
10 |
app/src/main/java/com/focasoftware/deboinventariov20/UI/Utils/Utils.kt
1 | package com.focasoftware.deboinventariov20.UI.Utils | 1 | package com.focasoftware.deboinventariov20.UI.Utils |
2 | 2 | ||
3 | import android.app.Activity | ||
3 | import android.app.AlertDialog | 4 | import android.app.AlertDialog |
4 | import android.app.Dialog | 5 | import android.app.Dialog |
5 | import android.content.Context | 6 | import android.content.Context |
7 | import android.content.Intent | ||
6 | import android.os.Bundle | 8 | import android.os.Bundle |
9 | import android.provider.Settings | ||
10 | import android.view.LayoutInflater | ||
11 | import android.view.View | ||
12 | import android.view.WindowManager | ||
13 | import android.view.inputmethod.InputMethodManager | ||
14 | import androidx.core.content.ContextCompat.getSystemService | ||
7 | import androidx.fragment.app.DialogFragment | 15 | import androidx.fragment.app.DialogFragment |
16 | import androidx.fragment.app.FragmentActivity | ||
8 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 17 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
18 | import com.focasoftware.deboinventariov20.Model.ServeInv | ||
19 | import com.focasoftware.deboinventariov20.R | ||
20 | import com.focasoftware.deboinventariov20.UI.inventario.InventarioFragment | ||
21 | import kotlinx.android.synthetic.main.fragment_inventario.* | ||
22 | import kotlinx.android.synthetic.main.solicitar_fecha.view.* | ||
9 | import kotlinx.coroutines.Dispatchers | 23 | import kotlinx.coroutines.Dispatchers |
10 | import kotlinx.coroutines.GlobalScope | 24 | import kotlinx.coroutines.GlobalScope |
11 | import kotlinx.coroutines.async | 25 | import kotlinx.coroutines.async |
12 | import java.io.IOException | 26 | import java.io.IOException |
13 | import java.net.UnknownHostException | 27 | import java.net.UnknownHostException |
14 | import java.time.LocalDateTime | 28 | import java.time.LocalDateTime |
15 | import java.time.format.DateTimeFormatter | 29 | import java.time.format.DateTimeFormatter |
16 | 30 | ||
31 | |||
32 | private var serverPre: ServeInv? = null | ||
33 | |||
17 | fun modificarCantidadEnCabecera(inventarioActual: Int, b: Boolean, context: Context) { | 34 | fun modificarCantidadEnCabecera(inventarioActual: Int, b: Boolean, context: Context) { |
18 | GlobalScope.async(Dispatchers.IO) { | 35 | GlobalScope.async(Dispatchers.IO) { |
19 | var cantProductos = 0 | 36 | var cantProductos = 0 |
20 | cantProductos = | 37 | cantProductos = |
21 | AppDb.getAppDb(context)!!.InvHeadDAO()!!.consultaCantidadInvH(inventarioActual) | 38 | AppDb.getAppDb(context)!!.InvHeadDAO()!!.consultaCantidadInvH(inventarioActual) |
22 | if (b) { | 39 | if (b) { |
23 | AppDb.getAppDb(context)!!.InvHeadDAO()!! | 40 | AppDb.getAppDb(context)!!.InvHeadDAO()!! |
24 | .updateInvBody(inventarioActual, cantProductos + 1) | 41 | .updateInvCantHead(inventarioActual, cantProductos + 1) |
25 | } else { | 42 | } else { |
26 | AppDb.getAppDb(context)!!.InvHeadDAO()!! | 43 | AppDb.getAppDb(context)!!.InvHeadDAO()!! |
27 | .updateInvBody(inventarioActual, cantProductos - 1) | 44 | .updateInvCantHead(inventarioActual, cantProductos - 1) |
28 | } | 45 | } |
29 | } | 46 | } |
30 | } | 47 | } |
31 | 48 | ||
32 | open class AlertDialogBorrarInv : DialogFragment() { | 49 | open class AlertDialogBorrarInv : DialogFragment() { |
33 | 50 | ||
34 | interface OnBorrarInvClickListener { | 51 | interface OnBorrarInvClickListener { |
35 | fun onPositiveClick() | 52 | fun onPositiveClick() |
36 | fun onCancelClick() | 53 | fun onCancelClick() |
37 | } | 54 | } |
38 | 55 | ||
39 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | 56 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |
40 | return activity?.let { | 57 | return activity?.let { |
41 | val title = "Borrar Inventario" | 58 | val title = "Borrar Inventario" |
42 | val content = "¿Seguro que desea Borrar el inventario?" | 59 | val content = "¿Seguro que desea Borrar el inventario?" |
43 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | 60 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) |
44 | builder.setTitle(title).setMessage(content) | 61 | builder.setTitle(title).setMessage(content) |
45 | 62 | ||
46 | .setPositiveButton(android.R.string.ok) { _, _ -> | 63 | .setPositiveButton(android.R.string.ok) { _, _ -> |
47 | val listener = activity as OnBorrarInvClickListener? | 64 | val listener = activity as OnBorrarInvClickListener? |
48 | listener!!.onPositiveClick() | 65 | listener!!.onPositiveClick() |
49 | } | 66 | } |
50 | .setNegativeButton(android.R.string.cancel) { _, _ -> | 67 | .setNegativeButton(android.R.string.cancel) { _, _ -> |
51 | val listener = activity as OnBorrarInvClickListener? | 68 | val listener = activity as OnBorrarInvClickListener? |
52 | listener!!.onCancelClick() | 69 | listener!!.onCancelClick() |
53 | } | 70 | } |
54 | return builder.create() | 71 | return builder.create() |
55 | } ?: throw IllegalStateException("Activity cannot be null") | 72 | } ?: throw IllegalStateException("Activity cannot be null") |
56 | } | 73 | } |
57 | } | 74 | } |
58 | 75 | ||
59 | class NoEncontradoSimple : DialogFragment() { | 76 | class NoEncontradoSimple : DialogFragment() { |
60 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | 77 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |
61 | return activity?.let { | 78 | return activity?.let { |
62 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | 79 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) |
80 | .setCancelable(true) | ||
81 | |||
63 | builder.show() | 82 | builder.show() |
64 | val title = "" | 83 | val title = "" |
65 | val content = "¡El producto buscado NO fue encontrado!" | 84 | val content = "¡El producto buscado NO fue encontrado!" |
66 | 85 | ||
67 | builder.setTitle(title).setMessage(content) | 86 | builder.setTitle(title).setMessage(content) |
68 | .setPositiveButton(android.R.string.ok) { _, _ -> } | 87 | .setPositiveButton(android.R.string.ok) { _, _ -> |
88 | |||
89 | } | ||
69 | return builder.create() | 90 | return builder.create() |
70 | } ?: throw IllegalStateException("Activity cannot be null") | 91 | } ?: throw IllegalStateException("Activity cannot be null") |
71 | } | 92 | } |
72 | } | 93 | } |
73 | 94 | ||
74 | class NoServerConf : DialogFragment() { | 95 | class NoServerConf : DialogFragment() { |
75 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | 96 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |
76 | return activity?.let { | 97 | return activity?.let { |
77 | val title = "" | 98 | val title = "" |
78 | val content = "¡Antes de importar debe configurar un servidor!" | 99 | val content = "¡Antes de importar debe configurar un servidor!" |
79 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | 100 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) |
80 | builder.setTitle(title).setMessage(content) | 101 | builder.setTitle(title).setMessage(content) |
81 | .setPositiveButton(android.R.string.ok) { _, _ -> | 102 | .setPositiveButton(android.R.string.ok) { _, _ -> |
82 | activity?.onBackPressed() | 103 | activity?.onBackPressed() |
83 | } | 104 | } |
84 | 105 | ||
85 | return builder.create() | 106 | return builder.create() |
86 | } ?: throw IllegalStateException("Activity cannot be null") | 107 | } ?: throw IllegalStateException("Activity cannot be null") |
87 | } | 108 | } |
88 | } | 109 | } |
89 | 110 | ||
90 | fun isConnectedToThisServer(host: String): Boolean { | 111 | fun isConnectedToThisServer(host: String): Boolean { |
91 | 112 | ||
92 | val runtime = Runtime.getRuntime() | 113 | val runtime = Runtime.getRuntime() |
93 | try { | 114 | try { |
94 | val ipProcess = runtime.exec("/system/bin/ping -c 1 $host") | 115 | val ipProcess = runtime.exec("/system/bin/ping -c 1 $host") |
95 | val exitValue = ipProcess.waitFor() | 116 | val exitValue = ipProcess.waitFor() |
96 | ipProcess.destroy() | 117 | ipProcess.destroy() |
97 | return exitValue == 0 | 118 | return exitValue == 0 |
98 | } catch (e: UnknownHostException) { | 119 | } catch (e: UnknownHostException) { |
99 | e.printStackTrace() | 120 | e.printStackTrace() |
100 | } catch (e: IOException) { | 121 | } catch (e: IOException) { |
101 | e.printStackTrace() | 122 | e.printStackTrace() |
102 | } catch (e: InterruptedException) { | 123 | } catch (e: InterruptedException) { |
103 | e.printStackTrace() | 124 | e.printStackTrace() |
104 | } | 125 | } |
105 | 126 | ||
106 | return false | 127 | return false |
107 | } | 128 | } |
129 | |||
108 | class ServerValido : DialogFragment() { | 130 | class ServerValido : DialogFragment() { |
109 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | 131 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |
110 | return activity?.let { | 132 | return activity?.let { |
111 | val title = "" | 133 | val title = "" |
112 | val content = "¡La IP del servidor es correcta!" | 134 | val content = "¡La IP del servidor es correcta!" |
113 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | 135 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) |
114 | builder.setTitle(title).setMessage(content) | 136 | builder.setTitle(title).setMessage(content) |
115 | .setPositiveButton(android.R.string.ok) { _, _ -> } | 137 | .setPositiveButton(android.R.string.ok) { _, _ -> } |
116 | return builder.create() | 138 | return builder.create() |
117 | } ?: throw IllegalStateException("Activity cannot be null") | 139 | } ?: throw IllegalStateException("Activity cannot be null") |
118 | } | 140 | } |
119 | } | 141 | } |
142 | |||
120 | class ServerNoValido : DialogFragment() { | 143 | class ServerNoValido : DialogFragment() { |
121 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | 144 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |
122 | return activity?.let { | 145 | return activity?.let { |
123 | val title = "" | 146 | val title = "" |
124 | val content = "¡La IP del servidor es Incorrecta! Verfique en la carga de Servidores." | 147 | val content = "¡La IP del servidor es Incorrecta! Verfique en la carga de Servidores." |
125 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | 148 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) |
126 | builder.setTitle(title).setMessage(content) | 149 | builder.setTitle(title).setMessage(content) |
127 | .setPositiveButton(android.R.string.ok) { _, _ -> } | 150 | .setPositiveButton(android.R.string.ok) { _, _ -> } |
128 | return builder.create() | 151 | return builder.create() |
129 | } ?: throw IllegalStateException("Activity cannot be null") | 152 | } ?: throw IllegalStateException("Activity cannot be null") |
130 | } | 153 | } |
131 | } | 154 | } |
155 | |||
132 | class ServerNoConf : DialogFragment() { | 156 | class ServerNoConf : DialogFragment() { |
133 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | 157 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |
134 | return activity?.let { | 158 | return activity?.let { |
135 | val title = "Servidor no Valido" | 159 | val title = "Servidor no Valido" |
136 | val content = "!Debe configurar el Servidor en Configuraciones¡" | 160 | val content = "!Debe configurar el Servidor en Configuraciones¡" |
137 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | 161 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) |
138 | builder.setTitle(title).setMessage(content) | 162 | builder.setTitle(title).setMessage(content) |
139 | .setPositiveButton(android.R.string.ok) { _, _ -> } | 163 | .setPositiveButton(android.R.string.ok) { _, _ -> } |
140 | return builder.create() | 164 | return builder.create() |
141 | } ?: throw IllegalStateException("Activity cannot be null") | 165 | } ?: throw IllegalStateException("Activity cannot be null") |
142 | } | 166 | } |
143 | } | 167 | } |
168 | |||
144 | class ExportacionExitosa : DialogFragment() { | 169 | class ExportacionExitosa : DialogFragment() { |
145 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | 170 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { |
146 | return activity?.let { | 171 | return activity?.let { |
147 | val title = "Exportación de Inventarios" | 172 | val title = "Exportación de Inventarios" |
148 | val content = "!La exportacion del inventario se realizo exitosamente¡" | 173 | val content = "!La exportacion del inventario se realizo exitosamente¡" |
149 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | 174 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) |
150 | builder.setTitle(title).setMessage(content) | 175 | builder.setTitle(title).setMessage(content) |
151 | .setPositiveButton(android.R.string.ok) { _, _ -> } | 176 | .setPositiveButton(android.R.string.ok) { _, _ -> } |
152 | return builder.create() | 177 | return builder.create() |
153 | } ?: throw IllegalStateException("Activity cannot be null") | 178 | } ?: throw IllegalStateException("Activity cannot be null") |
154 | } | 179 | } |
155 | } | 180 | } |
181 | |||
182 | class ExportacionFracasada : DialogFragment() { | ||
183 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
184 | return activity?.let { | ||
185 | val title = "Exportación de Inventarios" | ||
186 | val content = "!No se pudo realizar la expotación¡" | ||
187 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | ||
188 | builder.setTitle(title).setMessage(content) | ||
189 | .setPositiveButton(android.R.string.ok) { _, _ -> } | ||
190 | return builder.create() | ||
191 | } ?: throw IllegalStateException("Activity cannot be null") | ||
192 | } | ||
193 | } | ||
194 | |||
195 | fun obtenerFechaActualFormatoFoca(): String { | ||
196 | //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD | ||
197 | val current = LocalDateTime.now() | ||
198 | val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") | ||
199 | val dFechaHora = current.format(formatter) | ||
200 | return dFechaHora.toString() | ||
201 | } | ||
156 | fun obtenerFechaActual(): String { | 202 | fun obtenerFechaActual(): String { |
157 | //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD | ||
158 | val current = LocalDateTime.now() | ||
159 | val formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy hh:mm:ss") | ||
160 | val dFechaHora = current.format(formatter) | ||
161 | return dFechaHora.toString() | ||
162 | } | ||
203 | //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD | ||
204 | val current = LocalDateTime.now() | ||
205 | val formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss") | ||
206 | val dFechaHora = current.format(formatter) | ||
207 | return dFechaHora.toString() | ||
208 | } | ||
209 | fun obtenerHoraActual(): String { | ||
210 | //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD | ||
211 | val current = LocalDateTime.now() | ||
212 | val formatter = DateTimeFormatter.ofPattern("HHmmss") | ||
213 | val dFechaHora = current.format(formatter) | ||
214 | return dFechaHora.toString() | ||
215 | } | ||
216 | |||
217 | fun obtenerDiaActual(): String { | ||
218 | //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD | ||
219 | val current = LocalDateTime.now() | ||
220 | val formatter = DateTimeFormatter.ofPattern("ddMMyyyy") | ||
221 | val dFechaHora = current.format(formatter) | ||
222 | return dFechaHora.toString() | ||
223 | } | ||
224 | class SelAreaInventarioVentas : DialogFragment() { | ||
225 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
226 | return activity?.let { | ||
227 | val title = "Inventarios de Ventas" | ||
228 | val content = "!En busqueda de articulos no estaran disponibles los articulos de DEPOSITO¡" | ||
229 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | ||
230 | builder.setTitle(title).setMessage(content) | ||
231 | .setPositiveButton(android.R.string.ok) { _, _ -> } | ||
232 | return builder.create() | ||
233 | } ?: throw IllegalStateException("Activity cannot be null") | ||
234 | } | ||
235 | } | ||
236 | |||
237 | class SelAreaInventarioDeposito : DialogFragment() { | ||
238 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
239 | return activity?.let { | ||
240 | val title = "Inventarios de Depositos" | ||
241 | val content = "!En busqueda de articulos no estaran disponibles los articulos de VENTAS¡" | ||
242 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | ||
243 | builder.setTitle(title).setMessage(content) | ||
244 | .setPositiveButton(android.R.string.ok) { _, _ -> } | ||
245 | return builder.create() | ||
246 | } ?: throw IllegalStateException("Activity cannot be null") | ||
247 | } | ||
248 | } | ||
249 | |||
250 | fun dialogoHoraServer(reqActivity: FragmentActivity, context: Context, fechaHoraDispositivo: String, fechaHoraServer: String) { | ||
251 | val mDialogView: View = LayoutInflater.from(context).inflate(R.layout.solicitar_fecha, null) | ||
252 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(false) | ||
253 | |||
254 | |||
255 | mDialogView.tvHoraDispositivo.text = fechaHoraDispositivo | ||
256 | mDialogView.tvHoraServidor.text = fechaHoraServer | ||
257 | val mAlertDialog = mBuilder.show() | ||
258 | |||
259 | // mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | ||
260 | // mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | ||
261 | // | ||
262 | // val imm = reqActivity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager? | ||
263 | // imm!!.hideSoftInputFromWindow(reqActivity.currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | ||
264 | |||
265 | mDialogView.btnCambiarHora.setOnClickListener { | ||
266 | context.startActivity(Intent(Settings.ACTION_DATE_SETTINGS)) | ||
267 | mAlertDialog.dismiss() | ||
268 | } | ||
269 | |||
270 | mDialogView.btnSalir.setOnClickListener { | ||
271 | mAlertDialog.dismiss() | ||
272 | } | ||
273 | } | ||
274 | |||
275 | class InvSecImp : DialogFragment() { | ||
276 | override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { | ||
277 | return activity?.let { | ||
278 | val title = "Inventarios de Sectorizados" | ||
279 | val content = "!Inventario importado correctamente¡" | ||
280 | val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity()) | ||
281 | builder.setTitle(title).setMessage(content) | ||
282 | .setPositiveButton(android.R.string.ok) { _, _ -> } | ||
283 | return builder.create() | ||
284 | } ?: throw IllegalStateException("Activity cannot be null") | ||
285 | } | ||
286 | } | ||
287 | |||
288 | suspend fun fetchServerPreOne(reqActivity: FragmentActivity): ServeInv? { | ||
289 | return GlobalScope.async(Dispatchers.IO) { | ||
290 | return@async AppDb.getAppDb(reqActivity)!!.ServeInvDao()!!.fetchServerPreOne() | ||
291 | }.await() | ||
292 | } | ||
293 | |||
294 | //fun hideSoftKeyboard(reqActivity: FragmentActivity) { | ||
295 | // val imm = reqActivity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager? | ||
296 | // imm!!.hideSoftInputFromWindow(reqActivity.currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
app/src/main/java/com/focasoftware/deboinventariov20/UI/actualizacionMaestros/ActuaMaestrosFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.actualizacionMaestros | 1 | package com.focasoftware.deboinventariov20.UI.actualizacionMaestros |
2 | 2 | ||
3 | import android.os.Bundle | 3 | import android.os.Bundle |
4 | import android.view.LayoutInflater | 4 | import android.view.LayoutInflater |
5 | import android.view.View | 5 | import android.view.View |
6 | import android.view.ViewGroup | 6 | import android.view.ViewGroup |
7 | import android.widget.Button | 7 | import android.widget.Button |
8 | import android.widget.RadioButton | 8 | import android.widget.RadioButton |
9 | import android.widget.Toast | ||
9 | import androidx.fragment.app.Fragment | 10 | import androidx.fragment.app.Fragment |
10 | import androidx.lifecycle.lifecycleScope | 11 | import androidx.navigation.NavController |
12 | import androidx.navigation.Navigation | ||
11 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 13 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
12 | import com.focasoftware.deboinventariov20.Model.Articles | 14 | import com.focasoftware.deboinventariov20.Model.* |
13 | import com.focasoftware.deboinventariov20.Model.ServeInv | ||
14 | import com.focasoftware.deboinventariov20.R | 15 | import com.focasoftware.deboinventariov20.R |
16 | import com.focasoftware.deboinventariov20.UI.MainActivity | ||
15 | import com.focasoftware.deboinventariov20.UI.Utils.NoServerConf | 17 | import com.focasoftware.deboinventariov20.UI.Utils.NoServerConf |
16 | import com.focasoftware.deboinventariov20.UI.Utils.ServerNoConf | 18 | import com.focasoftware.deboinventariov20.UI.Utils.ServerNoConf |
19 | import com.focasoftware.deboinventariov20.UI.Utils.fetchServerPreOne | ||
17 | import kotlinx.android.synthetic.main.fragment_actua_maestros.* | 20 | import kotlinx.android.synthetic.main.fragment_actua_maestros.* |
18 | import kotlinx.coroutines.* | 21 | import kotlinx.coroutines.* |
19 | import kotlinx.coroutines.Dispatchers.IO | 22 | import kotlinx.coroutines.Dispatchers.IO |
20 | import kotlinx.coroutines.Dispatchers.Main | 23 | import kotlinx.coroutines.Dispatchers.Main |
24 | import retrofit2.Call | ||
25 | import retrofit2.Callback | ||
26 | import retrofit2.Response | ||
27 | import java.net.SocketTimeoutException | ||
21 | 28 | ||
22 | 29 | ||
23 | var BASE_URL = "" | 30 | private var serverPre: ServeInv? = null |
24 | var serverPre: ServeInv? = null | 31 | private lateinit var navController: NavController |
32 | |||
25 | 33 | ||
26 | class ActuaMaestrosFragment : Fragment() { | 34 | class ActuaMaestrosFragment : Fragment() { |
35 | private val job: Job = Job() | ||
36 | private val fragmentScopeAM = CoroutineScope(IO + job) | ||
27 | 37 | ||
28 | override fun onCreate(savedInstanceState: Bundle?) { | 38 | override fun onCreate(savedInstanceState: Bundle?) { |
29 | super.onCreate(savedInstanceState) | 39 | super.onCreate(savedInstanceState) |
30 | 40 | ||
31 | GlobalScope.launch(Main) { | 41 | // val servidor = urlBajada((activity as MainActivity)) |
32 | 42 | // if (servidor != "") { | |
33 | serverPre = fetchServerPreOne() | 43 | // tvServerConectado.text = "Conectado al servidor: $servidor" |
34 | if (serverPre != null) { | 44 | // } |
35 | btnConfirmarAct.isEnabled = true | ||
36 | if (serverPre!!.direccion.isNullOrEmpty()) { | ||
37 | val modalDialog = NoServerConf() | ||
38 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | ||
39 | } else { | ||
40 | BASE_URL = serverPre!!.direccion.toString() + ":" + serverPre!!.puerto.toString() + "/" | ||
41 | tvServerConectado.text = "Conectado al servidor: ${serverPre!!.descripcion}" | ||
42 | } | ||
43 | } else { | ||
44 | val modalDialog = ServerNoConf() | ||
45 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | ||
46 | |||
47 | btnConfirmarAct.isEnabled = false | ||
48 | |||
49 | } | ||
50 | } | ||
51 | |||
52 | // mostrarArticulos() | ||
53 | } | 45 | } |
54 | 46 | ||
55 | private suspend fun fetchServerPreOne(): ServeInv? { | 47 | override fun onDestroy() { |
56 | return GlobalScope.async(IO) { | 48 | super.onDestroy() |
57 | return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchServerPreOne() | 49 | fragmentScopeAM.cancel() |
58 | }.await() | ||
59 | } | 50 | } |
60 | 51 | ||
61 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 52 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
62 | // Inflate the layout for this fragment | ||
63 | val v = inflater.inflate(R.layout.fragment_actua_maestros, container, false) | 53 | val v = inflater.inflate(R.layout.fragment_actua_maestros, container, false) |
64 | val bConfirmarAct = v.findViewById<Button>(R.id.btnConfirmarAct) | 54 | val bConfirmarAct = v.findViewById<Button>(R.id.btnConfirmarAct) |
65 | val obPorWifi = v.findViewById<RadioButton>(R.id.obPorWifi) | 55 | val obPorWifi = v.findViewById<RadioButton>(R.id.obPorWifi) |
66 | val obImpInventarios= v.findViewById<RadioButton>(R.id.obImpInventarios) | 56 | val obImpInventarios = v.findViewById<RadioButton>(R.id.obImpInventarios) |
57 | |||
58 | obPorWifi.setOnClickListener { | ||
59 | bConfirmarAct.text = ("Confirmar Importación") | ||
60 | } | ||
61 | obImpInventarios.setOnClickListener { | ||
62 | bConfirmarAct.text = ("Buscar Inventarios sectorizados en servidor") | ||
63 | } | ||
67 | 64 | ||
68 | bConfirmarAct.setOnClickListener { | 65 | bConfirmarAct.setOnClickListener { |
69 | loading_view.visibility = View.VISIBLE | 66 | if (obPorWifi.isChecked) { |
70 | countriesList.text = "Obteniendo artículos del servidor, aguarde por favor." | 67 | loading_view.visibility = View.VISIBLE |
71 | obtenerArticulos() | 68 | countriesList.text = ("Obteniendo artículos del servidor, aguarde por favor.") |
69 | obtenerArticulos() | ||
70 | } | ||
71 | if (obImpInventarios.isChecked) { | ||
72 | navController = Navigation.findNavController(v) | ||
73 | navController.navigate(R.id.action_actuaMaestrosFragment_to_invSecImpFragment) | ||
74 | } | ||
72 | } | 75 | } |
73 | return v | 76 | return v |
74 | } | 77 | } |
75 | 78 | ||
76 | private fun obtenerArticulos() { | 79 | private fun obtenerArticulos() { |
80 | fragmentScopeAM.launch(Main) { | ||
81 | try { | ||
82 | serverPre = fetchServerPreOne((activity as MainActivity)) | ||
83 | |||
84 | } catch (e: RuntimeException) { | ||
85 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() | ||
86 | } | ||
87 | if (serverPre != null) { | ||
88 | if (serverPre!!.direccion.isNullOrEmpty()) { | ||
89 | val modalDialog = NoServerConf() | ||
90 | if (activity != null) { | ||
91 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
92 | } | ||
93 | } else { | ||
94 | BASE_URL = serverPre!!.direccion.toString() + ":" + serverPre!!.puertoBajada.toString() + "/" | ||
95 | } | ||
96 | } else { | ||
97 | if (activity != null) { | ||
98 | val modalDialog = ServerNoConf() | ||
99 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
100 | } | ||
101 | } | ||
102 | |||
103 | |||
104 | try { | ||
105 | val call: Call<List<Productos?>?>? = WebService.instance | ||
106 | ?.createService(WebServiceApi::class.java) | ||
107 | ?.getProductos() | ||
108 | var index: Long = 1 | ||
109 | call!!.enqueue(object : Callback<List<Productos?>?> { | ||
110 | override fun onResponse(call: Call<List<Productos?>?>?, response: Response<List<Productos?>?>) { | ||
111 | if (response.code() == 200) { | ||
112 | try { | ||
113 | for (pro in response.body()!!) { | ||
114 | val artiAcargar = Articles( | ||
115 | pro?.sector, | ||
116 | pro?.codigo, | ||
117 | pro?.descripcion, | ||
118 | pro?.codBar, | ||
119 | pro?.codOrigen, | ||
120 | pro?.precio, | ||
121 | pro?.costo, | ||
122 | pro?.exiVenta, | ||
123 | pro?.exiDeposito, | ||
124 | pro?.de, | ||
125 | pro?.balanza, | ||
126 | pro?.depSn, | ||
127 | pro?.imagen | ||
128 | ) | ||
129 | index += index | ||
130 | insertarProducto(artiAcargar) | ||
131 | } | ||
132 | countriesList.visibility = View.VISIBLE | ||
133 | countriesList.text = "¡Datos Importados Correctamente!" | ||
134 | loading_view.visibility = View.GONE | ||
135 | } catch (e: SocketTimeoutException) { | ||
136 | countriesList.visibility = View.VISIBLE | ||
137 | countriesList.text = "¡Sin conexión al Servidor!" | ||
138 | loading_view.visibility = View.GONE | ||
139 | } | ||
140 | } else if (response.code() == 404) { | ||
141 | countriesList.visibility = View.VISIBLE | ||
142 | countriesList.text = "¡Sin conexión al Servidor!" | ||
143 | loading_view.visibility = View.GONE | ||
144 | } | ||
145 | } | ||
146 | |||
147 | override fun onFailure(call: Call<List<Productos?>?>?, t: Throwable?) { countriesList.visibility = View.VISIBLE | ||
148 | countriesList.visibility = View.VISIBLE | ||
149 | countriesList.text = "¡Sin conexión al Servidor!" | ||
150 | loading_view.visibility = View.GONE | ||
151 | } | ||
152 | }) | ||
153 | } catch (e: RuntimeException) { | ||
154 | countriesList.visibility = View.VISIBLE | ||
155 | countriesList.text = "Error ${e.message}" | ||
156 | loading_view.visibility = View.GONE | ||
157 | } | ||
158 | } | ||
77 | // val call = getInstance() | 159 | // val call = getInstance() |
78 | // ?.createService(WebServiceApi::class.java) | 160 | // ?.createService(WebServiceApi::class.java) |
79 | // ?.getProductos() | 161 | // ?.getProductos() |
80 | // val api: WebService? = getInstance()!!.createService() | 162 | // val api: WebService? = getInstance()!!.createService() |
81 | // val call: Call<List<Productos>> = api!!.getProductos() | 163 | // val call: Call<List<Productos>> = api!!.getProductos() |
82 | 164 | ||
83 | // var index: Long = 1 | 165 | // var index: Long = 1 |
84 | // call!!.enqueue(object : Callback<List<Productos>> { | 166 | // call!!.enqueue(object : Callback<List<Productos>> { |
85 | // override fun onResponse(call: Call<List<Productos>>, response: Response<List<Productos>>) { | 167 | // override fun onResponse(call: Call<List<Productos>>, response: Response<List<Productos>>) { |
86 | // if (response.code() == 200) { | 168 | // if (response.code() == 200) { |
87 | // try { | 169 | // try { |
88 | // for (pro in response.body()!!) { | 170 | // for (pro in response.body()!!) { |
89 | // val artiAcargar = Articles( | 171 | // val artiAcargar = Articles( |
90 | // pro.sector, | 172 | // pro.sector, |
91 | // pro.codigo, | 173 | // pro.codigo, |
92 | // pro.descripcion, | 174 | // pro.descripcion, |
93 | // pro.codBar, | 175 | // pro.codBar, |
94 | // pro.codOrigen, | 176 | // pro.codOrigen, |
95 | // pro.precio, | 177 | // pro.precio, |
96 | // pro.costo, | 178 | // pro.costo, |
97 | // pro.exiVenta, | 179 | // pro.exiVenta, |
98 | // pro.exiDeposito, | 180 | // pro.exiDeposito, |
99 | // pro.de, | 181 | // pro.de, |
100 | // pro.balanza, | 182 | // pro.balanza, |
101 | // pro.depSn, | 183 | // pro.depSn, |
102 | // pro.imagen | 184 | // pro.imagen |
103 | // ) | 185 | // ) |
104 | // index += index | 186 | // index += index |
105 | // insertarProducto(artiAcargar) | 187 | // insertarProducto(artiAcargar) |
106 | // } | 188 | // } |
107 | // countriesList.visibility = View.VISIBLE | 189 | // countriesList.visibility = View.VISIBLE |
108 | // countriesList.text = "¡Datos Importados Correctamente!" | 190 | // countriesList.text = "¡Datos Importados Correctamente!" |
109 | // loading_view.visibility = View.GONE | 191 | // loading_view.visibility = View.GONE |
110 | // } catch (e: SocketTimeoutException) { | 192 | // } catch (e: SocketTimeoutException) { |
111 | // countriesList.visibility = View.VISIBLE | 193 | // countriesList.visibility = View.VISIBLE |
112 | // countriesList.text = "¡Sin conexión al Servidor!" | 194 | // countriesList.text = "¡Sin conexión al Servidor!" |
113 | // loading_view.visibility = View.GONE | 195 | // loading_view.visibility = View.GONE |
114 | // } | 196 | // } |
115 | // } | 197 | // } |
116 | // } | 198 | // } |
117 | // | 199 | // |
118 | // override fun onFailure(call: Call<List<Productos>>, t: Throwable) { | 200 | // override fun onFailure(call: Call<List<Productos>>, t: Throwable) { |
119 | // countriesList.visibility = View.VISIBLE | 201 | // countriesList.visibility = View.VISIBLE |
120 | // countriesList.text = (t.message + "." + t.cause) | 202 | // countriesList.text = (t.message + "." + t.cause) |
121 | // loading_view.visibility = View.GONE | 203 | // loading_view.visibility = View.GONE |
122 | // } | 204 | // } |
123 | // }) | 205 | // }) |
124 | 206 | ||
125 | //Este es el que andaba | 207 | //Este es el que andaba |
126 | // var index: Long = 1 | 208 | // var index: Long = 1 |
127 | // withContext(IO) { | 209 | // withContext(IO) { |
128 | // val job = CoroutineScope(IO).launch { | 210 | // val job = CoroutineScope(IO).launch { |
129 | // // TODO: BORRO TODO LOS ARTICULOS DE LA BASE PARA CARGARLOS DE NUEVO | 211 | // // TODO: BORRO TODO LOS ARTICULOS DE LA BASE PARA CARGARLOS DE NUEVO |
130 | // AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.deleteAllArticulos() | 212 | // AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.deleteAllArticulos() |
131 | // try { | 213 | // try { |
132 | // val response = WebServiceApi. | 214 | // val response = WebServiceApi. |
133 | // if (response.isSuccessful) { | 215 | // if (response.isSuccessful) { |
134 | // | 216 | // |
135 | // for (pro in response.body()!!) { | 217 | // for (pro in response.body()!!) { |
136 | // val artiAcargar = Articles( | 218 | // val artiAcargar = Articles( |
137 | // pro.sector, | 219 | // pro.sector, |
138 | // pro.codigo, | 220 | // pro.codigo, |
139 | // pro.descripcion, | 221 | // pro.descripcion, |
140 | // pro.codBar, | 222 | // pro.codBar, |
141 | // pro.codOrigen, | 223 | // pro.codOrigen, |
142 | // pro.precio, | 224 | // pro.precio, |
143 | // pro.costo, | 225 | // pro.costo, |
144 | // pro.exiVenta, | 226 | // pro.exiVenta, |
145 | // pro.exiDeposito, | 227 | // pro.exiDeposito, |
146 | // pro.de, | 228 | // pro.de, |
147 | // pro.balanza, | 229 | // pro.balanza, |
148 | // pro.depSn, | 230 | // pro.depSn, |
149 | // pro.imagen | 231 | // pro.imagen |
150 | // ) | 232 | // ) |
151 | // index += index | 233 | // index += index |
152 | // AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.insertArticulos(artiAcargar) | 234 | // AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.insertArticulos(artiAcargar) |
153 | // } | 235 | // } |
154 | // withContext(Main) { | 236 | // withContext(Main) { |
155 | // countriesList.visibility = View.VISIBLE | 237 | // countriesList.visibility = View.VISIBLE |
156 | // countriesList.text = "¡Datos Importados Correctamente!" | 238 | // countriesList.text = "¡Datos Importados Correctamente!" |
157 | // loading_view.visibility = View.GONE | 239 | // loading_view.visibility = View.GONE |
158 | // } | 240 | // } |
159 | // } else if (!response.isSuccessful) { | 241 | // } else if (!response.isSuccessful) { |
160 | // withContext(Main) { | 242 | // withContext(Main) { |
161 | // countriesList.visibility = View.VISIBLE | 243 | // countriesList.visibility = View.VISIBLE |
162 | // countriesList.text = "¡Sin servicio. No se puede conectar a la api o al servidor configurado en el BackEnd!" | 244 | // countriesList.text = "¡Sin servicio. No se puede conectar a la api o al servidor configurado en el BackEnd!" |
163 | // loading_view.visibility = View.GONE | 245 | // loading_view.visibility = View.GONE |
164 | // } | 246 | // } |
165 | // } | 247 | // } |
166 | // } catch (e: SocketTimeoutException) { | 248 | // } catch (e: SocketTimeoutException) { |
167 | // withContext(Main) { | 249 | // withContext(Main) { |
168 | // countriesList.visibility = View.VISIBLE | 250 | // countriesList.visibility = View.VISIBLE |
169 | // countriesList.text = "¡Sin conexión al Servidor!" | 251 | // countriesList.text = "¡Sin conexión al Servidor!" |
170 | // loading_view.visibility = View.GONE | 252 | // loading_view.visibility = View.GONE |
171 | // } | 253 | // } |
172 | // } | 254 | // } |
173 | // } | 255 | // } |
174 | // } | 256 | // } |
175 | |||
176 | |||
177 | // withContext(Dispatchers.Main) { | 257 | // withContext(Dispatchers.Main) { |
178 | // if (response.isSuccessful) { | 258 | // if (response.isSuccessful) { |
179 | // val call = WebService | 259 | // val call = WebService |
180 | // .instance | 260 | // .instance |
181 | // ?.createService(WebServiceApi::class.java) | 261 | // ?.createService(WebServiceApi::class.java) |
182 | // ?.articulos | 262 | // ?.articulos |
183 | // call?.enqueue(object : Callback<List<productos?>?> { | 263 | // call?.enqueue(object : Callback<List<productos?>?> { |
184 | // override fun onResponse( | 264 | // override fun onResponse( |
185 | // call: Call<List<productos?>?>, | 265 | // call: Call<List<productos?>?>, |
186 | // response: Response<List<productos?>?> | 266 | // response: Response<List<productos?>?> |
187 | // ) { | 267 | // ) { |
188 | // if (response.code() == 200) { | 268 | // if (response.code() == 200) { |
189 | // for (i in response.body()!!.indices) { | 269 | // for (i in response.body()!!.indices) { |
190 | // //AppDb.getAppDb(requireActivity())!!.ArticulosDAO()?.insertArticulos(response.body()!![i]) | 270 | // //AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()?.insertArticulos(response.body()!![i]) |
191 | // cargarArticulos(2, 500, "sfas", "66666","2,2", "2,2", false, false, "") | 271 | // cargarArticulos(2, 500, "sfas", "66666","2,2", "2,2", false, false, "") |
192 | //// Log.d( | 272 | //// Log.d( |
193 | //// "TAG1", "Nombre Curso: " + response.body()!![i]?.sector | 273 | //// "TAG1", "Nombre Curso: " + response.body()!![i]?.sector |
194 | //// + "Codigo Profesor: " + response.body()!![i]?.descripcion | 274 | //// + "Codigo Profesor: " + response.body()!![i]?.descripcion |
195 | //// ) | 275 | //// ) |
196 | // mostrarArticulos() | 276 | // mostrarArticulos() |
197 | // } | 277 | // } |
198 | // } else if (response.code() == 404) { | 278 | // } else if (response.code() == 404) { |
199 | // Log.d("TAG1", "No hay cursos") | 279 | // Log.d("TAG1", "No hay cursos") |
200 | // } | 280 | // } |
201 | // | 281 | // |
202 | // } | 282 | // } |
203 | // | 283 | // |
204 | // override fun onFailure(call: Call<List<productos?>?>, t: Throwable) {} | 284 | // override fun onFailure(call: Call<List<productos?>?>, t: Throwable) {} |
205 | // }) | 285 | // }) |
206 | } | 286 | } |
207 | 287 | ||
208 | fun insertarProducto(aCargar: Articles) { | 288 | fun insertarProducto(aCargar: Articles) { |
209 | lifecycleScope.launch { | 289 | fragmentScopeAM.launch { |
210 | withContext(IO) { | 290 | withContext(IO) { |
211 | AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!.insertArticulos(aCargar) | 291 | AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.insertArticulos(aCargar) |
212 | } | 292 | } |
213 | } | 293 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/actualizacionMaestros/InvImportadosFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.actualizacionMaestros | File was deleted | |
2 | |||
3 | import android.os.Bundle | ||
4 | import androidx.fragment.app.Fragment | ||
5 | import android.view.LayoutInflater | ||
6 | import android.view.View | ||
7 | import android.view.ViewGroup | ||
8 | import com.focasoftware.deboinventariov20.R | ||
9 | |||
10 | class InvImportadosFragment : Fragment() { | ||
11 | |||
12 | override fun onCreate(savedInstanceState: Bundle?) { | ||
13 | super.onCreate(savedInstanceState) | ||
14 | |||
15 | } | ||
16 | |||
17 | override fun onCreateView( | ||
18 | inflater: LayoutInflater, container: ViewGroup?, | ||
19 | savedInstanceState: Bundle? | ||
20 | ): View? { | ||
21 | // Inflate the layout for this fragment | ||
22 | return inflater.inflate(R.layout.fragment_inv_importados, container, false) | ||
23 | } | ||
24 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/actualizacionMaestros/InvSecHeadListAdapter.kt
File was created | 1 | package com.focasoftware.deboinventariov20.UI.actualizacionMaestros | |
2 | |||
3 | import android.content.Context | ||
4 | import android.view.LayoutInflater | ||
5 | import android.view.View | ||
6 | import android.view.ViewGroup | ||
7 | import androidx.recyclerview.widget.RecyclerView | ||
8 | import com.focasoftware.deboinventariov20.R | ||
9 | import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder | ||
10 | import kotlinx.android.synthetic.main.item_inv_importados.view.* | ||
11 | |||
12 | |||
13 | class InvSecHeadListAdapter( | ||
14 | private val context: Context, private val invHead: ArrayList<ItemsInvSecHead>, private val itemCheckListener: OnCheckListener | ||
15 | ) : RecyclerView.Adapter<BaseViewHolder<*>>() { | ||
16 | |||
17 | interface OnCheckListener { | ||
18 | fun onItemCheck(inventario: String?) | ||
19 | } | ||
20 | |||
21 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(context).inflate(R.layout.item_inv_importados, parent, false)) | ||
22 | |||
23 | override fun getItemCount() = invHead.size | ||
24 | |||
25 | override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) { | ||
26 | when (holder) { | ||
27 | is ItemsViewHolder -> { | ||
28 | holder.bind(invHead[position], position) | ||
29 | } | ||
30 | } | ||
31 | } | ||
32 | |||
33 | inner class ItemsViewHolder(itemView: View) : BaseViewHolder<ItemsInvSecHead>(itemView) { | ||
34 | override fun bind(item: ItemsInvSecHead, position: Int) { | ||
35 | itemView.tvPrincipalinventario.setOnCheckedChangeListener { button, b -> itemCheckListener.onItemCheck(item.invnum.toString()) } | ||
36 | itemView.tvPrincipalinventario.text = item.invnum.toString() + "-" + item.detalle.toString() + " " + item.fecha.toString() | ||
37 | } | ||
38 | } | ||
39 | } | ||
40 | |||
41 | |||
42 | |||
43 | |||
44 |
app/src/main/java/com/focasoftware/deboinventariov20/UI/actualizacionMaestros/InvSecImpFragment.kt
File was created | 1 | package com.focasoftware.deboinventariov20.UI.actualizacionMaestros | |
2 | |||
3 | import android.app.AlertDialog | ||
4 | import android.content.DialogInterface | ||
5 | import android.os.Bundle | ||
6 | import android.view.LayoutInflater | ||
7 | import android.view.View | ||
8 | import android.view.ViewGroup | ||
9 | import android.widget.Button | ||
10 | import android.widget.ProgressBar | ||
11 | import android.widget.TextView | ||
12 | import android.widget.Toast | ||
13 | import androidx.fragment.app.Fragment | ||
14 | import androidx.navigation.NavController | ||
15 | import androidx.navigation.Navigation | ||
16 | import androidx.recyclerview.widget.LinearLayoutManager | ||
17 | import androidx.recyclerview.widget.RecyclerView | ||
18 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | ||
19 | import com.focasoftware.deboinventariov20.Model.* | ||
20 | import com.focasoftware.deboinventariov20.R | ||
21 | import com.focasoftware.deboinventariov20.UI.MainActivity | ||
22 | import com.focasoftware.deboinventariov20.UI.Utils.* | ||
23 | import kotlinx.android.synthetic.main.fragment_inv_importados.* | ||
24 | import kotlinx.coroutines.* | ||
25 | import kotlinx.coroutines.Dispatchers.IO | ||
26 | import kotlinx.coroutines.Dispatchers.Main | ||
27 | import retrofit2.Call | ||
28 | import retrofit2.Callback | ||
29 | import retrofit2.Response | ||
30 | import java.lang.Thread.sleep | ||
31 | import java.net.SocketTimeoutException | ||
32 | |||
33 | private lateinit var viewAdapter: RecyclerView.Adapter<*> | ||
34 | private lateinit var viewManager: RecyclerView.LayoutManager | ||
35 | private lateinit var recicler: RecyclerView | ||
36 | private var listInv = ArrayList<ItemsInvSecHead>() | ||
37 | private var serverPre: ServeInv? = null | ||
38 | var invSeleccionados = mutableListOf<String>() | ||
39 | private lateinit var navController: NavController | ||
40 | |||
41 | class InvSecImpFragment : Fragment(), InvSecHeadListAdapter.OnCheckListener { | ||
42 | private val job: Job = Job() | ||
43 | private val fragmentScopeInvSec = CoroutineScope(Dispatchers.IO + job) | ||
44 | |||
45 | override fun onCreate(savedInstanceState: Bundle?) { | ||
46 | super.onCreate(savedInstanceState) | ||
47 | invSeleccionados.clear() | ||
48 | } | ||
49 | override fun onDestroy() { | ||
50 | super.onDestroy() | ||
51 | fragmentScopeInvSec.cancel() | ||
52 | } | ||
53 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
54 | super.onViewCreated(view, savedInstanceState) | ||
55 | val navController = Navigation.findNavController(view) | ||
56 | val btnConfirmarAct = view.findViewById<Button>(R.id.btnConfirmarAct) | ||
57 | val pbInvSec = view.findViewById<ProgressBar>(R.id.pbInvSec) | ||
58 | val tvMensaje = view.findViewById<TextView>(R.id.tvMensaje) | ||
59 | recicler = view.findViewById(R.id.rcDescripcion) | ||
60 | |||
61 | fragmentScopeInvSec.launch(Main) { | ||
62 | invSeleccionados.clear() | ||
63 | pbInvSec.visibility = View.VISIBLE | ||
64 | recicler.visibility = View.GONE | ||
65 | try { | ||
66 | serverPre = fetchServerPreOne(requireActivity()) | ||
67 | } catch (e: RuntimeException) { | ||
68 | |||
69 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() | ||
70 | } | ||
71 | if (serverPre != null) { | ||
72 | if (serverPre!!.direccion.isNullOrEmpty()) { | ||
73 | val modalDialog = NoServerConf() | ||
74 | if (activity != null) { | ||
75 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
76 | } | ||
77 | } else { | ||
78 | BASE_URL = serverPre!!.direccion.toString() + ":" + serverPre!!.puertoSubida.toString() + "/" | ||
79 | listInv.clear() | ||
80 | try { | ||
81 | // val call: Call<List<InvHeadSecR?>?>? = WebService.instance | ||
82 | // ?.createService(WebServiceApi::class.java) | ||
83 | // ?.getHeadInvSec() | ||
84 | ItomInv.request.getHeadInvSec() | ||
85 | ?.enqueue(object : Callback<List<InvHeadSecR?>?> { | ||
86 | // call!!.enqueue(object : Callback<List<InvHeadSecR?>?> { | ||
87 | override fun onResponse(call: Call<List<InvHeadSecR?>?>?, response: Response<List<InvHeadSecR?>?>) { | ||
88 | if (response.code() == 200) { | ||
89 | try { | ||
90 | for (inv in response.body()!!) { | ||
91 | cargarRecicler(inv?.invNum, inv!!.detalle, inv.fechaInicio, inv.depsn) | ||
92 | } | ||
93 | } catch (e: SocketTimeoutException) { | ||
94 | } | ||
95 | } else if (response.code() == 404) { | ||
96 | tvSeleccionInventario.visibility = View.VISIBLE | ||
97 | tvMensaje.visibility = View.VISIBLE | ||
98 | tvMensaje.text = "No hay inventarios disponibles." | ||
99 | pbInvSec.visibility = View.GONE | ||
100 | } | ||
101 | } | ||
102 | |||
103 | override fun onFailure(call: Call<List<InvHeadSecR?>?>?, t: Throwable?) {} | ||
104 | }) | ||
105 | } catch (e: RuntimeException) { | ||
106 | tvSeleccionInventario.visibility = View.VISIBLE | ||
107 | tvMensaje.visibility = View.VISIBLE | ||
108 | tvMensaje.text = "Error ${e.message}" | ||
109 | pbInvSec.visibility = View.GONE | ||
110 | tvMensaje.visibility = View.GONE | ||
111 | } | ||
112 | // obtenerInvSectorizados() | ||
113 | } | ||
114 | } else { | ||
115 | if (activity != null) { | ||
116 | val modalDialog = ServerNoConf() | ||
117 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
118 | } | ||
119 | } | ||
120 | pbInvSec.visibility = View.GONE | ||
121 | recicler.visibility = View.VISIBLE | ||
122 | |||
123 | } | ||
124 | |||
125 | |||
126 | btnConfirmarAct.setOnClickListener { | ||
127 | var entroAlFor=false | ||
128 | for (inv in invSeleccionados) { | ||
129 | entroAlFor=true | ||
130 | GlobalScope.launch(Main) { | ||
131 | deleteAllInvHeadSec(inv.toInt()) | ||
132 | deleteAllInvBodySec(inv.toInt()) | ||
133 | } | ||
134 | val aEnviar: NumInvSec = NumInvSec(inv) | ||
135 | // val call: Call<List<InvBodySecR?>?>? = WebService.instance | ||
136 | // ?.createService(WebServiceApi::class.java) | ||
137 | // ?.getBodyInvSec(aEnviar) | ||
138 | // call!!.enqueue(object : Callback<List<InvBodySecR?>?> { | ||
139 | ItomInv.request.getBodyInvSec(aEnviar) | ||
140 | ?.enqueue(object : Callback<List<InvBodySecR?>?> { | ||
141 | override fun onResponse(call: Call<List<InvBodySecR?>?>?, response: Response<List<InvBodySecR?>?>) { | ||
142 | |||
143 | if (response.code() == 200) { | ||
144 | try { | ||
145 | preparaParaInsertar(response.body(), inv) | ||
146 | } catch (e: SocketTimeoutException) { | ||
147 | } | ||
148 | } else if (response.code() == 404) { | ||
149 | } | ||
150 | } | ||
151 | |||
152 | override fun onFailure(call: Call<List<InvBodySecR?>?>?, t: Throwable?) {} | ||
153 | }) | ||
154 | } | ||
155 | if (entroAlFor) { | ||
156 | recicler.visibility = View.GONE | ||
157 | btnConfirmarAct.isEnabled = false | ||
158 | val modalDialog = InvSecImp() | ||
159 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | ||
160 | } | ||
161 | // navController.navigate(R.id.action_invSecImpFragment_to_mainFragment2) | ||
162 | } | ||
163 | } | ||
164 | |||
165 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
166 | val v = inflater.inflate(R.layout.fragment_inv_importados, container, false) | ||
167 | return v | ||
168 | } | ||
169 | |||
170 | private fun preparaParaInsertar(list: List<InvBodySecR?>?, inv: String) { | ||
171 | |||
172 | fragmentScopeInvSec.launch(Main) { | ||
173 | if (list != null) { | ||
174 | for (head in listInv) { | ||
175 | if (inv.toInt() == head.invnum) { | ||
176 | val invHeadTemp = InvHeadSec(head.invnum, head.detalle, head.fecha, head.deposito == 1, "", head.fecha, 0) | ||
177 | insertInvHeadSec(invHeadTemp) | ||
178 | break | ||
179 | } | ||
180 | } | ||
181 | for (body in list) { | ||
182 | val invBodyTemp = InvBodySec( | ||
183 | body!!.INV.toInt(), body.SEC, body.ART, body.DET, body.PRE, | ||
184 | body.uniVta, | ||
185 | body.COS, "", body.DEPSN!!.toInt() != 0, body.EXIVTA, body.EXIDEP, body.CODBAR, "", "" | ||
186 | ) | ||
187 | insertInvBodySec(invBodyTemp) | ||
188 | } | ||
189 | } | ||
190 | sleep(500) | ||
191 | buscarCantArtInvSecHead(inv) | ||
192 | sleep(500) | ||
193 | } | ||
194 | } | ||
195 | |||
196 | fun cargarRecicler(invNum: Int?, detalle: String?, fechaInicio: String?, deposito: Int?) { | ||
197 | //TODO CARGO EN LE RV | ||
198 | val item = ItemsInvSecHead(invNum, detalle, fechaInicio, deposito) | ||
199 | listInv.add(item) | ||
200 | |||
201 | viewAdapter = InvSecHeadListAdapter(requireContext(), listInv, this) | ||
202 | viewManager = LinearLayoutManager(requireContext()) | ||
203 | // deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! | ||
204 | recicler.apply { | ||
205 | adapter = viewAdapter | ||
206 | layoutManager = viewManager | ||
207 | } | ||
208 | } | ||
209 | |||
210 | override fun onItemCheck(inventario: String?) { | ||
211 | if (inventario in invSeleccionados) { | ||
212 | invSeleccionados.removeIf { it == inventario } | ||
213 | } else { | ||
214 | fragmentScopeInvSec.launch(Main) { | ||
215 | var invBodySec: List<InvBodySec>? = null | ||
216 | invBodySec = verificoExisteInvSec(inventario!!.toInt()) | ||
217 | if (!invBodySec.isNullOrEmpty()) { | ||
218 | AlertDialog.Builder(requireContext()).setTitle("El inventario $inventario ya se encuentra cargado.").setMessage(" Si continúa se perderan los datos ingresados.") | ||
219 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> | ||
220 | invSeleccionados.add(inventario) | ||
221 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> | ||
222 | |||
223 | }).show() | ||
224 | } else invSeleccionados.add(inventario) | ||
225 | } | ||
226 | } | ||
227 | } | ||
228 | |||
229 | private suspend fun insertInvBodySec(inventario: InvBodySec) { | ||
230 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { | ||
231 | AppDb.getAppDb(requireActivity())!!.InvBodySecDAO()!!.insertInvBodySec(inventario) | ||
232 | } | ||
233 | } | ||
234 | |||
235 | private suspend fun insertInvHeadSec(inventario: InvHeadSec) { | ||
236 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { | ||
237 | AppDb.getAppDb(requireActivity())!!.InvHeadSecDAO()!!.insertInvHeadSec(inventario) | ||
238 | } | ||
239 | } | ||
240 | |||
241 | private suspend fun deleteAllInvHeadSec(invNum: Int) { | ||
242 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { | ||
243 | AppDb.getAppDb(requireContext())!!.InvHeadSecDAO()!!.deleteAllInvHeadSec(invNum) | ||
244 | } | ||
245 | } | ||
246 | |||
247 | private suspend fun deleteAllInvBodySec(invNum: Int) { | ||
248 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { | ||
249 | AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.deleteAllInvBodySec(invNum) | ||
250 | } | ||
251 | } | ||
252 | |||
253 | private suspend fun buscarCantArtInvSecHead(invNum: String) { | ||
254 | return withContext(fragmentScopeInvSec.coroutineContext + IO) { | ||
255 | val arti = mutableListOf<String>() | ||
256 | val invBodySec: List<InvBodySec> = fetchInvSecBodyGroup(invNum) | ||
257 | // var cant = 0 | ||
258 | // var encontrado: Boolean | ||
259 | // var first = false | ||
260 | // for (inv in invBodySec) { | ||
261 | // if (!first) { | ||
262 | // arti.add(inv.sector.toString() + inv.codigo.toString()) | ||
263 | // first = true | ||
264 | // cant += 1 | ||
265 | // } else { | ||
266 | // encontrado = false | ||
267 | // for (ar in arti) { | ||
268 | // | ||
269 | // + | ||
270 | // if (ar == inv.sector.toString() + inv.codigo.toString()) { | ||
271 | // encontrado = true | ||
272 | // break | ||
273 | // } | ||
274 | // } | ||
275 | // if (!encontrado) { | ||
276 | // cant += 1 | ||
277 | // arti.add(inv.sector.toString() + inv.codigo.toString()) | ||
278 | // } | ||
279 | // } | ||
280 | // } | ||
281 | AppDb.getAppDb(requireActivity())!!.InvHeadSecDAO()!!.updateCantArtInvSecHead(invNum.toInt(), invBodySec.count()) | ||
282 | } | ||
283 | } | ||
284 | |||
285 | private suspend fun verificoExisteInvSec(invNum: Int): List<InvBodySec> { | ||
286 | var busqueda: List<InvBodySec> | ||
287 | return fragmentScopeInvSec.async(IO) { | ||
288 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.verificoExisteInvSec(invNum) | ||
289 | return@async busqueda | ||
290 | }.await() | ||
291 | } | ||
292 | |||
293 | private suspend fun fetchInvSecBodyGroup(invNum: String): List<InvBodySec> { | ||
294 | var busqueda: List<InvBodySec> | ||
295 | return fragmentScopeInvSec.async(IO) { | ||
296 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.fetchInvSecBodyGroup(invNum) | ||
297 | return@async busqueda | ||
298 | }.await() | ||
299 | } | ||
300 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/actualizacionMaestros/ItemsInvSecHead.kt
File was created | 1 | package com.focasoftware.deboinventariov20.UI.actualizacionMaestros | |
2 | |||
3 | data class ItemsInvSecHead(val invnum: Int?, val detalle: String?, val fecha: String?, val deposito: Int?) { | ||
4 | |||
5 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/configuracion/ConfiguracionFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.configuracion | 1 | package com.focasoftware.deboinventariov20.UI.configuracion |
2 | 2 | ||
3 | import android.content.Context | 3 | import android.content.Context |
4 | import android.content.SharedPreferences | 4 | import android.content.SharedPreferences |
5 | import android.os.Bundle | 5 | import android.os.Bundle |
6 | import android.view.LayoutInflater | 6 | import android.view.LayoutInflater |
7 | import android.view.View | 7 | import android.view.View |
8 | import android.view.ViewGroup | 8 | import android.view.ViewGroup |
9 | import android.widget.* | 9 | import android.widget.* |
10 | import androidx.fragment.app.Fragment | 10 | import androidx.fragment.app.Fragment |
11 | import androidx.fragment.app.FragmentActivity | ||
12 | import androidx.lifecycle.lifecycleScope | 11 | import androidx.lifecycle.lifecycleScope |
13 | import androidx.navigation.NavController | 12 | import androidx.navigation.NavController |
14 | import androidx.navigation.Navigation | 13 | import androidx.navigation.Navigation |
15 | import androidx.navigation.fragment.findNavController | 14 | import androidx.navigation.fragment.findNavController |
16 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 15 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
17 | import com.focasoftware.deboinventariov20.Model.ServeInv | 16 | import com.focasoftware.deboinventariov20.Model.* |
18 | import com.focasoftware.deboinventariov20.R | 17 | import com.focasoftware.deboinventariov20.R |
19 | import com.focasoftware.deboinventariov20.UI.Utils.isConnectedToThisServer | 18 | import com.focasoftware.deboinventariov20.UI.MainActivity |
20 | import com.focasoftware.deboinventariov20.UI.Utils.ServerNoValido | 19 | import com.focasoftware.deboinventariov20.UI.Utils.* |
21 | import com.focasoftware.deboinventariov20.UI.Utils.ServerValido | ||
22 | import kotlinx.android.synthetic.main.fragment_configuracion.* | 20 | import kotlinx.android.synthetic.main.fragment_configuracion.* |
23 | import kotlinx.coroutines.* | 21 | import kotlinx.coroutines.* |
24 | import kotlinx.coroutines.Dispatchers.Main | 22 | import kotlinx.coroutines.Dispatchers.Main |
23 | import retrofit2.Call | ||
24 | import retrofit2.Callback | ||
25 | import retrofit2.Response | ||
26 | import java.net.SocketTimeoutException | ||
27 | import kotlin.math.absoluteValue | ||
28 | |||
25 | 29 | ||
26 | class ConfiguracionFragment : Fragment() { | 30 | class ConfiguracionFragment : Fragment() { |
27 | 31 | ||
28 | lateinit var sharedPreferences: SharedPreferences | 32 | lateinit var sharedPreferences: SharedPreferences |
29 | private lateinit var navController: NavController | 33 | private lateinit var navController: NavController |
30 | var itemSelect: Int = 0 | 34 | var itemSelect: Int = 0 |
31 | var indexSelect: Int = 0 | 35 | var indexSelect: Int = 0 |
32 | 36 | ||
33 | override fun onCreate(savedInstanceState: Bundle?) { | 37 | override fun onCreate(savedInstanceState: Bundle?) { |
34 | super.onCreate(savedInstanceState) | 38 | super.onCreate(savedInstanceState) |
35 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 39 | sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
36 | } | 40 | } |
37 | 41 | ||
38 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 42 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
39 | super.onViewCreated(view, savedInstanceState) | 43 | super.onViewCreated(view, savedInstanceState) |
40 | navController = Navigation.findNavController(view) | 44 | navController = Navigation.findNavController(view) |
41 | 45 | ||
42 | GlobalScope.launch(Main) { | 46 | GlobalScope.launch(Main) { |
43 | val listServer = mutableListOf<String>() | 47 | val listServer = mutableListOf<String>() |
44 | for (server in getDescServers()) { | 48 | for (server in getDescServers()) { |
45 | listServer.add((if (server.servNum < 9) "0" + server.servNum.toString() else server.servNum.toString()) + " - " + server.descripcion.toString()) | 49 | listServer.add((if (server.servNum < 9) "0" + server.servNum.toString() else server.servNum.toString()) + " - " + server.descripcion.toString()) |
46 | } | 50 | } |
47 | val adapterSpServer = ArrayAdapter( | 51 | val adapterSpServer = ArrayAdapter( |
48 | requireContext(), | 52 | requireContext(), |
49 | R.layout.support_simple_spinner_dropdown_item, | 53 | R.layout.support_simple_spinner_dropdown_item, |
50 | listServer | 54 | listServer |
51 | ) | 55 | ) |
52 | spServidor.adapter = adapterSpServer | 56 | spServidor.adapter = adapterSpServer |
53 | if (sharedPreferences.contains("ServerPredeterminado")) { | 57 | if (sharedPreferences.contains("ServerPredeterminado")) { |
54 | spServidor.setSelection( | 58 | spServidor.setSelection( |
55 | sharedPreferences.getString("ServerPredeterminado", "").toString().toInt() | 59 | sharedPreferences.getString("ServerPredeterminado", "").toString().toInt() |
56 | ) | 60 | ) |
57 | } else (spServidor.setSelection(0)) | 61 | } else (spServidor.setSelection(0)) |
58 | } | 62 | } |
59 | } | 63 | } |
60 | 64 | ||
61 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 65 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
62 | 66 | ||
63 | val v = inflater.inflate(R.layout.fragment_configuracion, container, false) | 67 | val v = inflater.inflate(R.layout.fragment_configuracion, container, false) |
64 | val etRuta = v.findViewById<EditText>(R.id.etRuta) | ||
65 | val btnGuardar = v.findViewById<Button>(R.id.btnGuardar) | 68 | val btnGuardar = v.findViewById<Button>(R.id.btnGuardar) |
66 | val rbProInclu = v.findViewById<RadioButton>(R.id.rbProInclu) | 69 | val rbProInclu = v.findViewById<RadioButton>(R.id.rbProInclu) |
67 | val rbProNoInclu = v.findViewById<RadioButton>(R.id.rbProNoInclu) | 70 | val rbProNoInclu = v.findViewById<RadioButton>(R.id.rbProNoInclu) |
68 | val cbHabiLectura = v.findViewById<CheckBox>(R.id.cbHabiLectura) | 71 | val cbHabiLectura = v.findViewById<CheckBox>(R.id.cbHabiLectura) |
69 | val cbMostrarStock = v.findViewById<CheckBox>(R.id.cbMostrarStock) | 72 | val cbMostrarStock = v.findViewById<CheckBox>(R.id.cbMostrarStock) |
70 | val rbCodigoBarras = v.findViewById<RadioButton>(R.id.rbCodigoBarras) | 73 | // val rbCodigoBarras = v.findViewById<RadioButton>(R.id.rbCodigoBarras) |
71 | val rbCodigoDebo = v.findViewById<RadioButton>(R.id.rbCodigoDebo) | 74 | // val rbCodigoDebo = v.findViewById<RadioButton>(R.id.rbCodigoDebo) |
72 | val rbCodigoOrigen = v.findViewById<RadioButton>(R.id.rbCodigoOrigen) | 75 | // val rbCodigoOrigen = v.findViewById<RadioButton>(R.id.rbCodigoOrigen) |
73 | val rbDeposito = v.findViewById<RadioButton>(R.id.rbDeposito) | 76 | val rbDeposito = v.findViewById<RadioButton>(R.id.rbDeposito) |
74 | val rbVentas = v.findViewById<RadioButton>(R.id.rbVentas) | 77 | val rbVentas = v.findViewById<RadioButton>(R.id.rbVentas) |
75 | val cbMostrarExistencia = v.findViewById<CheckBox>(R.id.cbMostrarExistencia) | ||
76 | val cbMostrarPrecio = v.findViewById<CheckBox>(R.id.cbMostrarPrecio) | ||
77 | val btnAgregarServidor = v.findViewById<Button>(R.id.btnAgregarServidor) | 78 | val btnAgregarServidor = v.findViewById<Button>(R.id.btnAgregarServidor) |
78 | val spServidor = v.findViewById<Spinner>(R.id.spServidor) | 79 | val spServidor = v.findViewById<Spinner>(R.id.spServidor) |
79 | val btnValidarServidor = v.findViewById<Button>(R.id.btnValidarServidor) | 80 | val btnValidarServidor = v.findViewById<Button>(R.id.btnValidarServidor) |
81 | val cbAskTimeServerToStart = v.findViewById<CheckBox>(R.id.cbAskTimeServerToStart) | ||
80 | 82 | ||
81 | if (sharedPreferences.contains("etRuta")) if (sharedPreferences.contains("rbProInclu")) { | 83 | if (sharedPreferences.contains("etRuta")) if (sharedPreferences.contains("rbProInclu")) { |
82 | if (sharedPreferences.getString("rbProInclu", "").toString() == "0") { | 84 | if (sharedPreferences.getString("rbProInclu", "").toString() == "0") { |
83 | rbProInclu.isChecked = false | 85 | rbProInclu.isChecked = false |
84 | rbProNoInclu.isChecked = true | 86 | rbProNoInclu.isChecked = true |
85 | } else if (sharedPreferences.getString("rbProInclu", "").toString() == "1") { | 87 | } else if (sharedPreferences.getString("rbProInclu", "").toString() == "1") { |
86 | rbProInclu.isChecked = true | 88 | rbProInclu.isChecked = true |
87 | rbProNoInclu.isChecked = false | 89 | rbProNoInclu.isChecked = false |
88 | } | 90 | } |
89 | } else (sharedPreferences.getString("rbProInclu", "").toString() == "") | 91 | } else (sharedPreferences.getString("rbProInclu", "").toString() == "") |
90 | 92 | ||
91 | if (sharedPreferences.contains("rbProNoInclu")) { | 93 | if (sharedPreferences.contains("rbProNoInclu")) { |
92 | if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") { | 94 | if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") { |
93 | rbProNoInclu.isChecked = false | 95 | rbProNoInclu.isChecked = false |
94 | rbProInclu.isChecked = true | 96 | rbProInclu.isChecked = true |
95 | } else if (sharedPreferences.getString("rbProNoInclu", "").toString() == "1") { | 97 | } else if (sharedPreferences.getString("rbProNoInclu", "").toString() == "1") { |
96 | rbProNoInclu.isChecked = true | 98 | rbProNoInclu.isChecked = true |
97 | rbProInclu.isChecked = false | 99 | rbProInclu.isChecked = false |
98 | } | 100 | } |
99 | } else (sharedPreferences.getString("rbProNoInclu", "").toString() == "") | 101 | } else (sharedPreferences.getString("rbProNoInclu", "").toString() == "") |
100 | 102 | ||
101 | if (sharedPreferences.contains("cbHabiLectura")) { | 103 | if (sharedPreferences.contains("cbHabiLectura")) { |
102 | if (sharedPreferences.getString("cbHabiLectura", "").toString() == "0") { | 104 | if (sharedPreferences.getString("cbHabiLectura", "").toString() == "0") { |
103 | cbHabiLectura.isChecked = false | 105 | cbHabiLectura.isChecked = false |
104 | } else if (sharedPreferences.getString("cbHabiLectura", "").toString() == "1") { | 106 | } else if (sharedPreferences.getString("cbHabiLectura", "").toString() == "1") { |
105 | cbHabiLectura.isChecked = true | 107 | cbHabiLectura.isChecked = true |
106 | } | 108 | } |
107 | } else (sharedPreferences.getString("cbHabiLectura", "").toString() == "") | 109 | } else (sharedPreferences.getString("cbHabiLectura", "").toString() == "") |
108 | 110 | ||
109 | if (sharedPreferences.contains("cbMostrarStock")) { | 111 | if (sharedPreferences.contains("cbMostrarStock")) { |
110 | if (sharedPreferences.getString("cbMostrarStock", "").toString() == "0") { | 112 | if (sharedPreferences.getString("cbMostrarStock", "").toString() == "0") { |
111 | cbMostrarStock.isChecked = false | 113 | cbMostrarStock.isChecked = false |
112 | } else if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") { | 114 | } else if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") { |
113 | cbMostrarStock.isChecked = true | 115 | cbMostrarStock.isChecked = true |
114 | } | 116 | } |
115 | } else (sharedPreferences.getString("cbMostrarStock", "").toString() == "") | 117 | } else (sharedPreferences.getString("cbMostrarStock", "").toString() == "") |
116 | 118 | ||
117 | if (sharedPreferences.contains("rbVentas")) { | 119 | if (sharedPreferences.contains("rbVentas")) { |
118 | if (sharedPreferences.getString("rbVentas", "").toString() == "0") { | 120 | if (sharedPreferences.getString("rbVentas", "").toString() == "0") { |
119 | rbVentas.isChecked = false | 121 | rbVentas.isChecked = false |
120 | rbDeposito.isChecked = true | 122 | rbDeposito.isChecked = true |
121 | } else if (sharedPreferences.getString("rbVentas", "").toString() == "1") { | 123 | } else if (sharedPreferences.getString("rbVentas", "").toString() == "1") { |
122 | rbVentas.isChecked = true | 124 | rbVentas.isChecked = true |
123 | rbDeposito.isChecked = false | 125 | rbDeposito.isChecked = false |
124 | } | 126 | } |
125 | } else (sharedPreferences.getString("rbVentas", "").toString() == "") | 127 | } else (sharedPreferences.getString("rbVentas", "").toString() == "") |
126 | 128 | ||
127 | if (sharedPreferences.contains("rbDeposito")) { | 129 | if (sharedPreferences.contains("rbDeposito")) { |
128 | if (sharedPreferences.getString("rbDeposito", "").toString() == "0") { | 130 | if (sharedPreferences.getString("rbDeposito", "").toString() == "0") { |
129 | rbDeposito.isChecked = false | 131 | rbDeposito.isChecked = false |
130 | rbVentas.isChecked = true | 132 | rbVentas.isChecked = true |
131 | } else if (sharedPreferences.getString("rbDeposito", "").toString() == "1") { | 133 | } else if (sharedPreferences.getString("rbDeposito", "").toString() == "1") { |
132 | rbDeposito.isChecked = true | 134 | rbDeposito.isChecked = true |
133 | rbVentas.isChecked = false | 135 | rbVentas.isChecked = false |
134 | } | 136 | } |
135 | } else (sharedPreferences.getString("rbDeposito", "").toString() == "") | 137 | } else (sharedPreferences.getString("rbDeposito", "").toString() == "") |
136 | 138 | ||
137 | if (sharedPreferences.contains("rbCodigoDebo")) { | 139 | // if (sharedPreferences.contains("rbCodigoDebo")) { |
138 | if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "0") { | 140 | // if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "0") { |
139 | rbCodigoDebo.isChecked = false | 141 | // rbCodigoDebo.isChecked = false |
140 | rbCodigoOrigen.isChecked = false | 142 | // rbCodigoOrigen.isChecked = false |
141 | rbCodigoBarras.isChecked = false | 143 | // rbCodigoBarras.isChecked = false |
142 | } else if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "1") { | 144 | // } else if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "1") { |
143 | rbCodigoDebo.isChecked = true | 145 | // rbCodigoDebo.isChecked = true |
144 | rbCodigoOrigen.isChecked = false | 146 | // rbCodigoOrigen.isChecked = false |
145 | rbCodigoBarras.isChecked = false | 147 | // rbCodigoBarras.isChecked = false |
148 | // } | ||
149 | // } else (sharedPreferences.getString("rbCodigoDebo", "").toString() == "") | ||
150 | // | ||
151 | // if (sharedPreferences.contains("rbCodigoOrigen")) { | ||
152 | // if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "0") { | ||
153 | // rbCodigoOrigen.isChecked = false | ||
154 | // } else if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "1") { | ||
155 | // rbCodigoOrigen.isChecked = true | ||
156 | // } | ||
157 | // } else (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "") | ||
158 | |||
159 | // if (sharedPreferences.contains("rbCodigoBarras")) { | ||
160 | // if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "0") { | ||
161 | // rbCodigoBarras.isChecked = false | ||
162 | // } else if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "1") { | ||
163 | // rbCodigoBarras.isChecked = true | ||
164 | // } | ||
165 | // } else (sharedPreferences.getString("rbCodigoBarras", "").toString() == "") | ||
166 | |||
167 | if (sharedPreferences.contains("cbAskTimeServerToStart")) { | ||
168 | if (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "0") { | ||
169 | cbAskTimeServerToStart.isChecked = false | ||
170 | } else if (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "1") { | ||
171 | cbAskTimeServerToStart.isChecked = true | ||
146 | } | 172 | } |
147 | } else (sharedPreferences.getString("rbCodigoDebo", "").toString() == "") | 173 | } else (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "") |
148 | 174 | ||
149 | if (sharedPreferences.contains("rbCodigoOrigen")) { | ||
150 | if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "0") { | ||
151 | rbCodigoOrigen.isChecked = false | ||
152 | } else if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "1") { | ||
153 | rbCodigoOrigen.isChecked = true | ||
154 | } | ||
155 | } else (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "") | ||
156 | 175 | ||
157 | if (sharedPreferences.contains("rbCodigoBarras")) { | 176 | btnGuardar.setOnClickListener { |
158 | if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "0") { | 177 | guardarPreferencias() |
159 | rbCodigoBarras.isChecked = false | 178 | GlobalScope.launch(Main) { |
160 | } else if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "1") { | ||
161 | rbCodigoBarras.isChecked = true | ||
162 | } | ||
163 | } else (sharedPreferences.getString("rbCodigoBarras", "").toString() == "") | ||
164 | 179 | ||
165 | if (sharedPreferences.contains("cbMostrarExistencia")) { | 180 | val serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne() |
166 | if (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "0") { | 181 | if (serverBajada != null) { |
167 | cbMostrarExistencia.isChecked = false | 182 | if (serverBajada.direccion.isNullOrEmpty()) { |
168 | } else if (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "1") { | 183 | val modalDialog = NoServerConf() |
169 | cbMostrarExistencia.isChecked = true | 184 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
170 | } | 185 | } else { |
171 | } else (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "") | 186 | BASE_URL = serverBajada.direccion.toString() + ":" + serverBajada.puertoBajada.toString() + "/" |
187 | val call: Call<List<Time?>?>? = WebService.instance | ||
188 | ?.createService(WebServiceApi::class.java) | ||
189 | ?.getTime() | ||
190 | call!!.enqueue(object : Callback<List<Time?>?> { | ||
191 | override fun onResponse(call: Call<List<Time?>?>?, response: Response<List<Time?>?>) { | ||
192 | if (response.code() == 200) { | ||
193 | try { | ||
194 | val timeServer = | ||
195 | response.body()?.get(0)?.dia + "/" + | ||
196 | response.body()?.get(0)?.mes + "/" + | ||
197 | response.body()?.get(0)?.ano + " " + | ||
198 | response.body()?.get(0)?.hora + ":" + | ||
199 | response.body()?.get(0)?.minutos + ":" + | ||
200 | response.body()?.get(0)?.segundos | ||
201 | val horaServer = response.body()?.get(0)?.hora + "" + | ||
202 | response.body()?.get(0)?.minutos + "" + | ||
203 | response.body()?.get(0)?.segundos | ||
204 | val fechaServer = response.body()?.get(0)?.dia + "" + | ||
205 | response.body()?.get(0)?.mes + "" + | ||
206 | response.body()?.get(0)?.ano | ||
207 | if (!askTimeServer(timeServer, horaServer, fechaServer)) { | ||
208 | // Toast.makeText(v.context, "Los Datos se guardaron correctamente", Toast.LENGTH_SHORT).show() | ||
209 | // navController.navigate(R.id.action_configuracionFragment_to_mainFragment2) | ||
210 | } | ||
211 | } catch (e: SocketTimeoutException) { | ||
212 | |||
213 | } | ||
214 | } else if (response.code() == 400) { | ||
215 | } | ||
216 | } | ||
217 | |||
218 | override fun onFailure(call: Call<List<Time?>?>?, t: Throwable?) {} | ||
219 | }) | ||
220 | |||
221 | Toast.makeText(v.context, "Los Datos se guardaron correctamente", Toast.LENGTH_SHORT).show() | ||
222 | navController.navigate(R.id.action_configuracionFragment_to_mainFragment2) | ||
172 | 223 | ||
173 | if (sharedPreferences.contains("cbMostrarPrecio")) { | 224 | } |
174 | if (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "0") { | 225 | } |
175 | cbMostrarPrecio.isChecked = false | ||
176 | } else if (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "1") { | ||
177 | cbMostrarPrecio.isChecked = true | ||
178 | } | 226 | } |
179 | } else (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "") | ||
180 | |||
181 | btnGuardar.setOnClickListener { | ||
182 | guardarPreferencias() | ||
183 | Toast.makeText(v.context, "Los Datos se guardaron correctamente", Toast.LENGTH_LONG) | ||
184 | .show() | ||
185 | navController.navigate(R.id.action_configuracionFragment_to_mainFragment2) | ||
186 | } | 227 | } |
187 | btnAgregarServidor.setOnClickListener { findNavController().navigate(R.id.servidoresFragment) } | 228 | btnAgregarServidor.setOnClickListener { findNavController().navigate(R.id.servidoresFragment) } |
188 | 229 | ||
189 | spServidor.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { | 230 | spServidor.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { |
190 | override fun onNothingSelected(parent: AdapterView<*>?) {} | 231 | override fun onNothingSelected(parent: AdapterView<*>?) {} |
191 | override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { | 232 | override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { |
192 | itemSelect = parent!!.getItemAtPosition(position).toString().substring(0, 2).toInt() | 233 | itemSelect = parent!!.getItemAtPosition(position).toString().substring(0, 2).toInt() |
193 | indexSelect = position | 234 | indexSelect = position |
194 | } | 235 | } |
195 | } | 236 | } |
196 | 237 | ||
197 | btnValidarServidor.setOnClickListener { | 238 | btnValidarServidor.setOnClickListener { |
198 | GlobalScope.launch(Main) { | 239 | GlobalScope.launch(Main) { |
199 | |||
200 | val serverPre = fetchServer() | 240 | val serverPre = fetchServer() |
201 | if (serverPre != null) { | 241 | if (serverPre != null) { |
202 | if (isConnectedToThisServer(serverPre.direccion.toString().substring(7, serverPre.direccion.toString().length))) { | 242 | if (isConnectedToThisServer(serverPre.direccion.toString().substring(7, serverPre.direccion.toString().length))) { |
203 | val modalDialog = ServerValido() | 243 | val modalDialog = ServerValido() |
204 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 244 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
205 | } else { | 245 | } else { |
206 | val modalDialog = ServerNoValido() | 246 | val modalDialog = ServerNoValido() |
207 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 247 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
208 | } | 248 | } |
209 | } | 249 | } |
210 | } | 250 | } |
211 | } | 251 | } |
212 | 252 | ||
253 | rbVentas.setOnClickListener { | ||
254 | val modalDialog = SelAreaInventarioVentas() | ||
255 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
256 | } | ||
257 | |||
258 | rbDeposito.setOnClickListener { | ||
259 | val modalDialog = SelAreaInventarioDeposito() | ||
260 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
261 | } | ||
213 | return v | 262 | return v |
214 | } | 263 | } |
215 | 264 | ||
216 | private suspend fun fetchServer(): ServeInv? { | 265 | private suspend fun fetchServer(): ServeInv? { |
217 | return GlobalScope.async(Dispatchers.IO) { | 266 | return GlobalScope.async(Dispatchers.IO) { |
218 | return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchServer(itemSelect) | 267 | return@async AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServer(itemSelect) |
219 | }.await() | 268 | }.await() |
220 | } | 269 | } |
221 | 270 | ||
222 | suspend fun getDescServers(): List<ServeInv> { | 271 | private suspend fun getDescServers(): List<ServeInv> { |
223 | return GlobalScope.async(Dispatchers.IO) { | 272 | return GlobalScope.async(Dispatchers.IO) { |
224 | return@async AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.fetchAllServers() | 273 | return@async AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchAllServers() |
225 | }.await() | 274 | }.await() |
226 | } | 275 | } |
227 | 276 | ||
228 | fun guardarPreferencias() { | 277 | fun guardarPreferencias() { |
229 | try { | 278 | try { |
230 | val editor = sharedPreferences.edit() | 279 | val editor = sharedPreferences.edit() |
231 | 280 | ||
232 | if (etRuta.text.isNotEmpty()) editor?.putString("etRuta", etRuta.text.toString()) | 281 | if (etRuta.text.isNotEmpty()) editor?.putString("etRuta", etRuta.text.toString()) |
233 | 282 | ||
234 | if (rbProInclu.isChecked) editor?.putString("rbProInclu", "1") else editor?.putString("rbProInclu", "0") | 283 | if (rbProInclu.isChecked) editor?.putString("rbProInclu", "1") else editor?.putString("rbProInclu", "0") |
235 | if (rbProNoInclu.isChecked) editor?.putString("rbProNoInclu", "1") else editor?.putString("rbProNoInclu", "0") | 284 | if (rbProNoInclu.isChecked) editor?.putString("rbProNoInclu", "1") else editor?.putString("rbProNoInclu", "0") |
236 | if (cbHabiLectura.isChecked) editor?.putString("cbHabiLectura", "1") else editor?.putString("cbHabiLectura", "0") | 285 | if (cbHabiLectura.isChecked) editor?.putString("cbHabiLectura", "1") else editor?.putString("cbHabiLectura", "0") |
237 | if (cbMostrarStock.isChecked) editor?.putString("cbMostrarStock", "1") else editor?.putString("cbMostrarStock", "0") | 286 | if (cbMostrarStock.isChecked) editor?.putString("cbMostrarStock", "1") else editor?.putString("cbMostrarStock", "0") |
238 | if (rbVentas.isChecked) editor?.putString("rbVentas","1") else editor?.putString("rbVentas", "0") | 287 | if (rbVentas.isChecked) editor?.putString("rbVentas", "1") else editor?.putString("rbVentas", "0") |
239 | if (rbDeposito.isChecked) editor?.putString("rbDeposito","1") else editor?.putString("rbDeposito", "0") | 288 | if (rbDeposito.isChecked) editor?.putString("rbDeposito", "1") else editor?.putString("rbDeposito", "0") |
240 | // if (rbCodigoDebo.isChecked) editor?.putString("rbCodigoDebo", "1") else editor?.putString("rbCodigoDebo", "0") | 289 | if (cbAskTimeServerToStart.isChecked) editor?.putString("cbAskTimeServerToStart", "1") else editor?.putString("cbAskTimeServerToStart", "0") |
241 | // if (rbCodigoOrigen.isChecked) editor?.putString("rbCodigoOrigen", "1") else editor?.putString("rbCodigoOrigen", "0") | ||
242 | // if (rbCodigoBarras.isChecked) editor?.putString("rbCodigoBarras", "1") else editor?.putString("rbCodigoBarras", "0") | ||
243 | // if (cbMostrarExistencia.isChecked) editor?.putString("cbMostrarExistencia", "1") else editor?.putString("cbMostrarExistencia", "0") | ||
244 | // if (cbMostrarPrecio.isChecked) editor?.putString("cbMostrarPrecio", "1") else editor?.putString("cbMostrarPrecio", "0") | ||
245 | editor?.putString("ServerPredeterminado", indexSelect.toString()) | 290 | editor?.putString("ServerPredeterminado", indexSelect.toString()) |
246 | updateServerPreInZero() | 291 | updateServerPreInZero() |
247 | updateServerPre(itemSelect) | 292 | updateServerPre(itemSelect) |
248 | 293 | ||
249 | editor?.apply() | 294 | editor?.apply() |
250 | editor.commit() | 295 | editor.commit() |
251 | 296 | ||
252 | } catch (e: Exception) { | 297 | } catch (e: Exception) { |
253 | Toast.makeText(requireContext(), "Error ", Toast.LENGTH_LONG).show() | 298 | Toast.makeText(requireContext(), "Error ", Toast.LENGTH_LONG).show() |
254 | e.printStackTrace() | 299 | e.printStackTrace() |
255 | } | 300 | } |
256 | } | 301 | } |
257 | 302 | ||
303 | private fun askTimeServer(timeServer: String, horaServer: String, fechaServer: String): Boolean { | ||
304 | |||
305 | var existeDiferencias = false | ||
306 | val horaAct = obtenerHoraActual().toDouble() | ||
307 | val fechaAct = obtenerDiaActual().toDouble() | ||
308 | val difFecha = fechaAct - fechaServer.toDouble() | ||
309 | val difHora = horaAct - horaServer.toDouble() | ||
310 | if (difFecha.absoluteValue > 0) existeDiferencias = true | ||
311 | if (difHora.absoluteValue > 130) existeDiferencias = true | ||
312 | |||
313 | if (existeDiferencias) { |
app/src/main/java/com/focasoftware/deboinventariov20/UI/descripCorigenFragment/CodigoOriFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.descripCorigenFragment | 1 | package com.focasoftware.deboinventariov20.UI.descripCorigenFragment |
2 | 2 | ||
3 | import android.app.AlertDialog | 3 | import android.app.AlertDialog |
4 | import android.content.Context | 4 | import android.content.Context |
5 | import android.content.SharedPreferences | 5 | import android.content.SharedPreferences |
6 | import android.graphics.Canvas | 6 | import android.graphics.Canvas |
7 | import android.graphics.Color | 7 | import android.graphics.Color |
8 | import android.graphics.drawable.ColorDrawable | 8 | import android.graphics.drawable.ColorDrawable |
9 | import android.os.Bundle | 9 | import android.os.Bundle |
10 | import android.text.Editable | 10 | import android.text.Editable |
11 | import android.text.InputType | 11 | import android.text.InputType |
12 | import android.text.TextWatcher | 12 | import android.text.TextWatcher |
13 | import androidx.fragment.app.Fragment | 13 | import androidx.fragment.app.Fragment |
14 | import android.view.LayoutInflater | 14 | import android.view.LayoutInflater |
15 | import android.view.View | 15 | import android.view.View |
16 | import android.view.ViewGroup | 16 | import android.view.ViewGroup |
17 | import android.view.WindowManager | 17 | import android.view.WindowManager |
18 | import android.view.inputmethod.InputMethodManager | 18 | import android.view.inputmethod.InputMethodManager |
19 | import androidx.fragment.app.FragmentActivity | 19 | import androidx.fragment.app.FragmentActivity |
20 | import androidx.lifecycle.lifecycleScope | 20 | import androidx.lifecycle.lifecycleScope |
21 | import androidx.navigation.NavController | 21 | import androidx.navigation.NavController |
22 | import androidx.navigation.Navigation | 22 | import androidx.navigation.Navigation |
23 | import androidx.recyclerview.widget.ItemTouchHelper | 23 | import androidx.recyclerview.widget.ItemTouchHelper |
24 | import androidx.recyclerview.widget.LinearLayoutManager | 24 | import androidx.recyclerview.widget.LinearLayoutManager |
25 | import androidx.recyclerview.widget.RecyclerView | 25 | import androidx.recyclerview.widget.RecyclerView |
26 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 26 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
27 | import com.focasoftware.deboinventariov20.Model.Articles | 27 | import com.focasoftware.deboinventariov20.Model.Articles |
28 | import com.focasoftware.deboinventariov20.Model.InvBody | 28 | import com.focasoftware.deboinventariov20.Model.InvBody |
29 | import com.focasoftware.deboinventariov20.R | 29 | import com.focasoftware.deboinventariov20.R |
30 | import com.focasoftware.deboinventariov20.UI.Utils.obtenerFechaActual | 30 | import com.focasoftware.deboinventariov20.UI.Utils.obtenerFechaActual |
31 | import com.focasoftware.deboinventariov20.UI.Utils.modificarCantidadEnCabecera | 31 | import com.focasoftware.deboinventariov20.UI.Utils.modificarCantidadEnCabecera |
32 | import kotlinx.android.synthetic.main.ingresar_cantidad.view.* | 32 | import kotlinx.android.synthetic.main.ingresar_cantidad.view.* |
33 | import kotlinx.android.synthetic.main.ingresar_cantidad.view.btnAceptar | 33 | import kotlinx.android.synthetic.main.ingresar_cantidad.view.btnAceptar |
34 | import kotlinx.android.synthetic.main.login_dialog.view.* | 34 | import kotlinx.android.synthetic.main.login_dialog.view.* |
35 | import kotlinx.coroutines.* | 35 | import kotlinx.coroutines.* |
36 | 36 | ||
37 | // | 37 | // |
38 | class CodigoOriFragment : Fragment() { | 38 | class CodigoOriFragment : Fragment() { |
39 | 39 | ||
40 | private lateinit var artAcargar2: List<Articles> | 40 | private lateinit var artAcargar2: List<Articles> |
41 | private var listArticulos: List<Articles>? = null | 41 | private var listArticulos: List<Articles>? = null |
42 | lateinit var viewAdapter2: RecyclerView.Adapter<*> | 42 | lateinit var viewAdapter2: RecyclerView.Adapter<*> |
43 | private lateinit var viewManager2: RecyclerView.LayoutManager | 43 | private lateinit var viewManager2: RecyclerView.LayoutManager |
44 | private lateinit var rcCodigoOri: RecyclerView | 44 | private lateinit var rcCodigoOri: RecyclerView |
45 | private var swipeBackground: ColorDrawable = ColorDrawable(Color.YELLOW) | 45 | private var swipeBackground: ColorDrawable = ColorDrawable(Color.YELLOW) |
46 | private var cantidad = 0F | 46 | private var cantidad = 0F |
47 | private var numeroInventario = 0 | 47 | private var numeroInventario = 0 |
48 | lateinit var navController: NavController | 48 | lateinit var navController: NavController |
49 | lateinit var sharedPreferences: SharedPreferences | 49 | lateinit var sharedPreferences: SharedPreferences |
50 | private var artCargadoEnBD: InvBody? = null | 50 | private var artCargadoEnBD: InvBody? = null |
51 | lateinit var mDialogViewM: View | 51 | lateinit var mDialogViewM: View |
52 | var resultadoTemp:Float=0F | ||
52 | 53 | ||
53 | override fun onCreate(savedInstanceState: Bundle?) { | 54 | override fun onCreate(savedInstanceState: Bundle?) { |
54 | super.onCreate(savedInstanceState) | 55 | super.onCreate(savedInstanceState) |
55 | 56 | ||
56 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 57 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
57 | arguments.apply { | 58 | arguments.apply { |
58 | artAcargar2 = requireArguments().getSerializable("ArrayDesc") as List<Articles> | 59 | artAcargar2 = requireArguments().getSerializable("ArrayDesc") as List<Articles> |
59 | numeroInventario = requireArguments().getInt("numeroInv") | 60 | numeroInventario = requireArguments().getInt("numeroInv") |
60 | } | 61 | } |
61 | 62 | ||
62 | } | 63 | } |
63 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 64 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
64 | super.onViewCreated(view, savedInstanceState) | 65 | super.onViewCreated(view, savedInstanceState) |
65 | navController = Navigation.findNavController(view) | 66 | navController = Navigation.findNavController(view) |
66 | showSoftKeyboard(view) | 67 | showSoftKeyboard(view) |
67 | } | 68 | } |
68 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 69 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
69 | val v = inflater.inflate(R.layout.fragment_codigo_ori, container, false) | 70 | val v = inflater.inflate(R.layout.fragment_codigo_ori, container, false) |
70 | rcCodigoOri = v.findViewById(R.id.rcCodigoOri) | 71 | rcCodigoOri = v.findViewById(R.id.rcCodigoOri) |
71 | 72 | ||
72 | IngresarRecicler(artAcargar2) | 73 | IngresarRecicler(artAcargar2) |
73 | showSoftKeyboard(v) | 74 | showSoftKeyboard(v) |
74 | // btnSalir.setOnClickListener { | 75 | // btnSalir.setOnClickListener { |
75 | // activity?.onBackPressed(); | 76 | // activity?.onBackPressed(); |
76 | //// VolverAinventario() | 77 | //// VolverAinventario() |
77 | // } | 78 | // } |
78 | return v | 79 | return v |
79 | } | 80 | } |
80 | 81 | ||
81 | private fun showSoftKeyboard(view: View) { | 82 | private fun showSoftKeyboard(view: View) { |
82 | if (view.requestFocus()) { | 83 | if (view.requestFocus()) { |
83 | val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager | 84 | val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager |
84 | imm.showSoftInput(view, InputMethodManager.HIDE_IMPLICIT_ONLY) | 85 | imm.showSoftInput(view, InputMethodManager.HIDE_IMPLICIT_ONLY) |
85 | } | 86 | } |
86 | } | 87 | } |
87 | 88 | ||
88 | fun IngresarRecicler(articulos: List<Articles>) { | 89 | fun IngresarRecicler(articulos: List<Articles>) { |
89 | 90 | ||
90 | viewAdapter2 = CodigoOrigenAdapter(requireContext(),articulos) | 91 | viewAdapter2 = CodigoOrigenAdapter(requireContext(),articulos) |
91 | viewManager2 = LinearLayoutManager(requireContext()) | 92 | viewManager2 = LinearLayoutManager(requireContext()) |
92 | 93 | ||
93 | rcCodigoOri.apply { | 94 | rcCodigoOri.apply { |
94 | adapter = viewAdapter2 | 95 | adapter = viewAdapter2 |
95 | layoutManager = viewManager2 | 96 | layoutManager = viewManager2 |
96 | } | 97 | } |
97 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) { | 98 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) { |
98 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { | 99 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { |
99 | return false | 100 | return false |
100 | } | 101 | } |
101 | 102 | ||
102 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, position: Int) { | 103 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, position: Int) { |
103 | 104 | ||
104 | GlobalScope.launch(Dispatchers.Main) { | 105 | GlobalScope.launch(Dispatchers.Main) { |
105 | //TODO BUSCO EN BASE DE DATOS | 106 | //TODO BUSCO EN BASE DE DATOS |
106 | artCargadoEnBD = buscarCodigoDeboEnBD((viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)?.sector.toString(), | 107 | artCargadoEnBD = buscarCodigoDeboEnBD((viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)?.sector.toString(), |
107 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)?.codigo.toString(), | 108 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)?.codigo.toString(), |
108 | numeroInventario.toString()) | 109 | numeroInventario.toString()) |
109 | if (artCargadoEnBD == null) { | 110 | if (artCargadoEnBD == null) { |
110 | val mDialogView = LayoutInflater.from(context).inflate(R.layout.ingresar_cantidad, null) | 111 | val mDialogView = LayoutInflater.from(context).inflate(R.layout.ingresar_cantidad, null) |
111 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(false) | 112 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(false) |
112 | //TODO: DEPENDIENDO DEL TIPO DE ARTICULO PERMITER INGRESAR DECIMALES O NO | 113 | //TODO: DEPENDIENDO DEL TIPO DE ARTICULO PERMITER INGRESAR DECIMALES O NO |
113 | if ((viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza==1 || (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza==3 || (viewAdapter2 as CodigoOrigenAdapter).items2?.get( | 114 | if ((viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza==1 || (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza==3 || (viewAdapter2 as CodigoOrigenAdapter).items2?.get( |
114 | viewHolder.layoutPosition)!!.balanza==7) | 115 | viewHolder.layoutPosition)!!.balanza==7) |
115 | mDialogView.etCantidad.inputType= InputType.TYPE_CLASS_NUMBER | 116 | mDialogView.etCantidad.inputType= InputType.TYPE_CLASS_NUMBER |
116 | 117 | ||
117 | mDialogView.tvTitulo.text = "${(viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion}" | 118 | mDialogView.tvTitulo.text = "${(viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion}" |
118 | val mAlertDialog = mBuilder.show() | 119 | val mAlertDialog = mBuilder.show() |
119 | mDialogView.etCantidad.requestFocus() | 120 | mDialogView.etCantidad.requestFocus() |
120 | mAlertDialog.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 121 | mAlertDialog.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
121 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 122 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
122 | mDialogView.btnAceptar.setOnClickListener { | 123 | mDialogView.btnAceptar.setOnClickListener { |
123 | if (mDialogView.etCantidad.text.isNullOrEmpty()) { | 124 | if (mDialogView.etCantidad.text.isNullOrEmpty()) { |
124 | mDialogView.etCantidad.error = "No vacio" | 125 | mDialogView.etCantidad.error = "No vacio" |
125 | mDialogView.etCantidad.requestFocus() | 126 | mDialogView.etCantidad.requestFocus() |
126 | mDialogView.etCantidad.hint = "Ingrese un valor" | 127 | mDialogView.etCantidad.hint = "Ingrese un valor" |
127 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { | 128 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { |
128 | cantidad = mDialogView.etCantidad.text.toString().toFloat() | 129 | cantidad = mDialogView.etCantidad.text.toString().toFloat() |
129 | val body = InvBody(numeroInventario, | 130 | val body = InvBody(numeroInventario, |
130 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.sector, | 131 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.sector, |
131 | // TODO: PREPARO PARA MANDAR A CARGAR EN LA BD | 132 | // TODO: PREPARO PARA MANDAR A CARGAR EN LA BD |
132 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo, | 133 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo, |
133 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion, | 134 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion, |
134 | cantidad.toString(), | 135 | cantidad.toString(), |
135 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.codBar, | 136 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.codBar, |
136 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.codOrigen, | 137 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.codOrigen, |
137 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, | 138 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, |
138 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, | 139 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, |
139 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza, | 140 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza, |
140 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.depSn, | 141 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.depSn, |
141 | obtenerFechaActual(), | 142 | obtenerFechaActual(), |
142 | obtenerFechaActual()) | 143 | obtenerFechaActual()) |
143 | InsertarArtEnDB(body)// TODO: MANDO A CARGAR A LA BASE DE DATOS | 144 | InsertarArtEnDB(body)// TODO: MANDO A CARGAR A LA BASE DE DATOS |
144 | modificarCantidadEnCabecera(numeroInventario, true, requireActivity()) | 145 | modificarCantidadEnCabecera(numeroInventario, true, requireActivity()) |
145 | // VolverAinventario() | 146 | // VolverAinventario() |
146 | activity?.onBackPressed() | 147 | activity?.onBackPressed() |
147 | mAlertDialog.dismiss() | 148 | mAlertDialog.dismiss() |
148 | } | 149 | } |
149 | } | 150 | } |
150 | } else if (artCargadoEnBD != null) { | 151 | } else if (artCargadoEnBD != null) { |
151 | 152 | ||
152 | mDialogViewM = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | 153 | mDialogViewM = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) |
153 | val mBuilder = AlertDialog.Builder(context).setView(mDialogViewM).setCancelable(false) | 154 | val mBuilder = AlertDialog.Builder(context).setView(mDialogViewM).setCancelable(false) |
154 | if (artCargadoEnBD!!.balanza.toString().contains("1") || artCargadoEnBD!!.balanza.toString().contains("3") || artCargadoEnBD!!.balanza.toString().contains("7")) mDialogViewM.tvNuevaCantidad.inputType= InputType.TYPE_CLASS_NUMBER | 155 | if (artCargadoEnBD!!.balanza.toString().contains("1") || artCargadoEnBD!!.balanza.toString().contains("3") || artCargadoEnBD!!.balanza.toString().contains("7")) mDialogViewM.tvNuevaCantidad.inputType= InputType.TYPE_CLASS_NUMBER |
155 | mDialogViewM.tvTitulo2.text="${artCargadoEnBD!!.descripcion}" | 156 | mDialogViewM.tvTitulo2.text="${artCargadoEnBD!!.descripcion}" |
156 | mDialogViewM.tvCantInicial.text =String.format("%.2f", artCargadoEnBD!!.cantTomada.toString().toFloat()) | 157 | mDialogViewM.tvCantInicial.text = (Math.round(artCargadoEnBD!!.cantTomada.toString().toFloat() * 100.0) / 100.0).toString() |
158 | |||
157 | 159 | ||
158 | val mAlertDialog = mBuilder.show() | 160 | val mAlertDialog = mBuilder.show() |
159 | mDialogViewM.tvNuevaCantidad.requestFocus() | 161 | mDialogViewM.tvNuevaCantidad.requestFocus() |
160 | mDialogViewM.tvNuevaCantidad.addTextChangedListener(textWatcher) | 162 | mDialogViewM.tvNuevaCantidad.addTextChangedListener(textWatcher) |
161 | 163 | ||
162 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 164 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
163 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 165 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
164 | 166 | ||
165 | mDialogViewM.rbSumar.setOnClickListener { | 167 | mDialogViewM.rbSumar.setOnClickListener { |
166 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 168 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
167 | mDialogViewM.tvResultado.text = String.format("%.2f", (mDialogViewM.tvCantInicial.text.toString().toFloat() + mDialogViewM.tvNuevaCantidad.text.toString().toFloat())) | 169 | resultadoTemp=mDialogViewM.tvCantInicial.text.toString().toFloat() + mDialogViewM.tvNuevaCantidad.text.toString().toFloat() |
168 | // mDialogView.tvNuevaCantidad.isEnabled=false | 170 | mDialogViewM.tvResultado.text = (Math.round(resultadoTemp * 100.0) / 100.0).toString() |
169 | } | 171 | } |
170 | } | 172 | } |
171 | mDialogViewM.rbRestar.setOnClickListener { | 173 | mDialogViewM.rbRestar.setOnClickListener { |
172 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 174 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
173 | if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) { | 175 | if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) { |
174 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) | 176 | resultadoTemp= mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat() |
175 | // mDialogView.tvNuevaCantidad.isEnabled = false | 177 | mDialogViewM.tvResultado.text = (Math.round(resultadoTemp * 100.0) / 100.0).toString() |
176 | }else{ | 178 | }else{ |
177 | mDialogViewM.tvResultado.text="" | 179 | mDialogViewM.tvResultado.text="" |
178 | mDialogViewM.tvResultado.error = "Operación No Valida" | 180 | mDialogViewM.tvResultado.error = "Operación No Valida" |
179 | mDialogViewM.tvResultado.requestFocus() | 181 | mDialogViewM.tvResultado.requestFocus() |
180 | mDialogViewM.tvResultado.hint = "Error" | 182 | mDialogViewM.tvResultado.hint = "Error" |
181 | } | 183 | } |
182 | } | 184 | } |
183 | } | 185 | } |
184 | mDialogViewM.rbMdodificar.setOnClickListener { | 186 | mDialogViewM.rbMdodificar.setOnClickListener { |
185 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 187 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
186 | mDialogViewM.tvResultado.text = String.format("%.2f", (mDialogViewM.tvNuevaCantidad.text.toString().toFloat())) | 188 | mDialogViewM.tvResultado.text = (Math.round(mDialogViewM.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString() |
187 | // mDialogView.tvNuevaCantidad.isEnabled = false | ||
188 | } | 189 | } |
189 | } | 190 | } |
190 | mDialogViewM.btnAceptar.setOnClickListener { | 191 | mDialogViewM.btnAceptar.setOnClickListener { |
191 | if (mDialogViewM.tvNuevaCantidad.text.isNotEmpty() || !mDialogViewM.tvNuevaCantidad.text.isBlank()) { | 192 | if (mDialogViewM.tvNuevaCantidad.text.isNotEmpty() || !mDialogViewM.tvNuevaCantidad.text.isBlank()) { |
192 | if (mDialogViewM.tvResultado.text.isNotEmpty() || !mDialogViewM.tvResultado.text.isBlank()) { | 193 | if (mDialogViewM.tvResultado.text.isNotEmpty() || !mDialogViewM.tvResultado.text.isBlank()) { |
193 | 194 | ||
194 | updateCantidad((viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.sector.toString(), | 195 | updateCantidad((viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.sector.toString(), |
195 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo.toString(), | 196 | (viewAdapter2 as CodigoOrigenAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo.toString(), |
196 | mDialogViewM.tvResultado.text.toString().toFloat()) | 197 | mDialogViewM.tvResultado.text.toString().toFloat()) |
197 | // VolverAinventario() | 198 | // VolverAinventario() |
198 | activity?.onBackPressed(); | 199 | activity?.onBackPressed(); |
199 | mAlertDialog.dismiss() | 200 | mAlertDialog.dismiss() |
200 | } else if (mDialogViewM.tvNuevaCantidad.text.isNotEmpty() || mDialogViewM.tvNuevaCantidad.text.isBlank()) { | 201 | } else if (mDialogViewM.tvNuevaCantidad.text.isNotEmpty() || mDialogViewM.tvNuevaCantidad.text.isBlank()) { |
201 | mDialogViewM.tvResultado.error = "Operación Requerida" | 202 | mDialogViewM.tvResultado.error = "Operación Requerida" |
202 | mDialogViewM.tvResultado.requestFocus() | 203 | mDialogViewM.tvResultado.requestFocus() |
203 | mDialogViewM.tvResultado.hint = "Seleccione Operación" | 204 | mDialogViewM.tvResultado.hint = "Seleccione Operación" |
204 | } | 205 | } |
205 | } else if (mDialogViewM.tvNuevaCantidad.text.isEmpty() || mDialogViewM.tvNuevaCantidad.text.isBlank()) { | 206 | } else if (mDialogViewM.tvNuevaCantidad.text.isEmpty() || mDialogViewM.tvNuevaCantidad.text.isBlank()) { |
206 | mDialogViewM.tvNuevaCantidad.error = "Completar" | 207 | mDialogViewM.tvNuevaCantidad.error = "Completar" |
207 | mDialogViewM.tvNuevaCantidad.requestFocus() | 208 | mDialogViewM.tvNuevaCantidad.requestFocus() |
208 | mDialogViewM.tvNuevaCantidad.hint = "Ingrese un valor" | 209 | mDialogViewM.tvNuevaCantidad.hint = "Ingrese un valor" |
209 | } | 210 | } |
210 | } | 211 | } |
211 | mDialogViewM.dialogCancelBtn.setOnClickListener { | 212 | mDialogViewM.dialogCancelBtn.setOnClickListener { |
212 | activity?.onBackPressed(); | 213 | activity?.onBackPressed(); |
213 | mAlertDialog.dismiss() | 214 | mAlertDialog.dismiss() |
214 | } | 215 | } |
215 | } | 216 | } |
216 | } | 217 | } |
217 | } | 218 | } |
218 | 219 | ||
219 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { | 220 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { |
220 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | 221 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) |
221 | val itemView = viewHolder.itemView | 222 | val itemView = viewHolder.itemView |
222 | 223 | ||
223 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) | 224 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) |
224 | 225 | ||
225 | if (dX > 0) { | 226 | if (dX > 0) { |
226 | 227 | ||
227 | c.drawColor(Color.RED) | 228 | c.drawColor(Color.RED) |
228 | } else if (dX < 0) { | 229 | } else if (dX < 0) { |
229 | // swipeBackground.setBounds(itemView.right+dX.toInt(),itemView.top,itemView.right,itemView.bottom) | 230 | // swipeBackground.setBounds(itemView.right+dX.toInt(),itemView.top,itemView.right,itemView.bottom) |
230 | c.drawColor(Color.YELLOW) | 231 | c.drawColor(Color.YELLOW) |
231 | } | 232 | } |
232 | swipeBackground.draw(c) | 233 | swipeBackground.draw(c) |
233 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | 234 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) |
234 | } | 235 | } |
235 | } | 236 | } |
236 | val itemTouchHelper2 = ItemTouchHelper(itemTouchHelperCallback) | 237 | val itemTouchHelper2 = ItemTouchHelper(itemTouchHelperCallback) |
237 | itemTouchHelper2.attachToRecyclerView(rcCodigoOri) | 238 | itemTouchHelper2.attachToRecyclerView(rcCodigoOri) |
238 | 239 | ||
239 | } | 240 | } |
240 | 241 | ||
241 | fun InsertarArtEnDB(cuarpoInventario: InvBody) { | 242 | fun InsertarArtEnDB(cuarpoInventario: InvBody) { |
242 | lifecycleScope.launch { | 243 | lifecycleScope.launch { |
243 | withContext(Dispatchers.IO) { | 244 | withContext(Dispatchers.IO) { |
244 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) | 245 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) |
245 | } | 246 | } |
246 | } | 247 | } |
247 | } | 248 | } |
248 | 249 | ||
249 | suspend fun buscarCodigoDeboEnBD(sector: String, codigo: String, numInventario: String): InvBody? { | 250 | suspend fun buscarCodigoDeboEnBD(sector: String, codigo: String, numInventario: String): InvBody? { |
250 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 251 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
251 | var busqueda: InvBody? = null | 252 | var busqueda: InvBody? = null |
252 | return GlobalScope.async(Dispatchers.IO) { | 253 | return GlobalScope.async(Dispatchers.IO) { |
253 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.fetchArtInInvBody(sector.toLong(), codigo.toLong(), numInventario.toInt()) | 254 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.fetchArtInInvBody(sector.toLong(), codigo.toLong(), numInventario.toInt()) |
254 | return@async busqueda | 255 | return@async busqueda |
255 | }.await() | 256 | }.await() |
256 | } | 257 | } |
257 | 258 | ||
258 | fun updateCantidad(sector: String, codigo: String, cantidad: Float) { | 259 | fun updateCantidad(sector: String, codigo: String, cantidad: Float) { |
259 | lifecycleScope.launch { | 260 | lifecycleScope.launch { |
260 | withContext(Dispatchers.IO) { | 261 | withContext(Dispatchers.IO) { |
261 | val activity: FragmentActivity? = activity | 262 | val activity: FragmentActivity? = activity |
262 | if (activity != null && isAdded) { | 263 | if (activity != null && isAdded) { |
263 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.updateInvBody(cantidad, sector.toLong(), codigo.toLong(), obtenerFechaActual()) | 264 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.updateInvBody(cantidad, sector.toLong(), codigo.toLong(), obtenerFechaActual()) |
264 | } | 265 | } |
265 | } | 266 | } |
266 | } | 267 | } |
267 | } | 268 | } |
268 | private val textWatcher = object : TextWatcher { | 269 | private val textWatcher = object : TextWatcher { |
269 | override fun afterTextChanged(s: Editable?) { | 270 | override fun afterTextChanged(s: Editable?) { |
271 | if (mDialogViewM.tvNuevaCantidad.text.toString() == "") { mDialogViewM.tvResultado.text = ""} | ||
270 | } | 272 | } |
271 | 273 | ||
272 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { | 274 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { |
273 | } | 275 | } |
274 | 276 | ||
275 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { | 277 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { |
276 | if (mDialogViewM.rbSumar.isChecked) { | 278 | if (mDialogViewM.tvNuevaCantidad.text.toString() != "") { |
277 | // mDialogView.tvNuevaCantidad.isEnabled=false | 279 | |
278 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvNuevaCantidad.text.toString().toFloat() + mDialogViewM.tvCantInicial.text.toString().toFloat()) | 280 | if (mDialogViewM.rbSumar.isChecked) { |
279 | } | 281 | resultadoTemp = mDialogViewM.tvNuevaCantidad.text.toString().toFloat() + mDialogViewM.tvCantInicial.text.toString().toFloat() |
280 | if (mDialogViewM.rbRestar.isChecked) { | 282 | mDialogViewM.tvResultado.text = (Math.round(resultadoTemp * 100.0) / 100.0).toString() |
281 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 283 | } |
282 | if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) { | 284 | if (mDialogViewM.rbRestar.isChecked) { |
283 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) | 285 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
286 | if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) { | ||
287 | resultadoTemp = mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat() | ||
288 | mDialogViewM.tvResultado.text = (Math.round(resultadoTemp * 100.0) / 100.0).toString() | ||
284 | // mDialogView.tvNuevaCantidad.isEnabled = false | 289 | // mDialogView.tvNuevaCantidad.isEnabled = false |
285 | } else { | 290 | } else { |
286 | mDialogViewM.tvResultado.text = "" | 291 | mDialogViewM.tvResultado.text = "" |
287 | mDialogViewM.tvResultado.error = "Operación No Valida" | 292 | mDialogViewM.tvResultado.error = "Operación No Valida" |
288 | mDialogViewM.tvResultado.requestFocus() | 293 | mDialogViewM.tvResultado.requestFocus() |
289 | mDialogViewM.tvResultado.hint = "Error" | 294 | mDialogViewM.tvResultado.hint = "Error" |
295 | } | ||
290 | } | 296 | } |
291 | } | 297 | } |
292 | } | 298 | if (mDialogViewM.rbMdodificar.isChecked) { |
293 | if (mDialogViewM.rbMdodificar.isChecked) { | 299 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
294 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 300 | mDialogViewM.tvResultado.text = (Math.round(mDialogViewM.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString() |
295 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) | ||
296 | // mDialogView.tvNuevaCantidad.isEnabled = false | 301 | // mDialogView.tvNuevaCantidad.isEnabled = false |
302 | } | ||
297 | } | 303 | } |
298 | } | 304 | } |
299 | } | 305 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/descripcionFragment/DescripcionFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.descripcionFragment | 1 | package com.focasoftware.deboinventariov20.UI.descripcionFragment |
2 | 2 | ||
3 | import android.app.AlertDialog | 3 | import android.app.AlertDialog |
4 | import android.content.Context | 4 | import android.content.Context |
5 | import android.content.SharedPreferences | 5 | import android.content.SharedPreferences |
6 | import android.graphics.Canvas | 6 | import android.graphics.Canvas |
7 | import android.graphics.Color | 7 | import android.graphics.Color |
8 | import android.graphics.drawable.ColorDrawable | 8 | import android.graphics.drawable.ColorDrawable |
9 | import android.os.Bundle | 9 | import android.os.Bundle |
10 | import android.text.Editable | 10 | import android.text.Editable |
11 | import android.text.InputType | 11 | import android.text.InputType |
12 | import android.text.TextWatcher | 12 | import android.text.TextWatcher |
13 | import android.view.LayoutInflater | 13 | import android.view.LayoutInflater |
14 | import android.view.View | 14 | import android.view.View |
15 | import android.view.ViewGroup | 15 | import android.view.ViewGroup |
16 | import android.view.WindowManager | 16 | import android.view.WindowManager |
17 | import android.view.inputmethod.InputMethodManager | 17 | import android.view.inputmethod.InputMethodManager |
18 | import androidx.fragment.app.Fragment | 18 | import androidx.fragment.app.Fragment |
19 | import androidx.fragment.app.FragmentActivity | 19 | import androidx.fragment.app.FragmentActivity |
20 | import androidx.lifecycle.lifecycleScope | 20 | import androidx.lifecycle.lifecycleScope |
21 | import androidx.navigation.NavController | 21 | import androidx.navigation.NavController |
22 | import androidx.navigation.Navigation | 22 | import androidx.navigation.Navigation |
23 | import androidx.recyclerview.widget.ItemTouchHelper | 23 | import androidx.recyclerview.widget.ItemTouchHelper |
24 | import androidx.recyclerview.widget.LinearLayoutManager | 24 | import androidx.recyclerview.widget.LinearLayoutManager |
25 | import androidx.recyclerview.widget.RecyclerView | 25 | import androidx.recyclerview.widget.RecyclerView |
26 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 26 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
27 | import com.focasoftware.deboinventariov20.Model.Articles | 27 | import com.focasoftware.deboinventariov20.Model.Articles |
28 | import com.focasoftware.deboinventariov20.Model.InvBody | 28 | import com.focasoftware.deboinventariov20.Model.InvBody |
29 | import com.focasoftware.deboinventariov20.R | 29 | import com.focasoftware.deboinventariov20.R |
30 | import com.focasoftware.deboinventariov20.UI.MainActivity | ||
30 | import com.focasoftware.deboinventariov20.UI.Utils.obtenerFechaActual | 31 | import com.focasoftware.deboinventariov20.UI.Utils.obtenerFechaActual |
31 | import com.focasoftware.deboinventariov20.UI.Utils.modificarCantidadEnCabecera | 32 | import com.focasoftware.deboinventariov20.UI.Utils.modificarCantidadEnCabecera |
32 | import kotlinx.android.synthetic.main.ingresar_cantidad.view.* | 33 | import kotlinx.android.synthetic.main.ingresar_cantidad.view.* |
33 | import kotlinx.android.synthetic.main.login_dialog.view.* | 34 | import kotlinx.android.synthetic.main.login_dialog.view.* |
34 | import kotlinx.android.synthetic.main.login_dialog.view.btnAceptar | 35 | import kotlinx.android.synthetic.main.login_dialog.view.btnAceptar |
35 | import kotlinx.coroutines.* | 36 | import kotlinx.coroutines.* |
36 | 37 | ||
37 | |||
38 | class DescripcionFragment : Fragment() { | 38 | class DescripcionFragment : Fragment() { |
39 | private var artAcargar2: List<Articles>? = null | 39 | private var artAcargar2: List<Articles>? = null |
40 | private var listArticulos2: List<Articles>? = null | 40 | private var listArticulos2: List<Articles>? = null |
41 | lateinit var viewAdapter2: RecyclerView.Adapter<*> | 41 | lateinit var viewAdapter2: RecyclerView.Adapter<*> |
42 | private lateinit var viewManager2: RecyclerView.LayoutManager | 42 | private lateinit var viewManager2: RecyclerView.LayoutManager |
43 | private lateinit var rcDescripcion: RecyclerView | 43 | private lateinit var rcDescripcion: RecyclerView |
44 | private var swipeBackground: ColorDrawable = ColorDrawable(Color.YELLOW) | 44 | private var swipeBackground: ColorDrawable = ColorDrawable(Color.YELLOW) |
45 | private var cantidad = 0F | 45 | private var cantidad = 0F |
46 | private var numeroInventario = 0 | 46 | private var numeroInventario = 0 |
47 | lateinit var navController: NavController | 47 | lateinit var navController: NavController |
48 | lateinit var sharedPreferences: SharedPreferences | 48 | lateinit var sharedPreferences: SharedPreferences |
49 | private var artCargadoEnBD: InvBody? = null | 49 | private var artCargadoEnBD: InvBody? = null |
50 | lateinit var mDialogViewM: View | 50 | lateinit var mDialogViewM: View |
51 | var resultadoTemp:Float=0F | ||
51 | 52 | ||
52 | override fun onCreate(savedInstanceState: Bundle?) { | 53 | override fun onCreate(savedInstanceState: Bundle?) { |
53 | super.onCreate(savedInstanceState) | 54 | super.onCreate(savedInstanceState) |
54 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 55 | sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
55 | arguments.apply { | 56 | arguments.apply { |
56 | artAcargar2 = requireArguments().getSerializable("ArrayDesc") as List<Articles> | 57 | artAcargar2 = requireArguments().getSerializable("ArrayDesc") as List<Articles> |
57 | numeroInventario = requireArguments().getInt("numeroInv") | 58 | numeroInventario = requireArguments().getInt("numeroInv") |
58 | } | 59 | } |
59 | 60 | ||
60 | } | 61 | } |
61 | 62 | ||
62 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 63 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
63 | super.onViewCreated(view, savedInstanceState) | 64 | super.onViewCreated(view, savedInstanceState) |
64 | navController = Navigation.findNavController(view) | 65 | navController = Navigation.findNavController(view) |
65 | showSoftKeyboard(view) | 66 | showSoftKeyboard(view) |
66 | } | 67 | } |
67 | 68 | ||
68 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 69 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
69 | val v = inflater.inflate(R.layout.fragment_descripcion, container, false) | 70 | val v = inflater.inflate(R.layout.fragment_descripcion, container, false) |
70 | rcDescripcion = v.findViewById(R.id.rcDescripcion) | 71 | rcDescripcion = v.findViewById(R.id.rcDescripcion) |
71 | IngresarRecicler(artAcargar2) | 72 | IngresarRecicler(artAcargar2) |
72 | showSoftKeyboard(v) | 73 | showSoftKeyboard(v) |
73 | 74 | ||
74 | return v | 75 | return v |
75 | } | 76 | } |
76 | 77 | ||
77 | private fun showSoftKeyboard(view: View) { | 78 | private fun showSoftKeyboard(view: View) { |
78 | if (view.requestFocus()) { | 79 | if (view.requestFocus()) { |
79 | val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager | 80 | val imm = (activity as MainActivity).getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager |
80 | imm.showSoftInput(view, InputMethodManager.HIDE_IMPLICIT_ONLY) | 81 | imm.showSoftInput(view, InputMethodManager.HIDE_IMPLICIT_ONLY) |
81 | } | 82 | } |
82 | } | 83 | } |
83 | 84 | ||
84 | fun IngresarRecicler(articulos: List<Articles>?) { | 85 | fun IngresarRecicler(articulos: List<Articles>?) { |
85 | 86 | ||
86 | viewAdapter2 = DescripcionListAdapter(articulos) | 87 | viewAdapter2 = DescripcionListAdapter(articulos) |
87 | viewManager2 = LinearLayoutManager(requireContext()) | 88 | viewManager2 = LinearLayoutManager(requireContext()) |
88 | 89 | ||
89 | rcDescripcion.apply { | 90 | rcDescripcion.apply { |
90 | adapter = viewAdapter2 | 91 | adapter = viewAdapter2 |
91 | layoutManager = viewManager2 | 92 | layoutManager = viewManager2 |
92 | } | 93 | } |
93 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) { | 94 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) { |
94 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { | 95 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { |
95 | return false | 96 | return false |
96 | } | 97 | } |
97 | 98 | ||
98 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, position: Int) { | 99 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, position: Int) { |
99 | 100 | ||
100 | GlobalScope.launch(Dispatchers.Main) { | 101 | GlobalScope.launch(Dispatchers.Main) { |
101 | //TODO BUSCO EN BASE DE DATOS | 102 | //TODO BUSCO EN BASE DE DATOS |
102 | artCargadoEnBD = buscarCodigoDeboEnBD( | 103 | artCargadoEnBD = buscarCodigoDeboEnBD( |
103 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)?.sector.toString(), | 104 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)?.sector.toString(), |
104 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)?.codigo.toString(), numeroInventario.toString() | 105 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)?.codigo.toString(), numeroInventario.toString() |
105 | ) | 106 | ) |
106 | if (artCargadoEnBD == null) { | 107 | if (artCargadoEnBD == null) { |
107 | val mDialogView = LayoutInflater.from(context).inflate(R.layout.ingresar_cantidad, null) | 108 | val mDialogView = LayoutInflater.from(context).inflate(R.layout.ingresar_cantidad, null) |
108 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(false) | 109 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(false) |
109 | //TODO: DEPENDIENDO DEL TIPO DE ARTICULO PERMITER INGRESAR DECIMALES O NO | 110 | //TODO: DEPENDIENDO DEL TIPO DE ARTICULO PERMITER INGRESAR DECIMALES O NO |
110 | if ((viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza == 1 || (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza == 3 || (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza == 7) | 111 | if ((viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza == 1 || (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza == 3 || (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza == 7) |
111 | mDialogView.etCantidad.inputType = InputType.TYPE_CLASS_NUMBER | 112 | mDialogView.etCantidad.inputType = InputType.TYPE_CLASS_NUMBER |
112 | 113 | ||
113 | mDialogView.tvTitulo.text = "${(viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion}" | 114 | mDialogView.tvTitulo.text = "${(viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion}" |
114 | val mAlertDialog = mBuilder.show() | 115 | val mAlertDialog = mBuilder.show() |
115 | 116 | ||
116 | mDialogView.etCantidad.requestFocus() | 117 | mDialogView.etCantidad.requestFocus() |
117 | mAlertDialog.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 118 | mAlertDialog.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
118 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 119 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
119 | 120 | ||
120 | mDialogView.btnAceptar.setOnClickListener { | 121 | mDialogView.btnAceptar.setOnClickListener { |
121 | if (mDialogView.etCantidad.text.isNullOrEmpty()) { | 122 | if (mDialogView.etCantidad.text.isNullOrEmpty()) { |
122 | mDialogView.etCantidad.error = "No vacio" | 123 | mDialogView.etCantidad.error = "No vacio" |
123 | mDialogView.etCantidad.requestFocus() | 124 | mDialogView.etCantidad.requestFocus() |
124 | mDialogView.etCantidad.hint = "Ingrese un valor" | 125 | mDialogView.etCantidad.hint = "Ingrese un valor" |
125 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { | 126 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { |
127 | val tr: Double = Math.round(mDialogView.etCantidad.text.toString().toFloat() * 100.0) / 100.0 | ||
128 | cantidad = tr.toFloat() | ||
126 | 129 | ||
127 | cantidad = String.format("%.2f",mDialogView.etCantidad.text.toString().toFloat()).toFloat() | ||
128 | val body = InvBody( | 130 | val body = InvBody( |
129 | numeroInventario, | 131 | numeroInventario, |
130 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.sector, | 132 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.sector, |
131 | // TODO: PREPARO PARA MANDAR A CARGAR EN LA BD | 133 | // TODO: PREPARO PARA MANDAR A CARGAR EN LA BD |
132 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo, | 134 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo, |
133 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion, | 135 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.descripcion, |
134 | cantidad.toString(), | 136 | cantidad.toString(), |
135 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codBar, | 137 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codBar, |
136 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codOrigen, | 138 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codOrigen, |
137 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, | 139 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, |
138 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, | 140 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.precio, |
139 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza, | 141 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.balanza, |
140 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.depSn, | 142 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.depSn, |
141 | obtenerFechaActual(), | 143 | obtenerFechaActual(), |
142 | obtenerFechaActual() | 144 | obtenerFechaActual() |
143 | ) | 145 | ) |
144 | InsertarArtEnDB(body)// TODO: MANDO A CARGAR A LA BASE DE DATOS | 146 | insertarArtEnDB(body)// TODO: MANDO A CARGAR A LA BASE DE DATOS |
145 | modificarCantidadEnCabecera(numeroInventario, true, requireActivity()) | 147 | modificarCantidadEnCabecera(numeroInventario, true, (activity as MainActivity)) |
146 | // VolverAinventario() | 148 | // VolverAinventario() |
147 | activity?.onBackPressed() | 149 | activity?.onBackPressed() |
148 | mAlertDialog.dismiss() | 150 | mAlertDialog.dismiss() |
149 | } | 151 | } |
150 | } | 152 | } |
151 | } else if (artCargadoEnBD != null) { | 153 | } else if (artCargadoEnBD != null) { |
152 | 154 | ||
153 | mDialogViewM = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | 155 | mDialogViewM = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) |
154 | val mBuilder = AlertDialog.Builder(context).setView(mDialogViewM).setCancelable(false) | 156 | val mBuilder = AlertDialog.Builder(context).setView(mDialogViewM).setCancelable(false) |
155 | if (artCargadoEnBD!!.balanza.toString().contains("1") || artCargadoEnBD!!.balanza.toString().contains("3") || artCargadoEnBD!!.balanza.toString().contains("7") | 157 | if (artCargadoEnBD!!.balanza.toString().contains("1") || artCargadoEnBD!!.balanza.toString().contains("3") || artCargadoEnBD!!.balanza.toString().contains("7") |
156 | ) mDialogViewM.tvNuevaCantidad.inputType = InputType.TYPE_CLASS_NUMBER | 158 | ) mDialogViewM.tvNuevaCantidad.inputType = InputType.TYPE_CLASS_NUMBER |
157 | mDialogViewM.tvTitulo2.text="${artCargadoEnBD!!.descripcion}" | 159 | mDialogViewM.tvTitulo2.text="${artCargadoEnBD!!.descripcion}" |
158 | mDialogViewM.tvCantInicial.text = String.format("%.2f", artCargadoEnBD!!.cantTomada.toString().toFloat()) | 160 | val tr: Double = Math.round(artCargadoEnBD!!.cantTomada.toString().toFloat() * 100.0) / 100.0 |
161 | mDialogViewM.tvCantInicial.text = tr.toString() | ||
159 | 162 | ||
160 | val mAlertDialog = mBuilder.show() | 163 | val mAlertDialog = mBuilder.show() |
161 | mDialogViewM.tvNuevaCantidad.requestFocus() | 164 | mDialogViewM.tvNuevaCantidad.requestFocus() |
162 | 165 | ||
163 | 166 | ||
164 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 167 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
165 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 168 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
166 | 169 | ||
167 | mDialogViewM.tvNuevaCantidad.addTextChangedListener(textWatcher) | 170 | mDialogViewM.tvNuevaCantidad.addTextChangedListener(textWatcher) |
168 | 171 | ||
169 | mDialogViewM.rbSumar.setOnClickListener { | 172 | mDialogViewM.rbSumar.setOnClickListener { |
170 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 173 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
171 | mDialogViewM.tvResultado.text = String.format("%.2f", (mDialogViewM.tvCantInicial.text.toString().toFloat() + mDialogViewM.tvNuevaCantidad.text.toString().toFloat())) | 174 | resultadoTemp=mDialogViewM.tvCantInicial.text.toString().toFloat() + mDialogViewM.tvNuevaCantidad.text.toString().toFloat() |
172 | // mDialogViewM.tvNuevaCantidad.isEnabled = false | 175 | mDialogViewM.tvResultado.text = (Math.round(resultadoTemp * 100.0) / 100.0).toString() |
176 | |||
173 | } | 177 | } |
174 | } | 178 | } |
175 | mDialogViewM.rbRestar.setOnClickListener { | 179 | mDialogViewM.rbRestar.setOnClickListener { |
176 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 180 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
177 | if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) { | 181 | if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) { |
178 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) | 182 | resultadoTemp=mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat() |
179 | // mDialogViewM.tvNuevaCantidad.isEnabled = false | 183 | mDialogViewM.tvResultado.text = (Math.round(resultadoTemp* 100.0) / 100.0).toString() |
184 | |||
185 | |||
180 | } else { | 186 | } else { |
181 | mDialogViewM.tvResultado.text = "" | 187 | mDialogViewM.tvResultado.text = "" |
182 | mDialogViewM.tvResultado.error = "Operación No Valida" | 188 | mDialogViewM.tvResultado.error = "Operación No Valida" |
183 | mDialogViewM.tvResultado.requestFocus() | 189 | mDialogViewM.tvResultado.requestFocus() |
184 | mDialogViewM.tvResultado.hint = "Error" | 190 | mDialogViewM.tvResultado.hint = "Error" |
185 | } | 191 | } |
186 | } | 192 | } |
187 | } | 193 | } |
188 | mDialogViewM.rbMdodificar.setOnClickListener { | 194 | mDialogViewM.rbMdodificar.setOnClickListener { |
189 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 195 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
190 | mDialogViewM.tvResultado.text = String.format("%.2f", (mDialogViewM.tvNuevaCantidad.text.toString().toFloat())) | 196 | mDialogViewM.tvResultado.text = (Math.round(mDialogViewM.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString() |
191 | // mDialogViewM.tvNuevaCantidad.isEnabled = false | 197 | |
192 | } | 198 | } |
193 | } | 199 | } |
194 | mDialogViewM.btnAceptar.setOnClickListener { | 200 | mDialogViewM.btnAceptar.setOnClickListener { |
195 | if (mDialogViewM.tvNuevaCantidad.text.isNotEmpty() || !mDialogViewM.tvNuevaCantidad.text.isBlank()) { | 201 | if (mDialogViewM.tvNuevaCantidad.text.isNotEmpty() || !mDialogViewM.tvNuevaCantidad.text.isBlank()) { |
196 | if (mDialogViewM.tvResultado.text.isNotEmpty() || !mDialogViewM.tvResultado.text.isBlank()) { | 202 | if (mDialogViewM.tvResultado.text.isNotEmpty() || !mDialogViewM.tvResultado.text.isBlank()) { |
197 | 203 | ||
198 | updateCantidad( | 204 | updateCantidad( |
199 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.sector.toString(), | 205 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.sector.toString(), |
200 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo.toString(), | 206 | (viewAdapter2 as DescripcionListAdapter).items2?.get(viewHolder.layoutPosition)!!.codigo.toString(), |
201 | mDialogViewM.tvResultado.text.toString().toFloat() | 207 | mDialogViewM.tvResultado.text.toString().toFloat() |
202 | ) | 208 | ) |
203 | activity?.onBackPressed() | 209 | activity?.onBackPressed() |
204 | mAlertDialog.dismiss() | 210 | mAlertDialog.dismiss() |
205 | } else if (mDialogViewM.tvNuevaCantidad.text.isNotEmpty() || mDialogViewM.tvNuevaCantidad.text.isBlank()) { | 211 | } else if (mDialogViewM.tvNuevaCantidad.text.isNotEmpty() || mDialogViewM.tvNuevaCantidad.text.isBlank()) { |
206 | mDialogViewM.tvResultado.error = "Operación Requerida" | 212 | mDialogViewM.tvResultado.error = "Operación Requerida" |
207 | mDialogViewM.tvResultado.requestFocus() | 213 | mDialogViewM.tvResultado.requestFocus() |
208 | mDialogViewM.tvResultado.hint = "Seleccione Operación" | 214 | mDialogViewM.tvResultado.hint = "Seleccione Operación" |
209 | } | 215 | } |
210 | } else if (mDialogViewM.tvNuevaCantidad.text.isEmpty() || mDialogViewM.tvNuevaCantidad.text.isBlank()) { | 216 | } else if (mDialogViewM.tvNuevaCantidad.text.isEmpty() || mDialogViewM.tvNuevaCantidad.text.isBlank()) { |
211 | mDialogViewM.tvNuevaCantidad.error = "Completar" | 217 | mDialogViewM.tvNuevaCantidad.error = "Completar" |
212 | mDialogViewM.tvNuevaCantidad.requestFocus() | 218 | mDialogViewM.tvNuevaCantidad.requestFocus() |
213 | mDialogViewM.tvNuevaCantidad.hint = "Ingrese un valor" | 219 | mDialogViewM.tvNuevaCantidad.hint = "Ingrese un valor" |
214 | } | 220 | } |
215 | } | 221 | } |
216 | mDialogViewM.dialogCancelBtn.setOnClickListener { | 222 | mDialogViewM.dialogCancelBtn.setOnClickListener { |
217 | activity?.onBackPressed() | 223 | activity?.onBackPressed() |
218 | mAlertDialog.dismiss() | 224 | mAlertDialog.dismiss() |
219 | } | 225 | } |
220 | } | 226 | } |
221 | } | 227 | } |
222 | } | 228 | } |
223 | 229 | ||
224 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { | 230 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { |
225 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | 231 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) |
226 | val itemView = viewHolder.itemView | 232 | val itemView = viewHolder.itemView |
227 | 233 | ||
228 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) | 234 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) |
229 | 235 | ||
230 | if (dX > 0) { | 236 | if (dX > 0) { |
231 | 237 | ||
232 | c.drawColor(Color.RED) | 238 | c.drawColor(Color.RED) |
233 | } else if (dX < 0) { | 239 | } else if (dX < 0) { |
234 | // swipeBackground.setBounds(itemView.right+dX.toInt(),itemView.top,itemView.right,itemView.bottom) | 240 | // swipeBackground.setBounds(itemView.right+dX.toInt(),itemView.top,itemView.right,itemView.bottom) |
235 | c.drawColor(Color.YELLOW) | 241 | c.drawColor(Color.YELLOW) |
236 | } | 242 | } |
237 | swipeBackground.draw(c) | 243 | swipeBackground.draw(c) |
238 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | 244 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) |
239 | } | 245 | } |
240 | } | 246 | } |
241 | val itemTouchHelper2 = ItemTouchHelper(itemTouchHelperCallback) | 247 | val itemTouchHelper2 = ItemTouchHelper(itemTouchHelperCallback) |
242 | itemTouchHelper2.attachToRecyclerView(rcDescripcion) | 248 | itemTouchHelper2.attachToRecyclerView(rcDescripcion) |
243 | } | 249 | } |
244 | 250 | ||
245 | fun InsertarArtEnDB(cuarpoInventario: InvBody) { | 251 | fun insertarArtEnDB(cuarpoInventario: InvBody) { |
246 | lifecycleScope.launch { | 252 | lifecycleScope.launch { |
247 | withContext(Dispatchers.IO) { | 253 | withContext(Dispatchers.IO) { |
248 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) | 254 | AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) |
249 | } | 255 | } |
250 | } | 256 | } |
251 | } | 257 | } |
252 | 258 | ||
253 | suspend fun buscarCodigoDeboEnBD(sector: String, codigo: String, numInventario: String): InvBody? { | 259 | suspend fun buscarCodigoDeboEnBD(sector: String, codigo: String, numInventario: String): InvBody? { |
254 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 260 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
255 | var busqueda: InvBody? = null | 261 | var busqueda: InvBody? = null |
256 | return GlobalScope.async(Dispatchers.IO) { | 262 | return GlobalScope.async(Dispatchers.IO) { |
257 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.fetchArtInInvBody(sector.toLong(), codigo.toLong(), numInventario.toInt()) | 263 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.fetchArtInInvBody(sector.toLong(), codigo.toLong(), numInventario.toInt()) |
258 | return@async busqueda | 264 | return@async busqueda |
259 | }.await() | 265 | }.await() |
260 | } | 266 | } |
261 | 267 | ||
262 | fun updateCantidad(sector: String, codigo: String, cantidad: Float) { | 268 | fun updateCantidad(sector: String, codigo: String, cantidad: Float) { |
263 | lifecycleScope.launch { | 269 | lifecycleScope.launch { |
264 | withContext(Dispatchers.IO) { | 270 | withContext(Dispatchers.IO) { |
265 | val activity: FragmentActivity? = activity | 271 | val activity: FragmentActivity? = activity |
266 | if (activity != null && isAdded) { | 272 | if (activity != null && isAdded) { |
267 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.updateInvBody(cantidad, sector.toLong(), codigo.toLong(),obtenerFechaActual()) | 273 | AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.updateInvBody(cantidad, sector.toLong(), codigo.toLong(),obtenerFechaActual()) |
268 | } | 274 | } |
269 | } | 275 | } |
270 | } | 276 | } |
271 | } | 277 | } |
272 | 278 | ||
273 | private val textWatcher = object : TextWatcher { | 279 | private val textWatcher = object : TextWatcher { |
274 | override fun afterTextChanged(s: Editable?) { | 280 | override fun afterTextChanged(s: Editable?) { |
281 | if (mDialogViewM.tvNuevaCantidad.text.toString() == "") { mDialogViewM.tvResultado.text = ""} | ||
275 | } | 282 | } |
276 | 283 | ||
277 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { | 284 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { |
278 | } | 285 | } |
279 | 286 | ||
280 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { | 287 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { |
288 | |||
289 | if (mDialogViewM.tvNuevaCantidad.text.toString() != "") { | ||
281 | if (mDialogViewM.rbSumar.isChecked) { | 290 | if (mDialogViewM.rbSumar.isChecked) { |
282 | // mDialogView.tvNuevaCantidad.isEnabled=false | 291 | resultadoTemp=mDialogViewM.tvNuevaCantidad.text.toString().toFloat() + mDialogViewM.tvCantInicial.text.toString().toFloat() |
283 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvNuevaCantidad.text.toString().toFloat() + mDialogViewM.tvCantInicial.text.toString().toFloat()) | 292 | mDialogViewM.tvResultado.text = (Math.round(resultadoTemp * 100.0) / 100.0).toString() |
284 | } | 293 | } |
285 | if (mDialogViewM.rbRestar.isChecked) { | 294 | if (mDialogViewM.rbRestar.isChecked) { |
286 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 295 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
287 | if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) { | 296 | if (mDialogViewM.tvCantInicial.text.toString().toFloat() >= mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) { |
288 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) | 297 | resultadoTemp=mDialogViewM.tvCantInicial.text.toString().toFloat() - mDialogViewM.tvNuevaCantidad.text.toString().toFloat() |
289 | // mDialogView.tvNuevaCantidad.isEnabled = false | 298 | mDialogViewM.tvResultado.text = (Math.round( resultadoTemp * 100.0) / 100.0).toString() |
290 | } else { | 299 | } else { |
291 | mDialogViewM.tvResultado.text = "" | 300 | mDialogViewM.tvResultado.text = "" |
292 | mDialogViewM.tvResultado.error = "Operación No Valida" | 301 | mDialogViewM.tvResultado.error = "Operación No Valida" |
293 | mDialogViewM.tvResultado.requestFocus() | 302 | mDialogViewM.tvResultado.requestFocus() |
294 | mDialogViewM.tvResultado.hint = "Error" | 303 | mDialogViewM.tvResultado.hint = "Error" |
295 | } | 304 | } |
296 | } | 305 | } |
297 | } | 306 | } |
298 | if (mDialogViewM.rbMdodificar.isChecked) { | 307 | if (mDialogViewM.rbMdodificar.isChecked) { |
299 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { | 308 | if (!mDialogViewM.tvNuevaCantidad.text.isNullOrEmpty()) { |
300 | mDialogViewM.tvResultado.text = String.format("%.2f", mDialogViewM.tvNuevaCantidad.text.toString().toFloat()) | 309 | mDialogViewM.tvResultado.text = (Math.round(mDialogViewM.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString() |
301 | // mDialogView.tvNuevaCantidad.isEnabled = false | 310 | } |
302 | } | 311 | } |
303 | } | 312 | } |
304 | } | 313 | } |
305 | } | 314 | } |
306 | } | 315 | } |
307 | 316 |
app/src/main/java/com/focasoftware/deboinventariov20/UI/detalleProducto/DetalleArtFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.detalleProducto | 1 | package com.focasoftware.deboinventariov20.UI.detalleProducto |
2 | 2 | ||
3 | import android.content.Context | 3 | import android.content.Context |
4 | import android.content.SharedPreferences | 4 | import android.content.SharedPreferences |
5 | import android.os.Bundle | 5 | import android.os.Bundle |
6 | import android.view.LayoutInflater | 6 | import android.view.LayoutInflater |
7 | import android.view.View | 7 | import android.view.View |
8 | import android.view.ViewGroup | 8 | import android.view.ViewGroup |
9 | import android.view.inputmethod.InputMethodManager | 9 | import android.view.inputmethod.InputMethodManager |
10 | import androidx.fragment.app.Fragment | 10 | import androidx.fragment.app.Fragment |
11 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 11 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
12 | import com.focasoftware.deboinventariov20.Model.Articles | 12 | import com.focasoftware.deboinventariov20.Model.Articles |
13 | import com.focasoftware.deboinventariov20.R | 13 | import com.focasoftware.deboinventariov20.R |
14 | import kotlinx.android.synthetic.main.fragment_detalle_art.* | 14 | import kotlinx.android.synthetic.main.fragment_detalle_art.* |
15 | import kotlinx.coroutines.Dispatchers | 15 | import kotlinx.coroutines.Dispatchers |
16 | import kotlinx.coroutines.Dispatchers.Main | ||
16 | import kotlinx.coroutines.GlobalScope | 17 | import kotlinx.coroutines.GlobalScope |
17 | import kotlinx.coroutines.async | 18 | import kotlinx.coroutines.async |
18 | import kotlinx.coroutines.launch | 19 | import kotlinx.coroutines.launch |
19 | 20 | ||
20 | class DetalleArtFragment : Fragment() { | 21 | class DetalleArtFragment : Fragment() { |
21 | 22 | ||
22 | private var Inventario: Int = 0 | 23 | private var Inventario: Int = 0 |
23 | private var sector: String? = null | 24 | private var sector: String? = null |
24 | private var codigo: String? = null | 25 | private var codigo: String? = null |
25 | private var artSerch: Articles? = null | 26 | private var artSerch: Articles? = null |
26 | lateinit var sharedPreferences: SharedPreferences | 27 | lateinit var sharedPreferences: SharedPreferences |
27 | 28 | ||
28 | override fun onCreate(savedInstanceState: Bundle?) { | 29 | override fun onCreate(savedInstanceState: Bundle?) { |
29 | super.onCreate(savedInstanceState) | 30 | super.onCreate(savedInstanceState) |
30 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 31 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
31 | arguments?.let { | 32 | arguments?.let { |
32 | sector = it.getString("sector") | 33 | sector = it.getString("sector") |
33 | codigo = it.getString("codigo") | 34 | codigo = it.getString("codigo") |
34 | Inventario= it.getInt("numeroInv") | 35 | Inventario= it.getInt("numeroInv") |
35 | } | 36 | } |
36 | val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager? | 37 | val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager? |
37 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 38 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
38 | 39 | ||
39 | marcarInventario() | 40 | marcarInventario() |
40 | GlobalScope.launch(Dispatchers.Main) { | 41 | GlobalScope.launch(Main) { |
41 | artSerch = buscarCodigoDeboEnBD(sector, codigo) | 42 | artSerch = buscarCodigoDeboEnBD(sector, codigo) |
42 | if (artSerch == null) { | 43 | if (artSerch == null) { |
43 | 44 | ||
44 | // val type = InputType.TYPE_CLASS_NUMBER | 45 | // val type = InputType.TYPE_CLASS_NUMBER |
45 | // MaterialDialog(requireContext()).show { | 46 | // MaterialDialog(requireContext()).show { |
46 | // | 47 | // |
47 | // title(text = "Producto '$sChangeUpper', se encuentra cargado.") | 48 | // title(text = "Producto '$sChangeUpper', se encuentra cargado.") |
48 | // message(R.string.sCantidadNueva) | 49 | // message(R.string.sCantidadNueva) |
49 | // input(waitForPositiveButton = false, hint = "99.99", inputType = type) { materialDialog, charSequence -> | 50 | // input(waitForPositiveButton = false, hint = "99.99", inputType = type) { materialDialog, charSequence -> |
50 | // fCant = 0F | 51 | // fCant = 0F |
51 | // fCant = charSequence.toString().toFloat() | 52 | // fCant = charSequence.toString().toFloat() |
52 | // } | 53 | // } |
53 | // positiveButton(R.string.btnOk) { | 54 | // positiveButton(R.string.btnOk) { |
54 | // //TODO ACTUALIZO CANTIADAD EN BD | 55 | // //TODO ACTUALIZO CANTIADAD EN BD |
55 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 56 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
56 | // //TODO ACTUALIZO CANTIDAD EN RV | 57 | // //TODO ACTUALIZO CANTIDAD EN RV |
57 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 58 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
58 | // viewAdapter.notifyDataSetChanged() | 59 | // viewAdapter.notifyDataSetChanged() |
59 | // dismiss() | 60 | // dismiss() |
60 | // } | 61 | // } |
61 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 62 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
62 | } else if (artSerch != null) { | 63 | } else if (artSerch != null) { |
63 | tvSector.text=sector | 64 | tvSector.text=sector |
64 | tvCodigo.text=codigo | 65 | tvCodigo.text=codigo |
65 | tvDeposito.text=if(!artSerch!!.depSn!!)"No" else "Si" | 66 | tvDeposito.text=if(!artSerch!!.depSn!!)"No" else "Si" |
66 | tvDescripcion.text=artSerch!!.descripcion.toString() | 67 | tvDescripcion.text=artSerch!!.descripcion.toString() |
67 | tvCodigoBarras.text=if (artSerch!!.codBar.toString()=="null")"" else artSerch!!.codBar.toString() | 68 | tvCodigoBarras.text=if (artSerch!!.codBar.toString()=="null")"" else artSerch!!.codBar.toString() |
68 | tvCodigoOrigen.text=if (artSerch!!.codOrigen.toString()=="null")"" else artSerch!!.codOrigen.toString() | 69 | tvCodigoOrigen.text=if (artSerch!!.codOrigen.toString()=="null")"" else artSerch!!.codOrigen.toString() |
69 | tvExiVenta.text=artSerch!!.exiVenta.toString() | 70 | tvExiVenta.text=artSerch!!.exiVenta.toString() |
70 | tvExiDeposito.text=artSerch!!.exiDeposito.toString() | 71 | tvExiDeposito.text=artSerch!!.exiDeposito.toString() |
71 | 72 | ||
72 | when ( artSerch!!.balanza.toString().toInt()) { | 73 | when ( artSerch!!.balanza.toString().toInt()) { |
73 | 1 ->tvBal.text="Unidades" | 74 | 1 ->tvBal.text="Unidades" |
74 | 2 ->tvBal.text="Litros" | 75 | 2 ->tvBal.text="Litros" |
75 | 3 ->tvBal.text="Cajas" | 76 | 3 ->tvBal.text="Cajas" |
76 | 4 ->tvBal.text="M3" | 77 | 4 ->tvBal.text="M3" |
77 | 5 ->tvBal.text="Metros" | 78 | 5 ->tvBal.text="Metros" |
78 | 6 ->tvBal.text="Fracción" | 79 | 6 ->tvBal.text="Fracción" |
79 | 7 ->tvBal.text="Bultos" | 80 | 7 ->tvBal.text="Bultos" |
80 | 8 ->tvBal.text="Gramos" | 81 | 8 ->tvBal.text="Gramos" |
81 | 9 ->tvBal.text="Cent. cúbicos" | 82 | 9 ->tvBal.text="Cent. cúbicos" |
82 | 10 ->tvBal.text="Kgs" | 83 | 10 ->tvBal.text="Kgs" |
83 | else -> { tvBal.text="Otros" | 84 | else -> { tvBal.text="Otros" |
84 | } | 85 | } |
85 | } | 86 | } |
86 | tvCosto.text=String.format("%.2f", artSerch!!.costo.toString().toFloat()) | 87 | if(!artSerch!!.costo.toString().isNullOrEmpty()){} |
87 | tvPrecio.text=String.format("%.2f", artSerch!!.precio.toString().toFloat()) | 88 | tvCosto.text= |
89 | (Math.round(artSerch!!.costo.toString().toFloat() * 100.0) / 100.0).toString() | ||
90 | tvPrecio.text= (Math.round( artSerch!!.precio.toString().toFloat() * 100.0) / 100.0).toString() | ||
88 | } | 91 | } |
89 | } | 92 | } |
90 | } | 93 | } |
91 | 94 | ||
92 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 95 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
93 | 96 | ||
94 | return inflater.inflate(R.layout.fragment_detalle_art, container, false) | 97 | return inflater.inflate(R.layout.fragment_detalle_art, container, false) |
95 | } | 98 | } |
96 | 99 | ||
97 | suspend fun buscarCodigoDeboEnBD(sector: String?, codigo: String?): Articles? { | 100 | suspend fun buscarCodigoDeboEnBD(sector: String?, codigo: String?): Articles? { |
98 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 101 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
99 | var busqueda: Articles? | 102 | var busqueda: Articles? |
100 | return GlobalScope.async(Dispatchers.IO) { | 103 | return GlobalScope.async(Dispatchers.IO) { |
101 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.fetchArticuloByCodSec(sector, codigo) | 104 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.fetchArticuloByCodSec(sector, codigo) |
102 | return@async busqueda | 105 | return@async busqueda |
103 | }.await() | 106 | }.await() |
104 | } | 107 | } |
105 | fun marcarInventario() { | 108 | fun marcarInventario() { |
106 | 109 | ||
107 | val editor = sharedPreferences.edit() | 110 | val editor = sharedPreferences.edit() |
108 | editor?.putString("Inventario", Inventario.toString()) | 111 | editor?.putString("Inventario", Inventario.toString()) |
109 | editor?.apply() | 112 | editor?.apply() |
110 | editor.commit() | 113 | editor.commit() |
111 | // navController.navigate(R.id.action_descripcionFragment_to_inventarioFragment) | 114 | // navController.navigate(R.id.action_descripcionFragment_to_inventarioFragment) |
112 | } | 115 | } |
113 | } | 116 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/detalleProducto/DetalleArtSecFragment.kt
File was created | 1 | package com.focasoftware.deboinventariov20.UI.detalleProducto | |
2 | |||
3 | import android.content.Context | ||
4 | import android.content.SharedPreferences | ||
5 | import android.os.Bundle | ||
6 | import androidx.fragment.app.Fragment | ||
7 | import android.view.LayoutInflater | ||
8 | import android.view.View | ||
9 | import android.view.ViewGroup | ||
10 | import android.view.inputmethod.InputMethodManager | ||
11 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | ||
12 | import com.focasoftware.deboinventariov20.Model.Articles | ||
13 | import com.focasoftware.deboinventariov20.Model.InvBodySec | ||
14 | import com.focasoftware.deboinventariov20.R | ||
15 | import kotlinx.android.synthetic.main.fragment_detalle_art.* | ||
16 | import kotlinx.android.synthetic.main.fragment_inv_sec.* | ||
17 | import kotlinx.coroutines.Dispatchers | ||
18 | import kotlinx.coroutines.GlobalScope | ||
19 | import kotlinx.coroutines.async | ||
20 | import kotlinx.coroutines.launch | ||
21 | |||
22 | private lateinit var sharedPreferences: SharedPreferences | ||
23 | private var Inventario: String? = null | ||
24 | private var sector: String? = null | ||
25 | private var codigo: String? = null | ||
26 | private var busqueda: String? = null | ||
27 | private var artSerch: InvBodySec? = null | ||
28 | |||
29 | class DetalleArtSecFragment : Fragment() { | ||
30 | |||
31 | override fun onCreate(savedInstanceState: Bundle?) { | ||
32 | super.onCreate(savedInstanceState) | ||
33 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | ||
34 | |||
35 | arguments?.let { | ||
36 | sector = it.getString("sector") | ||
37 | codigo = it.getString("codigo") | ||
38 | busqueda= it.getString("Busqueda") | ||
39 | Inventario= it.getString("numeroInv").toString() | ||
40 | } | ||
41 | val imm = requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager? | ||
42 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | ||
43 | |||
44 | GlobalScope.launch(Dispatchers.Main) { | ||
45 | artSerch = Inventario?.let { buscarCodigoDeboEnBD(it,sector, codigo) } | ||
46 | if (artSerch != null) { | ||
47 | tvSector.text=sector | ||
48 | tvCodigo.text=codigo | ||
49 | tvDeposito.text=if(!artSerch!!.depSn!!)"No" else "Si" | ||
50 | tvDescripcion.text=artSerch!!.descripcion.toString() | ||
51 | tvCodigoBarras.text=if (artSerch!!.CODBAR.toString()=="null")"" else artSerch!!.CODBAR.toString() | ||
52 | // tvCodigoOrigen.text=if (artSerch!!.codOrigen.toString()=="null")"" else artSerch!!.codOrigen.toString() | ||
53 | tvExiVenta.text=artSerch!!.EXIVTA.toString() | ||
54 | tvExiDeposito.text=artSerch!!.EXIDEP.toString() | ||
55 | |||
56 | when ( artSerch!!.uniVenta.toString().toInt()) { | ||
57 | 1 ->tvBal.text="Unidades" | ||
58 | 2 ->tvBal.text="Litros" | ||
59 | 3 ->tvBal.text="Cajas" | ||
60 | 4 ->tvBal.text="M3" | ||
61 | 5 ->tvBal.text="Metros" | ||
62 | 6 ->tvBal.text="Fracción" | ||
63 | 7 ->tvBal.text="Bultos" | ||
64 | 8 ->tvBal.text="Gramos" | ||
65 | 9 ->tvBal.text="Cent. cúbicos" | ||
66 | 10 ->tvBal.text="Kgs" | ||
67 | else -> { tvBal.text="Otros" | ||
68 | } | ||
69 | } | ||
70 | tvCosto.text= (Math.round(artSerch!!.costo.toString().toFloat() * 100.0) / 100.0).toString() | ||
71 | tvPrecio.text=(Math.round(artSerch!!.precio.toString().toFloat() * 100.0) / 100.0).toString() | ||
72 | } | ||
73 | } | ||
74 | val editor = sharedPreferences.edit() | ||
75 | editor?.putString("BusquedaVuelta", busqueda) | ||
76 | editor?.apply() | ||
77 | editor.commit() | ||
78 | } | ||
79 | suspend fun buscarCodigoDeboEnBD(inventario: String, sector: String?, codigo: String?): InvBodySec? { | ||
80 | //TODO BUSQUEDA POR CODIGO DE BARRAS | ||
81 | var busqueda: InvBodySec? | ||
82 | return GlobalScope.async(Dispatchers.IO) { | ||
83 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.fetchArticuloByCodSec(inventario,sector!!, codigo!!) | ||
84 | return@async busqueda | ||
85 | }.await() | ||
86 | } | ||
87 | override fun onCreateView( | ||
88 | inflater: LayoutInflater, container: ViewGroup?, | ||
89 | savedInstanceState: Bundle? | ||
90 | ): View? {return inflater.inflate(R.layout.fragment_detalle_art_sec, container, false) } | ||
91 | |||
92 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/inventario/InvSecFragment.kt
File was created | 1 | package com.focasoftware.deboinventariov20.UI.inventario | |
2 | |||
3 | import android.app.AlertDialog | ||
4 | import android.content.Context | ||
5 | import android.content.DialogInterface | ||
6 | import android.content.SharedPreferences | ||
7 | import android.os.Bundle | ||
8 | import android.text.Editable | ||
9 | import android.text.InputType | ||
10 | import android.text.TextWatcher | ||
11 | import android.view.* | ||
12 | import android.widget.EditText | ||
13 | import android.widget.TextView | ||
14 | import android.widget.Toast | ||
15 | import androidx.fragment.app.Fragment | ||
16 | import androidx.navigation.NavController | ||
17 | import androidx.navigation.Navigation | ||
18 | import androidx.recyclerview.widget.LinearLayoutManager | ||
19 | import androidx.recyclerview.widget.RecyclerView | ||
20 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | ||
21 | import com.focasoftware.deboinventariov20.Model.* | ||
22 | import com.focasoftware.deboinventariov20.R | ||
23 | import com.focasoftware.deboinventariov20.UI.MainActivity | ||
24 | import com.focasoftware.deboinventariov20.UI.Utils.* | ||
25 | import kotlinx.android.synthetic.main.fragment_inv_sec.* | ||
26 | import kotlinx.android.synthetic.main.login_dialog.view.* | ||
27 | import kotlinx.coroutines.* | ||
28 | import kotlinx.coroutines.Dispatchers.IO | ||
29 | import kotlinx.coroutines.Dispatchers.Main | ||
30 | import retrofit2.Call | ||
31 | import retrofit2.Callback | ||
32 | import retrofit2.Response | ||
33 | import java.util.* | ||
34 | import kotlin.collections.ArrayList | ||
35 | |||
36 | private var listArtSec = ArrayList<ItemsSecRecycler>() | ||
37 | private lateinit var viewAdapter: RecyclerView.Adapter<*> | ||
38 | private lateinit var viewManager: RecyclerView.LayoutManager | ||
39 | lateinit var mDialogView: View | ||
40 | private lateinit var invSecActual: String | ||
41 | private lateinit var navController: NavController | ||
42 | private var serverBajada: ServeInv? = null | ||
43 | private var filtrado = false | ||
44 | private var countryFilterList = ArrayList<ItemsSecRecycler>() | ||
45 | |||
46 | |||
47 | class InvSecFragment : Fragment(), ProdSecListAdapter.OnImageDotsClickListener { | ||
48 | private lateinit var rcInventariosSec: RecyclerView | ||
49 | private lateinit var sharedPreferences: SharedPreferences | ||
50 | private val job: Job = Job() | ||
51 | private val fragmentScope = CoroutineScope(IO + job) | ||
52 | |||
53 | |||
54 | override fun onCreate(savedInstanceState: Bundle?) { | ||
55 | super.onCreate(savedInstanceState) | ||
56 | sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | ||
57 | if (sharedPreferences.contains("InventarioSec")) if (sharedPreferences.getString("InventarioSec", "").toString() != "-1") { | ||
58 | } | ||
59 | } | ||
60 | |||
61 | override fun onCreateView( | ||
62 | inflater: LayoutInflater, container: ViewGroup?, | ||
63 | savedInstanceState: Bundle? | ||
64 | ): View? { | ||
65 | |||
66 | val v = inflater.inflate(R.layout.fragment_inv_sec, container, false) | ||
67 | val tvTituloSec = v.findViewById<TextView>(R.id.tvTitulo) | ||
68 | val etDescripcion = v.findViewById<EditText>(R.id.etDescripcion) | ||
69 | rcInventariosSec = v.findViewById<RecyclerView>(R.id.rcInventarios) | ||
70 | |||
71 | invSecActual = sharedPreferences.getString("InventarioSecNum", "").toString() | ||
72 | tvTituloSec.text = "# ${sharedPreferences.getString("InventarioSecNum", "").toString()} ${sharedPreferences.getString("InventarioSecNom", "").toString()}" | ||
73 | if (sharedPreferences.contains("BusquedaVuelta")) if (sharedPreferences.getString("BusquedaVuelta", "").toString() == "") { | ||
74 | |||
75 | cargarDeBdInventario(sharedPreferences.getString("InventarioSecNum", "").toString().toInt()) | ||
76 | } | ||
77 | |||
78 | if (sharedPreferences.getString("BusquedaVuelta", "").toString() != "") { | ||
79 | etDescripcion.setText("") | ||
80 | etDescripcion.setText(sharedPreferences.getString("BusquedaVuelta", "").toString()) | ||
81 | etDescripcion.setImeActionLabel(sharedPreferences.getString("BusquedaVuelta", "").toString(), KeyEvent.KEYCODE_ENTER) | ||
82 | } | ||
83 | val editor = sharedPreferences.edit() | ||
84 | editor?.putString("BusquedaVuelta", "") | ||
85 | editor?.apply() | ||
86 | editor.commit() | ||
87 | updateFETinvSecHead(sharedPreferences.getString("InventarioSecNum", "").toString(), obtenerFechaActualFormatoFoca()) | ||
88 | updateFECTOMyFECTOMFINinvSecBody(sharedPreferences.getString("InventarioSecNum", "").toString(), obtenerFechaActualFormatoFoca()) | ||
89 | |||
90 | return v | ||
91 | } | ||
92 | |||
93 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
94 | super.onViewCreated(view, savedInstanceState) | ||
95 | navController = Navigation.findNavController(view) | ||
96 | |||
97 | btnBorrarInv.setOnClickListener { | ||
98 | AlertDialog.Builder(requireContext()).setTitle("Eliminación de Inventarios").setMessage("¿Confirma que desea eliminar el inventario?") | ||
99 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> | ||
100 | borrarInvActualCabecera() | ||
101 | borrarInvActualCuerpo() | ||
102 | Toast.makeText(requireContext(), "El inventario $invSecActual fue Borrado", Toast.LENGTH_LONG).show() | ||
103 | navController.navigate(R.id.action_invSecFragment_to_mainFragment2) | ||
104 | |||
105 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> }).show() | ||
106 | } | ||
107 | |||
108 | etDescripcion.addTextChangedListener(textWatcher2) | ||
109 | |||
110 | btnExportarInv.setOnClickListener { | ||
111 | AlertDialog.Builder(requireContext()).setTitle(R.string.sTituloExportar).setMessage(R.string.sMensajeExportar) | ||
112 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> | ||
113 | preparaInvParaExportar(invSecActual) | ||
114 | val modalDialog = ExportacionExitosa() | ||
115 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
116 | Thread.sleep(500) | ||
117 | navController.navigate(R.id.action_invSecFragment_to_mainFragment2) | ||
118 | |||
119 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> }).show() | ||
120 | } | ||
121 | } | ||
122 | |||
123 | private fun preparaInvParaExportar(inventario: String) { | ||
124 | |||
125 | fragmentScope.launch(Main) { | ||
126 | val aEnviarHead: InvSecHeadToSend | ||
127 | var aEnviarBody: InvSecBodyToSend | ||
128 | val datosCabecera = foundInvHeadDB(inventario) | ||
129 | val datosCuerpo = foundInvBodyBD(inventario) | ||
130 | |||
131 | aEnviarHead = InvSecHeadToSend(datosCabecera.invNum.toString(), "D", obtenerFechaActualFormatoFoca()) | ||
132 | updateFECinvSecHead(datosCabecera.invNum.toString(), obtenerFechaActualFormatoFoca()) | ||
133 | exportarInventarioSecHead(aEnviarHead) | ||
134 | |||
135 | for (cuerpo in datosCuerpo) { | ||
136 | aEnviarBody = InvSecBodyToSend( | ||
137 | cuerpo.invNum.toString(), | ||
138 | cuerpo.sector.toString(), | ||
139 | cuerpo.codigo.toString(), | ||
140 | if (cuerpo.contado.toString() == "" || cuerpo.contado.toString().isEmpty()) "-1" else cuerpo.contado.toString(), | ||
141 | cuerpo.fechaTomado.toString(), | ||
142 | cuerpo.fechaFinal.toString() | ||
143 | ) | ||
144 | |||
145 | exportarInventarioSecBody(aEnviarBody) | ||
146 | } | ||
147 | borrarInvActualCabecera() | ||
148 | borrarInvActualCuerpo() | ||
149 | |||
150 | } | ||
151 | } | ||
152 | |||
153 | private fun exportarInventarioSecBody(EnviarBody: InvSecBodyToSend) { | ||
154 | fragmentScope.launch(Main) { | ||
155 | serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne() | ||
156 | |||
157 | if (serverBajada != null) { | ||
158 | if (serverBajada!!.direccion.isNullOrEmpty()) { | ||
159 | val modalDialog = NoServerConf() | ||
160 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
161 | } else { | ||
162 | BASE_URL = serverBajada!!.direccion.toString() + ":" + serverBajada!!.puertoSubida.toString() + "/" | ||
163 | |||
164 | // val call: Call<Void?>? = WebService.instance | ||
165 | // ?.createService(WebServiceApi::class.java) | ||
166 | // ?.inventarioSecToSendBody(EnviarBody) | ||
167 | ItomInv.request.inventarioSecToSendBody(EnviarBody) | ||
168 | .enqueue(object : Callback<Void?> { | ||
169 | // call?.enqueue(object : Callback<Void?> { | ||
170 | override fun onResponse(call: Call<Void?>, response: Response<Void?>) { | ||
171 | if (response.code() == 200) { } | ||
172 | if (response.code() == 409) { | ||
173 | Toast.makeText(requireContext(), response.message(), Toast.LENGTH_SHORT).show() | ||
174 | } | ||
175 | } | ||
176 | |||
177 | override fun onFailure(call: Call<Void?>?, t: Throwable?) {} | ||
178 | }) | ||
179 | } | ||
180 | } else { | ||
181 | val modalDialog = ServerNoConf() | ||
182 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
183 | } | ||
184 | } | ||
185 | } | ||
186 | |||
187 | private fun exportarInventarioSecHead(aEnviar: InvSecHeadToSend) { | ||
188 | |||
189 | fragmentScope.launch(Main) { | ||
190 | serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne() | ||
191 | |||
192 | if (serverBajada != null) { | ||
193 | |||
194 | if (serverBajada!!.direccion.isNullOrEmpty()) { | ||
195 | val modalDialog = NoServerConf() | ||
196 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
197 | } else { | ||
198 | BASE_URL = serverBajada!!.direccion.toString() + ":" + serverBajada!!.puertoSubida.toString() + "/" | ||
199 | |||
200 | ItomInv.request.inventarioSecToSendHead(aEnviar) | ||
201 | .enqueue(object : Callback<Void?> { | ||
202 | |||
203 | // } | ||
204 | // val call: Call<Void?>? = WebService.instance | ||
205 | // ?.createService(WebServiceApi::class.java) | ||
206 | // ?.inventarioSecToSendHead(aEnviar) | ||
207 | // call?.enqueue(object : Callback<Void?> { | ||
208 | override fun onResponse(call: Call<Void?>, response: Response<Void?>) { | ||
209 | if (response.code() == 201) {} | ||
210 | if (response.code() == 409) { | ||
211 | Toast.makeText(requireContext(), response.message(), Toast.LENGTH_SHORT).show() | ||
212 | } | ||
213 | } | ||
214 | override fun onFailure(call: Call<Void?>?, t: Throwable?) {} | ||
215 | }) | ||
216 | } | ||
217 | } else { | ||
218 | val modalDialog = ServerNoConf() | ||
219 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
220 | } | ||
221 | } | ||
222 | } | ||
223 | |||
224 | override fun onDestroy() { | ||
225 | super.onDestroy() | ||
226 | fragmentScope.cancel() | ||
227 | } | ||
228 | // private fun exportarInventario(aEnviar: InvToSend){ | ||
229 | // var serverBajada: ServeInv? = null | ||
230 | // GlobalScope.launch(IO) { | ||
231 | // serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne() | ||
232 | // | ||
233 | // if (serverBajada != null) { | ||
234 | // | ||
235 | // if (serverBajada!!.direccion.isNullOrEmpty()) { | ||
236 | // val modalDialog = NoServerConf() | ||
237 | // modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
238 | // } else { | ||
239 | // BASE_URL = serverBajada!!.direccion.toString() + ":" + serverBajada!!.puertoSubida.toString() + "/" | ||
240 | // | ||
241 | // val call: Call<Void?>? = WebService.instance | ||
242 | // ?.createService(WebServiceApi::class.java) | ||
243 | // ?.inventarioToSend(aEnviar) | ||
244 | // call?.enqueue(object : Callback<Void?> { | ||
245 | // override fun onResponse(call: Call<Void?>, response: Response<Void?>) { | ||
246 | // if (response.code() == 201) { | ||
247 | // } | ||
248 | // if (response.code() == 409) { | ||
249 | // } | ||
250 | // } | ||
251 | // override fun onFailure(call: Call<Void?>?, t: Throwable?) {} | ||
252 | // }) | ||
253 | // } | ||
254 | // } else { | ||
255 | // val modalDialog = ServerNoConf() | ||
256 | // modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
257 | // } | ||
258 | // | ||
259 | // } | ||
260 | // } | ||
261 | |||
262 | private suspend fun foundInvHeadDB(inv: String): InvHeadSec { | ||
263 | var busqueda: InvHeadSec | ||
264 | return fragmentScope.async(IO) { | ||
265 | busqueda = AppDb.getAppDb(requireContext())!!.InvHeadSecDAO()!!.foundInvSecHead(inv) | ||
266 | return@async busqueda | ||
267 | }.await() | ||
268 | } | ||
269 | |||
270 | private suspend fun foundInvBodyBD(inv: String): List<InvBodySec> { | ||
271 | var busqueda: List<InvBodySec> | ||
272 | return fragmentScope.async(IO) { | ||
273 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodySecDAO()!!.fetchInvSecBody(inv) | ||
274 | return@async busqueda | ||
275 | }.await() | ||
276 | } | ||
277 | |||
278 | private fun borrarInvActualCuerpo() { | ||
279 | fragmentScope.launch { | ||
280 | withContext(IO) { | ||
281 | AppDb.getAppDb((activity as MainActivity))!!.InvBodySecDAO()!!.deleteInvSecBody(invSecActual) | ||
282 | } | ||
283 | } | ||
284 | } | ||
285 | |||
286 | private fun borrarInvActualCabecera() { | ||
287 | fragmentScope.launch { | ||
288 | withContext(IO) { | ||
289 | AppDb.getAppDb((activity as MainActivity))!!.InvHeadSecDAO()!!.deleteinvSecHead(invSecActual) | ||
290 | } | ||
291 | } | ||
292 | } | ||
293 | |||
294 | private fun cargarDeBdInventario(ultimoInv: Int) { | ||
295 | fragmentScope.launch(Main) { | ||
296 | listArtSec.clear() | ||
297 | val invbody = searchInvSecBody(ultimoInv) | ||
298 | for ((i, _) in invbody!!.withIndex()) { | ||
299 | loadRecycler( | ||
300 | invbody[i].invNum, | ||
301 | if (invbody[i].sector.toString().toInt() < 9) "0${invbody[i].sector.toString()}" else invbody[i].sector.toString(), | ||
302 | invbody[i].codigo!!, | ||
303 | invbody[i].descripcion!!, | ||
304 | invbody[i].precio!!, | ||
305 | invbody[i].uniVenta!!, | ||
306 | invbody[i].costo!!, | ||
307 | invbody[i].contado!!, | ||
308 | invbody[i].depSn!!, | ||
309 | invbody[i].fechaTomado!!, | ||
310 | invbody[i].fechaFinal!! | ||
311 | ) | ||
312 | } | ||
313 | } | ||
314 | } | ||
315 | |||
316 | private suspend fun searchInvSecBody(inventario: Int): List<InvBodySec>? { | ||
317 | return fragmentScope.async(IO) { | ||
318 | return@async AppDb.getAppDb((activity as MainActivity))!!.InvBodySecDAO()!!.buscarInvSecBody(inventario) | ||
319 | }.await() | ||
320 | } | ||
321 | |||
322 | private fun loadRecycler( | ||
323 | invNum: Int, sector: String, codigo: String, descripcion: String, precio: String, uniVta: String, | ||
324 | costo: String, contado: String, depSn: Boolean, fechaTomado: String, fechaFinal: String | ||
325 | ) { | ||
326 | |||
327 | //TODO CARGO EN LE RV | ||
328 | val item = ItemsSecRecycler( | ||
329 | invNum.toString(), | ||
330 | sector, | ||
331 | codigo, | ||
332 | descripcion, | ||
333 | precio, | ||
334 | uniVta, | ||
335 | costo, | ||
336 | contado, | ||
337 | depSn, | ||
338 | fechaTomado, | ||
339 | fechaFinal | ||
340 | ) | ||
341 | listArtSec.add(item) | ||
342 | |||
343 | viewAdapter = ProdSecListAdapter(requireContext(), listArtSec, this) | ||
344 | viewManager = LinearLayoutManager(requireContext()) | ||
345 | rcInventariosSec.apply { | ||
346 | adapter = viewAdapter | ||
347 | layoutManager = viewManager | ||
348 | } | ||
349 | } | ||
350 | |||
351 | override fun onImagePenClick(numInv: String?, sector: String?, codigo: String?, cantidad: String?, position: String) { | ||
352 | if (filtrado) | ||
353 | dialogoSumaResta(numInv, requireContext(), position.toInt(), countryFilterList[position.toInt()].uniVta, true) | ||
354 | else | ||
355 | dialogoSumaResta(numInv, requireContext(), position.toInt(), listArtSec[position.toInt()].uniVta, true) | ||
356 | } | ||
357 | |||
358 | override fun onImageDotsClick(numInv: String?, sector: String?, codigo: String?) { | ||
359 | val bundle = Bundle() | ||
360 | bundle.putString("sector", sector!!.toInt().toString()) | ||
361 | bundle.putString("codigo", codigo) | ||
362 | bundle.putString("numeroInv", numInv) | ||
363 | bundle.putString("Busqueda", etDescripcion.text.toString()) | ||
364 | navController.navigate(R.id.action_invSecFragment_to_detalleArtSecFragment, bundle) | ||
365 | } | ||
366 | |||
367 | fun dialogoSumaResta(numInv: String?, context: Context, indiceDelArtEncontrado: Int, univta: String, cancelable: Boolean) { | ||
368 | var segundaVezCant = false | ||
369 | var cantidadTemp: Float | ||
370 | mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | ||
371 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(cancelable) | ||
372 | // TODO: SI PERMITE QUE INGRESE DECIMALES | ||
373 | if (univta.contains("1") || univta.contains("3") || univta.contains("7")) mDialogView.tvNuevaCantidad.inputType = InputType.TYPE_CLASS_NUMBER | ||
374 | mDialogView.tvTitulo2.text = if (filtrado) countryFilterList[indiceDelArtEncontrado].descripcion else listArtSec[indiceDelArtEncontrado].descripcion | ||
375 | mDialogView.tvCantInicial.text = | ||
376 | if (filtrado) | ||
377 | (Math.round((if (countryFilterList[indiceDelArtEncontrado].contado == "") "0".toDouble() else countryFilterList[indiceDelArtEncontrado].contado.toFloat() * 100.0)) / 100.0).toString() | ||
378 | else | ||
379 | (Math.round((if (listArtSec[indiceDelArtEncontrado].contado == "") "0".toDouble() else listArtSec[indiceDelArtEncontrado].contado.toFloat() * 100.0)) / 100.0).toString() | ||
380 | |||
381 | if (filtrado) | ||
382 | if (countryFilterList[indiceDelArtEncontrado].contado != "") segundaVezCant = true | ||
383 | else | ||
384 | if (listArtSec[indiceDelArtEncontrado].contado != "") segundaVezCant = true | ||
385 | |||
386 | val mAlertDialog = mBuilder.show() | ||
387 | mDialogView.tvNuevaCantidad.requestFocus() | ||
388 | |||
389 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | ||
390 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | ||
391 | |||
392 | mDialogView.tvNuevaCantidad.addTextChangedListener(textWatcher) | ||
393 | |||
394 | mDialogView.rbSumar.setOnClickListener { | ||
395 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | ||
396 | cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat() | ||
397 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() | ||
398 | } | ||
399 | } | ||
400 | mDialogView.rbRestar.setOnClickListener { | ||
401 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | ||
402 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { | ||
403 | cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat() | ||
404 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() | ||
405 | } else { | ||
406 | mDialogView.tvResultado.text = "" | ||
407 | mDialogView.tvResultado.error = "Operación No Valida" | ||
408 | mDialogView.tvResultado.requestFocus() | ||
409 | mDialogView.tvResultado.hint = "Error" | ||
410 | } | ||
411 | } | ||
412 | } | ||
413 | mDialogView.rbMdodificar.setOnClickListener { | ||
414 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | ||
415 | mDialogView.tvResultado.text = (Math.round(mDialogView.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString() | ||
416 | } | ||
417 | } | ||
418 | mDialogView.btnAceptar.setOnClickListener { | ||
419 | if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || !mDialogView.tvNuevaCantidad.text.isBlank()) { | ||
420 | if (mDialogView.tvResultado.text.isNotEmpty() || !mDialogView.tvResultado.text.isBlank()) { | ||
421 | mAlertDialog.dismiss() | ||
422 | |||
423 | if (filtrado) | ||
424 | countryFilterList[indiceDelArtEncontrado].contado = (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toString() | ||
425 | else | ||
426 | listArtSec[indiceDelArtEncontrado].contado = (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toString() | ||
427 | |||
428 | if (segundaVezCant) { | ||
429 | updateFECTOMFINinvSecBody( | ||
430 | numInv!!, | ||
431 | if (filtrado) countryFilterList[indiceDelArtEncontrado].sector else listArtSec[indiceDelArtEncontrado].sector, | ||
432 | if (filtrado) countryFilterList[indiceDelArtEncontrado].codigo else listArtSec[indiceDelArtEncontrado].codigo, | ||
433 | (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toFloat() | ||
434 | ) | ||
435 | } else { | ||
436 | updateCantidad( | ||
437 | numInv!!, | ||
438 | if (filtrado) countryFilterList[indiceDelArtEncontrado].sector else listArtSec[indiceDelArtEncontrado].sector, | ||
439 | if (filtrado) countryFilterList[indiceDelArtEncontrado].codigo else listArtSec[indiceDelArtEncontrado].codigo, | ||
440 | (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toFloat() | ||
441 | ) | ||
442 | } | ||
443 | |||
444 | viewAdapter.notifyDataSetChanged() | ||
445 | } else if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { | ||
446 | mDialogView.tvResultado.error = "Operación Requerida" | ||
447 | mDialogView.tvResultado.requestFocus() | ||
448 | mDialogView.tvResultado.hint = "Seleccione Operación" | ||
449 | } | ||
450 | } else if (mDialogView.tvNuevaCantidad.text.isEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { | ||
451 | mDialogView.tvNuevaCantidad.error = "Completar" | ||
452 | mDialogView.tvNuevaCantidad.requestFocus() | ||
453 | mDialogView.tvNuevaCantidad.hint = "Ingrese un valor" | ||
454 | } | ||
455 | } | ||
456 | mDialogView.dialogCancelBtn.setOnClickListener { | ||
457 | mAlertDialog.dismiss() | ||
458 | } | ||
459 | } | ||
460 | |||
461 | private val textWatcher = object : TextWatcher { | ||
462 | |||
463 | override fun afterTextChanged(s: Editable?) { | ||
464 | if (mDialogView.tvNuevaCantidad.text.toString() == "") { | ||
465 | mDialogView.tvResultado.text = "" | ||
466 | } | ||
467 | } | ||
468 | |||
469 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {} | ||
470 | |||
471 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { | ||
472 | var cantidadTemp: Float | ||
473 | if (mDialogView.tvNuevaCantidad.text.toString() != "") { | ||
474 | if (mDialogView.rbSumar.isChecked) { | ||
475 | cantidadTemp = mDialogView.tvNuevaCantidad.text.toString().toFloat() + mDialogView.tvCantInicial.text.toString().toFloat() | ||
476 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() | ||
477 | } | ||
478 | if (mDialogView.rbRestar.isChecked) { | ||
479 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | ||
480 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { | ||
481 | cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat() | ||
482 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() | ||
483 | } else { | ||
484 | mDialogView.tvResultado.text = "" | ||
485 | mDialogView.tvResultado.error = "Operación No Valida" | ||
486 | mDialogView.tvResultado.requestFocus() | ||
487 | mDialogView.tvResultado.hint = "Error" | ||
488 | } | ||
489 | } | ||
490 | } | ||
491 | if (mDialogView.rbMdodificar.isChecked) { | ||
492 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | ||
493 | mDialogView.tvResultado.text = (Math.round(mDialogView.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString() | ||
494 | } | ||
495 | } | ||
496 | } | ||
497 | } | ||
498 | } | ||
499 | |||
500 | private val textWatcher2 = object : TextWatcher { | ||
501 | |||
502 | override fun afterTextChanged(constraint: Editable?) {} | ||
503 | |||
504 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {} | ||
505 | |||
506 | override fun onTextChanged(constraint: CharSequence?, start: Int, before: Int, count: Int) { | ||
507 | |||
508 | val charSearch = constraint.toString() | ||
509 | if (charSearch.isEmpty()) { | ||
510 | countryFilterList = listArtSec | ||
511 | filtrado = false | ||
512 | } else { | ||
513 | val resultList = ArrayList<ItemsSecRecycler>() | ||
514 | for (row in listArtSec) { | ||
515 | if (row.descripcion.toLowerCase(Locale.ROOT).contains(charSearch.toLowerCase(Locale.ROOT))) { | ||
516 | resultList.add(row) | ||
517 | filtrado = true | ||
518 | } | ||
519 | } | ||
520 | countryFilterList = resultList | ||
521 | } | ||
522 | viewAdapter = ProdSecListAdapter(requireContext(), countryFilterList, this@InvSecFragment) | ||
523 | viewManager = LinearLayoutManager(requireContext()) | ||
524 | rcInventariosSec.apply { | ||
525 | adapter = viewAdapter | ||
526 | layoutManager = viewManager | ||
527 | rcInventariosSec.recycledViewPool.clear() | ||
528 | viewAdapter.notifyDataSetChanged() | ||
529 | } | ||
530 | } | ||
531 | } | ||
532 | |||
533 | private fun updateFETinvSecHead(numInv: String, fecha: String) { | ||
534 | fragmentScope.launch(IO) { | ||
535 | AppDb.getAppDb((activity as MainActivity))!!.InvHeadSecDAO()!!.updateFETinvSecHead(numInv, fecha) | ||
536 | } | ||
537 | } | ||
538 | |||
539 | private fun updateFECTOMyFECTOMFINinvSecBody(numInv: String, fecha: String) { | ||
540 | fragmentScope.launch(IO) { | ||
541 | AppDb.getAppDb((activity as MainActivity))!!.InvBodySecDAO()!!.updateFECTOMyFECTOMFINinvSecBody(numInv, fecha) | ||
542 | } | ||
543 | } | ||
544 | |||
545 | private fun updateFECinvSecHead(numInv: String, fecha: String) { | ||
546 | fragmentScope.launch(IO) { | ||
547 | AppDb.getAppDb((activity as MainActivity))!!.InvHeadSecDAO()!!.updateFECinvSecHead(numInv, fecha) | ||
548 | } | ||
549 | } | ||
550 | |||
551 | private fun updateFECTOMFINinvSecBody(numInv: String, sector: String, codigo: String, cantidad: Float) { | ||
552 | fragmentScope.launch(IO) { | ||
553 | AppDb.getAppDb((activity as MainActivity))!!.InvBodySecDAO()!!.updateFECTOMFINinvSecBody(numInv, cantidad, sector.toLong(), codigo.toLong(), obtenerFechaActualFormatoFoca()) | ||
554 | } | ||
555 | } | ||
556 | |||
557 | private fun updateCantidad(numInv: String, sector: String, codigo: String, cantidad: Float) { | ||
558 | fragmentScope.launch(IO) { | ||
559 | AppDb.getAppDb((activity as MainActivity))!!.InvBodySecDAO()!!.updateInvSecBody(numInv, cantidad, sector.toLong(), codigo.toLong(), obtenerFechaActualFormatoFoca()) | ||
560 | } | ||
561 | } | ||
562 | } | ||
563 | |||
564 | |||
565 |
app/src/main/java/com/focasoftware/deboinventariov20/UI/inventario/InventarioFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.inventario | 1 | package com.focasoftware.deboinventariov20.UI.inventario |
2 | 2 | ||
3 | import android.annotation.SuppressLint | ||
4 | import android.app.AlertDialog | 3 | import android.app.AlertDialog |
5 | import android.content.Context | 4 | import android.content.Context |
6 | import android.content.Context.INPUT_METHOD_SERVICE | 5 | import android.content.Context.INPUT_METHOD_SERVICE |
7 | import android.content.DialogInterface | 6 | import android.content.DialogInterface |
8 | import android.content.SharedPreferences | 7 | import android.content.SharedPreferences |
9 | import android.graphics.Canvas | 8 | import android.graphics.Canvas |
10 | import android.graphics.Color | 9 | import android.graphics.Color |
11 | import android.graphics.drawable.Drawable | 10 | import android.graphics.drawable.Drawable |
12 | import android.os.Bundle | 11 | import android.os.Bundle |
12 | import android.system.ErrnoException | ||
13 | import android.text.Editable | 13 | import android.text.Editable |
14 | import android.text.InputType.TYPE_CLASS_NUMBER | 14 | import android.text.InputType.TYPE_CLASS_NUMBER |
15 | import android.text.TextWatcher | 15 | import android.text.TextWatcher |
16 | import android.view.* | 16 | import android.view.* |
17 | import android.view.inputmethod.InputMethodManager | 17 | import android.view.inputmethod.InputMethodManager |
18 | import android.widget.EditText | 18 | import android.widget.EditText |
19 | import android.widget.TextView | 19 | import android.widget.TextView |
20 | import android.widget.Toast | 20 | import android.widget.Toast |
21 | import androidx.core.content.ContextCompat | 21 | import androidx.core.content.ContextCompat |
22 | import androidx.core.os.bundleOf | 22 | import androidx.core.os.bundleOf |
23 | import androidx.fragment.app.Fragment | 23 | import androidx.fragment.app.Fragment |
24 | import androidx.lifecycle.ViewModel | 24 | import androidx.lifecycle.ViewModel |
25 | import androidx.lifecycle.ViewModelProviders | 25 | import androidx.lifecycle.ViewModelProviders |
26 | import androidx.lifecycle.lifecycleScope | 26 | import androidx.lifecycle.lifecycleScope |
27 | import androidx.navigation.NavController | 27 | import androidx.navigation.NavController |
28 | import androidx.navigation.Navigation | 28 | import androidx.navigation.Navigation |
29 | import androidx.recyclerview.widget.ItemTouchHelper | 29 | import androidx.recyclerview.widget.ItemTouchHelper |
30 | import androidx.recyclerview.widget.LinearLayoutManager | 30 | import androidx.recyclerview.widget.LinearLayoutManager |
31 | import androidx.recyclerview.widget.RecyclerView | 31 | import androidx.recyclerview.widget.RecyclerView |
32 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 32 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
33 | import com.focasoftware.deboinventariov20.Model.* | 33 | import com.focasoftware.deboinventariov20.Model.* |
34 | import com.focasoftware.deboinventariov20.R | 34 | import com.focasoftware.deboinventariov20.R |
35 | import com.focasoftware.deboinventariov20.UI.Utils.ExportacionExitosa | 35 | import com.focasoftware.deboinventariov20.UI.MainActivity |
36 | import com.focasoftware.deboinventariov20.UI.Utils.NoEncontradoSimple | 36 | import com.focasoftware.deboinventariov20.UI.Utils.* |
37 | import com.focasoftware.deboinventariov20.UI.Utils.modificarCantidadEnCabecera | ||
38 | import com.focasoftware.deboinventariov20.UI.Utils.obtenerFechaActual | ||
39 | import com.focasoftware.deboinventariov20.UI.inventario.viewModel.InventarioViewModel | 37 | import com.focasoftware.deboinventariov20.UI.inventario.viewModel.InventarioViewModel |
40 | import kotlinx.android.synthetic.main.fragment_inventario.* | 38 | import kotlinx.android.synthetic.main.fragment_inventario.* |
41 | import kotlinx.android.synthetic.main.ingresar_cantidad.view.* | 39 | import kotlinx.android.synthetic.main.ingresar_cantidad.view.* |
42 | import kotlinx.android.synthetic.main.login_dialog.view.* | 40 | import kotlinx.android.synthetic.main.login_dialog.view.* |
43 | import kotlinx.android.synthetic.main.login_dialog.view.btnAceptar | 41 | import kotlinx.android.synthetic.main.login_dialog.view.btnAceptar |
44 | import kotlinx.coroutines.* | 42 | import kotlinx.coroutines.* |
45 | import kotlinx.coroutines.Dispatchers.IO | 43 | import kotlinx.coroutines.Dispatchers.IO |
46 | import kotlinx.coroutines.Dispatchers.Main | 44 | import kotlinx.coroutines.Dispatchers.Main |
47 | import retrofit2.Call | 45 | import retrofit2.Call |
48 | import retrofit2.Callback | 46 | import retrofit2.Callback |
49 | import retrofit2.Response | 47 | import retrofit2.Response |
48 | import java.io.IOException | ||
49 | import java.net.SocketTimeoutException | ||
50 | import java.util.* | 50 | import java.util.* |
51 | import kotlin.collections.ArrayList | 51 | import kotlin.collections.ArrayList |
52 | 52 | ||
53 | class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickListener { | 53 | private lateinit var sharedPreferences: SharedPreferences |
54 | private var iArea: Boolean = false | ||
55 | private lateinit var invHead: InvHead | ||
56 | private lateinit var viewAdapter: RecyclerView.Adapter<*> | ||
57 | private lateinit var viewManager: RecyclerView.LayoutManager | ||
58 | private lateinit var sChangeUpper: String | ||
59 | private var listArticulos = ArrayList<ItemsRecycler>() | ||
60 | private lateinit var navController: NavController | ||
61 | private var iEstado = 0 | ||
62 | private var iBusquedaPor = 0 | ||
63 | private var fCant = 0F | ||
64 | private var bFirst = false | ||
65 | private lateinit var deleteIcon: Drawable | ||
66 | lateinit var inventarioViewModel: ViewModel | ||
67 | private var sectorBalanza = 0 | ||
68 | private var codigoBalanza = 0 | ||
69 | private var cantEnteraBalanza = 0 | ||
70 | private var cantDecimalBalanza = 0 | ||
71 | private var EsBalanza = false | ||
54 | 72 | ||
55 | private lateinit var sharedPreferences: SharedPreferences | 73 | class InventarioFragment : Fragment(), ProductosListAdapter.OnImageDotsClickListener { |
56 | private var iArea: Boolean = false | ||
57 | private lateinit var invHead: InvHead | ||
58 | private lateinit var rcInventarios: RecyclerView | ||
59 | private lateinit var viewAdapter: RecyclerView.Adapter<*> | ||
60 | private lateinit var viewManager: RecyclerView.LayoutManager | ||
61 | private lateinit var sChangeUpper: String | ||
62 | private var listArticulos = ArrayList<ItemsRecycler>() | ||
63 | private lateinit var navController: NavController | ||
64 | var InventarioNuevo: Int = 0 | ||
65 | private var iEstado = 0 | ||
66 | private var iBusquedaPor = 0 | ||
67 | private var fCant = 0F | ||
68 | private var bFirst = false | ||
69 | private lateinit var deleteIcon: Drawable | ||
70 | lateinit var mDialogView: View | 74 | lateinit var mDialogView: View |
71 | lateinit var inventarioViewModel: ViewModel | 75 | private lateinit var rcInventarios: RecyclerView |
76 | private val job: Job = Job() | ||
77 | private val fragmentScopeInvFrag = CoroutineScope(IO + job) | ||
78 | private var serverBajada: ServeInv? = null | ||
79 | |||
80 | override fun onDestroy() { | ||
81 | super.onDestroy() | ||
82 | fragmentScopeInvFrag.cancel() | ||
83 | } | ||
72 | 84 | ||
73 | @SuppressLint("MissingPermission") | ||
74 | override fun onCreate(savedInstanceState: Bundle?) { | 85 | override fun onCreate(savedInstanceState: Bundle?) { |
75 | super.onCreate(savedInstanceState) | 86 | super.onCreate(savedInstanceState) |
76 | inventarioViewModel = ViewModelProviders.of(this).get(InventarioViewModel::class.java) | 87 | inventarioViewModel = ViewModelProviders.of(this).get(InventarioViewModel::class.java) |
77 | 88 | ||
78 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 89 | sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) |
79 | if (sharedPreferences.contains("Inventario")) if (sharedPreferences.getString("Inventario", "").toString() != "-1") { | 90 | if (sharedPreferences.contains("Inventario")) if (sharedPreferences.getString("Inventario", "").toString() != "-1") { |
80 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = sharedPreferences.getString("Inventario", "").toString().toInt() | 91 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = sharedPreferences.getString("Inventario", "").toString().toInt() |
81 | val editor = sharedPreferences.edit() | 92 | val editor = sharedPreferences.edit() |
82 | editor?.putString("Inventario", "-1") | 93 | editor?.putString("Inventario", "-1") |
83 | editor?.apply() | 94 | editor?.apply() |
84 | editor.commit() | 95 | editor.commit() |
85 | } | 96 | } |
86 | // val c = Calendar.getInstance() | ||
87 | // c[2009, 9, 9, 12, 0] = 0 | ||
88 | // val am: AlarmManager = requireActivity().getSystemService(Context.ALARM_SERVICE) as AlarmManager | ||
89 | // am.setTime(c.timeInMillis) | ||
90 | } | 97 | } |
91 | // private fun setupTimeZone(timeZoneName: String) { | ||
92 | // val am = requireContext().getSystemService(Context.ALARM_SERVICE) as AlarmManager | ||
93 | // am.setTimeZone("Europe/Madrid") | ||
94 | // } | ||
95 | |||
96 | 98 | ||
97 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 99 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
98 | val v = inflater.inflate(R.layout.fragment_inventario, container, false) | 100 | val v = inflater.inflate(R.layout.fragment_inventario, container, false) |
99 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | 101 | |
102 | |||
100 | val tCodigoBarras = v.findViewById<EditText>(R.id.etCodigoBarras) | 103 | val tCodigoBarras = v.findViewById<EditText>(R.id.etCodigoBarras) |
101 | rcInventarios = v.findViewById(R.id.rcInventarios) | 104 | rcInventarios = v.findViewById(R.id.rcInventarios) |
102 | val tvTitulo = v.findViewById<TextView>(R.id.tvTitulo) | 105 | val tvTitulo = v.findViewById<TextView>(R.id.tvTitulo) |
103 | val descArea: String = if (!SerchArea()) "Ventas" else "Deposito" | 106 | val descArea: String = if (!SerchArea()) "Ventas" else "Deposito" |
104 | 107 | ||
105 | if ((inventarioViewModel as InventarioViewModel).InventarioNuevo == 0) {// TODO: SI INVETNARIO NUEVO | 108 | if ((inventarioViewModel as InventarioViewModel).InventarioNuevo == 0) {// TODO: SI INVETNARIO NUEVO |
106 | GlobalScope.launch(Dispatchers.Main) { | 109 | GlobalScope.launch(Dispatchers.Main) { |
107 | //TODO: BUSCO EL ULTIMO INVENTARIO EN LA BD PARA PODER CREAR EL PROXIMO | 110 | //TODO: BUSCO EL ULTIMO INVENTARIO EN LA BD PARA PODER CREAR EL PROXIMO |
108 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = AppDb.getAppDb(requireActivity())?.InvHeadDAO()?.findLastInv()?.plus(1) ?: 1 | 111 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = AppDb.getAppDb((activity as MainActivity))?.InvHeadDAO()?.findLastInv()?.plus(1) ?: 1 |
109 | //TODO: CREAMOS EL INVENTARIO EN LA CABECERA DEL INVENTARIO | 112 | //TODO: CREAMOS EL INVENTARIO EN LA CABECERA DEL INVENTARIO |
110 | invHead = InvHead( | 113 | invHead = InvHead( |
111 | (inventarioViewModel as InventarioViewModel).InventarioNuevo, | 114 | (inventarioViewModel as InventarioViewModel).InventarioNuevo, |
112 | if (!SerchArea()) "Ventas" else "Deposito", | 115 | if (!SerchArea()) "Ventas" else "Deposito", |
113 | 1, | 116 | 1, |
114 | obtenerFechaActual(), | 117 | obtenerFechaActual(), |
115 | obtenerFechaActual(), | 118 | obtenerFechaActual(), |
116 | 0L, | 119 | 0L, |
117 | SerchArea(), | 120 | SerchArea(), |
118 | AjusteProductos(), | 121 | AjusteProductos(), |
119 | ProdNoCont() | 122 | ProdNoCont() |
120 | ) | 123 | ) |
121 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.insertInvHead(invHead) | 124 | AppDb.getAppDb((activity as MainActivity))!!.InvHeadDAO()!!.insertInvHead(invHead) |
122 | 125 | ||
123 | tvTitulo.text = "Inventario " + " # ${(inventarioViewModel as InventarioViewModel).InventarioNuevo} " + descArea | 126 | tvTitulo.text = "Inventario " + " # ${(inventarioViewModel as InventarioViewModel).InventarioNuevo} " + descArea |
124 | } | 127 | } |
125 | } else {// TODO (SI VENGO DE FRAGMENT DESCRIPCION) | 128 | } else {// TODO (SI VENGO DE FRAGMENT DESCRIPCION) |
126 | listArticulos.clear() | 129 | listArticulos.clear() |
127 | cargarDeBdInventario((inventarioViewModel as InventarioViewModel).InventarioNuevo) | 130 | cargarDeBdInventario((inventarioViewModel as InventarioViewModel).InventarioNuevo) |
128 | tvTitulo.text = "Inventario " + " # ${(inventarioViewModel as InventarioViewModel).InventarioNuevo} " + descArea | 131 | tvTitulo.text = "Inventario " + " # ${(inventarioViewModel as InventarioViewModel).InventarioNuevo} " + descArea |
129 | } | 132 | } |
130 | 133 | ||
131 | tCodigoBarras.setOnKeyListener { _, keyCode, keyEvent -> | 134 | tCodigoBarras.setOnKeyListener { _, keyCode, keyEvent -> |
132 | if (keyCode == KeyEvent.KEYCODE_ENTER && keyEvent.action == KeyEvent.ACTION_UP) { | 135 | if (keyCode == KeyEvent.KEYCODE_ENTER && keyEvent.action == KeyEvent.ACTION_UP) { |
133 | sChangeUpper = tCodigoBarras.text.toString() | 136 | sChangeUpper = tCodigoBarras.text.toString() |
137 | |||
138 | // val esnumero = try { | ||
139 | // val retorno = java.lang.Double.valueOf(sChangeUpper) | ||
140 | // true | ||
141 | // } catch (e: NumberFormatException) { | ||
142 | // //retorno = 0.0 | ||
143 | // false | ||
144 | // } | ||
145 | // if (esnumero){} | ||
134 | var indiceDelArtEncontrado = 0 | 146 | var indiceDelArtEncontrado = 0 |
135 | 147 | ||
136 | if (tCodigoBarras.text.isNullOrBlank()) { | 148 | if (tCodigoBarras.text.isNullOrBlank()) { |
137 | tCodigoBarras.error = "No puede estar vacio" | 149 | tCodigoBarras.error = "No puede estar vacio" |
138 | tCodigoBarras.requestFocus() | 150 | tCodigoBarras.requestFocus() |
139 | tCodigoBarras.hint = "No puede estar vacio" | 151 | tCodigoBarras.hint = "No puede estar vacio" |
140 | } else if (tCodigoBarras.text.toString().length < 4 && iEstado == 2) { | 152 | } else if (tCodigoBarras.text.toString().length < 4 && iEstado == 2) { |
141 | tCodigoBarras.error = "Minimo 4 caracteres" | 153 | tCodigoBarras.error = "Minimo 4 caracteres" |
142 | tCodigoBarras.requestFocus() | 154 | tCodigoBarras.requestFocus() |
143 | tCodigoBarras.hint = "4 Minimo" | 155 | tCodigoBarras.hint = "4 Minimo" |
144 | 156 | ||
145 | } else { | 157 | } else { |
146 | 158 | tCodigoBarras.hint = "" | |
147 | //TODO COMIENZA LA BUSQUEDA POR CODIGO DE BARRAS | 159 | //TODO COMIENZA LA BUSQUEDA POR CODIGO DE BARRAS |
148 | when (iBusquedaPor) { | 160 | when (iBusquedaPor) { |
149 | 0 -> { | 161 | 0 -> { |
150 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 162 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
151 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 163 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
152 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 164 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
153 | 165 | ||
154 | GlobalScope.launch(Dispatchers.Main) { | 166 | if (sharedPreferences.contains("cbHabiLectura")) { |
167 | if (sharedPreferences.getString("cbHabiLectura", "").toString() == "1") { | ||
168 | if (sChangeUpper.length == 13) | ||
169 | if (sChangeUpper.substring(0, 2) == "20" && sChangeUpper.substring(12, 13) == "2") { | ||
170 | EsBalanza=true | ||
171 | sectorBalanza = sChangeUpper.substring(2, 4).toInt() | ||
172 | codigoBalanza = sChangeUpper.substring(4, 7).toInt() | ||
173 | cantEnteraBalanza = sChangeUpper.substring(7, 9).toInt() | ||
174 | cantDecimalBalanza = sChangeUpper.substring(9, 12).toInt() | ||
175 | } | ||
176 | } | ||
177 | } | ||
178 | GlobalScope.launch(Main) { | ||
155 | indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 0)//TODO Si encuentra el articulo en el RV devuelve el indice | 179 | indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 0)//TODO Si encuentra el articulo en el RV devuelve el indice |
156 | //TODO (Si no lo encuentra devuelve -1) | 180 | //TODO (Si no lo encuentra devuelve -1) |
157 | if (indiceDelArtEncontrado != -1) { | 181 | if (indiceDelArtEncontrado != -1) { |
158 | if (swSumaUno!!.isChecked) { | 182 | if (!EsBalanza) { |
159 | // fCant = 0F | 183 | // //TODO ACTUALIZO LA CANTIDAD EN LA BD |
160 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 184 | // updateCantidad( |
161 | // fCant += 1F | 185 | // sectorBalanza.toString(), |
162 | //TODO ACTUALIZO LA CANTIDAD EN LA BD | 186 | // codigoBalanza.toString(), |
163 | updateCantidad( | 187 | // ("$cantEnteraBalanza.$cantDecimalBalanza").toFloat()) |
164 | listArticulos[indiceDelArtEncontrado].sector.toString(), | 188 | // //TODO ACTUALIZO LA CANTIDAD EN EL RV |
165 | listArticulos[indiceDelArtEncontrado].codigo.toString(), | 189 | // listArticulos[indiceDelArtEncontrado].cantTomada = ("$cantEnteraBalanza.$cantDecimalBalanza").toFloat() |
166 | listArticulos[indiceDelArtEncontrado].cantTomada + 1 | 190 | // viewAdapter.notifyDataSetChanged() |
167 | ) | 191 | // }else{ |
168 | //TODO ACTUALIZO LA CANTIDAD EN EL RV | 192 | if (swSumaUno!!.isChecked) { |
169 | listArticulos[indiceDelArtEncontrado].cantTomada = listArticulos[indiceDelArtEncontrado].cantTomada + 1 | 193 | //TODO ACTUALIZO LA CANTIDAD EN LA BD |
170 | viewAdapter.notifyDataSetChanged() | 194 | updateCantidad( |
171 | } else { | 195 | listArticulos[indiceDelArtEncontrado].sector.toString(), |
172 | dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) | 196 | listArticulos[indiceDelArtEncontrado].codigo.toString(), |
197 | listArticulos[indiceDelArtEncontrado].cantTomada + 1 | ||
198 | ) | ||
199 | //TODO ACTUALIZO LA CANTIDAD EN EL RV | ||
200 | listArticulos[indiceDelArtEncontrado].cantTomada = listArticulos[indiceDelArtEncontrado].cantTomada + 1 | ||
201 | viewAdapter.notifyDataSetChanged() | ||
202 | |||
203 | } else { | ||
204 | dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) | ||
205 | } | ||
173 | } | 206 | } |
174 | |||
175 | } else if (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD | 207 | } else if (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD |
176 | //TODO BUSCO EN BASE DE DATOS | 208 | //TODO BUSCO EN BASE DE DATOS |
177 | val artEncontrado = buscarCBEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | 209 | val artEncontrado:Articles? = if (EsBalanza) { |
210 | buscarCodigoDeboEnBD(sectorBalanza.toString(), codigoBalanza.toString()) | ||
211 | }else{ | ||
212 | buscarCBEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | ||
213 | } | ||
178 | continuarCargaCB(artEncontrado)//TODO SE MANDA CERO POR QUE ES UN ARTICULO ESCANEADO NUEVO PARA QUE SEA COMPATIBLE | 214 | continuarCargaCB(artEncontrado)//TODO SE MANDA CERO POR QUE ES UN ARTICULO ESCANEADO NUEVO PARA QUE SEA COMPATIBLE |
179 | } | 215 | } |
180 | tCodigoBarras.focusable = View.FOCUSABLE | 216 | etCodigoBarras.requestFocus() |
181 | tCodigoBarras.setText("") | 217 | tCodigoBarras.setText("") |
182 | tCodigoBarras.selectAll() | 218 | tCodigoBarras.selectAll() |
183 | } | 219 | } |
184 | return@setOnKeyListener true | 220 | return@setOnKeyListener true |
185 | 221 | ||
186 | 222 | ||
187 | } | 223 | } |
188 | 1 -> {//TODO: BUSQUEDA POR DESCRIPCION************************************************************************** | 224 | 1 -> {//TODO: BUSQUEDA POR DESCRIPCION************************************************************************** |
189 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 225 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
190 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 226 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
191 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 227 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
192 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 1) //TODO :Si encuentra el articulo en el RV devuelve el indice | 228 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 1) //TODO :Si encuentra el articulo en el RV devuelve el indice |
193 | // //TODO Si no lo encuentra devuelve -1 | 229 | // //TODO Si no lo encuentra devuelve -1 |
194 | // if (indiceDelArtEncontrado != -1) { | 230 | // if (indiceDelArtEncontrado != -1) { |
195 | //// if (swSumaUno!!.isChecked) { | 231 | //// if (swSumaUno!!.isChecked) { |
196 | //// fCant = 0F | 232 | //// fCant = 0F |
197 | //// fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 233 | //// fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
198 | //// fCant += 1F | 234 | //// fCant += 1F |
199 | //// listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 235 | //// listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
200 | //// viewAdapter.notifyDataSetChanged() | 236 | //// viewAdapter.notifyDataSetChanged() |
201 | //// } else { | 237 | //// } else { |
202 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 238 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
203 | // MaterialDialog(requireContext()).show { | 239 | // MaterialDialog(requireContext()).show { |
204 | // title(R.string.sTituloNueva) | 240 | // title(R.string.sTituloNueva) |
205 | // message(R.string.sCantidadNueva) | 241 | // message(R.string.sCantidadNueva) |
206 | // input { materialDialog, charSequence -> | 242 | // input { materialDialog, charSequence -> |
207 | // fCant = 0F | 243 | // fCant = 0F |
208 | // fCant = charSequence.toString().toFloat() | 244 | // fCant = charSequence.toString().toFloat() |
209 | // } | 245 | // } |
210 | // positiveButton(R.string.btnOk) { | 246 | // positiveButton(R.string.btnOk) { |
211 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 247 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
212 | // viewAdapter.notifyDataSetChanged() | 248 | // viewAdapter.notifyDataSetChanged() |
213 | // dismiss() | 249 | // dismiss() |
214 | // } | 250 | // } |
215 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 251 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
216 | //// } | 252 | //// } |
217 | // | 253 | // |
218 | // } else if | 254 | // } else if |
219 | // (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD | 255 | // (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD |
220 | GlobalScope.launch(Dispatchers.Main) { | 256 | GlobalScope.launch(Main) { |
221 | val artEncontrado = buscarDescEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | 257 | val artEncontrado = buscarDescEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) |
222 | continuarCargaDesc(artEncontrado as ArrayList<Articles>) | 258 | continuarCargaDesc(artEncontrado as ArrayList<Articles>) |
223 | } | 259 | } |
224 | 260 | ||
261 | ivCamara.setImageResource(R.drawable.codbar) | ||
262 | etCodigoBarras.hint = "Busqueda por Código de Barras" | ||
263 | swSumaUno.visibility = View.VISIBLE | ||
225 | iBusquedaPor = 0 | 264 | iBusquedaPor = 0 |
265 | iEstado = 0 | ||
266 | bFirst = false | ||
226 | // } | 267 | // } |
227 | 268 | ||
228 | return@setOnKeyListener true | 269 | return@setOnKeyListener true |
229 | } | 270 | } |
230 | 2 -> {//TODO: BUSQUEDA POR CODIGO DE ORIGEN************************************************************************** | 271 | 2 -> {//TODO: BUSQUEDA POR CODIGO DE ORIGEN************************************************************************** |
231 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 272 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
232 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 273 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
233 | 274 | ||
234 | // GlobalScope.launch(Dispatchers.Main) { | 275 | // GlobalScope.launch(Dispatchers.Main) { |
235 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 2)//TODO Si encuentra el articulo en el RV devuelve el indice | 276 | // indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 2)//TODO Si encuentra el articulo en el RV devuelve el indice |
236 | //// //TODO Si no lo encuentra devuelve -1 | 277 | //// //TODO Si no lo encuentra devuelve -1 |
237 | // if (indiceDelArtEncontrado != -1) { | 278 | // if (indiceDelArtEncontrado != -1) { |
238 | // if (swSumaUno!!.isChecked) { | 279 | // if (swSumaUno!!.isChecked) { |
239 | // fCant = 0F | 280 | // fCant = 0F |
240 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 281 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
241 | // fCant += 1F | 282 | // fCant += 1F |
242 | // //TODO ACTUALIZO LA CANTIDAD EN LA BD | 283 | // //TODO ACTUALIZO LA CANTIDAD EN LA BD |
243 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 284 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
244 | // //TODO ACTUALIZO LA CANTIDAD EN EL RV | 285 | // //TODO ACTUALIZO LA CANTIDAD EN EL RV |
245 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 286 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
246 | // viewAdapter.notifyDataSetChanged() | 287 | // viewAdapter.notifyDataSetChanged() |
247 | // } else { | 288 | // } else { |
248 | // dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) | 289 | // dialogoSumaResta(requireContext(), indiceDelArtEncontrado, listArticulos[indiceDelArtEncontrado].univta, false) |
249 | // } | 290 | // } |
250 | // } else { | 291 | // } else { |
251 | // val mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | 292 | // val mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) |
252 | // val mBuilder = | 293 | // val mBuilder = |
253 | // AlertDialog.Builder(context).setView(mDialogView).setTitle("Producto '${listArticulos[indiceDelArtEncontrado].descripcion}', se encuentra cargado.") | 294 | // AlertDialog.Builder(context).setView(mDialogView).setTitle("Producto '${listArticulos[indiceDelArtEncontrado].descripcion}', se encuentra cargado.") |
254 | // .setCancelable(false) | 295 | // .setCancelable(false) |
255 | // mDialogView.tvCantInicial.text = listArticulos[indiceDelArtEncontrado].cantTomada.toString() | 296 | // mDialogView.tvCantInicial.text = listArticulos[indiceDelArtEncontrado].cantTomada.toString() |
256 | // val mAlertDialog = mBuilder.show() | 297 | // val mAlertDialog = mBuilder.show() |
257 | // mDialogView.rbSumar.setOnClickListener { | 298 | // mDialogView.rbSumar.setOnClickListener { |
258 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 299 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
259 | // mDialogView.tvgenerico4.text = (mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() | 300 | // mDialogView.tvgenerico4.text = (mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() |
260 | // } | 301 | // } |
261 | // } | 302 | // } |
262 | // mDialogView.rbRestar.setOnClickListener { | 303 | // mDialogView.rbRestar.setOnClickListener { |
263 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 304 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
264 | // if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { | 305 | // if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { |
265 | // mDialogView.tvgenerico4.text = | 306 | // mDialogView.tvgenerico4.text = |
266 | // (mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() | 307 | // (mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() |
267 | // } | 308 | // } |
268 | // } | 309 | // } |
269 | // } | 310 | // } |
270 | // mDialogView.rbMdodificar.setOnClickListener { | 311 | // mDialogView.rbMdodificar.setOnClickListener { |
271 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 312 | // if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
272 | // mDialogView.tvgenerico4.text = (mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() | 313 | // mDialogView.tvgenerico4.text = (mDialogView.tvNuevaCantidad.text.toString().toFloat()).toString() |
273 | // } | 314 | // } |
274 | // } | 315 | // } |
275 | // mDialogView.btnAceptar.setOnClickListener { | 316 | // mDialogView.btnAceptar.setOnClickListener { |
276 | // mAlertDialog.dismiss() | 317 | // mAlertDialog.dismiss() |
277 | // val name = mDialogView.tvgenerico4.text.toString().toFloat() | 318 | // val name = mDialogView.tvgenerico4.text.toString().toFloat() |
278 | // fCant = 0F | 319 | // fCant = 0F |
279 | // fCant = name | 320 | // fCant = name |
280 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 321 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
281 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 322 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
282 | // viewAdapter.notifyDataSetChanged() | 323 | // viewAdapter.notifyDataSetChanged() |
283 | // } | 324 | // } |
284 | // mDialogView.dialogCancelBtn.setOnClickListener { | 325 | // mDialogView.dialogCancelBtn.setOnClickListener { |
285 | // mAlertDialog.dismiss() | 326 | // mAlertDialog.dismiss() |
286 | // } | 327 | // } |
287 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada | 328 | // fCant = listArticulos[indiceDelArtEncontrado].cantTomada |
288 | // val type = InputType.TYPE_CLASS_NUMBER | 329 | // val type = InputType.TYPE_CLASS_NUMBER |
289 | // MaterialDialog(requireContext()).show { | 330 | // MaterialDialog(requireContext()).show { |
290 | // | 331 | // |
291 | // title(text = "Producto '$sChangeUpper', se encuentra cargado.") | 332 | // title(text = "Producto '$sChangeUpper', se encuentra cargado.") |
292 | // message(R.string.sCantidadNueva) | 333 | // message(R.string.sCantidadNueva) |
293 | // input(waitForPositiveButton = false, hint = "99.99", inputType = type) { materialDialog, charSequence -> | 334 | // input(waitForPositiveButton = false, hint = "99.99", inputType = type) { materialDialog, charSequence -> |
294 | // fCant = 0F | 335 | // fCant = 0F |
295 | // fCant = charSequence.toString().toFloat() | 336 | // fCant = charSequence.toString().toFloat() |
296 | // } | 337 | // } |
297 | // positiveButton(R.string.btnOk) { | 338 | // positiveButton(R.string.btnOk) { |
298 | // //TODO ACTUALIZO CANTIADAD EN BD | 339 | // //TODO ACTUALIZO CANTIADAD EN BD |
299 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) | 340 | // updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant) |
300 | // //TODO ACTUALIZO CANTIDAD EN RV | 341 | // //TODO ACTUALIZO CANTIDAD EN RV |
301 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant | 342 | // listArticulos[indiceDelArtEncontrado].cantTomada = fCant |
302 | // viewAdapter.notifyDataSetChanged() | 343 | // viewAdapter.notifyDataSetChanged() |
303 | // dismiss() | 344 | // dismiss() |
304 | // } | 345 | // } |
305 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 346 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
306 | // } | 347 | // } |
307 | // } else if (indiceDelArtEncontrado == -1) { | 348 | // } else if (indiceDelArtEncontrado == -1) { |
308 | // no lo encontro en el RV, lo va a buscar en al BD | 349 | // no lo encontro en el RV, lo va a buscar en al BD |
309 | 350 | ||
310 | GlobalScope.launch(Dispatchers.Main) { | 351 | GlobalScope.launch(Dispatchers.Main) { |
311 | //TODO BUSCO EN BASE DE DATOS | 352 | //TODO BUSCO EN BASE DE DATOS |
312 | val artEncontrado = buscarCodiogoOriEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) | 353 | val artEncontrado = buscarCodiogoOriEnBD(sChangeUpper.toUpperCase(Locale.ROOT)) |
313 | continuarCargaCodigoOri(artEncontrado) | 354 | continuarCargaCodigoOri(artEncontrado) |
314 | } | 355 | } |
356 | ivCamara.setImageResource(R.drawable.codbar) | ||
357 | etCodigoBarras.hint = "Busqueda por Código de Barras" | ||
358 | swSumaUno.visibility = View.VISIBLE | ||
315 | iBusquedaPor = 0 | 359 | iBusquedaPor = 0 |
360 | iEstado = 0 | ||
361 | bFirst = false | ||
362 | |||
316 | // } | 363 | // } |
317 | // } | 364 | // } |
318 | return@setOnKeyListener true | 365 | return@setOnKeyListener true |
319 | } | 366 | } |
320 | } | 367 | } |
321 | } | 368 | } |
322 | } | 369 | } |
323 | return@setOnKeyListener false | 370 | return@setOnKeyListener false |
324 | } | 371 | } |
325 | return v | 372 | return v |
326 | } | 373 | } |
327 | 374 | ||
328 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 375 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
329 | super.onViewCreated(view, savedInstanceState) | 376 | super.onViewCreated(view, savedInstanceState) |
330 | navController = Navigation.findNavController(view) | 377 | navController = Navigation.findNavController(view) |
331 | etCodigoBarras.requestFocus() | 378 | etCodigoBarras.requestFocus() |
332 | // val modalDialog = NoEncontradoSimple() | 379 | // val modalDialog = NoEncontradoSimple() |
333 | // modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 380 | // modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
334 | 381 | ||
335 | btnBorrarInv.setOnClickListener { | 382 | btnBorrarInv.setOnClickListener { |
336 | AlertDialog.Builder(requireContext()).setTitle("Eliminación de Inventarios").setMessage("¿Confirma que desea eliminar el inventario?") | 383 | AlertDialog.Builder(requireContext()).setTitle("Eliminación de Inventarios").setMessage("¿Confirma que desea eliminar el inventario?") |
337 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> | 384 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> |
338 | borrarInvActual() | 385 | borrarInvActualCabecera() |
339 | Toast.makeText(requireContext(), "El inventario $(inventarioViewModel as InventarioViewModel).InventarioNuevo fue Borrado", Toast.LENGTH_LONG).show() | 386 | borrarInvActualCuerpo() |
387 | Toast.makeText(requireContext(), "El inventario fue Borrado", Toast.LENGTH_LONG).show() | ||
340 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) | 388 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) |
341 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = 0 | 389 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = 0 |
342 | 390 | ||
343 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> | 391 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> |
344 | //botón cancel pulsado | 392 | //botón cancel pulsado |
345 | }).show() | 393 | }).show() |
346 | } | 394 | } |
347 | 395 | ||
348 | btnExportarInv.setOnClickListener { | 396 | btnExportarInv.setOnClickListener { |
349 | AlertDialog.Builder(requireContext()).setTitle(R.string.sTituloExportar).setMessage(R.string.sMensajeExportar) | 397 | AlertDialog.Builder(requireContext()).setTitle(R.string.sTituloExportar).setMessage(R.string.sMensajeExportar) |
350 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> | 398 | .setPositiveButton(R.string.btnOk, DialogInterface.OnClickListener { dialog, which -> |
351 | if (preparaInvParaExportar((inventarioViewModel as InventarioViewModel).InventarioNuevo )) { | 399 | preparaInvParaExportar((inventarioViewModel as InventarioViewModel).InventarioNuevo) |
352 | borrarInvActual() | ||
353 | Toast.makeText(requireContext(), "El inventario $(inventarioViewModel as InventarioViewModel).InventarioNuevo fue Exportado al Servidor", Toast.LENGTH_LONG).show() | ||
354 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) | ||
355 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = 0 | ||
356 | } else { | ||
357 | Toast.makeText(requireContext(), "No se pudo realizar la exportación, Intente mas tarde.", Toast.LENGTH_LONG).show() | ||
358 | } | ||
359 | |||
360 | |||
361 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> }).show() | 400 | }).setNegativeButton(R.string.btnCancelar, DialogInterface.OnClickListener { dialog, which -> }).show() |
362 | } | 401 | } |
363 | ivCamara.setOnClickListener { | 402 | ivCamara.setOnClickListener { |
364 | if (!bFirst) { | 403 | if (!bFirst) { |
365 | iEstado = 1 | 404 | iEstado = 1 |
366 | bFirst = true | 405 | bFirst = true |
367 | } | 406 | } |
368 | 407 | ||
369 | when (iEstado) { | 408 | when (iEstado) { |
370 | 0 -> { | 409 | 0 -> { |
371 | ivCamara.setImageResource(R.drawable.codbar) | 410 | ivCamara.setImageResource(R.drawable.codbar) |
372 | etCodigoBarras.hint = "Busqueda por Código de Barras" | 411 | etCodigoBarras.hint = "Busqueda por Código de Barras" |
373 | swSumaUno.visibility = View.VISIBLE | 412 | swSumaUno.visibility = View.VISIBLE |
374 | iBusquedaPor = 0 | 413 | iBusquedaPor = 0 |
375 | iEstado = 1 | 414 | iEstado = 1 |
376 | } | 415 | } |
377 | 1 -> { | 416 | 1 -> { |
378 | ivCamara.setImageResource(R.drawable.desc) | 417 | ivCamara.setImageResource(R.drawable.desc) |
379 | etCodigoBarras.hint = "Busqueda por Descripción" | 418 | etCodigoBarras.hint = "Busqueda por Descripción" |
380 | swSumaUno.visibility = View.GONE | 419 | swSumaUno.visibility = View.GONE |
381 | iBusquedaPor = 1 | 420 | iBusquedaPor = 1 |
382 | iEstado = 2 | 421 | iEstado = 2 |
383 | } | 422 | } |
384 | 2 -> { | 423 | 2 -> { |
385 | ivCamara.setImageResource(R.drawable.cod_origen) | 424 | ivCamara.setImageResource(R.drawable.cod_origen) |
386 | etCodigoBarras.hint = "Busqueda por Código de Origen" | 425 | etCodigoBarras.hint = "Busqueda por Código de Origen" |
387 | swSumaUno.visibility = View.GONE | 426 | swSumaUno.visibility = View.GONE |
388 | iBusquedaPor = 2 | 427 | iBusquedaPor = 2 |
389 | iEstado = 0 | 428 | iEstado = 0 |
390 | } | 429 | } |
391 | } | 430 | } |
392 | } | 431 | } |
393 | } | 432 | } |
394 | 433 | ||
395 | private fun preparaInvParaExportar(inventario: Int): Boolean { | 434 | private fun preparaInvParaExportar(inventario: Int) { |
396 | var bExporto = false | 435 | |
397 | GlobalScope.launch(Main) { | 436 | var fecInicio: String |
398 | val aEnviar: ArrayList<InvToSend>? = arrayListOf<InvToSend>() | 437 | var lug: Int |
438 | var itomInvC: ItomInvC | ||
439 | lifecycleScope.launch(Main) { | ||
440 | // fragmentScopeInvFrag.launch(Main) { | ||
441 | |||
399 | val datosCabecera = foundInvHeadDB(inventario) | 442 | val datosCabecera = foundInvHeadDB(inventario) |
400 | val datosCuerpo = foundInvBodyBD(inventario) | 443 | val datosCuerpo = foundInvBodyBD(inventario) |
444 | fecInicio = datosCabecera.fechaInicio.toString() | ||
445 | var fecActual: String = "${obtenerFechaActual()}" | ||
446 | fecActual = "$fecActual" | ||
447 | lug = if (datosCabecera.lugar!!) 1 else 0 | ||
448 | itomInvC = ItomInvC(fecInicio, fecActual, lug) | ||
449 | serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne() | ||
450 | exportarInventarioHead(itomInvC, datosCuerpo) | ||
451 | |||
401 | 452 | ||
402 | for (cuerpo in datosCuerpo) { | 453 | } |
403 | val temp=InvToSend(datosCabecera.fechaInicio, datosCabecera.fechaFinal, if (datosCabecera.lugar!!) 1 else 0, cuerpo.sector, cuerpo.codigo, cuerpo.descripcion, cuerpo.cantTomada, cuerpo.fechaInicio, cuerpo.fechaFinal) | 454 | } |
404 | aEnviar!!.add(temp) | 455 | |
456 | private fun exportarInventarioHead(aEnviar: ItomInvC, datosCuerpo: List<InvBody>) { | ||
457 | var exporto = false | ||
458 | if (serverBajada != null) { | ||
459 | |||
460 | if (serverBajada!!.direccion.isNullOrEmpty()) { | ||
461 | val modalDialog = NoServerConf() | ||
462 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
463 | } else { | ||
464 | BASE_URL = serverBajada!!.direccion.toString() + ":" + serverBajada!!.puertoSubida.toString() + "/" | ||
465 | try { | ||
466 | ItomInv.request.insertarItominvc(aEnviar) | ||
467 | .enqueue(object : Callback<DefaultResponse> { | ||
468 | override fun onResponse(call: Call<DefaultResponse>, response: Response<DefaultResponse>) { | ||
469 | lifecycleScope.launch(Main) { | ||
470 | loading_view.visibility=View.VISIBLE | ||
471 | if(exportarInventarioBody(datosCuerpo)) { | ||
472 | borrarInvActualCabecera() | ||
473 | borrarInvActualCuerpo() | ||
474 | loading_view.visibility = View.INVISIBLE | ||
475 | |||
476 | navController.navigate(R.id.action_inventarioFragment_to_mainFragment2) | ||
477 | (inventarioViewModel as InventarioViewModel).InventarioNuevo = 0 | ||
478 | |||
479 | val modalDialog = ExportacionExitosa() | ||
480 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
481 | }else { | ||
482 | loading_view.visibility = View.INVISIBLE | ||
483 | val modalDialog = ExportacionFracasada() | ||
484 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
485 | } | ||
486 | } | ||
487 | } | ||
488 | |||
489 | override fun onFailure(call: Call<DefaultResponse>, t: Throwable) { | ||
490 | val modalDialog = ExportacionFracasada() | ||
491 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
492 | } | ||
493 | }) | ||
494 | |||
495 | } catch (e: RuntimeException) { | ||
496 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() | ||
497 | } catch (e: Error) { | ||
498 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() | ||
499 | } catch (e: ErrnoException) { | ||
500 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() | ||
501 | } catch (e: InternalError) { | ||
502 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() | ||
503 | } catch (e: IOException) { | ||
504 | Toast.makeText(context, "Error ${e.message}", Toast.LENGTH_LONG).show() | ||
505 | } catch (e: SocketTimeoutException) { | ||
506 | Toast.makeText(requireContext(), e.message, Toast.LENGTH_SHORT).show() | ||
507 | } | ||
405 | } | 508 | } |
406 | // exportarInventario(aEnviar!!) | 509 | } else { |
407 | bExporto = true | 510 | val modalDialog = ServerNoConf() |
511 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
408 | } | 512 | } |
409 | return bExporto | ||
410 | } | 513 | } |
411 | 514 | ||
412 | // private fun exportarInventario(aEnviar: List<InvToSend>) { | 515 | private fun exportarInventarioBody(datosCuerpo: List<InvBody>):Boolean { |
413 | // | 516 | |
414 | // val call: Call<Void?>? = WebService | 517 | |
415 | // .getInstance() | 518 | for (cuerpo in datosCuerpo) { |
416 | // ?.createService(WebServiceApi::class.java) | 519 | val aEnviar: ItomInvD = ItomInvD( |
417 | // ?.inventarioToSend(aEnviar) | 520 | cuerpo.sector.toString(), |
418 | // | 521 | cuerpo.codigo.toString(), |
419 | // call!!.enqueue(object : Callback<Void?> { | 522 | cuerpo.descripcion.toString(), |
420 | // override fun onResponse(call: Call<Void?>?, response: Response<Void?>) { | 523 | cuerpo.cantTomada.toString(), |
421 | // if (response.code() == 201) { | 524 | cuerpo.fechaInicio.toString(), |
422 | // val modalDialog = ExportacionExitosa() | 525 | cuerpo.fechaFinal.toString() |
423 | // modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 526 | ) |
424 | // } | 527 | |
425 | // if (response.code() == 409) { | 528 | ItomInv.request.insertarItominvd(aEnviar) |
529 | .enqueue(object : Callback<Void?> { | ||
530 | override fun onResponse(call: Call<Void?>, response: Response<Void?>) {} | ||
531 | override fun onFailure(call: Call<Void?>, t: Throwable) {} | ||
532 | // val call: Call<Void?>? = WebService.instance | ||
533 | // ?.createService(WebServiceApi::class.java) | ||
534 | // ?.insertarItominvd(aEnviar) | ||
535 | // call?.enqueue(object : Callback<Void?> { | ||
536 | // override fun onResponse(call: Call<Void?>, response: Response<Void?>) { | ||
537 | // if (response.code() == 200) { } | ||
538 | // if (response.code() == 400) { } | ||
426 | // } | 539 | // } |
427 | // } | 540 | // override fun onFailure(call: Call<Void?>?, t: Throwable?) {} |
428 | // | 541 | }) |
429 | // override fun onFailure(call: Call<Void?>?, t: Throwable?) {} | 542 | |
430 | // }) | 543 | } |
431 | // | 544 | return true |
432 | // } | 545 | } |
433 | 546 | ||
434 | private suspend fun foundInvHeadDB(inv: Int): InvHead { | 547 | private suspend fun foundInvHeadDB(inv: Int): InvHead { |
435 | var busqueda: InvHead | 548 | var busqueda: InvHead |
436 | return GlobalScope.async(IO) { | 549 | return GlobalScope.async(IO) { |
437 | busqueda = AppDb.getAppDb(requireContext())!!.InvHeadDAO()!!.foundInvHead(inv) | 550 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.InvHeadDAO()!!.foundInvHead(inv) |
438 | return@async busqueda | 551 | return@async busqueda |
439 | }.await() | 552 | }.await() |
440 | } | 553 | } |
441 | 554 | ||
442 | private suspend fun foundInvBodyBD(inv: Int): List<InvBody> { | 555 | private suspend fun foundInvBodyBD(inv: Int): List<InvBody> { |
443 | var busqueda: List<InvBody> | 556 | var busqueda: List<InvBody> |
444 | return GlobalScope.async(IO) { | 557 | return GlobalScope.async(IO) { |
445 | busqueda = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.fetchAllInvBody(inv) | 558 | busqueda = AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.fetchAllInvBody(inv) |
446 | return@async busqueda | 559 | return@async busqueda |
447 | }.await() | 560 | }.await() |
448 | } | 561 | } |
449 | 562 | ||
450 | private fun borrarInvActual() { | 563 | private fun borrarInvActualCabecera() { |
451 | lifecycleScope.launch { | 564 | GlobalScope.launch(IO) { |
452 | withContext(Dispatchers.IO) { | 565 | AppDb.getAppDb(requireContext())!!.InvHeadDAO()!!.deleteinvHead((inventarioViewModel as InventarioViewModel).InventarioNuevo) |
453 | AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.deleteinvHead((inventarioViewModel as InventarioViewModel).InventarioNuevo) | 566 | } |
454 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.deleteInvBody((inventarioViewModel as InventarioViewModel).InventarioNuevo) | 567 | } |
455 | } | 568 | |
569 | private fun borrarInvActualCuerpo() { | ||
570 | GlobalScope.launch(IO) { | ||
571 | AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.deleteInvBody((inventarioViewModel as InventarioViewModel).InventarioNuevo) | ||
456 | } | 572 | } |
457 | } | 573 | } |
458 | 574 | ||
459 | private fun cargarDeBdInventario(ultimoInv: Int) { | 575 | private fun cargarDeBdInventario(ultimoInv: Int) { |
460 | GlobalScope.launch(Main) { | 576 | GlobalScope.launch(Main) { |
461 | val invbody = cargarInventario(ultimoInv) | 577 | val invbody = cargarInventario(ultimoInv) |
462 | for ((i, _) in invbody!!.withIndex()) { | 578 | for ((i, _) in invbody!!.withIndex()) { |
463 | val art = Articles( | 579 | val art = Articles( |
464 | invbody[i].sector, | 580 | invbody[i].sector, |
465 | invbody[i].codigo, | 581 | invbody[i].codigo, |
466 | invbody[i].descripcion, | 582 | invbody[i].descripcion, |
467 | invbody[i].codBar, | 583 | invbody[i].codBar, |
468 | invbody[i].codOrigen, | 584 | invbody[i].codOrigen, |
469 | invbody[i].precio, | 585 | invbody[i].precio, |
470 | invbody[i].costo, | 586 | invbody[i].costo, |
471 | "", | 587 | "", |
472 | "", | 588 | "", |
473 | "", | 589 | "", |
474 | invbody[i].balanza, | 590 | invbody[i].balanza, |
475 | invbody[i].depSn, | 591 | invbody[i].depSn, |
476 | invbody[i].costo | 592 | invbody[i].costo |
477 | ) | 593 | ) |
478 | cargarRecicler(art, invbody[i].cantTomada!!.toFloat()) | 594 | cargarRecicler(art, invbody[i].cantTomada!!.toFloat()) |
479 | } | 595 | } |
480 | } | 596 | } |
481 | } | 597 | } |
482 | 598 | ||
483 | private fun continuarCargaCodigoOri(artAcargar: List<Articles>) { | 599 | private fun continuarCargaCodigoOri(artAcargar: List<Articles>) { |
484 | 600 | ||
485 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD | 601 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD |
486 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 602 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
487 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 603 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
488 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 604 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
489 | 605 | ||
490 | var bundle = Bundle() | 606 | var bundle = Bundle() |
491 | bundle = bundleOf("ArrayDesc" to artAcargar) | 607 | bundle = bundleOf("ArrayDesc" to artAcargar) |
492 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) | 608 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) |
493 | navController.navigate(R.id.action_inventarioFragment_to_codigoOriFragment, bundle) | 609 | navController.navigate(R.id.action_inventarioFragment_to_codigoOriFragment, bundle) |
494 | 610 | ||
495 | } else {//TODO si no lo encuentra en la BD | 611 | } else {//TODO si no lo encuentra en la BD |
496 | val modalDialog = NoEncontradoSimple() | 612 | val modalDialog = NoEncontradoSimple() |
497 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 613 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
498 | } | 614 | } |
499 | etCodigoBarras.focusable = View.FOCUSABLE | 615 | // etCodigoBarras.focusable = View.FOCUSABLE |
616 | etCodigoBarras.requestFocus() | ||
500 | etCodigoBarras.setText("") | 617 | etCodigoBarras.setText("") |
501 | etCodigoBarras.selectAll() | 618 | etCodigoBarras.selectAll() |
502 | } | 619 | } |
503 | 620 | ||
504 | private fun continuarCargaDesc(artAcargar: ArrayList<Articles>) { | 621 | private fun continuarCargaDesc(artAcargar: ArrayList<Articles>) { |
505 | //TODO DESPUES DE INGRESAR LA DESCRIPCION Y DE BUSCAR LOS CAINCIDENCIAS EN LA BASE SE VA A MOSTRAR LAS MISMAS | 622 | //TODO DESPUES DE INGRESAR LA DESCRIPCION Y DE BUSCAR LOS CAINCIDENCIAS EN LA BASE SE VA A MOSTRAR LAS MISMAS |
506 | //TODO SI LA CANTIDAD ENCONTRADA ES UNO, LO CARGO DIRECTAMENTE EN EL RV | 623 | //TODO SI LA CANTIDAD ENCONTRADA ES UNO, LO CARGO DIRECTAMENTE EN EL RV |
507 | 624 | ||
508 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD | 625 | if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD |
509 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV | 626 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV |
510 | // fCant = 0F | 627 | // fCant = 0F |
511 | // fCant += 1F | 628 | // fCant += 1F |
512 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV | 629 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV |
513 | // val acargarPorDesc = Articles(artAcargar[0].sector, | 630 | // val acargarPorDesc = Articles(artAcargar[0].sector, |
514 | // artAcargar[0].codigo, | 631 | // artAcargar[0].codigo, |
515 | // artAcargar[0].descripcion, | 632 | // artAcargar[0].descripcion, |
516 | // artAcargar[0].codBar, | 633 | // artAcargar[0].codBar, |
517 | // artAcargar[0].codOrigen, | 634 | // artAcargar[0].codOrigen, |
518 | // artAcargar[0].precio, | 635 | // artAcargar[0].precio, |
519 | // artAcargar[0].costo, | 636 | // artAcargar[0].costo, |
520 | // "", | 637 | // "", |
521 | // "", | 638 | // "", |
522 | // "", | 639 | // "", |
523 | // artAcargar[0].balanza, | 640 | // artAcargar[0].balanza, |
524 | // artAcargar[0].depSn, | 641 | // artAcargar[0].depSn, |
525 | // "") | 642 | // "") |
526 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD | 643 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD |
527 | // cargarArtEnBd(acargarPorDesc, fCant) | 644 | // cargarArtEnBd(acargarPorDesc, fCant) |
528 | // cargarRecicler(acargarPorDesc, fCant) | 645 | // cargarRecicler(acargarPorDesc, fCant) |
529 | // } else { | 646 | // } else { |
530 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER | 647 | // TODO: ESCONDE EL TECLADO VIRTUAL AL PRESIONAR ENTER |
531 | val imm = requireActivity().getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? | 648 | val imm = (activity as MainActivity).getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager? |
532 | imm!!.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) | 649 | imm!!.hideSoftInputFromWindow((activity as MainActivity).currentFocus?.windowToken, InputMethodManager.HIDE_NOT_ALWAYS) |
533 | var bundle = Bundle() | 650 | var bundle = Bundle() |
534 | bundle = bundleOf("ArrayDesc" to artAcargar) | 651 | bundle = bundleOf("ArrayDesc" to artAcargar) |
535 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) | 652 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) |
536 | navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) | 653 | navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) |
537 | //navController.backStack.removeLast() | 654 | //navController.backStack.removeLast() |
538 | // } | 655 | // } |
539 | // } else {//SI NO ESTA +1 | 656 | // } else {//SI NO ESTA +1 |
540 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV | 657 | // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV |
541 | // fCant = listArticulos[0].cantTomada | 658 | // fCant = listArticulos[0].cantTomada |
542 | // MaterialDialog(requireContext()).show { | 659 | // MaterialDialog(requireContext()).show { |
543 | // title(R.string.sTituloNueva) | 660 | // title(R.string.sTituloNueva) |
544 | // message(R.string.sCantidadNueva) | 661 | // message(R.string.sCantidadNueva) |
545 | // input { materialDialog, charSequence -> | 662 | // input { materialDialog, charSequence -> |
546 | // fCant = 0F | 663 | // fCant = 0F |
547 | // fCant = charSequence.toString().toFloat() | 664 | // fCant = charSequence.toString().toFloat() |
548 | // } | 665 | // } |
549 | // positiveButton(R.string.btnOk) { | 666 | // positiveButton(R.string.btnOk) { |
550 | // listArticulos[0].cantTomada = fCant | 667 | // listArticulos[0].cantTomada = fCant |
551 | // viewAdapter.notifyDataSetChanged() | 668 | // viewAdapter.notifyDataSetChanged() |
552 | // dismiss() | 669 | // dismiss() |
553 | // } | 670 | // } |
554 | // }.cancelOnTouchOutside(false).cornerRadius(10F) | 671 | // }.cancelOnTouchOutside(false).cornerRadius(10F) |
555 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV | 672 | // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV |
556 | // val acargarPorDesc = Articles(artAcargar[0].sector, | 673 | // val acargarPorDesc = Articles(artAcargar[0].sector, |
557 | // artAcargar[0].codigo, | 674 | // artAcargar[0].codigo, |
558 | // artAcargar[0].descripcion, | 675 | // artAcargar[0].descripcion, |
559 | // artAcargar[0].codBar, | 676 | // artAcargar[0].codBar, |
560 | // artAcargar[0].cod_origen, | 677 | // artAcargar[0].cod_origen, |
561 | // artAcargar[0].precio, | 678 | // artAcargar[0].precio, |
562 | // artAcargar[0].costo, | 679 | // artAcargar[0].costo, |
563 | // artAcargar[0].balanza, | 680 | // artAcargar[0].balanza, |
564 | // artAcargar[0].depSn, | 681 | // artAcargar[0].depSn, |
565 | // "") | 682 | // "") |
566 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD | 683 | // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD |
567 | // cargarArtEnBd(acargarPorDesc, fCant) | 684 | // cargarArtEnBd(acargarPorDesc, fCant) |
568 | // cargarRecicler(acargarPorDesc, fCant) | 685 | // cargarRecicler(acargarPorDesc, fCant) |
569 | // } else { | 686 | // } else { |
570 | // var bundle = Bundle() | 687 | // var bundle = Bundle() |
571 | // bundle = bundleOf("ArrayDesc" to artAcargar) | 688 | // bundle = bundleOf("ArrayDesc" to artAcargar) |
572 | // bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) | 689 | // bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) |
573 | // navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) | 690 | // navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle) |
574 | // } | 691 | // } |
575 | // } | 692 | // } |
576 | } else {//TODO si no lo encuentra en la BD | 693 | } else {//TODO si no lo encuentra en la BD |
577 | val modalDialog = NoEncontradoSimple() | 694 | val modalDialog = NoEncontradoSimple() |
578 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 695 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
579 | } | 696 | } |
580 | etCodigoBarras.focusable = View.FOCUSABLE | 697 | // etCodigoBarras.focusable = View.FOCUSABLE |
698 | etCodigoBarras.requestFocus() | ||
581 | etCodigoBarras.setText("") | 699 | etCodigoBarras.setText("") |
582 | etCodigoBarras.selectAll() | 700 | etCodigoBarras.selectAll() |
583 | } | 701 | } |
584 | 702 | ||
585 | private fun continuarCargaCB(artAcargar: Articles?) { | 703 | private fun continuarCargaCB(artAcargar: Articles?) { |
586 | 704 | ||
587 | if (artAcargar != null) {// TODO: Si lo encuentra en la BD | 705 | if (artAcargar != null) { // TODO: Si lo encuentra en la BD |
588 | if (swSumaUno!!.isChecked) {//TODO: SI ESTA +1, PONE CANTIDAD 1 | 706 | if (EsBalanza) { |
589 | fCant = 0F | 707 | cargarArtEnBd(artAcargar, (Math.round(("$cantEnteraBalanza.$cantDecimalBalanza").toFloat() * 100.0) / 100.0).toFloat().toString()) |
590 | fCant += 1F | 708 | cargarRecicler(artAcargar, (Math.round(("$cantEnteraBalanza.$cantDecimalBalanza").toFloat() * 100.0) / 100.0).toFloat()) |
591 | cargarArtEnBd(artAcargar, String.format("%.3f", fCant)) | 709 | modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, true, requireContext()) |
592 | cargarRecicler(artAcargar, fCant) | 710 | EsBalanza=false |
593 | } else {//TODO: SI NO ESTA +1 PREGUNTA CANTIDAD | 711 | }else{ |
594 | 712 | if (swSumaUno!!.isChecked) {//TODO: SI ESTA +1, PONE CANTIDAD 1 | |
595 | dialogingresarCantidad(requireContext(), artAcargar) | 713 | fCant = 0F |
596 | 714 | fCant += 1F | |
715 | |||
716 | cargarArtEnBd(artAcargar, (Math.round(fCant * 100.0) / 100.0).toFloat().toString()) | ||
717 | cargarRecicler(artAcargar, (Math.round(fCant * 100.0) / 100.0).toFloat()) | ||
718 | } else {//TODO: SI NO ESTA +1 PREGUNTA CANTIDAD | ||
719 | dialogingresarCantidad(requireContext(), artAcargar) | ||
720 | } | ||
597 | } | 721 | } |
598 | } else {// TODO si no lo encuentra en la BD | 722 | } else {// TODO si no lo encuentra en la BD |
599 | val modalDialog = NoEncontradoSimple() | 723 | val modalDialog = NoEncontradoSimple() |
600 | modalDialog.show(requireActivity().supportFragmentManager, "confirmDialog") | 724 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") |
601 | } | 725 | } |
602 | etCodigoBarras.focusable = View.FOCUSABLE | 726 | etCodigoBarras.requestFocus() |
603 | etCodigoBarras.setText("") | 727 | etCodigoBarras.setText("") |
604 | etCodigoBarras.selectAll() | 728 | etCodigoBarras.selectAll() |
605 | } | 729 | } |
606 | 730 | ||
607 | fun dialogingresarCantidad(cnxt: Context, artAcargar: Articles?): Float { | 731 | fun dialogingresarCantidad(cnxt: Context, artAcargar: Articles?): Float { |
608 | var cantidad = 0F | 732 | var cantidad = 0F |
609 | val mDialogView = LayoutInflater.from(cnxt).inflate(R.layout.ingresar_cantidad, null) | 733 | val mDialogView = LayoutInflater.from(cnxt).inflate(R.layout.ingresar_cantidad, null) |
610 | val mBuilder = AlertDialog.Builder(cnxt).setView(mDialogView).setCancelable(false) | 734 | val mBuilder = AlertDialog.Builder(cnxt).setView(mDialogView).setCancelable(false) |
611 | if (artAcargar!!.balanza!!.toInt() == 1 || artAcargar.balanza!!.toInt() == 3 || artAcargar.balanza!!.toInt() == 7) mDialogView.etCantidad.inputType = TYPE_CLASS_NUMBER | 735 | if (artAcargar!!.balanza!!.toInt() == 1 || artAcargar.balanza!!.toInt() == 3 || artAcargar.balanza!!.toInt() == 7) mDialogView.etCantidad.inputType = TYPE_CLASS_NUMBER |
612 | mDialogView.tvTitulo.text = artAcargar.descripcion.toString() | 736 | mDialogView.tvTitulo.text = artAcargar.descripcion.toString() |
613 | val mAlertDialog = mBuilder.show() | 737 | val mAlertDialog = mBuilder.show() |
614 | 738 | ||
615 | mDialogView.etCantidad.requestFocus() | 739 | mDialogView.etCantidad.requestFocus() |
616 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 740 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
617 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 741 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
618 | 742 | ||
619 | mDialogView.btnAceptar.setOnClickListener { | 743 | mDialogView.btnAceptar.setOnClickListener { |
620 | if (mDialogView.etCantidad.text.isNullOrEmpty()) { | 744 | if (mDialogView.etCantidad.text.isNullOrEmpty()) { |
621 | mDialogView.etCantidad.error = "No vacio" | 745 | mDialogView.etCantidad.error = "No vacio" |
622 | mDialogView.etCantidad.requestFocus() | 746 | mDialogView.etCantidad.requestFocus() |
623 | mDialogView.etCantidad.hint = "Ingrese un valor" | 747 | mDialogView.etCantidad.hint = "Ingrese un valor" |
624 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { | 748 | } else if (!mDialogView.etCantidad.text.isNullOrEmpty()) { |
625 | mAlertDialog.dismiss() | 749 | mAlertDialog.dismiss() |
626 | cantidad = mDialogView.etCantidad.text.toString().toFloat() | 750 | cantidad = (Math.round(mDialogView.etCantidad.text.toString().toFloat() * 100.0) / 100.0).toFloat() |
627 | cargarArtEnBd(artAcargar, String.format("%.2f", cantidad)) | 751 | cargarArtEnBd(artAcargar, cantidad.toString()) |
628 | cargarRecicler(artAcargar, cantidad) | 752 | cargarRecicler(artAcargar, cantidad) |
629 | modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, true, requireContext()) | 753 | modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, true, requireContext()) |
630 | } | 754 | } |
631 | } | 755 | } |
632 | return cantidad | 756 | return cantidad |
633 | } | 757 | } |
634 | 758 | ||
635 | fun dialogoSumaResta(context: Context, indiceDelArtEncontrado: Int, univta: String, cancelable: Boolean) { | 759 | fun dialogoSumaResta(context: Context, indiceDelArtEncontrado: Int, univta: String, cancelable: Boolean) { |
636 | 760 | var cantidadTemp: Float | |
637 | mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) | 761 | mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null) |
638 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(cancelable) | 762 | val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setCancelable(cancelable) |
639 | // TODO: SI PERMITE QUE INGRESE DECIMALES | 763 | // TODO: SI PERMITE QUE INGRESE DECIMALES |
640 | if (univta.contains("1") || univta.contains("3") || univta.contains("7")) mDialogView.tvNuevaCantidad.inputType = TYPE_CLASS_NUMBER | 764 | if (univta.contains("1") || univta.contains("3") || univta.contains("7")) mDialogView.tvNuevaCantidad.inputType = TYPE_CLASS_NUMBER |
641 | mDialogView.tvTitulo2.text = "${listArticulos[indiceDelArtEncontrado].descripcion}" | 765 | mDialogView.tvTitulo2.text = "${listArticulos[indiceDelArtEncontrado].descripcion}" |
642 | mDialogView.tvCantInicial.text = String.format("%.2f", listArticulos[indiceDelArtEncontrado].cantTomada) | 766 | cantidadTemp = (Math.round(listArticulos[indiceDelArtEncontrado].cantTomada * 100.0) / 100.0).toFloat() |
767 | mDialogView.tvCantInicial.text = cantidadTemp.toString() | ||
643 | val mAlertDialog = mBuilder.show() | 768 | val mAlertDialog = mBuilder.show() |
644 | mDialogView.tvNuevaCantidad.requestFocus() | 769 | mDialogView.tvNuevaCantidad.requestFocus() |
645 | 770 | ||
646 | 771 | ||
647 | 772 | ||
648 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) | 773 | mAlertDialog?.window!!.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM) |
649 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) | 774 | mAlertDialog.window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) |
650 | 775 | ||
651 | mDialogView.tvNuevaCantidad.addTextChangedListener(textWatcher) | 776 | mDialogView.tvNuevaCantidad.addTextChangedListener(textWatcher) |
652 | 777 | ||
653 | mDialogView.rbSumar.setOnClickListener { | 778 | mDialogView.rbSumar.setOnClickListener { |
654 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 779 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
655 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat()) | 780 | cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() + mDialogView.tvNuevaCantidad.text.toString().toFloat() |
656 | // mDialogView.tvNuevaCantidad.isEnabled = false | 781 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() |
657 | } | 782 | } |
658 | } | 783 | } |
659 | mDialogView.rbRestar.setOnClickListener { | 784 | mDialogView.rbRestar.setOnClickListener { |
660 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 785 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
661 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { | 786 | if (mDialogView.tvCantInicial.text.toString().toFloat() >= mDialogView.tvNuevaCantidad.text.toString().toFloat()) { |
662 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat()) | 787 | cantidadTemp = mDialogView.tvCantInicial.text.toString().toFloat() - mDialogView.tvNuevaCantidad.text.toString().toFloat() |
788 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() | ||
663 | // mDialogView.tvNuevaCantidad.isEnabled = false | 789 | // mDialogView.tvNuevaCantidad.isEnabled = false |
664 | } else { | 790 | } else { |
665 | mDialogView.tvResultado.text = "" | 791 | mDialogView.tvResultado.text = "" |
666 | mDialogView.tvResultado.error = "Operación No Valida" | 792 | mDialogView.tvResultado.error = "Operación No Valida" |
667 | mDialogView.tvResultado.requestFocus() | 793 | mDialogView.tvResultado.requestFocus() |
668 | mDialogView.tvResultado.hint = "Error" | 794 | mDialogView.tvResultado.hint = "Error" |
669 | } | 795 | } |
670 | } | 796 | } |
671 | } | 797 | } |
672 | mDialogView.rbMdodificar.setOnClickListener { | 798 | mDialogView.rbMdodificar.setOnClickListener { |
673 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { | 799 | if (!mDialogView.tvNuevaCantidad.text.isNullOrEmpty()) { |
674 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat()) | 800 | mDialogView.tvResultado.text = (Math.round(mDialogView.tvNuevaCantidad.text.toString().toFloat() * 100.0) / 100.0).toString() |
675 | // mDialogView.tvNuevaCantidad.isEnabled = false | ||
676 | } | 801 | } |
677 | } | 802 | } |
678 | mDialogView.btnAceptar.setOnClickListener { | 803 | mDialogView.btnAceptar.setOnClickListener { |
679 | if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || !mDialogView.tvNuevaCantidad.text.isBlank()) { | 804 | if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || !mDialogView.tvNuevaCantidad.text.isBlank()) { |
680 | if (mDialogView.tvResultado.text.isNotEmpty() || !mDialogView.tvResultado.text.isBlank()) { | 805 | if (mDialogView.tvResultado.text.isNotEmpty() || !mDialogView.tvResultado.text.isBlank()) { |
681 | mAlertDialog.dismiss() | 806 | mAlertDialog.dismiss() |
682 | listArticulos[indiceDelArtEncontrado].cantTomada = String.format("%.2f", mDialogView.tvResultado.text.toString().toFloat()).toFloat() | 807 | listArticulos[indiceDelArtEncontrado].cantTomada = (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toFloat() |
683 | updateCantidad( | 808 | updateCantidad( |
684 | listArticulos[indiceDelArtEncontrado].sector.toString(), | 809 | listArticulos[indiceDelArtEncontrado].sector.toString(), |
685 | listArticulos[indiceDelArtEncontrado].codigo.toString(), | 810 | listArticulos[indiceDelArtEncontrado].codigo.toString(), |
686 | String.format("%.2f", mDialogView.tvResultado.text.toString().toFloat()).toFloat() | 811 | (Math.round(mDialogView.tvResultado.text.toString().toFloat() * 100.0) / 100.0).toFloat() |
687 | ) | 812 | ) |
688 | 813 | ||
689 | viewAdapter.notifyDataSetChanged() | 814 | viewAdapter.notifyDataSetChanged() |
690 | } else if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { | 815 | } else if (mDialogView.tvNuevaCantidad.text.isNotEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { |
691 | mDialogView.tvResultado.error = "Operación Requerida" | 816 | mDialogView.tvResultado.error = "Operación Requerida" |
692 | mDialogView.tvResultado.requestFocus() | 817 | mDialogView.tvResultado.requestFocus() |
693 | mDialogView.tvResultado.hint = "Seleccione Operación" | 818 | mDialogView.tvResultado.hint = "Seleccione Operación" |
694 | } | 819 | } |
695 | } else if (mDialogView.tvNuevaCantidad.text.isEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { | 820 | } else if (mDialogView.tvNuevaCantidad.text.isEmpty() || mDialogView.tvNuevaCantidad.text.isBlank()) { |
696 | mDialogView.tvNuevaCantidad.error = "Completar" | 821 | mDialogView.tvNuevaCantidad.error = "Completar" |
697 | mDialogView.tvNuevaCantidad.requestFocus() | 822 | mDialogView.tvNuevaCantidad.requestFocus() |
698 | mDialogView.tvNuevaCantidad.hint = "Ingrese un valor" | 823 | mDialogView.tvNuevaCantidad.hint = "Ingrese un valor" |
699 | } | 824 | } |
700 | } | 825 | } |
701 | mDialogView.dialogCancelBtn.setOnClickListener { | 826 | mDialogView.dialogCancelBtn.setOnClickListener { |
702 | mAlertDialog.dismiss() | 827 | mAlertDialog.dismiss() |
703 | } | 828 | } |
704 | } | 829 | } |
705 | 830 | ||
706 | suspend fun buscarCodiogoOriEnBD(CodOri: String): List<Articles> { | 831 | suspend fun buscarCodiogoOriEnBD(CodOri: String): List<Articles> { |
707 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 832 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
708 | var busqueda: List<Articles> | 833 | var busqueda: List<Articles> |
709 | return GlobalScope.async(IO) { | 834 | return GlobalScope.async(IO) { |
710 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodOri(CodOri, SerchAreaInventario()) | 835 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByCodOri(CodOri, SerchAreaInventario()) |
711 | return@async busqueda | 836 | return@async busqueda |
712 | }.await() | 837 | }.await() |
713 | } | 838 | } |
714 | 839 | ||
715 | suspend fun buscarCBEnBD(CodigoBarras: String): Articles? { | 840 | suspend fun buscarCBEnBD(CodigoBarras: String): Articles? { |
716 | //TODO BUSQUEDA POR CODIGO DE BARRAS | 841 | //TODO BUSQUEDA POR CODIGO DE BARRAS |
717 | var busqueda: Articles? = null | 842 | var busqueda: Articles? = null |
718 | return GlobalScope.async(IO) { | 843 | return GlobalScope.async(IO) { |
719 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, SerchAreaInventario()) | 844 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, SerchAreaInventario()) |
845 | return@async busqueda | ||
846 | }.await() | ||
847 | } | ||
848 | |||
849 | suspend fun buscarCodigoDeboEnBD(sector: String?, codigo: String?): Articles? { | ||
850 | //TODO BUSQUEDA POR CODIGO DE BARRAS | ||
851 | var busqueda: Articles? | ||
852 | return GlobalScope.async(IO) { | ||
853 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.fetchArticuloByCodSec(sector, codigo) | ||
720 | return@async busqueda | 854 | return@async busqueda |
721 | }.await() | 855 | }.await() |
722 | } | 856 | } |
723 | 857 | ||
724 | suspend fun buscarDescEnBD(descripcion: String): List<Articles>? { | 858 | suspend fun buscarDescEnBD(descripcion: String): List<Articles>? { |
725 | //TODO BUSQUEDA POR DESCRIPCION | 859 | //TODO BUSQUEDA POR DESCRIPCION |
726 | var busqueda: List<Articles>? = null | 860 | var busqueda: List<Articles>? = null |
727 | return GlobalScope.async(IO) { | 861 | return GlobalScope.async(IO) { |
728 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, SerchAreaInventario()) | 862 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, SerchAreaInventario()) |
729 | return@async busqueda | 863 | return@async busqueda |
730 | }.await() | 864 | }.await() |
731 | } | 865 | } |
732 | 866 | ||
733 | suspend fun borrarArticulo(sector: String, codigo: String, inventario: String): Int? { | 867 | suspend fun borrarArticulo(sector: String, codigo: String, inventario: String): Int? { |
734 | //TODO BUSQUEDA POR DESCRIPCION | 868 | //TODO BUSQUEDA POR DESCRIPCION |
735 | var result: Int | 869 | var result: Int |
736 | return GlobalScope.async(IO) { | 870 | return GlobalScope.async(IO) { |
737 | result = AppDb.getAppDb(requireContext())!!.InvBodyDAO()!!.deleteItemFromInvBody(sector.toLong(), codigo.toLong(), inventario.toInt()) | 871 | result = AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.deleteItemFromInvBody(sector.toLong(), codigo.toLong(), inventario.toInt()) |
738 | return@async result | 872 | return@async result |
739 | }.await() | 873 | }.await() |
740 | } | 874 | } |
741 | 875 | ||
742 | private suspend fun buscoArtEnRv(codigoBarras: String, sTipoBusqueda: Int): Int { | 876 | private suspend fun buscoArtEnRv(codigoBarras: String, sTipoBusqueda: Int): Int { |
743 | return GlobalScope.async(IO) { | 877 | return GlobalScope.async(IO) { |
744 | var indice = 0 | 878 | var indice = 0 |
745 | var bEncontrado = false | 879 | var bEncontrado = false |
746 | if (sTipoBusqueda == 0) {//TODO BUSQUEDA POR CODIGO DE BARRAS | 880 | if (sTipoBusqueda == 0) {//TODO BUSQUEDA POR CODIGO DE BARRAS |
747 | // TODO CAMBIO DE CB A CODIGO DEBO | 881 | // TODO CAMBIO DE CB A CODIGO DEBO |
748 | val any = cambioCBporCodigoDebo(codigoBarras) | 882 | if (EsBalanza){ |
749 | if (any != null) { | ||
750 | for (item in listArticulos) { | 883 | for (item in listArticulos) { |
751 | if (item.sector!!.toInt() == any.sector!!.toInt() && item.codigo!!.toInt() == any.codigo!!.toInt()) { | 884 | if (item.sector!!.toInt() == sectorBalanza.toInt() && item.codigo!!.toInt() == codigoBalanza.toInt()) { |
752 | bEncontrado = true | 885 | bEncontrado = true |
753 | break | 886 | break |
754 | } | 887 | } |
755 | indice += 1 | 888 | indice += 1 |
756 | } | 889 | } |
890 | }else { | ||
891 | val any = cambioCBporCodigoDebo(codigoBarras) | ||
892 | if (any != null) { | ||
893 | for (item in listArticulos) { | ||
894 | if (item.sector!!.toInt() == any.sector!!.toInt() && item.codigo!!.toInt() == any.codigo!!.toInt()) { | ||
895 | bEncontrado = true | ||
896 | break | ||
897 | } | ||
898 | indice += 1 | ||
899 | } | ||
900 | } | ||
757 | } | 901 | } |
758 | 902 | ||
759 | } else if (sTipoBusqueda == 1) {//TODO BUSQUEDA POR DESCRIPCION | 903 | } else if (sTipoBusqueda == 1) {//TODO BUSQUEDA POR DESCRIPCION |
760 | for (item in listArticulos) { | 904 | for (item in listArticulos) { |
761 | if (item.descripcion!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { | 905 | if (item.descripcion!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { |
762 | bEncontrado = true | 906 | bEncontrado = true |
763 | break | 907 | break |
764 | } | 908 | } |
765 | indice += 1 | 909 | indice += 1 |
766 | } | 910 | } |
767 | } else if (sTipoBusqueda == 2) {//TODO BUSQUEDA POR CODIGO DE ORIGEN | 911 | } else if (sTipoBusqueda == 2) {//TODO BUSQUEDA POR CODIGO DE ORIGEN |
768 | for (item in listArticulos) { | 912 | for (item in listArticulos) { |
769 | if (item.codigoOrigen!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { | 913 | if (item.codigoOrigen!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) { |
770 | bEncontrado = true | 914 | bEncontrado = true |
771 | break | 915 | break |
772 | } | 916 | } |
773 | indice += 1 | 917 | indice += 1 |
774 | } | 918 | } |
775 | } | 919 | } |
776 | return@async if (bEncontrado) indice else -1 | 920 | return@async if (bEncontrado) indice else -1 |
777 | }.await() | 921 | }.await() |
778 | } | 922 | } |
779 | 923 | ||
780 | suspend fun cambioCBporCodigoDebo(codigoBarras: String): Articles? { | 924 | suspend fun cambioCBporCodigoDebo(codigoBarras: String): Articles? { |
781 | //TODO BUSQUEDA POR DESCRIPCION | 925 | //TODO BUSQUEDA POR DESCRIPCION |
782 | var busqueda: Articles? = null | 926 | var busqueda: Articles? = null |
783 | return GlobalScope.async(IO) { | 927 | return GlobalScope.async(IO) { |
784 | busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(codigoBarras, SerchAreaInventario()) | 928 | busqueda = AppDb.getAppDb((activity as MainActivity))!!.ArticulosDAO()!!.findArticuloByCodBar(codigoBarras, SerchAreaInventario()) |
785 | return@async busqueda | 929 | return@async busqueda |
786 | }.await() | 930 | }.await() |
787 | } | 931 | } |
788 | 932 | ||
789 | private fun cargarArtEnBd(articulos: Articles, cant: String) { | 933 | private fun cargarArtEnBd(articulos: Articles, cant: String) { |
790 | val body = InvBody( | 934 | val body = InvBody( |
791 | (inventarioViewModel as InventarioViewModel).InventarioNuevo,// TODO PREPARO PARA MANDAR A CARGAR EN LA BD | 935 | (inventarioViewModel as InventarioViewModel).InventarioNuevo,// TODO PREPARO PARA MANDAR A CARGAR EN LA BD |
792 | articulos.sector, | 936 | articulos.sector, |
793 | articulos.codigo, | 937 | articulos.codigo, |
794 | articulos.descripcion, | 938 | articulos.descripcion, |
795 | cant, | 939 | cant, |
796 | articulos.codBar, | 940 | articulos.codBar, |
797 | articulos.codOrigen, | 941 | articulos.codOrigen, |
798 | articulos.precio, | 942 | articulos.precio, |
799 | articulos.precio, | 943 | articulos.precio, |
800 | articulos.balanza, | 944 | articulos.balanza, |
801 | articulos.depSn, | 945 | articulos.depSn, |
802 | obtenerFechaActual(), | 946 | obtenerFechaActual(), |
803 | obtenerFechaActual() | 947 | obtenerFechaActual() |
804 | ) | 948 | ) |
805 | InsertarArtEnDB(body)// TODO MANDO A CARGAR A LA BASE DE DATOS | 949 | InsertarArtEnDB(body)// TODO MANDO A CARGAR A LA BASE DE DATOS |
806 | } | 950 | } |
807 | 951 | ||
808 | fun cargarRecicler(articulos: Articles, cant: Float) { | 952 | fun cargarRecicler(articulos: Articles, cant: Float) { |
809 | //TODO CARGO EN LE RV | 953 | //TODO CARGO EN LE RV |
810 | val item = ItemsRecycler( | 954 | val item = ItemsRecycler( |
811 | if (articulos.sector.toString().toInt() < 9) "0${articulos.sector.toString()}" else articulos.sector.toString(), | 955 | if (articulos.sector.toString().toInt() < 9) "0${articulos.sector.toString()}" else articulos.sector.toString(), |
812 | articulos.codigo, | 956 | articulos.codigo, |
813 | articulos.descripcion, | 957 | articulos.descripcion, |
814 | cant, | 958 | cant, |
815 | articulos.codBar, | 959 | articulos.codBar, |
816 | articulos.codOrigen, | 960 | articulos.codOrigen, |
817 | articulos.balanza.toString(), | 961 | articulos.balanza.toString(), |
818 | articulos.de.toString() | 962 | articulos.de.toString() |
819 | ) | 963 | ) |
820 | listArticulos.add(item) | 964 | listArticulos.add(item) |
821 | 965 | ||
822 | viewAdapter = ProductosListAdapter(requireContext(), listArticulos, this) | 966 | viewAdapter = ProductosListAdapter(requireContext(), listArticulos, this) |
823 | viewManager = LinearLayoutManager(requireContext()) | 967 | viewManager = LinearLayoutManager(requireContext()) |
824 | deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! | 968 | deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! |
825 | rcInventarios.apply { | 969 | rcInventarios.apply { |
826 | adapter = viewAdapter | 970 | adapter = viewAdapter |
827 | layoutManager = viewManager | 971 | layoutManager = viewManager |
828 | } | 972 | } |
829 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { | 973 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { |
830 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { | 974 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { |
831 | return false | 975 | return false |
832 | } | 976 | } |
833 | 977 | ||
834 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { | 978 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) { |
835 | 979 | ||
836 | GlobalScope.launch(Dispatchers.Main) { | 980 | GlobalScope.launch(Dispatchers.Main) { |
837 | borrarArticulo( | 981 | borrarArticulo( |
838 | listArticulos[viewHolder.adapterPosition].sector.toString(), | 982 | listArticulos[viewHolder.adapterPosition].sector.toString(), |
839 | listArticulos[viewHolder.adapterPosition].codigo.toString(), | 983 | listArticulos[viewHolder.adapterPosition].codigo.toString(), |
840 | (inventarioViewModel as InventarioViewModel).InventarioNuevo.toString() | 984 | (inventarioViewModel as InventarioViewModel).InventarioNuevo.toString() |
841 | ) | 985 | ) |
842 | (viewAdapter as ProductosListAdapter).removeItem(viewHolder) | 986 | (viewAdapter as ProductosListAdapter).removeItem(viewHolder) |
843 | viewAdapter.notifyDataSetChanged() | 987 | viewAdapter.notifyDataSetChanged() |
844 | modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, false, requireContext()) | 988 | modificarCantidadEnCabecera((inventarioViewModel as InventarioViewModel).InventarioNuevo, false, requireContext()) |
845 | } | 989 | } |
846 | } | 990 | } |
847 | 991 | ||
848 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { | 992 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { |
849 | val itemView = viewHolder.itemView | 993 | val itemView = viewHolder.itemView |
850 | val iconMargin = (itemView.height - deleteIcon.intrinsicHeight) / 2 | 994 | val iconMargin = (itemView.height - deleteIcon.intrinsicHeight) / 2 |
851 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) | 995 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) |
852 | 996 | ||
853 | if (dX > 0) { | 997 | if (dX > 0) { |
854 | 998 | ||
855 | if (dX < c.width / 2) c.drawColor(Color.GREEN) | 999 | if (dX < c.width / 2) c.drawColor(Color.GREEN) |
856 | else c.drawColor(Color.RED) | 1000 | else c.drawColor(Color.RED) |
857 | deleteIcon.setBounds(itemView.left + iconMargin, itemView.top + iconMargin, itemView.left + iconMargin + deleteIcon.intrinsicWidth, itemView.bottom - iconMargin) | 1001 | deleteIcon.setBounds(itemView.left + iconMargin, itemView.top + iconMargin, itemView.left + iconMargin + deleteIcon.intrinsicWidth, itemView.bottom - iconMargin) |
858 | } else { | 1002 | } else { |
859 | } | 1003 | } |
860 | 1004 | ||
861 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | 1005 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) |
862 | deleteIcon.draw(c) | 1006 | deleteIcon.draw(c) |
863 | } | 1007 | } |
864 | } | 1008 | } |
865 | 1009 | ||
866 | val itemTouchHelper = ItemTouchHelper(itemTouchHelperCallback) | 1010 | val itemTouchHelper = ItemTouchHelper(itemTouchHelperCallback) |
867 | itemTouchHelper.attachToRecyclerView(rcInventarios) | 1011 | itemTouchHelper.attachToRecyclerView(rcInventarios) |
868 | } | 1012 | } |
869 | 1013 | ||
870 | private fun ProdNoCont(): Int? { | 1014 | private fun ProdNoCont(): Int? { |
871 | var mostrarStock = 0 | 1015 | var mostrarStock = 0 |
872 | if (sharedPreferences.contains("cbMostrarStock")) if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") mostrarStock = 1 | 1016 | if (sharedPreferences.contains("cbMostrarStock")) if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") mostrarStock = 1 |
873 | return mostrarStock | 1017 | return mostrarStock |
874 | } | 1018 | } |
875 | 1019 | ||
876 | private fun AjusteProductos(): Int? { | 1020 | private fun AjusteProductos(): Int? { |
877 | var prodInclu = 0 | 1021 | var prodInclu = 0 |
878 | if (sharedPreferences.contains("rbProInclu")) if (sharedPreferences.getString("rbProInclu", "").toString() == "1") prodInclu = 1 | 1022 | if (sharedPreferences.contains("rbProInclu")) if (sharedPreferences.getString("rbProInclu", "").toString() == "1") prodInclu = 1 |
879 | 1023 | ||
880 | if (sharedPreferences.contains("rbProNoInclu")) if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") prodInclu = 0 | 1024 | if (sharedPreferences.contains("rbProNoInclu")) if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") prodInclu = 0 |
881 | return prodInclu | 1025 | return prodInclu |
882 | } | 1026 | } |
883 | 1027 | ||
884 | private fun SerchArea(): Boolean { | 1028 | private fun SerchArea(): Boolean { |
885 | if (sharedPreferences.contains("rbVentas")) if (sharedPreferences.getString("rbVentas", "").toString() == "1") iArea = false | 1029 | if (sharedPreferences.contains("rbVentas")) if (sharedPreferences.getString("rbVentas", "").toString() == "1") iArea = false |
886 | if (sharedPreferences.contains("rbDeposito")) if (sharedPreferences.getString("rbDeposito", "").toString() == "1") iArea = true | 1030 | if (sharedPreferences.contains("rbDeposito")) if (sharedPreferences.getString("rbDeposito", "").toString() == "1") iArea = true |
887 | return iArea | 1031 | return iArea |
888 | } | 1032 | } |
889 | 1033 | ||
890 | suspend fun SerchAreaInventario(): Boolean { | 1034 | private suspend fun SerchAreaInventario(): Boolean { |
891 | return GlobalScope.async(IO) { | 1035 | return GlobalScope.async(IO) { |
892 | return@async AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.fetchAreaInvH((inventarioViewModel as InventarioViewModel).InventarioNuevo) | 1036 | return@async AppDb.getAppDb((activity as MainActivity))!!.InvHeadDAO()!!.fetchAreaInvH((inventarioViewModel as InventarioViewModel).InventarioNuevo) |
893 | }.await() | 1037 | }.await() |
894 | 1038 | ||
895 | } | 1039 | } |
896 | 1040 | ||
897 | fun InsertarArtEnDB(cuarpoInventario: InvBody) { | 1041 | private fun InsertarArtEnDB(cuarpoInventario: InvBody) { |
898 | lifecycleScope.launch { | 1042 | lifecycleScope.launch { |
899 | withContext(Dispatchers.IO) { | 1043 | withContext(Dispatchers.IO) { |
900 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) | 1044 | AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario) |
901 | } | 1045 | } |
902 | } | 1046 | } |
903 | } | 1047 | } |
904 | 1048 | ||
905 | fun updateCantidad(sector: String, codigo: String, cantidad: Float) { | 1049 | private fun updateCantidad(sector: String, codigo: String, cantidad: Float) { |
906 | lifecycleScope.launch { | 1050 | lifecycleScope.launch { |
907 | withContext(IO) { | 1051 | withContext(IO) { |
908 | AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.updateInvBody(cantidad, sector.toLong(), codigo.toLong(), obtenerFechaActual()) | 1052 | AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.updateInvBody(cantidad, sector.toLong(), codigo.toLong(), obtenerFechaActual()) |
909 | } | 1053 | } |
910 | } | 1054 | } |
911 | } | 1055 | } |
912 | 1056 | ||
913 | suspend fun cargarInventario(inventario: Int): List<InvBody>? { | 1057 | private suspend fun cargarInventario(inventario: Int): List<InvBody>? { |
914 | return GlobalScope.async(IO) { | 1058 | return GlobalScope.async(IO) { |
915 | return@async AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.fetchAllInvBody(inventario) | 1059 | return@async AppDb.getAppDb((activity as MainActivity))!!.InvBodyDAO()!!.fetchAllInvBody(inventario) |
916 | }.await() | 1060 | }.await() |
917 | } | 1061 | } |
918 | 1062 | ||
919 | override fun onImageDotsClick(sector: String?, codigo: String?) { | 1063 | override fun onImageDotsClick(sector: String?, codigo: String?) { |
920 | val bundle = Bundle() | 1064 | val bundle = Bundle() |
921 | bundle.putString("sector", sector!!.toInt().toString()) | 1065 | bundle.putString("sector", sector!!.toInt().toString()) |
922 | bundle.putString("codigo", codigo) | 1066 | bundle.putString("codigo", codigo) |
923 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) | 1067 | bundle.putInt("numeroInv", (inventarioViewModel as InventarioViewModel).InventarioNuevo) |
924 | navController.navigate(R.id.action_inventarioFragment_to_detalleArtFragment, bundle) | 1068 | navController.navigate(R.id.action_inventarioFragment_to_detalleArtFragment, bundle) |
925 | } | 1069 | } |
926 | 1070 | ||
927 | override fun onImagePenClick(sector: String?, codigo: String?, cantidad: String?, position: String) { | 1071 | override fun onImagePenClick(sector: String?, codigo: String?, cantidad: String?, position: String) { |
928 | dialogoSumaResta(requireContext(), position.toInt(), listArticulos[position.toInt()].univta, true) | 1072 | dialogoSumaResta(requireContext(), position.toInt(), listArticulos[position.toInt()].univta, true) |
929 | } | 1073 | } |
930 | 1074 | ||
931 | private val textWatcher = object : TextWatcher { | 1075 | private val textWatcher = object : TextWatcher { |
932 | override fun afterTextChanged(s: Editable?) {} | 1076 | override fun afterTextChanged(s: Editable?) { |
1077 | if (mDialogView.tvNuevaCantidad.text.toString() == "") { | ||
1078 | mDialogView.tvResultado.text = "" | ||
1079 | } | ||
1080 | } | ||
1081 | |||
933 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {} | 1082 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {} |
934 | 1083 | ||
935 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { | 1084 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { |
936 | if (mDialogView.rbSumar.isChecked) { | 1085 | var cantidadTemp: Float |
937 | // mDialogView.tvNuevaCantidad.isEnabled=false | 1086 | if (mDialogView.tvNuevaCantidad.text.toString() != "") { |
938 | mDialogView.tvResultado.text = String.format("%.2f", mDialogView.tvNuevaCantidad.text.toString().toFloat() + mDialogView.tvCantInicial.text.toString().toFloat()) | 1087 | if (mDialogView.rbSumar.isChecked) { |
939 | } | 1088 | cantidadTemp = mDialogView.tvNuevaCantidad.text.toString().toFloat() + mDialogView.tvCantInicial.text.toString().toFloat() |
940 | if (mDialogView.rbRestar.isChecked) { | 1089 | mDialogView.tvResultado.text = (Math.round(cantidadTemp * 100.0) / 100.0).toString() |
app/src/main/java/com/focasoftware/deboinventariov20/UI/inventario/ItemsSecRecycler.kt
File was created | 1 | package com.focasoftware.deboinventariov20.UI.inventario | |
2 | |||
3 | data class ItemsSecRecycler(val invNum: String, val sector: String, val codigo: String, val descripcion: String, var precio: String, var uniVta: String, val costo: String, var contado: String, val depSn: Boolean, val fechaTomado:String, val fechaFinal:String) { | ||
4 | |||
5 | |||
6 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/inventario/ProdSecListAdapter.kt
File was created | 1 | package com.focasoftware.deboinventariov20.UI.inventario | |
2 | |||
3 | import android.content.Context | ||
4 | import android.view.LayoutInflater | ||
5 | import android.view.View | ||
6 | import android.view.ViewGroup | ||
7 | import android.widget.Filter | ||
8 | import android.widget.Filterable | ||
9 | import androidx.recyclerview.widget.RecyclerView | ||
10 | import com.focasoftware.deboinventariov20.R | ||
11 | import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder | ||
12 | import kotlinx.android.synthetic.main.item.view.* | ||
13 | import java.util.* | ||
14 | import kotlin.collections.ArrayList | ||
15 | |||
16 | class ProdSecListAdapter(private val context: Context, private var productos: ArrayList<ItemsSecRecycler>, private val itemImageClickListener: InvSecFragment) : | ||
17 | RecyclerView.Adapter<BaseViewHolder<*>>() { | ||
18 | |||
19 | interface OnImageDotsClickListener { | ||
20 | fun onImagePenClick(numInv: String?, sector: String?, codigo: String?, cantidad: String?, position: String) | ||
21 | fun onImageDotsClick(numInv: String?, sector: String?, codigo: String?) | ||
22 | } | ||
23 | |||
24 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(context).inflate(R.layout.item, parent, false)) | ||
25 | |||
26 | override fun getItemCount(): Int { | ||
27 | return productos.count() | ||
28 | } | ||
29 | |||
30 | override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) { | ||
31 | when (holder) { | ||
32 | is ItemsViewHolder -> { | ||
33 | holder.bind(productos[position], position) | ||
34 | } | ||
35 | } | ||
36 | } | ||
37 | |||
38 | inner class ItemsViewHolder(itemView: View) : BaseViewHolder<ItemsSecRecycler>(itemView) { | ||
39 | override fun bind(item: ItemsSecRecycler, position: Int) { | ||
40 | |||
41 | itemView.ivDots.setOnClickListener { itemImageClickListener.onImageDotsClick(item.invNum, item.sector, item.codigo) } | ||
42 | itemView.ivPen.setOnClickListener { itemImageClickListener.onImagePenClick(item.invNum, item.sector, item.codigo, item.contado, adapterPosition.toString()) } | ||
43 | itemView.tvDescripcion.text = item.descripcion | ||
44 | itemView.tvCantidad.text = item.contado | ||
45 | itemView.ivPen.setImageResource(R.drawable.pen) | ||
46 | itemView.ivDots.setImageResource(R.drawable.more) | ||
47 | } | ||
48 | } | ||
49 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/inventario/ProductosListAdapter.kt
1 | package com.focasoftware.deboinventariov20.UI.inventario | 1 | package com.focasoftware.deboinventariov20.UI.inventario |
2 | 2 | ||
3 | import android.content.Context | 3 | import android.content.Context |
4 | import android.view.LayoutInflater | 4 | import android.view.LayoutInflater |
5 | import android.view.View | 5 | import android.view.View |
6 | import android.view.ViewGroup | 6 | import android.view.ViewGroup |
7 | import androidx.recyclerview.widget.RecyclerView | 7 | import androidx.recyclerview.widget.RecyclerView |
8 | import com.focasoftware.deboinventariov20.R | 8 | import com.focasoftware.deboinventariov20.R |
9 | import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder | 9 | import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder |
10 | import kotlinx.android.synthetic.main.item.view.* | 10 | import kotlinx.android.synthetic.main.item.view.* |
11 | import java.io.IOException | ||
12 | import java.net.UnknownHostException | ||
13 | 11 | ||
14 | 12 | ||
15 | class ProductosListAdapter(private val context: Context,private val productos: ArrayList<ItemsRecycler>, private val itemImageClickListener: OnImageDotsClickListener) : | 13 | class ProductosListAdapter(private val context: Context, private val productos: ArrayList<ItemsRecycler>, private val itemImageClickListener: OnImageDotsClickListener) : |
16 | RecyclerView.Adapter<BaseViewHolder<*>>() { | 14 | RecyclerView.Adapter<BaseViewHolder<*>>() { |
17 | 15 | ||
18 | private var removePosition: Int = 0 | 16 | private var removePosition: Int = 0 |
19 | private var removedItem: ItemsRecycler? = null | 17 | private var removedItem: ItemsRecycler? = null |
20 | 18 | ||
21 | interface OnImageDotsClickListener { | 19 | interface OnImageDotsClickListener { |
22 | fun onImageDotsClick(sector: String?,codigo: String?) | 20 | fun onImageDotsClick(sector: String?,codigo: String?) |
23 | fun onImagePenClick(sector: String?, codigo: String?, cantidad: String?, position: String) | 21 | fun onImagePenClick(sector: String?, codigo: String?, cantidad: String?, position: String) |
24 | 22 | ||
25 | } | 23 | } |
26 | 24 | ||
27 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(context).inflate(R.layout.item, parent, false)) | 25 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(context).inflate(R.layout.item, parent, false)) |
28 | 26 | ||
29 | override fun getItemCount() = productos.size | 27 | override fun getItemCount() = productos.size |
30 | 28 | ||
31 | override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) { | 29 | override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) { |
32 | when (holder) { | 30 | when (holder) { |
33 | is ItemsViewHolder -> { holder.bind(productos[position], position) } | 31 | is ItemsViewHolder -> { holder.bind(productos[position], position) } |
34 | 32 | ||
35 | } | 33 | } |
36 | } | 34 | } |
37 | inner class ItemsViewHolder (itemView: View) : BaseViewHolder<ItemsRecycler>(itemView) { | 35 | inner class ItemsViewHolder (itemView: View) : BaseViewHolder<ItemsRecycler>(itemView) { |
38 | override fun bind(item: ItemsRecycler, position: Int) { | 36 | override fun bind(item: ItemsRecycler, position: Int) { |
39 | itemView.ivDots.setOnClickListener {itemImageClickListener.onImageDotsClick(item.sector,item.codigo) } | 37 | itemView.ivDots.setOnClickListener {itemImageClickListener.onImageDotsClick(item.sector,item.codigo) } |
40 | itemView.ivPen.setOnClickListener {itemImageClickListener.onImagePenClick(item.sector,item.codigo,item.cantTomada.toString(),adapterPosition.toString()) } | 38 | itemView.ivPen.setOnClickListener {itemImageClickListener.onImagePenClick(item.sector,item.codigo,item.cantTomada.toString(),adapterPosition.toString()) } |
41 | 39 | ||
42 | // itemView.tvSector.text=item.sector | ||
43 | // itemView.tvCodigo.text=item.codigo | ||
44 | itemView.tvDescripcion.text=item.descripcion | 40 | itemView.tvDescripcion.text=item.descripcion |
45 | itemView.tvCantidad.text=item.cantTomada.toString() | 41 | itemView.tvCantidad.text=item.cantTomada.toString() |
46 | // itemView.tvCodigoBarras.text=item.sector | ||
47 | // itemView.tvCodigoOrigen.text=item.sector | ||
48 | itemView.ivPen.setImageResource(R.drawable.pen) | 42 | itemView.ivPen.setImageResource(R.drawable.pen) |
49 | itemView.ivDots.setImageResource(R.drawable.more) | 43 | itemView.ivDots.setImageResource(R.drawable.more) |
50 | } | 44 | } |
51 | } | 45 | } |
52 | 46 | ||
53 | fun removeItem(viewHolder: RecyclerView.ViewHolder) { | 47 | fun removeItem(viewHolder: RecyclerView.ViewHolder) { |
54 | removePosition = viewHolder.adapterPosition | 48 | removePosition = viewHolder.adapterPosition |
55 | removedItem = productos[viewHolder.adapterPosition] | 49 | removedItem = productos[viewHolder.adapterPosition] |
56 | 50 | ||
57 | productos.removeAt(viewHolder.adapterPosition) | 51 | productos.removeAt(viewHolder.adapterPosition) |
58 | notifyItemRemoved(viewHolder.adapterPosition) | 52 | notifyItemRemoved(viewHolder.adapterPosition) |
59 | } | 53 | } |
60 | } | 54 | } |
61 | 55 | ||
62 | 56 |
app/src/main/java/com/focasoftware/deboinventariov20/UI/main/InventarioSecListAdapter.kt
File was created | 1 | package com.focasoftware.deboinventariov20.UI.main | |
2 | |||
3 | import android.content.Context | ||
4 | import android.view.LayoutInflater | ||
5 | import android.view.View | ||
6 | import android.view.ViewGroup | ||
7 | import androidx.recyclerview.widget.RecyclerView | ||
8 | import com.focasoftware.deboinventariov20.Model.InvHeadSec | ||
9 | import com.focasoftware.deboinventariov20.R | ||
10 | import com.focasoftware.deboinventariov20.UI.Utils.BaseViewHolder | ||
11 | import kotlinx.android.synthetic.main.item_principal.view.* | ||
12 | |||
13 | class InventarioSecListAdapter(private val context: Context, private val inv: ArrayList<InvHeadSec>, private val itemClickListener: MainFragment) : | ||
14 | RecyclerView.Adapter<BaseViewHolder<*>>() { | ||
15 | |||
16 | interface OnInventarioSecClickListener { | ||
17 | fun onItemSecClick(inventario: String?, nombre: String?) | ||
18 | } | ||
19 | |||
20 | override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(context).inflate(R.layout.item_principal, parent, false)) | ||
21 | |||
22 | override fun getItemCount() = inv.size | ||
23 | |||
24 | inner class ItemsViewHolder(itemView: View) : BaseViewHolder<InvHeadSec>(itemView) { | ||
25 | override fun bind(item: InvHeadSec, position: Int) { | ||
26 | itemView.setOnClickListener { itemClickListener.onItemSecClick(item.invNum.toString(), item.detalle.toString()) } | ||
27 | itemView.tvPrincipalinventario.text = if (item.invNum < 10) "#0${item.invNum}" else "#" + item.invNum.toString() | ||
28 | |||
29 | itemView.tvDescription.text = item.detalle.toString() | ||
30 | itemView.tvFecha.text = item.fechaInicio.toString() | ||
31 | //SimpleDateFormat("dd/MM/yyyy HH:mm:SS").format(DateFormat(hd)).toString() | ||
32 | itemView.tvCantContada.text = item.prodContados.toString() | ||
33 | } | ||
34 | } | ||
35 | |||
36 | override fun onBindViewHolder(holder: BaseViewHolder<*>, position: Int) { | ||
37 | when (holder) { | ||
38 | is ItemsViewHolder -> holder.bind(inv[position], position) | ||
39 | else -> IllegalArgumentException("No se pudo pasar el ViewHolder") | ||
40 | } | ||
41 | } | ||
42 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/main/MainFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.main | 1 | package com.focasoftware.deboinventariov20.UI.main |
2 | 2 | ||
3 | import android.app.AlertDialog | ||
3 | import android.content.Context | 4 | import android.content.Context |
5 | import android.content.Intent | ||
4 | import android.content.SharedPreferences | 6 | import android.content.SharedPreferences |
5 | import android.os.Bundle | 7 | import android.os.Bundle |
8 | import android.provider.Settings | ||
6 | import android.view.LayoutInflater | 9 | import android.view.LayoutInflater |
7 | import android.view.View | 10 | import android.view.View |
8 | import android.view.ViewGroup | 11 | import android.view.ViewGroup |
12 | import android.view.WindowManager | ||
13 | import android.view.inputmethod.InputMethodManager | ||
9 | import android.widget.CheckBox | 14 | import android.widget.CheckBox |
10 | import android.widget.ImageButton | 15 | import android.widget.ImageButton |
16 | import android.widget.ImageView | ||
11 | import android.widget.TextView | 17 | import android.widget.TextView |
12 | import androidx.fragment.app.Fragment | 18 | import androidx.fragment.app.Fragment |
19 | import androidx.fragment.app.FragmentActivity | ||
13 | import androidx.navigation.NavController | 20 | import androidx.navigation.NavController |
14 | import androidx.navigation.Navigation | 21 | import androidx.navigation.Navigation |
15 | import androidx.recyclerview.widget.LinearLayoutManager | 22 | import androidx.recyclerview.widget.LinearLayoutManager |
16 | import androidx.recyclerview.widget.RecyclerView | 23 | import androidx.recyclerview.widget.RecyclerView |
17 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 24 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
18 | import com.focasoftware.deboinventariov20.Model.InvHead | 25 | import com.focasoftware.deboinventariov20.Model.* |
19 | import com.focasoftware.deboinventariov20.R | 26 | import com.focasoftware.deboinventariov20.R |
20 | import kotlinx.coroutines.Dispatchers | 27 | import com.focasoftware.deboinventariov20.UI.MainActivity |
21 | import kotlinx.coroutines.GlobalScope | 28 | import com.focasoftware.deboinventariov20.UI.Utils.* |
22 | import kotlinx.coroutines.async | 29 | import kotlinx.android.synthetic.main.fragment_main.* |
23 | import kotlinx.coroutines.launch | 30 | import kotlinx.android.synthetic.main.solicitar_fecha.view.* |
24 | import java.time.LocalDateTime | 31 | import kotlinx.coroutines.* |
32 | import kotlinx.coroutines.Dispatchers.Main | ||
33 | import retrofit2.Call | ||
34 | import retrofit2.Callback | ||
35 | import retrofit2.Response | ||
36 | import java.net.SocketTimeoutException | ||
25 | import java.util.* | 37 | import java.util.* |
38 | import kotlin.math.absoluteValue | ||
26 | 39 | ||
27 | class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener { | 40 | class MainFragment : Fragment(), InventarioListAdapter.OnInventarioClickListener, InventarioSecListAdapter.OnInventarioSecClickListener { |
28 | private lateinit var inventarios: List<InvHead> | 41 | private var inventarios: List<InvHead>? = null |
42 | private var inventariosII: List<InvHeadSec>? = null | ||
29 | private lateinit var ordenado: List<InvHead> | 43 | private lateinit var ordenado: List<InvHead> |
30 | private lateinit var ordenadoII: List<InvHead> | ||
31 | private lateinit var rcInventario: RecyclerView | 44 | private lateinit var rcInventario: RecyclerView |
32 | private lateinit var rcInventarioII: RecyclerView | 45 | private lateinit var rcInventarioII: RecyclerView |
33 | private lateinit var viewAdapter: RecyclerView.Adapter<*> | 46 | private lateinit var viewAdapter: RecyclerView.Adapter<*> |
34 | private lateinit var viewManager: RecyclerView.LayoutManager | 47 | private lateinit var viewManager: RecyclerView.LayoutManager |
35 | private var listIvn2 = ArrayList<InvHead>() | 48 | private var listIvn2 = ArrayList<InvHead>() |
36 | private var listIvn2II = ArrayList<InvHead>() | 49 | private var listIvn2II = ArrayList<InvHeadSec>() |
37 | private lateinit var navController: NavController | 50 | private lateinit var navController: NavController |
38 | private lateinit var sharedPreferences: SharedPreferences | 51 | private lateinit var sharedPreferences: SharedPreferences |
39 | private var cantidadInventarios: Int = 0 | 52 | private var cantidadInventarios: Int = 0 |
40 | private var cantidadInventariosII: Int = 0 | 53 | private var cantidadInventariosII: Int = 0 |
54 | private val job: Job = Job() | ||
55 | private val fragmentScopeMain = CoroutineScope(Dispatchers.IO + job) | ||
56 | private var serverBajada: ServeInv? = null | ||
41 | 57 | ||
42 | override fun onCreate(savedInstanceState: Bundle?) { | 58 | override fun onCreate(savedInstanceState: Bundle?) { |
43 | super.onCreate(savedInstanceState) | 59 | super.onCreate(savedInstanceState) |
44 | sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | ||
45 | 60 | ||
61 | sharedPreferences = (activity as MainActivity).getSharedPreferences("SP_INFO", Context.MODE_PRIVATE) | ||
62 | |||
63 | if (sharedPreferences.contains("inicio")) { | ||
64 | if (sharedPreferences.getString("inicio", "").toString() == "inicio") { | ||
65 | if (sharedPreferences.contains("cbAskTimeServerToStart")) { | ||
66 | if (sharedPreferences.getString("cbAskTimeServerToStart", "").toString() == "1") { | ||
67 | GlobalScope.launch(Main) { | ||
68 | serverBajada = AppDb.getAppDb((activity as MainActivity))!!.ServeInvDao()!!.fetchServerPreOne() | ||
69 | if (serverBajada != null) { | ||
70 | if (serverBajada!!.direccion.isNullOrEmpty()) { | ||
71 | val modalDialog = NoServerConf() | ||
72 | modalDialog.show((activity as MainActivity).supportFragmentManager, "confirmDialog") | ||
73 | } else { | ||
74 | BASE_URL = serverBajada!!.direccion.toString() + ":" + serverBajada!!.puertoBajada.toString() + "/" | ||
75 | } | ||
76 | } | ||
77 | |||
78 | val call: Call<List<Time?>?>? = WebService.instance | ||
79 | ?.createService(WebServiceApi::class.java) | ||
80 | ?.getTime() | ||
81 | call!!.enqueue(object : Callback<List<Time?>?> { | ||
82 | override fun onResponse(call: Call<List<Time?>?>?, response: Response<List<Time?>?>) { | ||
83 | if (response.code() == 200) { | ||
84 | try { | ||
85 | val timeServer = | ||
86 | response.body()?.get(0)?.dia + "/" + | ||
87 | response.body()?.get(0)?.mes + "/" + | ||
88 | response.body()?.get(0)?.ano + " " + | ||
89 | response.body()?.get(0)?.hora + ":" + | ||
90 | response.body()?.get(0)?.minutos + ":" + | ||
91 | response.body()?.get(0)?.segundos | ||
92 | val horaServer = response.body()?.get(0)?.hora + "" + | ||
93 | response.body()?.get(0)?.minutos + "" + | ||
94 | response.body()?.get(0)?.segundos | ||
95 | val fechaServer = response.body()?.get(0)?.dia + "" + | ||
96 | response.body()?.get(0)?.mes + "" + | ||
97 | response.body()?.get(0)?.ano | ||
98 | if (!askTimeServer(timeServer, horaServer, fechaServer)) { | ||
99 | } | ||
100 | } catch (e: SocketTimeoutException) { | ||
101 | } | ||
102 | } else if (response.code() == 400) { | ||
103 | } | ||
104 | } | ||
105 | |||
106 | override fun onFailure(call: Call<List<Time?>?>?, t: Throwable?) {} | ||
107 | }) | ||
108 | } | ||
109 | val editor = sharedPreferences.edit() | ||
110 | editor?.putString("inicio", "") | ||
111 | editor?.apply() | ||
112 | editor.commit() | ||
113 | } | ||
114 | } | ||
115 | } | ||
116 | } | ||
117 | } | ||
118 | |||
119 | override fun onDestroy() { | ||
120 | super.onDestroy() | ||
121 | fragmentScopeMain.cancel() | ||
46 | } | 122 | } |
47 | 123 | ||
48 | override fun onCreateView( | 124 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
49 | inflater: LayoutInflater, | ||
50 | container: ViewGroup?, | ||
51 | savedInstanceState: Bundle? | ||
52 | ): View? { | ||
53 | var bAbiertoCerrado = false | 125 | var bAbiertoCerrado = false |
54 | var bAbiertoCerradoII = false | 126 | var bAbiertoCerradoII = false |
55 | val v = inflater.inflate(R.layout.fragment_main, container, false) | 127 | val v = inflater.inflate(R.layout.fragment_main, container, false) |
56 | val tvInvDinamicos = v.findViewById<TextView>(R.id.tvInvDinamicos) | 128 | val tvInvDinamicos = v.findViewById<TextView>(R.id.tvInvDinamicos) |
57 | val tvInvImportados = v.findViewById<TextView>(R.id.tvInvImportados) | 129 | val tvInvImportados = v.findViewById<TextView>(R.id.tvInvImportados) |
58 | val ivSort19 = v.findViewById<ImageButton>(R.id.ivSort19) | 130 | val ivSort19 = v.findViewById<ImageButton>(R.id.ivSort19) |
59 | val ivSort91 = v.findViewById<ImageButton>(R.id.ivSort91) | 131 | val ivSort91 = v.findViewById<ImageButton>(R.id.ivSort91) |
60 | val ivSort19II = v.findViewById<ImageButton>(R.id.ivSort19II) | ||
61 | val ivSort91II = v.findViewById<ImageButton>(R.id.ivSort91II) | ||
62 | val cbVentas = v.findViewById<CheckBox>(R.id.cbVentas) | 132 | val cbVentas = v.findViewById<CheckBox>(R.id.cbVentas) |
63 | val cbDeposito = v.findViewById<CheckBox>(R.id.cbDeposito) | 133 | val cbDeposito = v.findViewById<CheckBox>(R.id.cbDeposito) |
64 | val tvTipo = v.findViewById<TextView>(R.id.tvTipo) | 134 | val tvTipo = v.findViewById<TextView>(R.id.tvTipo) |
65 | val cbVentasII = v.findViewById<CheckBox>(R.id.cbVentasII) | 135 | val ivPortada = v.findViewById<ImageView>(R.id.ivPortada) |
66 | val cbDepositoII = v.findViewById<CheckBox>(R.id.cbDepositoII) | ||
67 | val tvTipoII = v.findViewById<TextView>(R.id.tvTipoII) | ||
68 | rcInventario = v.findViewById(R.id.rcInventario) | 136 | rcInventario = v.findViewById(R.id.rcInventario) |
69 | rcInventarioII = v.findViewById(R.id.rcInventarioII) | 137 | rcInventarioII = v.findViewById(R.id.rcInventarioII) |
138 | ivPortada.visibility = View.VISIBLE | ||
139 | |||
140 | fragmentScopeMain.launch(Main) { | ||
141 | |||
142 | |||
143 | |||
144 | |||
145 | |||
70 | 146 | ||
71 | GlobalScope.launch(Dispatchers.Main) { | ||
72 | inventarios = buscarEnBDInvHead() | 147 | inventarios = buscarEnBDInvHead() |
73 | for ((i, item) in inventarios.withIndex()) { | 148 | for ((i, item) in inventarios!!.withIndex()) { |
74 | val inv = InvHead( | 149 | val inv = InvHead( |
75 | inventarios[i].invNum, | 150 | inventarios!![i].invNum, |
76 | inventarios[i].descripcion, | 151 | inventarios!![i].descripcion, |
77 | inventarios[i].estado, | 152 | inventarios!![i].estado, |
78 | inventarios[i].fechaInicio, | 153 | inventarios!![i].fechaInicio, |
79 | inventarios[i].fechaFinal, | 154 | inventarios!![i].fechaFinal, |
80 | inventarios[i].prodContados, | 155 | inventarios!![i].prodContados, |
81 | inventarios[i].lugar, | 156 | inventarios!![i].lugar, |
82 | inventarios[i].stDesc, | 157 | inventarios!![i].stDesc, |
83 | inventarios[i].proNoCont | 158 | inventarios!![i].proNoCont |
84 | ) | 159 | ) |
85 | cargarRecicler(inv) | 160 | cargarRecicler(inv) |
86 | cantidadInventarios = i + 1 | 161 | cantidadInventarios = i + 1 |
87 | } | 162 | } |
88 | tvInvDinamicos.text = "Inventarios Dinamicos ($cantidadInventarios) +" | 163 | tvInvDinamicos.text = "Inventarios Dinámicos ($cantidadInventarios) +" |
164 | listIvn2II.clear() | ||
165 | inventariosII = buscarEnBDInvSecHead() | ||
166 | for ((i, item) in inventariosII!!.withIndex()) { | ||
167 | val invII = InvHeadSec( | ||
168 | inventariosII!![i].invNum, | ||
169 | inventariosII!![i].detalle, | ||
170 | inventariosII!![i].fechaInicio, | ||
171 | inventariosII!![i].depsn, | ||
172 | inventariosII!![i].estado, | ||
173 | inventariosII!![i].fechaFinal, | ||
174 | inventariosII!![i].prodContados | ||
175 | ) | ||
176 | cargarReciclerII(invII) | ||
177 | cantidadInventariosII = i + 1 | ||
178 | } | ||
179 | tvInvImportados.text = "Inventarios Importados ($cantidadInventariosII) +" | ||
180 | |||
89 | tvInvDinamicos.setOnClickListener { | 181 | tvInvDinamicos.setOnClickListener { |
90 | if (!bAbiertoCerrado) { | 182 | if (!bAbiertoCerrado) { |
91 | bAbiertoCerrado = true | 183 | bAbiertoCerrado = true |
92 | tvInvImportados.visibility = View.GONE | 184 | tvInvImportados.visibility = View.GONE |
93 | ivSort19II.visibility = View.GONE | ||
94 | ivSort91II.visibility = View.GONE | ||
95 | tvTipoII.visibility = View.GONE | ||
96 | cbVentasII.visibility = View.GONE | ||
97 | cbDepositoII.visibility = View.GONE | ||
98 | |||
99 | rcInventario.visibility = View.VISIBLE | 185 | rcInventario.visibility = View.VISIBLE |
100 | ivSort91.visibility = View.INVISIBLE | 186 | ivSort91.visibility = View.INVISIBLE |
101 | ivSort19.visibility = View.VISIBLE | 187 | ivSort19.visibility = View.VISIBLE |
102 | cbVentas.visibility = View.VISIBLE | 188 | cbVentas.visibility = View.VISIBLE |
103 | cbDeposito.visibility = View.VISIBLE | 189 | cbDeposito.visibility = View.VISIBLE |
104 | tvTipo.visibility = View.VISIBLE | 190 | tvTipo.visibility = View.VISIBLE |
191 | ivPortada.visibility = View.GONE | ||
105 | tvInvDinamicos.text = "Inventarios Dinamicos ($cantidadInventarios) -" | 192 | tvInvDinamicos.text = "Inventarios Dinamicos ($cantidadInventarios) -" |
106 | } else { | 193 | } else { |
107 | bAbiertoCerrado = false | 194 | bAbiertoCerrado = false |
108 | rcInventario.visibility = View.GONE | 195 | rcInventario.visibility = View.GONE |
109 | ivSort91.visibility = View.GONE | 196 | ivSort91.visibility = View.GONE |
110 | ivSort19.visibility = View.GONE | 197 | ivSort19.visibility = View.GONE |
111 | tvInvImportados.visibility = View.VISIBLE | 198 | tvInvImportados.visibility = View.VISIBLE |
112 | cbVentas.visibility = View.GONE | 199 | cbVentas.visibility = View.GONE |
113 | cbDeposito.visibility = View.GONE | 200 | cbDeposito.visibility = View.GONE |
114 | tvTipo.visibility = View.GONE | 201 | tvTipo.visibility = View.GONE |
202 | ivPortada.visibility = View.VISIBLE | ||
115 | tvInvDinamicos.text = "Inventarios Dinamicos ($cantidadInventarios) +" | 203 | tvInvDinamicos.text = "Inventarios Dinamicos ($cantidadInventarios) +" |
116 | } | 204 | } |
117 | } | 205 | } |
118 | ordenado = inventarios.sortedBy { | 206 | |
119 | it.invNum | 207 | ordenado = inventarios!!.sortedBy { it.invNum } |
120 | } | 208 | |
121 | ivSort19.setOnClickListener { | 209 | ivSort19.setOnClickListener { |
122 | ordenado = inventarios.sortedByDescending { | 210 | ordenado = inventarios!!.sortedByDescending { |
123 | it.invNum | 211 | it.invNum |
124 | } | 212 | } |
125 | cbDeposito.isChecked=true | 213 | cbDeposito.isChecked = true |
126 | cbVentas.isChecked=true | 214 | cbVentas.isChecked = true |
127 | viewAdapter = InventarioListAdapter(requireContext(), ordenado, this@MainFragment) | 215 | viewAdapter = InventarioListAdapter(requireContext(), ordenado, this@MainFragment) |
128 | viewManager = LinearLayoutManager(requireContext()) | 216 | viewManager = LinearLayoutManager(requireContext()) |
129 | 217 | ||
130 | rcInventario.apply { | 218 | rcInventario.apply { |
131 | adapter = viewAdapter | 219 | adapter = viewAdapter |
132 | layoutManager = viewManager | 220 | layoutManager = viewManager |
133 | } | 221 | } |
134 | viewAdapter.notifyDataSetChanged() | 222 | viewAdapter.notifyDataSetChanged() |
135 | ivSort19.visibility = View.INVISIBLE | 223 | ivSort19.visibility = View.INVISIBLE |
136 | ivSort91.visibility = View.VISIBLE | 224 | ivSort91.visibility = View.VISIBLE |
137 | } | 225 | } |
226 | |||
138 | ivSort91.setOnClickListener { | 227 | ivSort91.setOnClickListener { |
139 | ordenado = inventarios.sortedBy { | 228 | ordenado = inventarios!!.sortedBy { |
140 | it.invNum | 229 | it.invNum |
141 | } | 230 | } |
142 | cbDeposito.isChecked=true | 231 | cbDeposito.isChecked = true |
143 | cbVentas.isChecked=true | 232 | cbVentas.isChecked = true |
144 | viewAdapter = InventarioListAdapter(requireContext(), ordenado, this@MainFragment) | 233 | viewAdapter = InventarioListAdapter(requireContext(), ordenado, this@MainFragment) |
145 | viewManager = LinearLayoutManager(requireContext()) | 234 | viewManager = LinearLayoutManager(requireContext()) |
146 | 235 | ||
147 | rcInventario.apply { | 236 | rcInventario.apply { |
148 | adapter = viewAdapter | 237 | adapter = viewAdapter |
149 | layoutManager = viewManager | 238 | layoutManager = viewManager |
150 | } | 239 | } |
151 | viewAdapter.notifyDataSetChanged() | 240 | viewAdapter.notifyDataSetChanged() |
152 | ivSort91.visibility = View.INVISIBLE | 241 | ivSort91.visibility = View.INVISIBLE |
153 | ivSort19.visibility = View.VISIBLE | 242 | ivSort19.visibility = View.VISIBLE |
154 | } | 243 | } |
244 | |||
245 | tvInvImportados.setOnClickListener { | ||
246 | if (!bAbiertoCerradoII) { | ||
247 | bAbiertoCerradoII = true | ||
248 | tvInvDinamicos.visibility = View.GONE | ||
249 | ivSort19.visibility = View.GONE | ||
250 | ivSort91.visibility = View.GONE | ||
251 | cbVentas.visibility = View.GONE | ||
252 | cbDeposito.visibility = View.GONE | ||
253 | ivPortada.visibility = View.GONE | ||
254 | tvInvDinamicos.visibility = View.GONE | ||
255 | rcInventarioII.visibility = View.VISIBLE | ||
256 | tvInvImportados.text = "Inventarios Importados ($cantidadInventariosII) -" | ||
257 | } else { | ||
258 | bAbiertoCerradoII = false | ||
259 | ivPortada.visibility = View.VISIBLE | ||
260 | rcInventarioII.visibility = View.GONE | ||
261 | tvInvImportados.visibility = View.VISIBLE | ||
262 | tvInvDinamicos.visibility = View.VISIBLE | ||
263 | tvInvImportados.text = "Inventarios Importados ($cantidadInventariosII) +" | ||
264 | } | ||
265 | } | ||
155 | } | 266 | } |
156 | 267 | ||
157 | cbVentas.setOnClickListener { | 268 | cbVentas.setOnClickListener { |
158 | if (!cbVentas.isChecked) { | 269 | if (!cbVentas.isChecked) { |
159 | cbDeposito.isChecked=true | 270 | cbDeposito.isChecked = true |
160 | listIvn2.clear() | 271 | listIvn2.clear() |
161 | ordenado.forEach { | 272 | ordenado.forEach { |
162 | if (it.lugar==true) { | 273 | if (it.lugar == true) { |
163 | listIvn2.add(it) | 274 | listIvn2.add(it) |
164 | } | 275 | } |
165 | } | 276 | } |
166 | } else { | 277 | } else { |
167 | listIvn2.clear() | 278 | listIvn2.clear() |
168 | listIvn2.addAll(ordenado) | 279 | listIvn2.addAll(ordenado) |
169 | } | 280 | } |
170 | viewAdapter = InventarioListAdapter(requireContext(), listIvn2, this@MainFragment) | 281 | viewAdapter = InventarioListAdapter(requireContext(), listIvn2, this@MainFragment) |
171 | viewManager = LinearLayoutManager(requireContext()) | 282 | viewManager = LinearLayoutManager(requireContext()) |
172 | rcInventario.apply { | 283 | rcInventario.apply { |
173 | adapter = viewAdapter | 284 | adapter = viewAdapter |
174 | layoutManager = viewManager | 285 | layoutManager = viewManager |
175 | } | 286 | } |
176 | viewAdapter.notifyDataSetChanged() | 287 | viewAdapter.notifyDataSetChanged() |
177 | } | 288 | } |
178 | 289 | ||
179 | cbDeposito.setOnClickListener { | 290 | cbDeposito.setOnClickListener { |
180 | if (!cbDeposito.isChecked) { | 291 | if (!cbDeposito.isChecked) { |
181 | cbVentas.isChecked=true | 292 | cbVentas.isChecked = true |
182 | listIvn2.clear() | 293 | listIvn2.clear() |
183 | ordenado.forEach { | 294 | ordenado.forEach { |
184 | if (it.lugar==false) { | 295 | if (it.lugar == false) { |
185 | listIvn2.add(it) | 296 | listIvn2.add(it) |
186 | } | 297 | } |
187 | } | 298 | } |
188 | } else { | 299 | } else { |
189 | listIvn2.clear() | 300 | listIvn2.clear() |
190 | listIvn2.addAll(ordenado) | 301 | listIvn2.addAll(ordenado) |
191 | } | 302 | } |
192 | viewAdapter = InventarioListAdapter(requireContext(), listIvn2, this@MainFragment) | 303 | viewAdapter = InventarioListAdapter(requireContext(), listIvn2, this@MainFragment) |
193 | viewManager = LinearLayoutManager(requireContext()) | 304 | viewManager = LinearLayoutManager(requireContext()) |
194 | rcInventario.apply { | 305 | rcInventario.apply { |
195 | adapter = viewAdapter | 306 | adapter = viewAdapter |
196 | layoutManager = viewManager | 307 | layoutManager = viewManager |
197 | } | 308 | } |
198 | viewAdapter.notifyDataSetChanged() | 309 | viewAdapter.notifyDataSetChanged() |
199 | } | 310 | } |
200 | 311 | ||
201 | GlobalScope.launch(Dispatchers.Main) { | ||
202 | tvInvImportados.text = "Inventarios Inportados ($cantidadInventariosII) +" | ||
203 | tvInvImportados.setOnClickListener { | ||
204 | if (!bAbiertoCerradoII) { | ||
205 | bAbiertoCerradoII = true | ||
206 | tvInvDinamicos.visibility = View.GONE | ||
207 | ivSort19.visibility = View.GONE | ||
208 | ivSort91.visibility = View.GONE | ||
209 | cbVentas.visibility = View.GONE | ||
210 | cbDeposito.visibility = View.GONE | ||
211 | |||
212 | tvInvDinamicos.visibility = View.GONE | ||
213 | rcInventarioII.visibility = View.VISIBLE | ||
214 | ivSort91II.visibility = View.INVISIBLE | ||
215 | ivSort19II.visibility = View.VISIBLE | ||
216 | cbVentasII.visibility = View.VISIBLE | ||
217 | cbDepositoII.visibility = View.VISIBLE | ||
218 | tvTipoII.visibility = View.VISIBLE | ||
219 | tvInvImportados.text = "Inventarios Inportados ($cantidadInventariosII) -" | ||
220 | } else { | ||
221 | bAbiertoCerradoII = false | ||
222 | rcInventarioII.visibility = View.GONE | ||
223 | ivSort91II.visibility = View.GONE | ||
224 | ivSort19II.visibility = View.GONE | ||
225 | tvInvImportados.visibility = View.VISIBLE | ||
226 | cbVentasII.visibility = View.GONE | ||
227 | cbDepositoII.visibility = View.GONE | ||
228 | tvTipoII.visibility = View.GONE | ||
229 | tvInvDinamicos.visibility = View.VISIBLE | ||
230 | tvInvImportados.text = "Inventarios Inportados ($cantidadInventariosII) +" | ||
231 | } | ||
232 | } | ||
233 | ordenadoII = inventarios.sortedBy { | ||
234 | it.invNum | ||
235 | } | ||
236 | ivSort19II.setOnClickListener { | ||
237 | ordenadoII = inventarios.sortedByDescending { | ||
238 | it.invNum | ||
239 | } | ||
240 | cbDepositoII.isChecked=true | ||
241 | cbVentasII.isChecked=true | ||
242 | viewAdapter = InventarioListAdapter(requireContext(), ordenadoII, this@MainFragment) | ||
243 | viewManager = LinearLayoutManager(requireContext()) | ||
244 | |||
245 | rcInventarioII.apply { | ||
246 | adapter = viewAdapter | ||
247 | layoutManager = viewManager | ||
248 | } | ||
249 | viewAdapter.notifyDataSetChanged() | ||
250 | ivSort19II.visibility = View.INVISIBLE | ||
251 | ivSort91II.visibility = View.VISIBLE | ||
252 | } | ||
253 | ivSort91II.setOnClickListener { | ||
254 | ordenadoII = inventarios.sortedBy { | ||
255 | it.invNum | ||
256 | } | ||
257 | cbDepositoII.isChecked=true | ||
258 | cbVentasII.isChecked=true | ||
259 | viewAdapter = InventarioListAdapter(requireContext(), ordenadoII, this@MainFragment) | ||
260 | viewManager = LinearLayoutManager(requireContext()) | ||
261 | |||
262 | rcInventarioII.apply { | ||
263 | adapter = viewAdapter | ||
264 | layoutManager = viewManager | ||
265 | } | ||
266 | viewAdapter.notifyDataSetChanged() | ||
267 | ivSort91.visibility = View.INVISIBLE | ||
268 | ivSort19.visibility = View.VISIBLE | ||
269 | } | ||
270 | } | ||
271 | |||
272 | cbVentasII.setOnClickListener { | ||
273 | if (!cbVentasII.isChecked) { | ||
274 | cbDepositoII.isChecked=true | ||
275 | listIvn2II.clear() | ||
276 | ordenadoII.forEach { | ||
277 | if (it.lugar==true) { | ||
278 | listIvn2II.add(it) | ||
279 | } | ||
280 | } | ||
281 | } else { | ||
282 | listIvn2II.clear() | ||
283 | listIvn2II.addAll(ordenadoII) | ||
284 | } | ||
285 | viewAdapter = InventarioListAdapter(requireContext(), listIvn2II, this@MainFragment) | ||
286 | viewManager = LinearLayoutManager(requireContext()) | ||
287 | rcInventarioII.apply { | ||
288 | adapter = viewAdapter | ||
289 | layoutManager = viewManager | ||
290 | } | ||
291 | viewAdapter.notifyDataSetChanged() | ||
292 | } | ||
293 | |||
294 | cbDepositoII.setOnClickListener { | ||
295 | if (!cbDepositoII.isChecked) { | ||
296 | cbVentasII.isChecked=true | ||
297 | listIvn2II.clear() | ||
298 | ordenadoII.forEach { | ||
299 | if (it.lugar==false) { | ||
300 | listIvn2II.add(it) | ||
301 | } | ||
302 | } | ||
303 | } else { | ||
304 | listIvn2II.clear() | ||
305 | listIvn2II.addAll(ordenadoII) | ||
306 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/servidores/AdapterServidores.kt
1 | package com.focasoftware.deboinventariov20.UI.servidores | 1 | package com.focasoftware.deboinventariov20.UI.servidores |
2 | 2 | ||
3 | import android.content.Context | 3 | import android.content.Context |
4 | import android.view.LayoutInflater | 4 | import android.view.LayoutInflater |
5 | import android.view.View | 5 | import android.view.View |
6 | import android.view.ViewGroup | 6 | import android.view.ViewGroup |
7 | import androidx.recyclerview.widget.RecyclerView | 7 | import androidx.recyclerview.widget.RecyclerView |
8 | import com.focasoftware.deboinventariov20.R | 8 | import com.focasoftware.deboinventariov20.R |
9 | import kotlinx.android.synthetic.main.item_servidores.view.* | 9 | import kotlinx.android.synthetic.main.item_servidores.view.* |
10 | 10 | ||
11 | class AdapterServidores(private val servidor: ArrayList<ItemsServidores>, private var contexto: Context) : | 11 | class AdapterServidores(private val servidor: ArrayList<ItemsServidores>, private var contexto: Context) : |
12 | RecyclerView.Adapter<AdapterServidores.ViewHolder>() { | 12 | RecyclerView.Adapter<AdapterServidores.ViewHolder>() { |
13 | private var removePosition: Int = 0 | 13 | private var removePosition: Int = 0 |
14 | private var removedItem: ItemsServidores? = null | 14 | private var removedItem: ItemsServidores? = null |
15 | 15 | ||
16 | class ViewHolder(var vista: View) : RecyclerView.ViewHolder(vista) { | 16 | class ViewHolder(var vista: View) : RecyclerView.ViewHolder(vista) { |
17 | fun bind(itemsServidores: ItemsServidores) { | 17 | fun bind(itemsServidores: ItemsServidores) { |
18 | vista.tvDescServidor.text = itemsServidores.descripcion | 18 | vista.tvDescServidor.text = itemsServidores.descripcion |
19 | vista.tvDireccionServidor.text = itemsServidores.direccion | 19 | vista.tvDireccionServidor.text = itemsServidores.direccion |
20 | vista.tvPuertoServidor.text = itemsServidores.puerto | 20 | vista.tvPuertoBajada.text = itemsServidores.puertoBajada |
21 | 21 | vista.tvPuertoSubida.text = itemsServidores.puertoSubida | |
22 | } | 22 | } |
23 | } | 23 | } |
24 | 24 | ||
25 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | 25 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { |
26 | return ViewHolder( | 26 | return ViewHolder( |
27 | LayoutInflater.from(parent.context).inflate(R.layout.item_servidores, parent, false) | 27 | LayoutInflater.from(parent.context).inflate(R.layout.item_servidores, parent, false) |
28 | ) | 28 | ) |
29 | } | 29 | } |
30 | 30 | ||
31 | override fun getItemCount(): Int { | 31 | override fun getItemCount(): Int { |
32 | return servidor.size | 32 | return servidor.size |
33 | } | 33 | } |
34 | 34 | ||
35 | override fun onBindViewHolder(holder: ViewHolder, position: Int) { | 35 | override fun onBindViewHolder(holder: ViewHolder, position: Int) { |
36 | holder.bind(servidor[position]) | 36 | holder.bind(servidor[position]) |
37 | } | 37 | } |
38 | fun removeItem(viewHolder: RecyclerView.ViewHolder) { | 38 | fun removeItem(viewHolder: RecyclerView.ViewHolder) { |
39 | removePosition = viewHolder.adapterPosition | 39 | removePosition = viewHolder.adapterPosition |
40 | removedItem = servidor[viewHolder.adapterPosition] | 40 | removedItem = servidor[viewHolder.adapterPosition] |
41 | 41 | ||
42 | servidor.removeAt(viewHolder.adapterPosition) | 42 | servidor.removeAt(viewHolder.adapterPosition) |
43 | notifyItemRemoved(viewHolder.adapterPosition) | 43 | notifyItemRemoved(viewHolder.adapterPosition) |
44 | } | 44 | } |
45 | } | 45 | } |
app/src/main/java/com/focasoftware/deboinventariov20/UI/servidores/ItemsServidores.kt
1 | package com.focasoftware.deboinventariov20.UI.servidores | 1 | package com.focasoftware.deboinventariov20.UI.servidores |
2 | 2 | ||
3 | data class ItemsServidores(val descripcion: String?, var direccion: String?, var puerto: String?, var predeterminado: String?) |
app/src/main/java/com/focasoftware/deboinventariov20/UI/servidores/ServidoresFragment.kt
1 | package com.focasoftware.deboinventariov20.UI.servidores | 1 | package com.focasoftware.deboinventariov20.UI.servidores |
2 | 2 | ||
3 | import android.graphics.Canvas | 3 | import android.graphics.Canvas |
4 | import android.graphics.Color | 4 | import android.graphics.Color |
5 | import android.graphics.drawable.Drawable | 5 | import android.graphics.drawable.Drawable |
6 | import android.os.Bundle | 6 | import android.os.Bundle |
7 | import android.view.LayoutInflater | 7 | import android.view.LayoutInflater |
8 | import android.view.View | 8 | import android.view.View |
9 | import android.view.ViewGroup | 9 | import android.view.ViewGroup |
10 | import android.widget.Toast | 10 | import android.widget.Toast |
11 | import androidx.core.content.ContextCompat | 11 | import androidx.core.content.ContextCompat |
12 | import androidx.fragment.app.Fragment | 12 | import androidx.fragment.app.Fragment |
13 | import androidx.lifecycle.lifecycleScope | 13 | import androidx.lifecycle.lifecycleScope |
14 | import androidx.recyclerview.widget.ItemTouchHelper | 14 | import androidx.recyclerview.widget.ItemTouchHelper |
15 | import androidx.recyclerview.widget.LinearLayoutManager | 15 | import androidx.recyclerview.widget.LinearLayoutManager |
16 | import androidx.recyclerview.widget.RecyclerView | 16 | import androidx.recyclerview.widget.RecyclerView |
17 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb | 17 | import com.focasoftware.deboinventariov20.DB.DataBase.AppDb |
18 | import com.focasoftware.deboinventariov20.Model.ServeInv | 18 | import com.focasoftware.deboinventariov20.Model.ServeInv |
19 | import com.focasoftware.deboinventariov20.R | 19 | import com.focasoftware.deboinventariov20.R |
20 | import com.focasoftware.deboinventariov20.UI.Utils.hideSoftKeyboard | ||
20 | import kotlinx.android.synthetic.main.fragment_servidores.* | 21 | import kotlinx.android.synthetic.main.fragment_servidores.* |
21 | import kotlinx.coroutines.* | 22 | import kotlinx.coroutines.* |
22 | 23 | ||
23 | class ServidoresFragment : Fragment() { | 24 | class ServidoresFragment : Fragment() { |
24 | 25 | ||
25 | private lateinit var rvServidores: RecyclerView | 26 | private lateinit var rvServidores: RecyclerView |
26 | private lateinit var viewAdapter: RecyclerView.Adapter<*> | 27 | private lateinit var viewAdapter: RecyclerView.Adapter<*> |
27 | private lateinit var viewManager: RecyclerView.LayoutManager | 28 | private lateinit var viewManager: RecyclerView.LayoutManager |
28 | private var listServ = ArrayList<ItemsServidores>() | 29 | private var listServ = ArrayList<ItemsServidores>() |
29 | private lateinit var servidores: List<ServeInv> | 30 | private lateinit var servidores: List<ServeInv> |
30 | private lateinit var deleteIcon: Drawable | 31 | private lateinit var deleteIcon: Drawable |
31 | 32 | ||
32 | override fun onCreate(savedInstanceState: Bundle?) { | 33 | override fun onCreate(savedInstanceState: Bundle?) { |
33 | super.onCreate(savedInstanceState) | 34 | super.onCreate(savedInstanceState) |
34 | CargarRV() | 35 | // hideSoftKeyboard() |
36 | loadRV() | ||
35 | } | 37 | } |
36 | 38 | ||
37 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | 39 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
38 | super.onViewCreated(view, savedInstanceState) | 40 | super.onViewCreated(view, savedInstanceState) |
39 | 41 | ||
40 | btnGuardarServidores.setOnClickListener { | 42 | btnGuardarServidores.setOnClickListener { |
41 | if (etNombreServidor.text.isNullOrBlank()) { | 43 | if (etNombreServidor.text.isNullOrBlank()) { |
42 | etNombreServidor.error = "Nombre no valido" | 44 | etNombreServidor.error = "Nombre no valido" |
43 | etNombreServidor.requestFocus() | 45 | etNombreServidor.requestFocus() |
44 | etNombreServidor.hint = "Nombre no valido" | 46 | etNombreServidor.hint = "Nombre no valido" |
45 | } | 47 | } |
46 | if (etDireccionServidor.text.isNullOrBlank()) { | 48 | if (etDireccionServidor.text.isNullOrBlank()) { |
47 | etDireccionServidor.error = "Dirección no valida" | 49 | etDireccionServidor.error = "Dirección no valida" |
48 | etDireccionServidor.requestFocus() | 50 | etDireccionServidor.requestFocus() |
49 | etDireccionServidor.hint = "Dirección no valida" | 51 | etDireccionServidor.hint = "Dirección no valida" |
50 | } | 52 | } |
51 | if (!etDireccionServidor.text.isNullOrBlank() || !etNombreServidor.text.isNullOrBlank()) { | 53 | if (!etDireccionServidor.text.isNullOrBlank() || !etNombreServidor.text.isNullOrBlank()) { |
52 | // GlobalScope.launch(Dispatchers.Main) { | 54 | // GlobalScope.launch(Dispatchers.Main) { |
53 | // ServerNew =AppDb.getAppDb(requireContext())?.ServeInvDao()?.findLastServer()?.plus(1) ?: 1 | 55 | // ServerNew =AppDb.getAppDb(requireContext())?.ServeInvDao()?.findLastServer()?.plus(1) ?: 1 |
54 | val servidor = ServeInv(etNombreServidor.text.toString(), "http://${etDireccionServidor.text}", | 56 | val servidor = ServeInv( |
55 | etPuerto.text.toString(),0) | 57 | etNombreServidor.text.toString(), "http://${etDireccionServidor.text}", |
56 | ingresarDatos(servidor) | 58 | etPuertoSubida.text.toString(), etPuertoBajada.text.toString(), 0 |
57 | cargarRecicler(servidor) | 59 | ) |
58 | Toast.makeText(requireContext(), "Servidor ${etNombreServidor.text} Guardado", Toast.LENGTH_LONG).show() | 60 | inputData(servidor) |
61 | continueLoadRV(servidor) | ||
62 | Toast.makeText(requireContext(), "Servidor ${etNombreServidor.text} Guardado", Toast.LENGTH_SHORT).show() | ||
59 | etNombreServidor.text.clear() | 63 | etNombreServidor.text.clear() |
60 | etDireccionServidor.text.clear() | 64 | etDireccionServidor.text.clear() |
65 | etPuertoBajada.text.clear() | ||
66 | etPuertoSubida.text.clear() | ||
67 | |||
61 | // } | 68 | // } |
62 | } | 69 | } |
63 | } | 70 | } |
64 | } | 71 | } |
65 | 72 | ||
66 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | 73 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
67 | val v = inflater.inflate(R.layout.fragment_servidores, container, false) | 74 | val v = inflater.inflate(R.layout.fragment_servidores, container, false) |
68 | rvServidores = v.findViewById(R.id.rvServidores) | 75 | rvServidores = v.findViewById(R.id.rvServidores) |
69 | return v | 76 | return v |
70 | } | 77 | } |
71 | 78 | ||
72 | fun ingresarDatos(servidor: ServeInv) { | 79 | private fun inputData(servidor: ServeInv) { |
73 | val Job = GlobalScope.launch { | 80 | val Job = GlobalScope.launch { |
74 | AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.insertServer(servidor) | 81 | AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.insertServer(servidor) |
75 | } | 82 | } |
76 | } | 83 | } |
77 | 84 | ||
78 | suspend fun buscarEnBD(): List<ServeInv> { | 85 | private suspend fun buscarEnBD(): List<ServeInv> { |
79 | var busqueda: List<ServeInv> | 86 | var busqueda: List<ServeInv> |
80 | return GlobalScope.async(Dispatchers.IO) { | 87 | return GlobalScope.async(Dispatchers.IO) { |
81 | busqueda = AppDb.getAppDb(requireContext())!!.ServeInvDao()!!.fetchAllServers() | 88 | busqueda = AppDb.getAppDb(requireContext())!!.ServeInvDao()!!.fetchAllServers() |
82 | return@async busqueda | 89 | return@async busqueda |
83 | }.await() | 90 | }.await() |
84 | } | 91 | } |
85 | 92 | ||
86 | fun CargarRV() { | 93 | private fun loadRV() { |
87 | GlobalScope.launch(Dispatchers.Main) { | 94 | GlobalScope.launch(Dispatchers.Main) { |
88 | servidores = buscarEnBD() | 95 | servidores = buscarEnBD() |
89 | for ((i, item) in servidores.withIndex()) { | 96 | for ((i, item) in servidores.withIndex()) { |
90 | val ser = ServeInv(servidores[i].descripcion, servidores[i].direccion,servidores[i].puerto, servidores[i].predeterminado) | 97 | val ser = ServeInv(servidores[i].descripcion, servidores[i].direccion, servidores[i].puertoSubida, servidores[i].puertoBajada, servidores[i].predeterminado) |
91 | cargarRecicler(ser) | 98 | continueLoadRV(ser) |
92 | } | 99 | } |
93 | } | 100 | } |
94 | } | 101 | } |
95 | 102 | ||
96 | fun cargarRecicler(ser: ServeInv) { | 103 | private fun continueLoadRV(ser: ServeInv) { |
97 | //TODO CARGO EN LE RV | 104 | //TODO CARGO EN LE RV |
98 | deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! | 105 | deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!! |
99 | val item = ItemsServidores(ser.descripcion, ser.direccion, ser.puerto.toString(),ser.predeterminado.toString()) | 106 | val item = ItemsServidores(ser.descripcion, ser.direccion, ser.puertoSubida.toString(), ser.puertoBajada.toString(), ser.predeterminado.toString()) |
100 | 107 | ||
101 | listServ.add(item) | 108 | listServ.add(item) |
102 | 109 | ||
103 | viewAdapter = AdapterServidores(listServ, requireContext()) | 110 | viewAdapter = AdapterServidores(listServ, requireContext()) |
104 | viewManager = LinearLayoutManager(requireContext()) | 111 | viewManager = LinearLayoutManager(requireContext()) |
105 | 112 | ||
106 | rvServidores.apply { | 113 | rvServidores.apply { |
107 | adapter = viewAdapter | 114 | adapter = viewAdapter |
108 | layoutManager = viewManager | 115 | layoutManager = viewManager |
109 | } | 116 | } |
110 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { | 117 | val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) { |
111 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { | 118 | override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean { |
112 | return false | 119 | return false |
113 | } | 120 | } |
114 | 121 | ||
115 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, position: Int) { | 122 | override fun onSwiped(viewHolder: RecyclerView.ViewHolder, position: Int) { |
116 | GlobalScope.launch(Dispatchers.Main) { | 123 | GlobalScope.launch(Dispatchers.Main) { |
117 | deleteServer(listServ[viewHolder.adapterPosition].descripcion.toString(), listServ[viewHolder.adapterPosition].direccion.toString()) | 124 | deleteServer(listServ[viewHolder.adapterPosition].descripcion.toString(), listServ[viewHolder.adapterPosition].direccion.toString()) |
118 | 125 | ||
119 | (viewAdapter as AdapterServidores).removeItem(viewHolder) | 126 | (viewAdapter as AdapterServidores).removeItem(viewHolder) |
120 | viewAdapter.notifyDataSetChanged() | 127 | viewAdapter.notifyDataSetChanged() |
121 | } | 128 | } |
122 | } | 129 | } |
123 | 130 | ||
124 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { | 131 | override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) { |
125 | val itemView = viewHolder.itemView | 132 | val itemView = viewHolder.itemView |
126 | val iconMargin = (itemView.height - deleteIcon.intrinsicHeight) / 2 | 133 | val iconMargin = (itemView.height - deleteIcon.intrinsicHeight) / 2 |
127 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) | 134 | c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat()) |
128 | 135 | ||
129 | if (dX > 0) { | 136 | if (dX > 0) { |
130 | 137 | ||
131 | if (dX < c.width / 2) c.drawColor(Color.GREEN) | 138 | if (dX < c.width / 2) c.drawColor(Color.GREEN) |
132 | else c.drawColor(Color.RED) | 139 | else c.drawColor(Color.RED) |
133 | deleteIcon.setBounds(itemView.left + iconMargin, itemView.top + iconMargin, itemView.left + iconMargin + deleteIcon.intrinsicWidth, itemView.bottom - iconMargin) | 140 | deleteIcon.setBounds(itemView.left + iconMargin, itemView.top + iconMargin, itemView.left + iconMargin + deleteIcon.intrinsicWidth, itemView.bottom - iconMargin) |
134 | } else { | 141 | } else { |
135 | } | 142 | } |
136 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) | 143 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive) |
137 | deleteIcon.draw(c) | 144 | deleteIcon.draw(c) |
138 | } | 145 | } |
139 | } | 146 | } |
140 | 147 | ||
141 | val itemTouchHelper = ItemTouchHelper(itemTouchHelperCallback) | 148 | val itemTouchHelper = ItemTouchHelper(itemTouchHelperCallback) |
142 | itemTouchHelper.attachToRecyclerView(rvServidores) | 149 | itemTouchHelper.attachToRecyclerView(rvServidores) |
143 | } | 150 | } |
144 | 151 | ||
145 | suspend fun deleteServer(serverName: String, serverDir: String) { | 152 | suspend fun deleteServer(serverName: String, serverDir: String) { |
146 | lifecycleScope.launch { | 153 | lifecycleScope.launch { |
147 | withContext(Dispatchers.IO) { | 154 | withContext(Dispatchers.IO) { |
148 | AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.deleteServer(serverName, serverDir) | 155 | AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.deleteServer(serverName, serverDir) |
149 | } | 156 | } |
150 | } | 157 | } |
151 | } | 158 | } |
152 | } | 159 | } |
153 | 160 |
app/src/main/res/drawable/error.png
569 KB
app/src/main/res/drawable/error_fecha_hora.png
2.54 KB
app/src/main/res/drawable/imagen_portada.jpg
35.3 KB
app/src/main/res/layout-land/fragment_configuracion.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <ScrollView | 2 | <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | tools:context=".UI.configuracion.ConfiguracionFragment" | ||
6 | xmlns:android="http://schemas.android.com/apk/res/android" | ||
7 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
8 | android:layout_height="wrap_content"> | 6 | android:layout_height="wrap_content" |
7 | tools:context=".UI.configuracion.ConfiguracionFragment"> | ||
9 | 8 | ||
10 | <androidx.constraintlayout.widget.ConstraintLayout | 9 | <androidx.constraintlayout.widget.ConstraintLayout |
11 | android:layout_width="match_parent" | ||
12 | android:layout_height="wrap_content"> | ||
13 | |||
14 | <androidx.appcompat.widget.AppCompatTextView | ||
15 | android:id="@+id/textView2" | ||
16 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
17 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content"> |
18 | android:layout_marginTop="@dimen/MarginTopTitulos" | 12 | |
19 | android:gravity="center" | 13 | <androidx.appcompat.widget.AppCompatTextView |
20 | android:lines="1" | 14 | android:id="@+id/textView2" |
21 | android:text="@string/tvTituloConf" | 15 | android:layout_width="match_parent" |
22 | android:textColor="@color/colorAccent" | 16 | android:layout_height="wrap_content" |
23 | android:textSize="@dimen/Titulos" | 17 | android:layout_marginTop="@dimen/MarginTopTitulos" |
24 | app:fontFamily="sans-serif-condensed" | 18 | android:gravity="center" |
25 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | 19 | android:lines="1" |
26 | app:layout_constraintEnd_toEndOf="parent" | 20 | android:text="@string/tvTituloConf" |
27 | app:layout_constraintStart_toStartOf="parent" | 21 | android:textColor="@color/colorAccent" |
28 | app:layout_constraintTop_toTopOf="parent" /> | 22 | android:textSize="@dimen/Titulos" |
29 | 23 | app:fontFamily="sans-serif-condensed" | |
30 | <TextView | 24 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" |
31 | android:id="@+id/tvSeleccioneServidor" | 25 | app:layout_constraintEnd_toEndOf="parent" |
32 | android:layout_width="0dp" | 26 | app:layout_constraintStart_toStartOf="parent" |
33 | android:layout_height="wrap_content" | 27 | app:layout_constraintTop_toTopOf="parent" /> |
34 | 28 | ||
35 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 29 | <TextView |
36 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 30 | android:id="@+id/tvSeleccioneServidor" |
37 | android:gravity="start" | 31 | android:layout_width="0dp" |
38 | android:lines="1" | 32 | android:layout_height="wrap_content" |
39 | android:text="@string/tvSeleccioneServidor" | 33 | |
40 | android:textColor="@android:color/black" | 34 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
41 | android:textSize="@dimen/SubTitulos" | 35 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
42 | app:fontFamily="sans-serif-condensed" | 36 | android:gravity="start" |
43 | app:layout_constraintBottom_toTopOf="@+id/spServidor" | 37 | android:lines="1" |
44 | app:layout_constraintEnd_toEndOf="parent" | 38 | android:text="@string/tvSeleccioneServidor" |
45 | app:layout_constraintStart_toStartOf="parent" | 39 | android:textColor="@android:color/black" |
46 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | 40 | android:textSize="@dimen/SubTitulos" |
47 | 41 | app:fontFamily="sans-serif-condensed" | |
48 | <Spinner | 42 | app:layout_constraintBottom_toTopOf="@+id/spServidor" |
49 | android:id="@+id/spServidor" | 43 | app:layout_constraintEnd_toEndOf="parent" |
50 | android:layout_width="0dp" | 44 | app:layout_constraintStart_toStartOf="parent" |
51 | android:layout_height="wrap_content" | 45 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> |
52 | android:backgroundTint="@color/LightGray" | 46 | |
53 | android:elevation="5dp" | 47 | <Spinner |
54 | android:fadeScrollbars="true" | 48 | android:id="@+id/spServidor" |
55 | android:foregroundTint="@android:color/holo_orange_dark" | 49 | android:layout_width="0dp" |
56 | android:soundEffectsEnabled="true" | ||
57 | android:spinnerMode="dialog" | ||
58 | android:splitMotionEvents="false" | ||
59 | android:textAlignment="center" | ||
60 | android:textSize="@dimen/NormalText" | ||
61 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | ||
62 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" | ||
63 | app:layout_constraintHorizontal_chainStyle="packed" | ||
64 | app:layout_constraintStart_toStartOf="parent" | ||
65 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" | ||
66 | android:prompt="@string/leyendaSpinner"/> | ||
67 | |||
68 | <Button | ||
69 | android:id="@+id/btnValidarServidor" | ||
70 | android:layout_width="wrap_content" | ||
71 | android:layout_height="wrap_content" | ||
72 | android:textColor="@android:color/white" | ||
73 | android:padding="10dp" | ||
74 | android:background="@drawable/boton_borde_redondeado" | ||
75 | android:text="@string/btnValidarServidor" | ||
76 | android:textSize="@dimen/NormalText" | ||
77 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | ||
78 | app:layout_constraintEnd_toEndOf="parent" | ||
79 | app:layout_constraintHorizontal_chainStyle="packed" | ||
80 | app:layout_constraintStart_toEndOf="@id/spServidor" | ||
81 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> | ||
82 | |||
83 | <Button | ||
84 | android:id="@+id/btnAgregarServidor" | ||
85 | android:layout_width="0dp" | ||
86 | android:layout_height="wrap_content" | ||
87 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
88 | android:layout_marginEnd="@dimen/MarginBotAgreSer" | ||
89 | android:text="@string/btnAgregarServidor" | ||
90 | android:textSize="@dimen/NormalText" | ||
91 | android:textColor="@android:color/white" | ||
92 | android:padding="10dp" | ||
93 | android:background="@drawable/boton_borde_redondeado" | ||
94 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" | ||
95 | app:layout_constraintEnd_toEndOf="parent" | ||
96 | app:layout_constraintStart_toStartOf="parent" | ||
97 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> | ||
98 | |||
99 | |||
100 | <TextView | ||
101 | android:id="@+id/tvUbicacionCarpetas" | ||
102 | android:layout_width="0dp" | ||
103 | android:layout_height="wrap_content" | ||
104 | |||
105 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
106 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | ||
107 | android:gravity="start" | ||
108 | android:lines="1" | ||
109 | android:text="@string/tvUbicacionCarpetas" | ||
110 | android:textColor="@android:color/black" | ||
111 | android:textSize="@dimen/SubTitulos" | ||
112 | app:fontFamily="sans-serif-condensed" | ||
113 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" | ||
114 | app:layout_constraintEnd_toEndOf="parent" | ||
115 | app:layout_constraintStart_toStartOf="parent" | ||
116 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> | ||
117 | |||
118 | <ImageButton | ||
119 | android:id="@+id/ibSearch" | ||
120 | android:layout_width="36dp" | ||
121 | android:layout_height="37dp" | ||
122 | android:layout_margin="10dp" | ||
123 | android:src="@drawable/search" | ||
124 | android:textColor="@android:color/white" | ||
125 | android:padding="10dp" | ||
126 | android:background="@drawable/boton_borde_redondeado" | ||
127 | app:layout_constraintEnd_toStartOf="@+id/etRuta" | ||
128 | app:layout_constraintStart_toStartOf="parent" | ||
129 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | ||
130 | |||
131 | <EditText | ||
132 | android:id="@+id/etRuta" | ||
133 | android:layout_width="0dp" | ||
134 | android:layout_height="wrap_content" | ||
135 | android:layout_marginTop="10dp" | ||
136 | android:layout_marginEnd="10dp" | ||
137 | android:clickable="true" | ||
138 | android:ems="10" | ||
139 | android:focusable="true" | ||
140 | android:inputType="textPersonName" | ||
141 | android:lines="1" | ||
142 | android:text="" | ||
143 | android:textSize="@dimen/NormalText" | ||
144 | app:layout_constraintEnd_toEndOf="parent" | ||
145 | app:layout_constraintStart_toEndOf="@id/ibSearch" | ||
146 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | ||
147 | |||
148 | <TextView | ||
149 | android:id="@+id/tvActuFecha" | ||
150 | android:layout_width="0dp" | ||
151 | android:layout_height="wrap_content" | ||
152 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
153 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | ||
154 | android:gravity="start" | ||
155 | android:lines="1" | ||
156 | android:text="@string/tvTituloArea" | ||
157 | android:textColor="@android:color/black" | ||
158 | android:textSize="@dimen/SubTitulos" | ||
159 | app:fontFamily="sans-serif-condensed" | ||
160 | app:layout_constraintEnd_toEndOf="parent" | ||
161 | app:layout_constraintStart_toStartOf="parent" | ||
162 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> | ||
163 | |||
164 | <RadioGroup | ||
165 | android:id="@+id/rgFechaHora" | ||
166 | android:layout_width="0dp" | ||
167 | android:layout_height="wrap_content" | ||
168 | |||
169 | android:gravity="center" | ||
170 | android:orientation="horizontal" | ||
171 | app:layout_constraintEnd_toEndOf="parent" | ||
172 | app:layout_constraintStart_toStartOf="parent" | ||
173 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> | ||
174 | |||
175 | <RadioButton | ||
176 | android:id="@+id/rbVentas" | ||
177 | android:layout_width="wrap_content" | ||
178 | android:layout_height="wrap_content" | 50 | android:layout_height="wrap_content" |
179 | android:layout_margin="5dp" | 51 | android:backgroundTint="@color/LightGray" |
180 | android:checked="true" | 52 | android:elevation="5dp" |
181 | android:padding="5dp" | 53 | android:fadeScrollbars="true" |
182 | android:text="@string/rbVentas" | 54 | android:foregroundTint="@android:color/holo_orange_dark" |
183 | android:textSize="@dimen/NormalText" /> | 55 | android:prompt="@string/leyendaSpinner" |
184 | 56 | android:soundEffectsEnabled="true" | |
185 | <RadioButton | 57 | android:spinnerMode="dialog" |
186 | android:id="@+id/rbDeposito" | 58 | android:splitMotionEvents="false" |
59 | android:textAlignment="center" | ||
60 | android:textSize="@dimen/NormalText" | ||
61 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | ||
62 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" | ||
63 | app:layout_constraintHorizontal_chainStyle="packed" | ||
64 | app:layout_constraintStart_toStartOf="parent" | ||
65 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> | ||
66 | |||
67 | <Button | ||
68 | android:id="@+id/btnValidarServidor" | ||
187 | android:layout_width="wrap_content" | 69 | android:layout_width="wrap_content" |
188 | android:layout_height="wrap_content" | 70 | android:layout_height="wrap_content" |
189 | android:layout_margin="5dp" | 71 | android:background="@drawable/boton_borde_redondeado" |
190 | android:checked="false" | 72 | android:padding="10dp" |
191 | android:padding="5dp" | 73 | android:text="@string/btnValidarServidor" |
192 | android:text="@string/rbDeposito" | 74 | android:textColor="@android:color/white" |
193 | android:textSize="@dimen/NormalText" /> | 75 | android:textSize="@dimen/NormalText" |
194 | 76 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | |
195 | </RadioGroup> | 77 | app:layout_constraintEnd_toEndOf="parent" |
196 | 78 | app:layout_constraintHorizontal_chainStyle="packed" | |
197 | <TextView | 79 | app:layout_constraintStart_toEndOf="@id/spServidor" |
198 | android:id="@+id/tvLosProductos" | 80 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> |
199 | android:layout_width="0dp" | 81 | |
200 | android:layout_height="wrap_content" | 82 | <Button |
201 | 83 | android:id="@+id/btnAgregarServidor" | |
202 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 84 | android:layout_width="0dp" |
203 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" | 85 | android:layout_height="wrap_content" |
204 | android:gravity="start" | 86 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
205 | android:lines="1" | 87 | android:layout_marginEnd="@dimen/MarginBotAgreSer" |
206 | android:text="@string/tvLosProductos" | 88 | android:background="@drawable/boton_borde_redondeado" |
207 | android:textColor="@android:color/black" | 89 | android:padding="10dp" |
208 | android:textSize="@dimen/SubTitulos" | 90 | android:text="@string/btnAgregarServidor" |
209 | app:fontFamily="sans-serif-condensed" | 91 | android:textColor="@android:color/white" |
210 | app:layout_constraintEnd_toEndOf="parent" | 92 | android:textSize="@dimen/NormalText" |
211 | app:layout_constraintStart_toStartOf="parent" | 93 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" |
212 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | 94 | app:layout_constraintEnd_toEndOf="parent" |
213 | 95 | app:layout_constraintStart_toStartOf="parent" | |
214 | <RadioGroup | 96 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> |
215 | android:id="@+id/rgLosProductos" | 97 | |
216 | android:layout_width="0dp" | 98 | |
217 | android:layout_height="wrap_content" | 99 | <TextView |
218 | 100 | android:id="@+id/tvUbicacionCarpetas" | |
219 | android:gravity="center" | 101 | android:layout_width="0dp" |
220 | android:orientation="vertical" | 102 | android:layout_height="wrap_content" |
221 | app:layout_constraintEnd_toEndOf="parent" | 103 | android:visibility="gone" |
222 | app:layout_constraintStart_toStartOf="parent" | 104 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
223 | app:layout_constraintTop_toBottomOf="@+id/tvLosProductos"> | 105 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
224 | 106 | android:gravity="start" | |
225 | <RadioButton | 107 | android:lines="1" |
226 | android:id="@+id/rbProInclu" | 108 | android:text="@string/tvUbicacionCarpetas" |
227 | android:layout_width="match_parent" | 109 | android:textColor="@android:color/black" |
110 | android:textSize="@dimen/SubTitulos" | ||
111 | app:fontFamily="sans-serif-condensed" | ||
112 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" | ||
113 | app:layout_constraintEnd_toEndOf="parent" | ||
114 | app:layout_constraintStart_toStartOf="parent" | ||
115 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> | ||
116 | |||
117 | <ImageButton | ||
118 | android:id="@+id/ibSearch" | ||
119 | android:layout_width="36dp" | ||
120 | android:layout_height="37dp" | ||
121 | android:layout_margin="10dp" | ||
122 | android:background="@drawable/boton_borde_redondeado" | ||
123 | android:padding="10dp" | ||
124 | android:visibility="gone" | ||
125 | android:src="@drawable/search" | ||
126 | android:textColor="@android:color/white" | ||
127 | app:layout_constraintEnd_toStartOf="@+id/etRuta" | ||
128 | app:layout_constraintStart_toStartOf="parent" | ||
129 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | ||
130 | |||
131 | <EditText | ||
132 | android:id="@+id/etRuta" | ||
133 | android:layout_width="0dp" | ||
134 | android:layout_height="wrap_content" | ||
135 | android:layout_marginTop="10dp" | ||
136 | android:layout_marginEnd="10dp" | ||
137 | android:clickable="true" | ||
138 | android:ems="10" | ||
139 | android:focusable="true" | ||
140 | android:inputType="textPersonName" | ||
141 | android:lines="1" | ||
142 | android:text="" | ||
143 | android:visibility="gone" | ||
144 | android:textSize="@dimen/NormalText" | ||
145 | app:layout_constraintEnd_toEndOf="parent" | ||
146 | app:layout_constraintStart_toEndOf="@id/ibSearch" | ||
147 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | ||
148 | |||
149 | <TextView | ||
150 | android:id="@+id/tvActuFecha" | ||
151 | android:layout_width="0dp" | ||
152 | android:layout_height="wrap_content" | ||
153 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
154 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | ||
155 | android:gravity="start" | ||
156 | android:lines="1" | ||
157 | android:text="@string/tvTituloArea" | ||
158 | android:textColor="@android:color/black" | ||
159 | android:textSize="@dimen/SubTitulos" | ||
160 | app:fontFamily="sans-serif-condensed" | ||
161 | app:layout_constraintEnd_toEndOf="parent" | ||
162 | app:layout_constraintStart_toStartOf="parent" | ||
163 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> | ||
164 | |||
165 | <RadioGroup | ||
166 | android:id="@+id/rgFechaHora" | ||
167 | android:layout_width="0dp" | ||
228 | android:layout_height="wrap_content" | 168 | android:layout_height="wrap_content" |
229 | 169 | ||
170 | android:gravity="center" | ||
171 | android:orientation="horizontal" | ||
172 | app:layout_constraintEnd_toEndOf="parent" | ||
173 | app:layout_constraintStart_toStartOf="parent" | ||
174 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> | ||
175 | |||
176 | <RadioButton | ||
177 | android:id="@+id/rbVentas" | ||
178 | android:layout_width="wrap_content" | ||
179 | android:layout_height="wrap_content" | ||
180 | android:layout_margin="5dp" | ||
181 | android:checked="true" | ||
182 | android:padding="5dp" | ||
183 | android:text="@string/rbVentas" | ||
184 | android:textSize="@dimen/NormalText" /> | ||
185 | |||
186 | <RadioButton | ||
187 | android:id="@+id/rbDeposito" | ||
188 | android:layout_width="wrap_content" | ||
189 | android:layout_height="wrap_content" | ||
190 | android:layout_margin="5dp" | ||
191 | android:checked="false" | ||
192 | android:padding="5dp" | ||
193 | android:text="@string/rbDeposito" | ||
194 | android:textSize="@dimen/NormalText" /> | ||
195 | |||
196 | </RadioGroup> | ||
197 | |||
198 | <TextView | ||
199 | android:id="@+id/tvLosProductos" | ||
200 | android:layout_width="0dp" | ||
201 | android:layout_height="wrap_content" | ||
202 | |||
203 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
204 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" | ||
205 | android:gravity="start" | ||
206 | android:lines="1" | ||
207 | android:text="@string/tvLosProductos" | ||
208 | android:textColor="@android:color/black" | ||
209 | android:textSize="@dimen/SubTitulos" | ||
210 | app:fontFamily="sans-serif-condensed" | ||
211 | app:layout_constraintEnd_toEndOf="parent" | ||
212 | app:layout_constraintStart_toStartOf="parent" | ||
213 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | ||
214 | |||
215 | <RadioGroup | ||
216 | android:id="@+id/rgLosProductos" | ||
217 | android:layout_width="0dp" | ||
218 | android:layout_height="wrap_content" | ||
219 | |||
220 | android:gravity="center" | ||
221 | android:orientation="vertical" | ||
222 | app:layout_constraintEnd_toEndOf="parent" | ||
223 | app:layout_constraintStart_toStartOf="parent" | ||
224 | app:layout_constraintTop_toBottomOf="@+id/tvLosProductos"> | ||
225 | |||
226 | <RadioButton | ||
227 | android:id="@+id/rbProInclu" | ||
228 | android:layout_width="match_parent" | ||
229 | android:layout_height="wrap_content" | ||
230 | |||
231 | android:layout_margin="@dimen/PadingCbyRb" | ||
232 | android:checked="true" | ||
233 | android:padding="@dimen/PadingCbyRb" | ||
234 | android:text="@string/rbProInclu" | ||
235 | android:textSize="@dimen/NormalText" /> | ||
236 | |||
237 | <RadioButton | ||
238 | android:id="@+id/rbProNoInclu" | ||
239 | android:layout_width="match_parent" | ||
240 | android:layout_height="wrap_content" | ||
241 | android:layout_margin="@dimen/PadingCbyRb" | ||
242 | android:checked="false" | ||
243 | android:padding="@dimen/PadingCbyRb" | ||
244 | android:text="@string/rbProNoInclu" | ||
245 | android:textSize="@dimen/NormalText" /> | ||
246 |
app/src/main/res/layout-land/fragment_inventario.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:id="@+id/frameLayout" | 5 | android:id="@+id/frameLayout" |
6 | android:layout_width="match_parent" | 6 | android:layout_width="match_parent" |
7 | android:layout_height="match_parent" | 7 | android:layout_height="match_parent" |
8 | tools:context=".UI.inventario.InventarioFragment"> | 8 | tools:context=".UI.inventario.InventarioFragment"> |
9 | 9 | ||
10 | <androidx.appcompat.widget.AppCompatTextView | 10 | <androidx.appcompat.widget.AppCompatTextView |
11 | android:id="@+id/tvTitulo" | 11 | android:id="@+id/tvTitulo" |
12 | android:layout_width="match_parent" | 12 | android:layout_width="match_parent" |
13 | android:layout_height="60dp" | 13 | android:layout_height="60dp" |
14 | android:autoSizeMaxTextSize="100sp" | 14 | android:autoSizeMaxTextSize="100sp" |
15 | android:autoSizeMinTextSize="20sp" | 15 | android:autoSizeMinTextSize="20sp" |
16 | android:autoSizeStepGranularity="5sp" | 16 | android:autoSizeStepGranularity="5sp" |
17 | android:autoSizeTextType="uniform" | 17 | android:autoSizeTextType="uniform" |
18 | android:gravity="center" | 18 | android:gravity="center" |
19 | android:lines="1" | 19 | android:lines="1" |
20 | android:text="@string/invTitulo" | 20 | android:text="@string/invTitulo" |
21 | android:textColor="@color/colorAccent" | 21 | android:textColor="@color/colorAccent" |
22 | app:fontFamily="sans-serif-condensed" | 22 | app:fontFamily="sans-serif-condensed" |
23 | app:layout_constraintBottom_toTopOf="@id/guideline2" | 23 | app:layout_constraintBottom_toTopOf="@id/guideline2" |
24 | app:layout_constraintEnd_toEndOf="parent" | 24 | app:layout_constraintEnd_toEndOf="parent" |
25 | app:layout_constraintStart_toStartOf="parent" | 25 | app:layout_constraintStart_toStartOf="parent" |
26 | app:layout_constraintTop_toTopOf="@id/guideline" /> | 26 | app:layout_constraintTop_toTopOf="@id/guideline" /> |
27 | 27 | ||
28 | 28 | ||
29 | <ImageButton | 29 | <ImageButton |
30 | android:id="@+id/ivCamara" | 30 | android:id="@+id/ivCamara" |
31 | android:layout_width="60dp" | 31 | android:layout_width="60dp" |
32 | android:layout_height="60dp" | 32 | android:layout_height="60dp" |
33 | android:layout_marginTop="15dp" | 33 | android:layout_marginTop="15dp" |
34 | android:clickable="true" | 34 | android:clickable="true" |
35 | android:contentDescription="@string/ibBusCB" | 35 | android:contentDescription="@string/ibBusCB" |
36 | android:elevation="5dp" | 36 | android:elevation="5dp" |
37 | android:background="@drawable/boton_redondo" | 37 | android:background="@drawable/boton_redondo" |
38 | android:layout_margin="10dp" | 38 | android:layout_margin="10dp" |
39 | android:focusable="false" | 39 | android:focusable="false" |
40 | android:scaleType="fitEnd" | 40 | android:scaleType="fitEnd" |
41 | app:layout_constraintCircleRadius="40dp" | 41 | app:layout_constraintCircleRadius="40dp" |
42 | android:src="@drawable/codbar" | 42 | android:src="@drawable/codbar" |
43 | app:layout_constraintBottom_toTopOf="@id/guideline3" | 43 | app:layout_constraintBottom_toTopOf="@id/guideline3" |
44 | app:layout_constraintEnd_toStartOf="@+id/etCodigoBarras" | 44 | app:layout_constraintEnd_toStartOf="@+id/etCodigoBarras" |
45 | app:layout_constraintHorizontal_bias="0.0" | 45 | app:layout_constraintHorizontal_bias="0.0" |
46 | app:layout_constraintStart_toStartOf="parent" | 46 | app:layout_constraintStart_toStartOf="parent" |
47 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | 47 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> |
48 | 48 | ||
49 | <EditText | 49 | <EditText |
50 | android:id="@+id/etCodigoBarras" | 50 | android:id="@+id/etCodigoBarras" |
51 | android:layout_width="0dp" | 51 | android:layout_width="0dp" |
52 | android:layout_height="wrap_content" | 52 | android:layout_height="wrap_content" |
53 | android:autofillHints="" | 53 | android:autofillHints="" |
54 | android:clickable="true" | 54 | android:clickable="true" |
55 | android:ems="10" | 55 | android:ems="10" |
56 | android:focusable="true" | 56 | android:focusable="true" |
57 | android:hint="@string/ibBusCB" | 57 | android:hint="@string/ibBusCB" |
58 | android:inputType="textPersonName" | 58 | android:inputType="textPersonName" |
59 | android:lines="1" | 59 | android:lines="1" |
60 | android:textAllCaps="true" | 60 | android:textAllCaps="true" |
61 | android:textSize="20sp" | 61 | android:textSize="20sp" |
62 | app:layout_constraintBottom_toTopOf="@+id/guideline3" | 62 | app:layout_constraintBottom_toTopOf="@+id/guideline3" |
63 | app:layout_constraintEnd_toStartOf="@+id/swSumaUno" | 63 | app:layout_constraintEnd_toStartOf="@+id/swSumaUno" |
64 | app:layout_constraintHorizontal_bias="0.49" | 64 | app:layout_constraintHorizontal_bias="0.49" |
65 | app:layout_constraintHorizontal_chainStyle="packed" | 65 | app:layout_constraintHorizontal_chainStyle="packed" |
66 | app:layout_constraintStart_toEndOf="@+id/ivCamara" | 66 | app:layout_constraintStart_toEndOf="@+id/ivCamara" |
67 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | 67 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> |
68 | 68 | ||
69 | 69 | ||
70 | <Switch | 70 | <Switch |
71 | android:id="@+id/swSumaUno" | 71 | android:id="@+id/swSumaUno" |
72 | android:layout_width="wrap_content" | 72 | android:layout_width="wrap_content" |
73 | android:layout_height="wrap_content" | 73 | android:layout_height="wrap_content" |
74 | android:text="@string/switch_1" | 74 | android:text="@string/switch_1" |
75 | app:layout_constraintBaseline_toBaselineOf="@+id/etCodigoBarras" | 75 | app:layout_constraintBaseline_toBaselineOf="@+id/etCodigoBarras" |
76 | app:layout_constraintEnd_toEndOf="parent" | 76 | app:layout_constraintEnd_toEndOf="parent" |
77 | app:layout_constraintStart_toEndOf="@id/etCodigoBarras" | 77 | app:layout_constraintStart_toEndOf="@id/etCodigoBarras" |
78 | tools:ignore="UseSwitchCompatOrMaterialXml" /> | 78 | tools:ignore="UseSwitchCompatOrMaterialXml" /> |
79 | 79 | ||
80 | <androidx.recyclerview.widget.RecyclerView | 80 | <androidx.recyclerview.widget.RecyclerView |
81 | android:id="@+id/rcInventarios" | 81 | android:id="@+id/rcInventarios" |
82 | android:layout_width="match_parent" | 82 | android:layout_width="match_parent" |
83 | android:layout_height="0dp" | 83 | android:layout_height="0dp" |
84 | android:background="@android:color/darker_gray" | 84 | android:background="@android:color/darker_gray" |
85 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" | 85 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" |
86 | app:layout_constraintEnd_toEndOf="parent" | 86 | app:layout_constraintEnd_toEndOf="parent" |
87 | app:layout_constraintStart_toStartOf="parent" | 87 | app:layout_constraintStart_toStartOf="parent" |
88 | app:layout_constraintTop_toBottomOf="@+id/guideline4" | 88 | app:layout_constraintTop_toBottomOf="@+id/guideline4" |
89 | tools:listitem="@layout/item" /> | 89 | tools:listitem="@layout/item" /> |
90 | 90 | ||
91 | 91 | ||
92 | <Button | 92 | <Button |
93 | android:id="@+id/btnExportarInv" | 93 | android:id="@+id/btnExportarInv" |
94 | android:layout_width="wrap_content" | 94 | android:layout_width="wrap_content" |
95 | android:layout_height="wrap_content" | 95 | android:layout_height="wrap_content" |
96 | android:text="@string/btnExportarInv" | 96 | android:text="@string/btnExportarInv" |
97 | android:textColor="@android:color/white" | 97 | android:textColor="@android:color/white" |
98 | android:padding="10dp" | 98 | android:padding="10dp" |
99 | android:background="@drawable/boton_borde_redondeado" | 99 | android:background="@drawable/boton_borde_redondeado" |
100 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | 100 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" |
101 | app:layout_constraintEnd_toEndOf="parent" | 101 | app:layout_constraintEnd_toEndOf="parent" |
102 | app:layout_constraintHorizontal_chainStyle="spread" | 102 | app:layout_constraintHorizontal_chainStyle="spread" |
103 | app:layout_constraintStart_toEndOf="@+id/btnBorrarInv" | 103 | app:layout_constraintStart_toEndOf="@+id/btnBorrarInv" |
104 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | 104 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> |
105 | 105 | ||
106 | <Button | 106 | <Button |
107 | android:id="@+id/btnBorrarInv" | 107 | android:id="@+id/btnBorrarInv" |
108 | android:layout_width="wrap_content" | 108 | android:layout_width="wrap_content" |
109 | android:layout_height="wrap_content" | 109 | android:layout_height="wrap_content" |
110 | android:text="@string/btnBorrarInv" | 110 | android:text="@string/btnBorrarInv" |
111 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | 111 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" |
112 | app:layout_constraintEnd_toStartOf="@id/btnExportarInv" | 112 | app:layout_constraintEnd_toStartOf="@id/btnExportarInv" |
113 | app:layout_constraintHorizontal_chainStyle="spread" | 113 | app:layout_constraintHorizontal_chainStyle="spread" |
114 | app:layout_constraintStart_toStartOf="parent" | 114 | app:layout_constraintStart_toStartOf="parent" |
115 | android:textColor="@android:color/white" | 115 | android:textColor="@android:color/white" |
116 | android:padding="10dp" | 116 | android:padding="10dp" |
117 | android:background="@drawable/boton_borde_redondeado" | 117 | android:background="@drawable/boton_borde_redondeado" |
118 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | 118 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> |
119 | 119 | ||
120 | |||
121 | <ProgressBar | ||
122 | android:id="@+id/loading_view" | ||
123 | android:layout_width="wrap_content" | ||
124 | android:layout_height="wrap_content" | ||
125 | android:layout_marginStart="8dp" | ||
126 | android:layout_marginLeft="8dp" | ||
127 | android:layout_marginTop="8dp" | ||
128 | android:layout_marginEnd="8dp" | ||
129 | android:layout_marginRight="8dp" | ||
130 | android:layout_marginBottom="8dp" | ||
131 | android:visibility="invisible" | ||
132 | app:layout_constraintBottom_toBottomOf="parent" | ||
133 | app:layout_constraintEnd_toEndOf="parent" | ||
134 | app:layout_constraintStart_toStartOf="parent" | ||
135 | app:layout_constraintTop_toTopOf="parent" /> | ||
136 | |||
120 | <androidx.constraintlayout.widget.Guideline | 137 | <androidx.constraintlayout.widget.Guideline |
121 | android:id="@+id/guideline" | 138 | android:id="@+id/guideline" |
122 | android:layout_width="wrap_content" | 139 | android:layout_width="wrap_content" |
123 | android:layout_height="wrap_content" | 140 | android:layout_height="wrap_content" |
124 | android:orientation="horizontal" | 141 | android:orientation="horizontal" |
125 | app:layout_constraintGuide_percent="0.02" /> | 142 | app:layout_constraintGuide_percent="0.02" /> |
126 | 143 | ||
127 | <androidx.constraintlayout.widget.Guideline | 144 | <androidx.constraintlayout.widget.Guideline |
128 | android:id="@+id/guideline2" | 145 | android:id="@+id/guideline2" |
129 | android:layout_width="wrap_content" | 146 | android:layout_width="wrap_content" |
130 | android:layout_height="wrap_content" | 147 | android:layout_height="wrap_content" |
131 | android:orientation="horizontal" | 148 | android:orientation="horizontal" |
132 | app:layout_constraintGuide_percent="0.2" /> | 149 | app:layout_constraintGuide_percent="0.2" /> |
133 | 150 | ||
134 | <androidx.constraintlayout.widget.Guideline | 151 | <androidx.constraintlayout.widget.Guideline |
135 | android:id="@+id/guideline3" | 152 | android:id="@+id/guideline3" |
136 | android:layout_width="wrap_content" | 153 | android:layout_width="wrap_content" |
137 | android:layout_height="wrap_content" | 154 | android:layout_height="wrap_content" |
138 | android:orientation="horizontal" | 155 | android:orientation="horizontal" |
139 | app:layout_constraintGuide_percent="0.29" /> | 156 | app:layout_constraintGuide_percent="0.29" /> |
140 | 157 | ||
141 | <androidx.constraintlayout.widget.Guideline | 158 | <androidx.constraintlayout.widget.Guideline |
142 | android:id="@+id/guideline4" | 159 | android:id="@+id/guideline4" |
143 | android:layout_width="wrap_content" | 160 | android:layout_width="wrap_content" |
144 | android:layout_height="wrap_content" | 161 | android:layout_height="wrap_content" |
145 | android:orientation="horizontal" | 162 | android:orientation="horizontal" |
146 | app:layout_constraintGuide_percent="0.35" /> | 163 | app:layout_constraintGuide_percent="0.35" /> |
147 | 164 | ||
148 | <androidx.constraintlayout.widget.Guideline | 165 | <androidx.constraintlayout.widget.Guideline |
149 | android:id="@+id/guideline5" | 166 | android:id="@+id/guideline5" |
150 | android:layout_width="wrap_content" | 167 | android:layout_width="wrap_content" |
151 | android:layout_height="wrap_content" | 168 | android:layout_height="wrap_content" |
152 | android:orientation="horizontal" | 169 | android:orientation="horizontal" |
153 | app:layout_constraintGuide_percent="0.83" /> | 170 | app:layout_constraintGuide_percent="0.83" /> |
154 | 171 | ||
155 | <androidx.constraintlayout.widget.Guideline | 172 | <androidx.constraintlayout.widget.Guideline |
156 | android:id="@+id/guideline6" | 173 | android:id="@+id/guideline6" |
157 | android:layout_width="wrap_content" | 174 | android:layout_width="wrap_content" |
158 | android:layout_height="wrap_content" | 175 | android:layout_height="wrap_content" |
159 | android:orientation="horizontal" | 176 | android:orientation="horizontal" |
160 | app:layout_constraintGuide_percent="0.97" /> | 177 | app:layout_constraintGuide_percent="0.97" /> |
161 | 178 | ||
162 | 179 | ||
163 | </androidx.constraintlayout.widget.ConstraintLayout> | 180 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout-land/fragment_servidores.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | tools:context=".UI.servidores.ServidoresFragment"> | 7 | tools:context=".UI.servidores.ServidoresFragment"> |
8 | 8 | ||
9 | <androidx.appcompat.widget.AppCompatTextView | 9 | <androidx.appcompat.widget.AppCompatTextView |
10 | android:id="@+id/tvTitutloServer" | 10 | android:id="@+id/tvTitutloServer" |
11 | android:layout_width="match_parent" | 11 | android:layout_width="match_parent" |
12 | android:layout_height="90dp" | 12 | android:layout_height="90dp" |
13 | android:layout_marginStart="8dp" | 13 | android:layout_marginStart="8dp" |
14 | android:layout_marginTop="15dp" | 14 | android:layout_marginTop="15dp" |
15 | android:layout_marginEnd="8dp" | 15 | android:layout_marginEnd="8dp" |
16 | android:autoSizeMaxTextSize="100sp" | 16 | android:autoSizeMaxTextSize="100sp" |
17 | android:autoSizeMinTextSize="20sp" | 17 | android:autoSizeMinTextSize="20sp" |
18 | android:autoSizeStepGranularity="5sp" | 18 | android:autoSizeStepGranularity="5sp" |
19 | android:autoSizeTextType="uniform" | 19 | android:autoSizeTextType="uniform" |
20 | android:gravity="center" | 20 | android:gravity="center" |
21 | android:lines="1" | 21 | android:lines="1" |
22 | android:text="@string/tvTitutloServer" | 22 | android:text="@string/tvTitutloServer" |
23 | android:textColor="@color/colorAccent" | 23 | android:textColor="@color/colorAccent" |
24 | app:fontFamily="sans-serif-condensed" | 24 | app:fontFamily="sans-serif-condensed" |
25 | app:layout_constraintEnd_toEndOf="parent" | 25 | app:layout_constraintEnd_toEndOf="parent" |
26 | app:layout_constraintStart_toStartOf="parent" | 26 | app:layout_constraintStart_toStartOf="parent" |
27 | app:layout_constraintTop_toTopOf="parent" /> | 27 | app:layout_constraintTop_toTopOf="parent" /> |
28 | 28 | ||
29 | 29 | ||
30 | <TextView | 30 | <TextView |
31 | android:id="@+id/tvNomServer" | 31 | android:id="@+id/tvNomServer" |
32 | android:layout_width="match_parent" | 32 | android:layout_width="match_parent" |
33 | android:layout_height="wrap_content" | 33 | android:layout_height="wrap_content" |
34 | android:layout_margin="10dp" | 34 | android:layout_margin="10dp" |
35 | android:gravity="start" | 35 | android:gravity="start" |
36 | android:lines="1" | 36 | android:lines="1" |
37 | android:text="@string/tvNomServer" | 37 | android:text="@string/tvNomServer" |
38 | android:textColor="@android:color/black" | 38 | android:textColor="@android:color/black" |
39 | android:textSize="@dimen/SubTitulos" | 39 | android:textSize="@dimen/SubTitulos" |
40 | android:textStyle="bold|italic" | 40 | android:textStyle="bold|italic" |
41 | app:fontFamily="sans-serif-condensed" | 41 | app:fontFamily="sans-serif-condensed" |
42 | app:layout_constraintEnd_toEndOf="parent" | 42 | app:layout_constraintEnd_toEndOf="parent" |
43 | app:layout_constraintStart_toStartOf="parent" | 43 | app:layout_constraintStart_toStartOf="parent" |
44 | app:layout_constraintTop_toBottomOf="@id/tvTitutloServer" /> | 44 | app:layout_constraintTop_toBottomOf="@id/tvTitutloServer" /> |
45 | 45 | ||
46 | <EditText | 46 | <EditText |
47 | android:id="@+id/etNombreServidor" | 47 | android:id="@+id/etNombreServidor" |
48 | android:layout_width="match_parent" | 48 | android:layout_width="match_parent" |
49 | android:layout_height="wrap_content" | 49 | android:layout_height="wrap_content" |
50 | android:layout_margin="10dp" | 50 | android:layout_margin="10dp" |
51 | android:autofillHints="" | 51 | android:autofillHints="" |
52 | android:clickable="true" | 52 | android:clickable="true" |
53 | android:ems="10" | 53 | android:ems="10" |
54 | android:focusable="true" | 54 | android:focusable="true" |
55 | android:hint="Servidor Local" | 55 | android:hint="Servidor Local" |
56 | android:inputType="text" | 56 | android:inputType="text" |
57 | android:lines="1" | 57 | android:lines="1" |
58 | android:textSize="15sp" | 58 | android:textSize="15sp" |
59 | app:layout_constraintEnd_toEndOf="parent" | 59 | app:layout_constraintEnd_toEndOf="parent" |
60 | app:layout_constraintStart_toStartOf="parent" | 60 | app:layout_constraintStart_toStartOf="parent" |
61 | app:layout_constraintTop_toBottomOf="@+id/tvNomServer" /> | 61 | app:layout_constraintTop_toBottomOf="@+id/tvNomServer" /> |
62 | 62 | ||
63 | <TextView | 63 | <TextView |
64 | android:id="@+id/tvDirServer" | 64 | android:id="@+id/tvDirServer" |
65 | android:layout_width="wrap_content" | 65 | android:layout_width="wrap_content" |
66 | android:layout_height="wrap_content" | 66 | android:layout_height="wrap_content" |
67 | android:layout_margin="10dp" | 67 | android:layout_margin="10dp" |
68 | android:gravity="start" | 68 | android:gravity="start" |
69 | android:lines="1" | 69 | android:lines="1" |
70 | android:text="@string/tvDirServer" | 70 | android:text="@string/tvDirServer" |
71 | android:textColor="@android:color/black" | 71 | android:textColor="@android:color/black" |
72 | android:textSize="@dimen/SubTitulos" | 72 | android:textSize="@dimen/SubTitulos" |
73 | android:textStyle="bold|italic" | 73 | android:textStyle="bold|italic" |
74 | app:fontFamily="sans-serif-condensed" | 74 | app:fontFamily="sans-serif-condensed" |
75 | app:layout_constraintStart_toStartOf="parent" | 75 | app:layout_constraintStart_toStartOf="parent" |
76 | app:layout_constraintTop_toBottomOf="@+id/etNombreServidor" /> | 76 | app:layout_constraintTop_toBottomOf="@+id/etNombreServidor" /> |
77 | 77 | ||
78 | <EditText | 78 | <EditText |
79 | android:id="@+id/etDireccionServidor" | 79 | android:id="@+id/etDireccionServidor" |
80 | android:layout_width="130dp" | 80 | android:layout_width="180dp" |
81 | android:layout_height="wrap_content" | 81 | android:layout_height="wrap_content" |
82 | android:clickable="true" | 82 | android:clickable="true" |
83 | android:ems="10" | 83 | android:ems="10" |
84 | android:focusable="true" | 84 | android:focusable="true" |
85 | android:hint="192.168.100.100" | 85 | android:hint="192.168.100.100" |
86 | android:inputType="phone" | 86 | android:inputType="phone" |
87 | android:lines="1" | 87 | android:lines="1" |
88 | android:nextFocusLeft="@id/etPuertoSubida" | ||
89 | android:nextFocusRight="@id/etPuertoSubida" | ||
90 | android:nextFocusDown="@id/etPuertoSubida" | ||
88 | android:textSize="15sp" | 91 | android:textSize="15sp" |
89 | app:layout_constraintBaseline_toBaselineOf="@+id/tvDirServer" | 92 | app:layout_constraintBaseline_toBaselineOf="@+id/tvDirServer" |
90 | app:layout_constraintStart_toEndOf="@+id/tvDirServer" /> | 93 | app:layout_constraintStart_toEndOf="@+id/tvDirServer" /> |
91 | 94 | ||
92 | 95 | ||
93 | <EditText | 96 | <EditText |
94 | android:id="@+id/etPuerto" | 97 | android:id="@+id/etPuertoSubida" |
95 | android:layout_width="80dp" | 98 | android:layout_width="150dp" |
96 | android:layout_height="wrap_content" | 99 | android:layout_height="wrap_content" |
100 | android:layout_margin="10dp" | ||
101 | android:autofillHints="" | ||
97 | android:clickable="true" | 102 | android:clickable="true" |
98 | android:ems="10" | 103 | android:ems="9" |
99 | android:focusable="true" | 104 | android:focusable="true" |
100 | android:hint="Puerto" | 105 | android:hint="Puerto de Subida" |
101 | android:inputType="number" | 106 | android:inputType="number" |
102 | android:lines="1" | 107 | android:lines="1" |
108 | android:nextFocusLeft="@id/etPuertoBajada" | ||
109 | android:nextFocusRight="@id/etPuertoBajada" | ||
110 | android:nextFocusDown="@id/etPuertoBajada" | ||
103 | android:textSize="15sp" | 111 | android:textSize="15sp" |
104 | app:layout_constraintBaseline_toBaselineOf="@+id/etDireccionServidor" | 112 | app:layout_constraintBaseline_toBaselineOf="@+id/etDireccionServidor" |
105 | app:layout_constraintStart_toEndOf="@+id/etDireccionServidor" | 113 | app:layout_constraintStart_toEndOf="@+id/etDireccionServidor" /> |
106 | android:autofillHints="" /> | 114 | |
115 | <EditText | ||
116 | android:id="@+id/etPuertoBajada" | ||
117 | android:layout_width="150dp" | ||
118 | android:layout_height="wrap_content" | ||
119 | android:layout_margin="10dp" | ||
120 | android:autofillHints="" | ||
121 | android:clickable="true" | ||
122 | android:ems="10" | ||
123 | android:focusable="true" | ||
124 | android:hint="Puerto de Bajada" | ||
125 | android:inputType="number" | ||
126 | android:lines="1" | ||
127 | android:nextFocusLeft="@id/btnGuardarServidores" | ||
128 | android:nextFocusRight="@id/btnGuardarServidores" | ||
129 | android:nextFocusDown="@id/btnGuardarServidores" | ||
130 | android:textSize="15sp" | ||
131 | app:layout_constraintBaseline_toBaselineOf="@+id/etPuertoSubida" | ||
132 | |||
133 | app:layout_constraintStart_toEndOf="@+id/etPuertoSubida" /> | ||
107 | 134 | ||
108 | 135 | ||
109 | <androidx.recyclerview.widget.RecyclerView | 136 | <androidx.recyclerview.widget.RecyclerView |
110 | android:id="@+id/rvServidores" | 137 | android:id="@+id/rvServidores" |
111 | android:layout_width="match_parent" | 138 | android:layout_width="match_parent" |
112 | android:layout_height="0dp" | 139 | android:layout_height="0dp" |
113 | android:layout_marginTop="10dp" | 140 | android:layout_marginTop="10dp" |
114 | android:background="@android:color/darker_gray" | 141 | android:background="@android:color/darker_gray" |
115 | app:layout_constraintBottom_toTopOf="@+id/btnGuardarServidores" | 142 | app:layout_constraintBottom_toTopOf="@+id/btnGuardarServidores" |
116 | app:layout_constraintEnd_toEndOf="parent" | 143 | app:layout_constraintEnd_toEndOf="parent" |
117 | app:layout_constraintStart_toStartOf="parent" | 144 | app:layout_constraintStart_toStartOf="parent" |
118 | app:layout_constraintTop_toBottomOf="@+id/etPuerto" | 145 | app:layout_constraintTop_toBottomOf="@+id/etPuertoSubida" |
119 | app:layout_goneMarginEnd="10dp" | 146 | app:layout_goneMarginEnd="10dp" |
120 | tools:listitem="@layout/item_servidores" /> | 147 | tools:listitem="@layout/item_servidores" /> |
121 | 148 | ||
122 | <Button | 149 | <Button |
123 | android:id="@+id/btnGuardarServidores" | 150 | android:id="@+id/btnGuardarServidores" |
124 | android:layout_width="0dp" | 151 | android:layout_width="0dp" |
125 | android:layout_height="wrap_content" | 152 | android:layout_height="wrap_content" |
126 | android:layout_marginTop="10dp" | 153 | android:layout_marginTop="10dp" |
127 | android:layout_marginEnd="10dp" | 154 | android:layout_marginEnd="10dp" |
128 | android:background="@drawable/boton_borde_redondeado" | 155 | android:background="@drawable/boton_borde_redondeado" |
129 | android:padding="10dp" | 156 | android:padding="10dp" |
130 | android:text="@string/btnGuardarServidores" | 157 | android:text="@string/btnGuardarServidores" |
131 | android:textColor="@android:color/white" | 158 | android:textColor="@android:color/white" |
132 | app:layout_constraintBottom_toBottomOf="parent" | 159 | app:layout_constraintBottom_toBottomOf="parent" |
133 | app:layout_constraintEnd_toEndOf="parent" | 160 | app:layout_constraintEnd_toEndOf="parent" |
134 | app:layout_constraintStart_toStartOf="parent" | 161 | app:layout_constraintStart_toStartOf="parent" |
135 | app:layout_constraintTop_toBottomOf="@+id/rvServidores" /> | 162 | app:layout_constraintTop_toBottomOf="@+id/rvServidores" /> |
136 | 163 | ||
137 | </androidx.constraintlayout.widget.ConstraintLayout> | 164 | </androidx.constraintlayout.widget.ConstraintLayout> |
138 | 165 |
app/src/main/res/layout-large-v26/fragment_main.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="match_parent"> | ||
7 | |||
8 | <androidx.appcompat.widget.AppCompatTextView | ||
9 | android:id="@+id/tvInvDinamicos" | ||
10 | android:layout_width="match_parent" | ||
11 | android:layout_height="110dp" | ||
12 | android:autoSizeMaxTextSize="150sp" | ||
13 | android:autoSizeMinTextSize="25sp" | ||
14 | android:autoSizeStepGranularity="5sp" | ||
15 | android:autoSizeTextType="uniform" | ||
16 | android:gravity="start" | ||
17 | android:lines="1" | ||
18 | android:padding="10dp" | ||
19 | android:text="@string/invDinamicoVenta" | ||
20 | android:textColor="@color/colorAccent" | ||
21 | android:visibility="visible" | ||
22 | app:fontFamily="sans-serif-condensed" | ||
23 | app:layout_constraintEnd_toEndOf="parent" | ||
24 | app:layout_constraintStart_toStartOf="parent" | ||
25 | app:layout_constraintTop_toTopOf="parent" /> | ||
26 | |||
27 | <androidx.appcompat.widget.AppCompatImageButton | ||
28 | android:id="@+id/ivSort19" | ||
29 | android:layout_width="@dimen/icon_dim10" | ||
30 | android:layout_height="@dimen/icon_dim10" | ||
31 | android:layout_marginStart="10dp" | ||
32 | android:padding="5dp" | ||
33 | android:src="@drawable/ic_sort19" | ||
34 | android:visibility="gone" | ||
35 | app:layout_constraintHorizontal_bias="0.0" | ||
36 | app:layout_constraintHorizontal_chainStyle="packed" | ||
37 | app:layout_constraintStart_toStartOf="parent" | ||
38 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | ||
39 | |||
40 | <androidx.appcompat.widget.AppCompatImageButton | ||
41 | android:id="@+id/ivSort91" | ||
42 | android:layout_width="@dimen/icon_dim10" | ||
43 | android:layout_height="@dimen/icon_dim10" | ||
44 | android:layout_marginStart="10dp" | ||
45 | android:padding="5dp" | ||
46 | android:src="@drawable/ic_sort91" | ||
47 | android:visibility="gone" | ||
48 | app:layout_constraintHorizontal_chainStyle="packed" | ||
49 | app:layout_constraintStart_toStartOf="parent" | ||
50 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | ||
51 | |||
52 | <TextView | ||
53 | android:id="@+id/tvTipo" | ||
54 | android:layout_width="wrap_content" | ||
55 | android:layout_height="wrap_content" | ||
56 | android:layout_margin="5dp" | ||
57 | android:layout_marginTop="12dp" | ||
58 | android:text="Tipo:" | ||
59 | android:textSize="@dimen/md_message_textsize" | ||
60 | android:visibility="gone" | ||
61 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" | ||
62 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> | ||
63 | |||
64 | <com.google.android.material.checkbox.MaterialCheckBox | ||
65 | android:id="@+id/cbVentas" | ||
66 | android:layout_width="wrap_content" | ||
67 | android:layout_height="wrap_content" | ||
68 | android:layout_margin="5dp" | ||
69 | android:layout_marginTop="12dp" | ||
70 | android:checked="true" | ||
71 | android:text="Ventas" | ||
72 | android:textSize="@dimen/SubTitulos10" | ||
73 | android:visibility="gone" | ||
74 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" | ||
75 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | ||
76 | |||
77 | <com.google.android.material.checkbox.MaterialCheckBox | ||
78 | android:id="@+id/cbDeposito" | ||
79 | android:layout_width="wrap_content" | ||
80 | android:layout_height="wrap_content" | ||
81 | android:layout_margin="5dp" | ||
82 | android:layout_marginTop="12dp" | ||
83 | android:checked="true" | ||
84 | android:text="Deposito" | ||
85 | android:textSize="@dimen/SubTitulos10" | ||
86 | android:visibility="gone" | ||
87 | app:layout_constraintEnd_toEndOf="parent" | ||
88 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | ||
89 | |||
90 | <androidx.recyclerview.widget.RecyclerView | ||
91 | android:id="@+id/rcInventario" | ||
92 | android:layout_width="match_parent" | ||
93 | android:layout_height="0dp" | ||
94 | android:background="@android:color/darker_gray" | ||
95 | android:scrollbars="vertical" | ||
96 | android:visibility="gone" | ||
97 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | ||
98 | app:layout_constraintEnd_toEndOf="parent" | ||
99 | app:layout_constraintStart_toStartOf="parent" | ||
100 | app:layout_constraintTop_toBottomOf="@id/ivSort19" | ||
101 | tools:listitem="@layout/item_principal" /> | ||
102 | |||
103 | |||
104 | <androidx.appcompat.widget.AppCompatTextView | ||
105 | android:id="@+id/tvInvImportados" | ||
106 | android:layout_width="match_parent" | ||
107 | android:layout_height="110dp" | ||
108 | android:autoSizeMaxTextSize="150sp" | ||
109 | android:autoSizeMinTextSize="25sp" | ||
110 | android:autoSizeStepGranularity="5sp" | ||
111 | android:autoSizeTextType="uniform" | ||
112 | android:gravity="start" | ||
113 | android:lines="1" | ||
114 | android:padding="10dp" | ||
115 | android:text="@string/invDinamicoCompra" | ||
116 | android:textColor="@color/colorAccent" | ||
117 | android:visibility="visible" | ||
118 | app:fontFamily="sans-serif-condensed" | ||
119 | app:layout_constraintBottom_toBottomOf="parent" | ||
120 | app:layout_constraintEnd_toEndOf="parent" | ||
121 | app:layout_constraintStart_toStartOf="parent" | ||
122 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" | ||
123 | app:layout_constraintVertical_bias="0.0" /> | ||
124 | |||
125 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | ||
126 | <!-- android:id="@+id/ivSort19II"--> | ||
127 | <!-- android:layout_width="@dimen/icon_dim10"--> | ||
128 | <!-- android:layout_height="@dimen/icon_dim10"--> | ||
129 | <!-- android:layout_marginStart="10dp"--> | ||
130 | <!-- android:padding="5dp"--> | ||
131 | <!-- android:src="@drawable/ic_sort19"--> | ||
132 | <!-- android:visibility="invisible"--> | ||
133 | <!-- app:layout_constraintHorizontal_bias="0.0"--> | ||
134 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
135 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
136 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | ||
137 | |||
138 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | ||
139 | <!-- android:id="@+id/ivSort91II"--> | ||
140 | <!-- android:layout_width="@dimen/icon_dim10"--> | ||
141 | <!-- android:layout_height="@dimen/icon_dim10"--> | ||
142 | <!-- android:layout_marginStart="10dp"--> | ||
143 | <!-- android:padding="5dp"--> | ||
144 | <!-- android:src="@drawable/ic_sort91"--> | ||
145 | <!-- android:visibility="invisible"--> | ||
146 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
147 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
148 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | ||
149 | <ImageView | ||
150 | android:id="@+id/ivPortada" | ||
151 | android:layout_width="452dp" | ||
152 | android:layout_height="259dp" | ||
153 | android:elevation="10dp" | ||
154 | android:visibility="visible" | ||
155 | app:layout_constraintBottom_toBottomOf="parent" | ||
156 | app:layout_constraintEnd_toEndOf="parent" | ||
157 | app:layout_constraintStart_toStartOf="parent" | ||
158 | app:layout_constraintTop_toBottomOf="@+id/tvInvImportados" | ||
159 | tools:srcCompat="@drawable/imagen_portada" /> | ||
160 | |||
161 | <androidx.recyclerview.widget.RecyclerView | ||
162 | android:id="@+id/rcInventarioII" | ||
163 | android:layout_width="match_parent" | ||
164 | android:layout_height="0dp" | ||
165 | android:background="@android:color/darker_gray" | ||
166 | android:scrollbars="vertical" | ||
167 | android:visibility="gone" | ||
168 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | ||
169 | app:layout_constraintEnd_toEndOf="parent" | ||
170 | app:layout_constraintStart_toStartOf="parent" | ||
171 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" | ||
172 | tools:listitem="@layout/item_principal" /> | ||
173 | |||
174 | <androidx.constraintlayout.widget.Guideline | ||
175 | android:id="@+id/guideline6" | ||
176 | android:layout_width="wrap_content" | ||
177 | android:layout_height="wrap_content" | ||
178 | android:orientation="horizontal" | ||
179 | app:layout_constraintGuide_percent="0.97" /> | ||
180 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout-large/fragment_main.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="match_parent"> | ||
7 | |||
8 | <androidx.appcompat.widget.AppCompatTextView | ||
9 | android:id="@+id/tvInvDinamicos" | ||
10 | android:layout_width="match_parent" | ||
11 | android:layout_height="wrap_content" | ||
12 | android:textSize="60sp" | ||
13 | android:gravity="start" | ||
14 | android:lines="1" | ||
15 | android:padding="10dp" | ||
16 | android:text="@string/invDinamicoVenta" | ||
17 | android:textColor="@color/colorAccent" | ||
18 | android:visibility="visible" | ||
19 | app:fontFamily="sans-serif-condensed" | ||
20 | app:layout_constraintEnd_toEndOf="parent" | ||
21 | app:layout_constraintStart_toStartOf="parent" | ||
22 | app:layout_constraintTop_toTopOf="parent" /> | ||
23 | |||
24 | <androidx.appcompat.widget.AppCompatImageButton | ||
25 | android:id="@+id/ivSort19" | ||
26 | android:layout_width="@dimen/icon_dim10" | ||
27 | android:layout_height="@dimen/icon_dim10" | ||
28 | android:layout_marginStart="10dp" | ||
29 | android:padding="5dp" | ||
30 | android:src="@drawable/ic_sort19" | ||
31 | android:visibility="gone" | ||
32 | app:layout_constraintHorizontal_bias="0.0" | ||
33 | app:layout_constraintHorizontal_chainStyle="packed" | ||
34 | app:layout_constraintStart_toStartOf="parent" | ||
35 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | ||
36 | |||
37 | <androidx.appcompat.widget.AppCompatImageButton | ||
38 | android:id="@+id/ivSort91" | ||
39 | android:layout_width="@dimen/icon_dim10" | ||
40 | android:layout_height="@dimen/icon_dim10" | ||
41 | android:layout_marginStart="10dp" | ||
42 | android:padding="5dp" | ||
43 | android:src="@drawable/ic_sort91" | ||
44 | android:visibility="gone" | ||
45 | app:layout_constraintHorizontal_chainStyle="packed" | ||
46 | app:layout_constraintStart_toStartOf="parent" | ||
47 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | ||
48 | |||
49 | <TextView | ||
50 | android:id="@+id/tvTipo" | ||
51 | android:layout_width="wrap_content" | ||
52 | android:layout_height="wrap_content" | ||
53 | android:layout_margin="5dp" | ||
54 | android:layout_marginTop="12dp" | ||
55 | android:text="Tipo:" | ||
56 | android:textSize="@dimen/md_message_textsize" | ||
57 | android:visibility="gone" | ||
58 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" | ||
59 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> | ||
60 | |||
61 | <com.google.android.material.checkbox.MaterialCheckBox | ||
62 | android:id="@+id/cbVentas" | ||
63 | android:layout_width="wrap_content" | ||
64 | android:layout_height="wrap_content" | ||
65 | android:layout_margin="5dp" | ||
66 | android:layout_marginTop="12dp" | ||
67 | android:checked="true" | ||
68 | android:text="Ventas" | ||
69 | android:textSize="@dimen/SubTitulos10" | ||
70 | android:visibility="gone" | ||
71 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" | ||
72 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | ||
73 | |||
74 | <com.google.android.material.checkbox.MaterialCheckBox | ||
75 | android:id="@+id/cbDeposito" | ||
76 | android:layout_width="wrap_content" | ||
77 | android:layout_height="wrap_content" | ||
78 | android:layout_margin="5dp" | ||
79 | android:layout_marginTop="12dp" | ||
80 | android:checked="true" | ||
81 | android:text="Deposito" | ||
82 | android:textSize="@dimen/SubTitulos10" | ||
83 | android:visibility="gone" | ||
84 | app:layout_constraintEnd_toEndOf="parent" | ||
85 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | ||
86 | |||
87 | <androidx.recyclerview.widget.RecyclerView | ||
88 | android:id="@+id/rcInventario" | ||
89 | android:layout_width="match_parent" | ||
90 | android:layout_height="0dp" | ||
91 | android:background="@android:color/darker_gray" | ||
92 | android:scrollbars="vertical" | ||
93 | android:visibility="gone" | ||
94 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | ||
95 | app:layout_constraintEnd_toEndOf="parent" | ||
96 | app:layout_constraintStart_toStartOf="parent" | ||
97 | app:layout_constraintTop_toBottomOf="@id/ivSort19" | ||
98 | tools:listitem="@layout/item_principal" /> | ||
99 | |||
100 | |||
101 | <androidx.appcompat.widget.AppCompatTextView | ||
102 | android:id="@+id/tvInvImportados" | ||
103 | android:layout_width="match_parent" | ||
104 | android:layout_height="wrap_content" | ||
105 | android:textSize="60sp" | ||
106 | android:gravity="start" | ||
107 | android:lines="1" | ||
108 | android:padding="10dp" | ||
109 | android:text="@string/invDinamicoCompra" | ||
110 | android:textColor="@color/colorAccent" | ||
111 | android:visibility="visible" | ||
112 | app:fontFamily="sans-serif-condensed" | ||
113 | app:layout_constraintBottom_toBottomOf="parent" | ||
114 | app:layout_constraintEnd_toEndOf="parent" | ||
115 | app:layout_constraintStart_toStartOf="parent" | ||
116 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" | ||
117 | app:layout_constraintVertical_bias="0.0" /> | ||
118 | |||
119 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | ||
120 | <!-- android:id="@+id/ivSort19II"--> | ||
121 | <!-- android:layout_width="@dimen/icon_dim10"--> | ||
122 | <!-- android:layout_height="@dimen/icon_dim10"--> | ||
123 | <!-- android:layout_marginStart="10dp"--> | ||
124 | <!-- android:padding="5dp"--> | ||
125 | <!-- android:src="@drawable/ic_sort19"--> | ||
126 | <!-- android:visibility="invisible"--> | ||
127 | <!-- app:layout_constraintHorizontal_bias="0.0"--> | ||
128 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
129 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
130 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | ||
131 | |||
132 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | ||
133 | <!-- android:id="@+id/ivSort91II"--> | ||
134 | <!-- android:layout_width="@dimen/icon_dim10"--> | ||
135 | <!-- android:layout_height="@dimen/icon_dim10"--> | ||
136 | <!-- android:layout_marginStart="10dp"--> | ||
137 | <!-- android:padding="5dp"--> | ||
138 | <!-- android:src="@drawable/ic_sort91"--> | ||
139 | <!-- android:visibility="invisible"--> | ||
140 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
141 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
142 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | ||
143 | <ImageView | ||
144 | android:id="@+id/ivPortada" | ||
145 | android:layout_width="706dp" | ||
146 | android:layout_height="448dp" | ||
147 | android:elevation="10dp" | ||
148 | android:visibility="visible" | ||
149 | app:layout_constraintBottom_toBottomOf="parent" | ||
150 | app:layout_constraintEnd_toEndOf="parent" | ||
151 | app:layout_constraintStart_toStartOf="parent" | ||
152 | app:layout_constraintTop_toBottomOf="@+id/tvInvImportados" | ||
153 | tools:srcCompat="@drawable/imagen_portada" /> | ||
154 | |||
155 | <androidx.recyclerview.widget.RecyclerView | ||
156 | android:id="@+id/rcInventarioII" | ||
157 | android:layout_width="match_parent" | ||
158 | android:layout_height="0dp" | ||
159 | android:background="@android:color/darker_gray" | ||
160 | android:scrollbars="vertical" | ||
161 | android:visibility="gone" | ||
162 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | ||
163 | app:layout_constraintEnd_toEndOf="parent" | ||
164 | app:layout_constraintStart_toStartOf="parent" | ||
165 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" | ||
166 | tools:listitem="@layout/item_principal" /> | ||
167 | |||
168 | <androidx.constraintlayout.widget.Guideline | ||
169 | android:id="@+id/guideline6" | ||
170 | android:layout_width="wrap_content" | ||
171 | android:layout_height="wrap_content" | ||
172 | android:orientation="horizontal" | ||
173 | app:layout_constraintGuide_percent="0.97" /> | ||
174 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout-xlarge-v26/fragment_actua_maestros.xml
File was created | 1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="match_parent" | ||
7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> | ||
8 | |||
9 | <androidx.appcompat.widget.AppCompatTextView | ||
10 | android:id="@+id/tvActMaestros" | ||
11 | android:layout_width="match_parent" | ||
12 | android:layout_height="120dp" | ||
13 | android:layout_marginTop="15dp" | ||
14 | android:autoSizeMaxTextSize="100sp" | ||
15 | android:autoSizeMinTextSize="20sp" | ||
16 | android:autoSizeStepGranularity="5sp" | ||
17 | android:autoSizeTextType="uniform" | ||
18 | android:gravity="center" | ||
19 | android:lines="1" | ||
20 | android:text="@string/tvActMaestros" | ||
21 | android:textColor="@color/colorAccent" | ||
22 | app:fontFamily="sans-serif-condensed" | ||
23 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | ||
24 | app:layout_constraintEnd_toEndOf="parent" | ||
25 | app:layout_constraintStart_toStartOf="parent" | ||
26 | app:layout_constraintTop_toTopOf="parent" /> | ||
27 | |||
28 | <TextView | ||
29 | android:id="@+id/tvSeleccioneServidor" | ||
30 | android:layout_width="0dp" | ||
31 | android:layout_height="wrap_content" | ||
32 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
33 | android:layout_marginTop="20dp" | ||
34 | android:gravity="start" | ||
35 | android:lines="1" | ||
36 | android:text="@string/tvMedio" | ||
37 | android:textColor="@android:color/black" | ||
38 | android:textSize="@dimen/VentasDeposito10" | ||
39 | app:fontFamily="sans-serif-condensed" | ||
40 | app:layout_constraintEnd_toEndOf="parent" | ||
41 | app:layout_constraintStart_toStartOf="parent" | ||
42 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> | ||
43 | |||
44 | <RadioGroup | ||
45 | android:id="@+id/rgTipoActualizacion" | ||
46 | android:layout_width="0dp" | ||
47 | android:layout_height="wrap_content" | ||
48 | android:layout_marginTop="20dp" | ||
49 | android:gravity="start" | ||
50 | android:orientation="vertical" | ||
51 | app:layout_constraintEnd_toEndOf="parent" | ||
52 | app:layout_constraintStart_toStartOf="parent" | ||
53 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"> | ||
54 | |||
55 | <RadioButton | ||
56 | android:id="@+id/obPorWifi" | ||
57 | android:layout_width="wrap_content" | ||
58 | android:layout_height="wrap_content" | ||
59 | android:layout_margin="10dp" | ||
60 | android:checked="true" | ||
61 | android:padding="5dp" | ||
62 | android:text="@string/obPorWifi" | ||
63 | android:textSize="@dimen/SubTitulos10" /> | ||
64 | |||
65 | <RadioButton | ||
66 | android:id="@+id/obImpInventarios" | ||
67 | android:layout_width="wrap_content" | ||
68 | android:layout_height="wrap_content" | ||
69 | android:layout_margin="10dp" | ||
70 | android:checked="false" | ||
71 | android:padding="5dp" | ||
72 | android:text="@string/obViaArchivo" | ||
73 | android:textSize="@dimen/SubTitulos10"/> | ||
74 | </RadioGroup> | ||
75 | |||
76 | <TextView | ||
77 | android:id="@+id/tvServerConectado" | ||
78 | android:layout_width="match_parent" | ||
79 | android:layout_height="wrap_content" | ||
80 | android:layout_margin="30dp" | ||
81 | android:gravity="center" | ||
82 | android:lines="2" | ||
83 | android:text="" | ||
84 | android:textColor="@android:color/black" | ||
85 | android:textSize="@dimen/textCantidad10" | ||
86 | android:textStyle="bold" | ||
87 | app:fontFamily="sans-serif-condensed" | ||
88 | app:layout_constraintBottom_toTopOf="@+id/countriesList" | ||
89 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" /> | ||
90 | |||
91 | <TextView | ||
92 | android:id="@+id/countriesList" | ||
93 | android:layout_width="0dp" | ||
94 | android:layout_height="wrap_content" | ||
95 | android:layout_marginTop="@dimen/MarginTopTitulos" | ||
96 | android:gravity="center" | ||
97 | android:text="" | ||
98 | android:textColor="@android:color/black" | ||
99 | android:textSize="@dimen/SubTitulos10" | ||
100 | android:textStyle="bold" | ||
101 | android:visibility="visible" | ||
102 | app:fontFamily="sans-serif-condensed" | ||
103 | app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct" | ||
104 | app:layout_constraintEnd_toEndOf="parent" | ||
105 | app:layout_constraintHorizontal_bias="0.0" | ||
106 | app:layout_constraintStart_toStartOf="parent" | ||
107 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" | ||
108 | app:layout_constraintVertical_bias="0.106" /> | ||
109 | |||
110 | <Button | ||
111 | android:id="@+id/btnConfirmarAct" | ||
112 | android:layout_width="0dp" | ||
113 | android:layout_height="wrap_content" | ||
114 | android:layout_margin="20dp" | ||
115 | android:background="@drawable/boton_borde_redondeado" | ||
116 | android:padding="10dp" | ||
117 | android:text="@string/btnConfirmarAct" | ||
118 | android:textColor="@android:color/white" | ||
119 | android:textSize="@dimen/SubTitulos10" | ||
120 | app:layout_constraintBottom_toBottomOf="parent" | ||
121 | app:layout_constraintEnd_toEndOf="parent" | ||
122 | app:layout_constraintStart_toStartOf="parent" /> | ||
123 | |||
124 | <ProgressBar | ||
125 | android:id="@+id/loading_view" | ||
126 | android:layout_width="wrap_content" | ||
127 | android:layout_height="wrap_content" | ||
128 | android:layout_marginStart="8dp" | ||
129 | android:layout_marginLeft="8dp" | ||
130 | android:layout_marginTop="8dp" | ||
131 | android:layout_marginEnd="8dp" | ||
132 | android:layout_marginRight="8dp" | ||
133 | android:layout_marginBottom="8dp" | ||
134 | android:visibility="gone" | ||
135 | app:layout_constraintBottom_toBottomOf="parent" | ||
136 | app:layout_constraintEnd_toEndOf="parent" | ||
137 | app:layout_constraintStart_toStartOf="parent" | ||
138 | app:layout_constraintTop_toTopOf="parent" /> | ||
139 | |||
140 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
141 |
app/src/main/res/layout-xlarge-v26/fragment_main.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="match_parent"> | ||
7 | |||
8 | <androidx.appcompat.widget.AppCompatTextView | ||
9 | android:id="@+id/tvInvDinamicos" | ||
10 | android:layout_width="match_parent" | ||
11 | android:layout_height="110dp" | ||
12 | android:autoSizeMaxTextSize="150sp" | ||
13 | android:autoSizeMinTextSize="25sp" | ||
14 | android:autoSizeStepGranularity="5sp" | ||
15 | android:autoSizeTextType="uniform" | ||
16 | android:gravity="start" | ||
17 | android:lines="1" | ||
18 | android:padding="10dp" | ||
19 | android:text="@string/invDinamicoVenta" | ||
20 | android:textColor="@color/colorAccent" | ||
21 | android:visibility="visible" | ||
22 | app:fontFamily="sans-serif-condensed" | ||
23 | app:layout_constraintEnd_toEndOf="parent" | ||
24 | app:layout_constraintStart_toStartOf="parent" | ||
25 | app:layout_constraintTop_toTopOf="parent" /> | ||
26 | |||
27 | <androidx.appcompat.widget.AppCompatImageButton | ||
28 | android:id="@+id/ivSort19" | ||
29 | android:layout_width="@dimen/icon_dim10" | ||
30 | android:layout_height="@dimen/icon_dim10" | ||
31 | android:layout_marginStart="10dp" | ||
32 | android:padding="5dp" | ||
33 | android:src="@drawable/ic_sort19" | ||
34 | android:visibility="gone" | ||
35 | app:layout_constraintHorizontal_bias="0.0" | ||
36 | app:layout_constraintHorizontal_chainStyle="packed" | ||
37 | app:layout_constraintStart_toStartOf="parent" | ||
38 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | ||
39 | |||
40 | <androidx.appcompat.widget.AppCompatImageButton | ||
41 | android:id="@+id/ivSort91" | ||
42 | android:layout_width="@dimen/icon_dim10" | ||
43 | android:layout_height="@dimen/icon_dim10" | ||
44 | android:layout_marginStart="10dp" | ||
45 | android:padding="5dp" | ||
46 | android:src="@drawable/ic_sort91" | ||
47 | android:visibility="gone" | ||
48 | app:layout_constraintHorizontal_chainStyle="packed" | ||
49 | app:layout_constraintStart_toStartOf="parent" | ||
50 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | ||
51 | |||
52 | <TextView | ||
53 | android:id="@+id/tvTipo" | ||
54 | android:layout_width="wrap_content" | ||
55 | android:layout_height="wrap_content" | ||
56 | android:layout_margin="5dp" | ||
57 | android:layout_marginTop="12dp" | ||
58 | android:text="Tipo:" | ||
59 | android:textSize="@dimen/md_message_textsize" | ||
60 | android:visibility="gone" | ||
61 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" | ||
62 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> | ||
63 | |||
64 | <com.google.android.material.checkbox.MaterialCheckBox | ||
65 | android:id="@+id/cbVentas" | ||
66 | android:layout_width="wrap_content" | ||
67 | android:layout_height="wrap_content" | ||
68 | android:layout_margin="5dp" | ||
69 | android:layout_marginTop="12dp" | ||
70 | android:checked="true" | ||
71 | android:text="Ventas" | ||
72 | android:textSize="@dimen/SubTitulos10" | ||
73 | android:visibility="gone" | ||
74 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" | ||
75 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | ||
76 | |||
77 | <com.google.android.material.checkbox.MaterialCheckBox | ||
78 | android:id="@+id/cbDeposito" | ||
79 | android:layout_width="wrap_content" | ||
80 | android:layout_height="wrap_content" | ||
81 | android:layout_margin="5dp" | ||
82 | android:layout_marginTop="12dp" | ||
83 | android:checked="true" | ||
84 | android:text="Deposito" | ||
85 | android:textSize="@dimen/SubTitulos10" | ||
86 | android:visibility="gone" | ||
87 | app:layout_constraintEnd_toEndOf="parent" | ||
88 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | ||
89 | |||
90 | <androidx.recyclerview.widget.RecyclerView | ||
91 | android:id="@+id/rcInventario" | ||
92 | android:layout_width="match_parent" | ||
93 | android:layout_height="0dp" | ||
94 | android:background="@android:color/darker_gray" | ||
95 | android:scrollbars="vertical" | ||
96 | android:visibility="gone" | ||
97 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | ||
98 | app:layout_constraintEnd_toEndOf="parent" | ||
99 | app:layout_constraintStart_toStartOf="parent" | ||
100 | app:layout_constraintTop_toBottomOf="@id/ivSort19" | ||
101 | tools:listitem="@layout/item_principal" /> | ||
102 | |||
103 | |||
104 | <androidx.appcompat.widget.AppCompatTextView | ||
105 | android:id="@+id/tvInvImportados" | ||
106 | android:layout_width="match_parent" | ||
107 | android:layout_height="110dp" | ||
108 | android:autoSizeMaxTextSize="150sp" | ||
109 | android:autoSizeMinTextSize="25sp" | ||
110 | android:autoSizeStepGranularity="5sp" | ||
111 | android:autoSizeTextType="uniform" | ||
112 | android:gravity="start" | ||
113 | android:lines="1" | ||
114 | android:padding="10dp" | ||
115 | android:text="@string/invDinamicoCompra" | ||
116 | android:textColor="@color/colorAccent" | ||
117 | android:visibility="visible" | ||
118 | app:fontFamily="sans-serif-condensed" | ||
119 | app:layout_constraintBottom_toBottomOf="parent" | ||
120 | app:layout_constraintEnd_toEndOf="parent" | ||
121 | app:layout_constraintStart_toStartOf="parent" | ||
122 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" | ||
123 | app:layout_constraintVertical_bias="0.0" /> | ||
124 | |||
125 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | ||
126 | <!-- android:id="@+id/ivSort19II"--> | ||
127 | <!-- android:layout_width="@dimen/icon_dim10"--> | ||
128 | <!-- android:layout_height="@dimen/icon_dim10"--> | ||
129 | <!-- android:layout_marginStart="10dp"--> | ||
130 | <!-- android:padding="5dp"--> | ||
131 | <!-- android:src="@drawable/ic_sort19"--> | ||
132 | <!-- android:visibility="invisible"--> | ||
133 | <!-- app:layout_constraintHorizontal_bias="0.0"--> | ||
134 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
135 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
136 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | ||
137 | |||
138 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | ||
139 | <!-- android:id="@+id/ivSort91II"--> | ||
140 | <!-- android:layout_width="@dimen/icon_dim10"--> | ||
141 | <!-- android:layout_height="@dimen/icon_dim10"--> | ||
142 | <!-- android:layout_marginStart="10dp"--> | ||
143 | <!-- android:padding="5dp"--> | ||
144 | <!-- android:src="@drawable/ic_sort91"--> | ||
145 | <!-- android:visibility="invisible"--> | ||
146 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
147 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
148 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | ||
149 | |||
150 | <ImageView | ||
151 | android:id="@+id/ivPortada" | ||
152 | android:layout_width="730dp" | ||
153 | android:layout_height="491dp" | ||
154 | android:layout_marginBottom="156dp" | ||
155 | android:elevation="10dp" | ||
156 | android:visibility="visible" | ||
157 | app:layout_constraintBottom_toBottomOf="parent" | ||
158 | app:layout_constraintEnd_toEndOf="parent" | ||
159 | app:layout_constraintStart_toStartOf="parent" | ||
160 | app:layout_constraintTop_toBottomOf="@+id/tvInvImportados" | ||
161 | tools:srcCompat="@drawable/imagen_portada" /> | ||
162 | |||
163 | <androidx.recyclerview.widget.RecyclerView | ||
164 | android:id="@+id/rcInventarioII" | ||
165 | android:layout_width="match_parent" | ||
166 | android:layout_height="0dp" | ||
167 | android:background="@android:color/darker_gray" | ||
168 | android:scrollbars="vertical" | ||
169 | android:visibility="gone" | ||
170 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | ||
171 | app:layout_constraintEnd_toEndOf="parent" | ||
172 | app:layout_constraintStart_toStartOf="parent" | ||
173 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" | ||
174 | tools:listitem="@layout/item_principal" /> | ||
175 | |||
176 | <androidx.constraintlayout.widget.Guideline | ||
177 | android:id="@+id/guideline6" | ||
178 | android:layout_width="wrap_content" | ||
179 | android:layout_height="wrap_content" | ||
180 | android:orientation="horizontal" | ||
181 | app:layout_constraintGuide_percent="0.97" /> | ||
182 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout-xlarge/activity_splash.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | android:background="#E6E6E6" | 7 | android:background="#E6E6E6" |
8 | 8 | ||
9 | tools:context=".UI.SplashActivity"> | 9 | tools:context=".UI.SplashActivity"> |
10 | 10 | ||
11 | 11 | ||
12 | <androidx.appcompat.widget.AppCompatTextView | 12 | <androidx.appcompat.widget.AppCompatTextView |
13 | android:id="@+id/textView2" | 13 | android:id="@+id/textView2" |
14 | android:layout_width="match_parent" | 14 | android:layout_width="match_parent" |
15 | android:layout_height="150dp" | 15 | android:layout_height="150dp" |
16 | android:layout_margin="20dp" | 16 | android:layout_margin="20dp" |
17 | android:autoSizeMaxTextSize="1000sp" | 17 | android:textSize="95sp" |
18 | android:autoSizeMinTextSize="30sp" | ||
19 | android:autoSizeStepGranularity="5sp" | ||
20 | android:autoSizeTextType="uniform" | ||
21 | android:gravity="center" | 18 | android:gravity="center" |
22 | android:lines="1" | 19 | android:lines="1" |
23 | android:text="@string/bien" | 20 | android:text="@string/bien" |
24 | android:textColor="@color/colorAccent" | 21 | android:textColor="@color/colorAccent" |
25 | app:fontFamily="sans-serif-condensed" | 22 | app:fontFamily="sans-serif-condensed" |
26 | app:layout_constraintBottom_toTopOf="@+id/imageView" | 23 | app:layout_constraintBottom_toTopOf="@+id/imageView" |
27 | app:layout_constraintEnd_toEndOf="parent" | 24 | app:layout_constraintEnd_toEndOf="parent" |
28 | app:layout_constraintStart_toStartOf="parent" | 25 | app:layout_constraintStart_toStartOf="parent" |
29 | app:layout_constraintTop_toTopOf="parent" /> | 26 | app:layout_constraintTop_toTopOf="parent" /> |
30 | 27 | ||
31 | <ImageView | 28 | <ImageView |
32 | android:id="@+id/imageView" | 29 | android:id="@+id/imageView" |
33 | android:layout_width="541dp" | 30 | android:layout_width="541dp" |
34 | android:layout_height="388dp" | 31 | android:layout_height="388dp" |
35 | android:contentDescription="@string/todo" | 32 | android:contentDescription="@string/todo" |
36 | android:src="@drawable/logo_splash" | 33 | android:src="@drawable/logo_splash" |
37 | app:layout_constraintBottom_toTopOf="@id/textView4" | 34 | app:layout_constraintBottom_toTopOf="@id/textView4" |
38 | app:layout_constraintEnd_toEndOf="parent" | 35 | app:layout_constraintEnd_toEndOf="parent" |
39 | app:layout_constraintStart_toStartOf="parent" | 36 | app:layout_constraintStart_toStartOf="parent" |
40 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | 37 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> |
41 | 38 | ||
42 | <androidx.appcompat.widget.AppCompatTextView | 39 | <androidx.appcompat.widget.AppCompatTextView |
43 | android:id="@+id/textView4" | 40 | android:id="@+id/textView4" |
44 | android:layout_width="match_parent" | 41 | android:layout_width="match_parent" |
45 | android:layout_height="150dp" | 42 | android:layout_height="150dp" |
46 | android:layout_margin="20dp" | 43 | android:layout_margin="20dp" |
47 | android:autoSizeMaxTextSize="1000sp" | 44 | android:textSize="95sp" |
48 | android:autoSizeMinTextSize="30sp" | ||
49 | android:autoSizeStepGranularity="5sp" | ||
50 | android:autoSizeTextType="uniform" | ||
51 | android:gravity="center" | 45 | android:gravity="center" |
52 | android:lines="1" | 46 | android:lines="1" |
53 | android:text="@string/inventario" | 47 | android:text="@string/inventario" |
54 | android:textColor="@color/colorAccent" | 48 | android:textColor="@color/colorAccent" |
55 | app:fontFamily="sans-serif-condensed" | 49 | app:fontFamily="sans-serif-condensed" |
56 | app:layout_constraintBottom_toBottomOf="parent" | 50 | app:layout_constraintBottom_toBottomOf="parent" |
57 | app:layout_constraintEnd_toEndOf="parent" | 51 | app:layout_constraintEnd_toEndOf="parent" |
58 | app:layout_constraintEnd_toStartOf="parent" | 52 | app:layout_constraintEnd_toStartOf="parent" |
59 | app:layout_constraintTop_toBottomOf="@id/imageView" /> | 53 | app:layout_constraintTop_toBottomOf="@id/imageView" /> |
60 | </androidx.constraintlayout.widget.ConstraintLayout> | 54 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout-xlarge/fragment_actua_maestros.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> | 7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> |
8 | 8 | ||
9 | |||
10 | <androidx.appcompat.widget.AppCompatTextView | 9 | <androidx.appcompat.widget.AppCompatTextView |
11 | android:id="@+id/tvActMaestros" | 10 | android:id="@+id/tvActMaestros" |
12 | android:layout_width="match_parent" | 11 | android:layout_width="match_parent" |
13 | android:layout_height="120dp" | 12 | android:layout_height="120dp" |
14 | android:layout_marginTop="15dp" | 13 | android:layout_marginTop="15dp" |
15 | android:autoSizeMaxTextSize="100sp" | 14 | android:textSize="60sp" |
16 | android:autoSizeMinTextSize="20sp" | ||
17 | android:autoSizeStepGranularity="5sp" | ||
18 | android:autoSizeTextType="uniform" | ||
19 | android:gravity="center" | 15 | android:gravity="center" |
20 | android:lines="1" | 16 | android:lines="1" |
21 | android:text="@string/tvActMaestros" | 17 | android:text="@string/tvActMaestros" |
22 | android:textColor="@color/colorAccent" | 18 | android:textColor="@color/colorAccent" |
23 | |||
24 | app:fontFamily="sans-serif-condensed" | 19 | app:fontFamily="sans-serif-condensed" |
25 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | 20 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" |
26 | app:layout_constraintEnd_toEndOf="parent" | 21 | app:layout_constraintEnd_toEndOf="parent" |
27 | app:layout_constraintStart_toStartOf="parent" | 22 | app:layout_constraintStart_toStartOf="parent" |
28 | app:layout_constraintTop_toTopOf="parent" /> | 23 | app:layout_constraintTop_toTopOf="parent" /> |
29 | 24 | ||
30 | <TextView | 25 | <TextView |
31 | android:id="@+id/tvSeleccioneServidor" | 26 | android:id="@+id/tvSeleccioneServidor" |
32 | android:layout_width="0dp" | 27 | android:layout_width="0dp" |
33 | android:layout_height="wrap_content" | 28 | android:layout_height="wrap_content" |
34 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 29 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
35 | android:layout_marginTop="20dp" | 30 | android:layout_marginTop="20dp" |
36 | android:gravity="start" | 31 | android:gravity="start" |
37 | android:lines="1" | 32 | android:lines="1" |
38 | android:text="@string/tvMedio" | 33 | android:text="@string/tvMedio" |
39 | android:textColor="@android:color/black" | 34 | android:textColor="@android:color/black" |
40 | android:textSize="@dimen/SubTitulos10" | 35 | android:textSize="@dimen/VentasDeposito10" |
41 | app:fontFamily="sans-serif-condensed" | 36 | app:fontFamily="sans-serif-condensed" |
42 | app:layout_constraintEnd_toEndOf="parent" | 37 | app:layout_constraintEnd_toEndOf="parent" |
43 | app:layout_constraintStart_toStartOf="parent" | 38 | app:layout_constraintStart_toStartOf="parent" |
44 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> | 39 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> |
45 | 40 | ||
46 | <RadioGroup | 41 | <RadioGroup |
47 | android:id="@+id/rgTipoActualizacion" | 42 | android:id="@+id/rgTipoActualizacion" |
48 | android:layout_width="0dp" | 43 | android:layout_width="0dp" |
49 | android:layout_height="wrap_content" | 44 | android:layout_height="wrap_content" |
50 | android:layout_marginTop="20dp" | 45 | android:layout_marginTop="20dp" |
51 | android:gravity="start" | 46 | android:gravity="start" |
52 | android:orientation="vertical" | 47 | android:orientation="vertical" |
53 | app:layout_constraintEnd_toEndOf="parent" | 48 | app:layout_constraintEnd_toEndOf="parent" |
54 | app:layout_constraintStart_toStartOf="parent" | 49 | app:layout_constraintStart_toStartOf="parent" |
55 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"> | 50 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"> |
56 | 51 | ||
57 | <RadioButton | 52 | <RadioButton |
58 | android:id="@+id/obPorWifi" | 53 | android:id="@+id/obPorWifi" |
59 | android:layout_width="wrap_content" | 54 | android:layout_width="wrap_content" |
60 | android:layout_height="wrap_content" | 55 | android:layout_height="wrap_content" |
61 | android:layout_margin="5dp" | 56 | android:layout_margin="10dp" |
62 | android:checked="true" | 57 | android:checked="true" |
63 | android:padding="5dp" | 58 | android:padding="5dp" |
64 | android:text="@string/obPorWifi" | 59 | android:text="@string/obPorWifi" |
65 | android:textSize="@dimen/SubTitulos10" /> | 60 | android:textSize="@dimen/SubTitulos10" /> |
66 | 61 | ||
67 | <RadioButton | 62 | <RadioButton |
68 | android:id="@+id/obViaArchivo" | 63 | android:id="@+id/obImpInventarios" |
69 | android:layout_width="wrap_content" | 64 | android:layout_width="wrap_content" |
70 | android:layout_height="wrap_content" | 65 | android:layout_height="wrap_content" |
71 | android:layout_margin="5dp" | 66 | android:layout_margin="10dp" |
72 | android:checked="false" | 67 | android:checked="false" |
73 | android:padding="5dp" | 68 | android:padding="5dp" |
74 | android:text="@string/obViaArchivo" | 69 | android:text="@string/obViaArchivo" |
75 | android:textSize="@dimen/SubTitulos10"/> | 70 | android:textSize="@dimen/SubTitulos10"/> |
76 | </RadioGroup> | 71 | </RadioGroup> |
77 | 72 | ||
78 | <TextView | 73 | <TextView |
79 | android:id="@+id/tvServerConectado" | 74 | android:id="@+id/tvServerConectado" |
80 | android:layout_width="match_parent" | 75 | android:layout_width="match_parent" |
81 | android:layout_height="wrap_content" | 76 | android:layout_height="wrap_content" |
82 | android:layout_margin="30dp" | 77 | android:layout_margin="30dp" |
83 | android:gravity="center" | 78 | android:gravity="center" |
84 | android:lines="2" | 79 | android:lines="2" |
85 | android:text="" | 80 | android:text="" |
86 | android:textColor="@android:color/black" | 81 | android:textColor="@android:color/black" |
87 | android:textSize="@dimen/textCantidad10" | 82 | android:textSize="@dimen/textCantidad10" |
88 | android:textStyle="bold" | 83 | android:textStyle="bold" |
89 | app:fontFamily="sans-serif-condensed" | 84 | app:fontFamily="sans-serif-condensed" |
90 | app:layout_constraintBottom_toTopOf="@+id/countriesList" | 85 | app:layout_constraintBottom_toTopOf="@+id/countriesList" |
91 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" /> | 86 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" /> |
92 | 87 | ||
93 | <TextView | 88 | <TextView |
94 | android:id="@+id/countriesList" | 89 | android:id="@+id/countriesList" |
95 | android:layout_width="0dp" | 90 | android:layout_width="0dp" |
96 | android:layout_height="wrap_content" | 91 | android:layout_height="wrap_content" |
97 | android:layout_marginTop="@dimen/MarginTopTitulos" | 92 | android:layout_marginTop="@dimen/MarginTopTitulos" |
98 | android:gravity="center" | 93 | android:gravity="center" |
99 | android:text="" | 94 | android:text="" |
100 | android:textColor="@android:color/black" | 95 | android:textColor="@android:color/black" |
101 | android:textSize="@dimen/SubTitulos10" | 96 | android:textSize="@dimen/SubTitulos10" |
102 | android:textStyle="bold" | 97 | android:textStyle="bold" |
103 | android:visibility="visible" | 98 | android:visibility="visible" |
104 | app:fontFamily="sans-serif-condensed" | 99 | app:fontFamily="sans-serif-condensed" |
105 | app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct" | 100 | app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct" |
106 | app:layout_constraintEnd_toEndOf="parent" | 101 | app:layout_constraintEnd_toEndOf="parent" |
107 | app:layout_constraintHorizontal_bias="0.0" | 102 | app:layout_constraintHorizontal_bias="0.0" |
108 | app:layout_constraintStart_toStartOf="parent" | 103 | app:layout_constraintStart_toStartOf="parent" |
109 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" | 104 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" |
110 | app:layout_constraintVertical_bias="0.106" /> | 105 | app:layout_constraintVertical_bias="0.106" /> |
111 | 106 | ||
112 | <Button | 107 | <Button |
113 | android:id="@+id/btnConfirmarAct" | 108 | android:id="@+id/btnConfirmarAct" |
114 | android:layout_width="0dp" | 109 | android:layout_width="0dp" |
115 | android:layout_height="wrap_content" | 110 | android:layout_height="wrap_content" |
116 | android:layout_margin="20dp" | 111 | android:layout_margin="20dp" |
117 | android:background="@drawable/boton_borde_redondeado" | 112 | android:background="@drawable/boton_borde_redondeado" |
118 | android:padding="10dp" | 113 | android:padding="10dp" |
119 | android:text="@string/btnConfirmarAct" | 114 | android:text="@string/btnConfirmarAct" |
120 | android:textColor="@android:color/white" | 115 | android:textColor="@android:color/white" |
121 | android:textSize="@dimen/SubTitulos10" | 116 | android:textSize="@dimen/SubTitulos10" |
122 | app:layout_constraintBottom_toBottomOf="parent" | 117 | app:layout_constraintBottom_toBottomOf="parent" |
123 | app:layout_constraintEnd_toEndOf="parent" | 118 | app:layout_constraintEnd_toEndOf="parent" |
124 | app:layout_constraintStart_toStartOf="parent" /> | 119 | app:layout_constraintStart_toStartOf="parent" /> |
125 | 120 | ||
126 | |||
127 | <ProgressBar | 121 | <ProgressBar |
128 | android:id="@+id/loading_view" | 122 | android:id="@+id/loading_view" |
129 | android:layout_width="wrap_content" | 123 | android:layout_width="wrap_content" |
130 | android:layout_height="wrap_content" | 124 | android:layout_height="wrap_content" |
131 | android:layout_marginStart="8dp" | 125 | android:layout_marginStart="8dp" |
132 | android:layout_marginLeft="8dp" | 126 | android:layout_marginLeft="8dp" |
133 | android:layout_marginTop="8dp" | 127 | android:layout_marginTop="8dp" |
134 | android:layout_marginEnd="8dp" | 128 | android:layout_marginEnd="8dp" |
135 | android:layout_marginRight="8dp" | 129 | android:layout_marginRight="8dp" |
136 | android:layout_marginBottom="8dp" | 130 | android:layout_marginBottom="8dp" |
137 | android:visibility="gone" | 131 | android:visibility="gone" |
138 | app:layout_constraintBottom_toBottomOf="parent" | 132 | app:layout_constraintBottom_toBottomOf="parent" |
139 | app:layout_constraintEnd_toEndOf="parent" | 133 | app:layout_constraintEnd_toEndOf="parent" |
140 | app:layout_constraintStart_toStartOf="parent" | 134 | app:layout_constraintStart_toStartOf="parent" |
141 | app:layout_constraintTop_toTopOf="parent" /> | 135 | app:layout_constraintTop_toTopOf="parent" /> |
142 | 136 | ||
143 | </androidx.constraintlayout.widget.ConstraintLayout> | 137 | </androidx.constraintlayout.widget.ConstraintLayout> |
144 | 138 |
app/src/main/res/layout-xlarge/fragment_configuracion.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <ScrollView | 2 | <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | tools:context=".UI.configuracion.ConfiguracionFragment" | ||
6 | xmlns:android="http://schemas.android.com/apk/res/android" | ||
7 | android:layout_width="match_parent" | ||
8 | android:layout_height="wrap_content"> | ||
9 | |||
10 | <androidx.constraintlayout.widget.ConstraintLayout | ||
11 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
12 | android:layout_height="wrap_content" | 6 | android:layout_height="wrap_content" |
13 | tools:context=".UI.configuracion.ConfiguracionFragment"> | 7 | tools:context=".UI.configuracion.ConfiguracionFragment"> |
14 | 8 | ||
15 | 9 | <androidx.constraintlayout.widget.ConstraintLayout | |
16 | <androidx.appcompat.widget.AppCompatTextView | ||
17 | android:id="@+id/textView2" | ||
18 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
19 | android:layout_height="100dp" | ||
20 | android:layout_marginStart="8dp" | ||
21 | android:layout_marginEnd="8dp" | ||
22 | android:autoSizeMaxTextSize="100sp" | ||
23 | android:autoSizeMinTextSize="20sp" | ||
24 | android:autoSizeStepGranularity="5sp" | ||
25 | android:autoSizeTextType="uniform" | ||
26 | android:gravity="center" | ||
27 | android:lines="1" | ||
28 | android:text="@string/tvTituloConf" | ||
29 | android:textColor="@color/colorAccent" | ||
30 | android:textSize="@dimen/Titulos" | ||
31 | app:fontFamily="sans-serif-condensed" | ||
32 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | ||
33 | app:layout_constraintEnd_toEndOf="parent" | ||
34 | app:layout_constraintStart_toStartOf="parent" | ||
35 | app:layout_constraintTop_toTopOf="parent" /> | ||
36 | |||
37 | <TextView | ||
38 | android:id="@+id/tvSeleccioneServidor" | ||
39 | android:layout_width="0dp" | ||
40 | android:layout_height="wrap_content" | ||
41 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
42 | android:layout_marginTop="15dp" | ||
43 | android:gravity="start" | ||
44 | android:lines="1" | ||
45 | android:text="@string/tvSeleccioneServidor" | ||
46 | android:textColor="@android:color/black" | ||
47 | android:textSize="@dimen/SubTitulos10" | ||
48 | app:fontFamily="sans-serif-condensed" | ||
49 | app:layout_constraintBottom_toTopOf="@+id/spServidor" | ||
50 | app:layout_constraintEnd_toEndOf="parent" | ||
51 | app:layout_constraintStart_toStartOf="parent" | ||
52 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | ||
53 | |||
54 | <Spinner | ||
55 | android:id="@+id/spServidor" | ||
56 | style="@android:style/Widget.Holo.Light.Spinner" | ||
57 | android:layout_width="0dp" | ||
58 | android:layout_height="wrap_content" | ||
59 | android:elevation="5dp" | ||
60 | android:textSize="@dimen/VentasDeposito10" | ||
61 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | ||
62 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" | ||
63 | app:layout_constraintHorizontal_chainStyle="packed" | ||
64 | app:layout_constraintStart_toStartOf="parent" | ||
65 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" | ||
66 | /> | ||
67 | |||
68 | <Button | ||
69 | android:id="@+id/btnValidarServidor" | ||
70 | android:layout_width="wrap_content" | ||
71 | android:layout_height="wrap_content" | ||
72 | android:textColor="@android:color/white" | ||
73 | android:padding="10dp" | ||
74 | android:background="@drawable/boton_borde_redondeado" | ||
75 | android:text="@string/btnValidarServidor" | ||
76 | android:textSize="@dimen/SubTitulos10" | ||
77 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | ||
78 | app:layout_constraintEnd_toEndOf="parent" | ||
79 | app:layout_constraintHorizontal_chainStyle="packed" | ||
80 | app:layout_constraintStart_toEndOf="@id/spServidor" | ||
81 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> | ||
82 | |||
83 | <Button | ||
84 | android:id="@+id/btnAgregarServidor" | ||
85 | android:layout_width="0dp" | ||
86 | android:layout_height="wrap_content" | ||
87 | android:layout_marginTop="10dp" | ||
88 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
89 | android:layout_marginEnd="@dimen/MarginBotAgreSer" | ||
90 | android:text="@string/btnAgregarServidor" | ||
91 | android:textSize="@dimen/SubTitulos10" | ||
92 | android:textColor="@android:color/white" | ||
93 | android:padding="10dp" | ||
94 | android:background="@drawable/boton_borde_redondeado" | ||
95 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" | ||
96 | app:layout_constraintEnd_toEndOf="parent" | ||
97 | app:layout_constraintStart_toStartOf="parent" | ||
98 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> | ||
99 | |||
100 | |||
101 | <TextView | ||
102 | android:id="@+id/tvUbicacionCarpetas" | ||
103 | android:layout_width="0dp" | ||
104 | android:layout_height="wrap_content" | ||
105 | android:visibility="gone" | ||
106 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
107 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | ||
108 | android:gravity="start" | ||
109 | android:lines="1" | ||
110 | android:text="@string/tvUbicacionCarpetas" | ||
111 | android:textColor="@android:color/black" | ||
112 | android:textSize="@dimen/SubTitulos" | ||
113 | app:fontFamily="sans-serif-condensed" | ||
114 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" | ||
115 | app:layout_constraintEnd_toEndOf="parent" | ||
116 | app:layout_constraintStart_toStartOf="parent" | ||
117 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> | ||
118 | |||
119 | <ImageButton | ||
120 | android:id="@+id/ibSearch" | ||
121 | android:layout_width="36dp" | ||
122 | android:layout_height="37dp" | ||
123 | android:layout_margin="10dp" | ||
124 | android:src="@drawable/search" | ||
125 | android:textColor="@android:color/white" | ||
126 | android:padding="10dp" | ||
127 | android:visibility="gone" | ||
128 | android:background="@drawable/boton_borde_redondeado" | ||
129 | app:layout_constraintEnd_toStartOf="@+id/etRuta" | ||
130 | app:layout_constraintStart_toStartOf="parent" | ||
131 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | ||
132 | |||
133 | <EditText | ||
134 | android:id="@+id/etRuta" | ||
135 | android:layout_width="0dp" | ||
136 | android:layout_height="wrap_content" | ||
137 | android:layout_marginTop="10dp" | ||
138 | android:layout_marginEnd="10dp" | ||
139 | android:clickable="true" | ||
140 | android:ems="10" | ||
141 | android:focusable="true" | ||
142 | android:visibility="gone" | ||
143 | android:inputType="textPersonName" | ||
144 | android:lines="1" | ||
145 | android:text="" | ||
146 | android:textSize="@dimen/NormalText" | ||
147 | app:layout_constraintEnd_toEndOf="parent" | ||
148 | app:layout_constraintStart_toEndOf="@id/ibSearch" | ||
149 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | ||
150 | |||
151 | <TextView | ||
152 | android:id="@+id/tvActuFecha" | ||
153 | android:layout_width="0dp" | ||
154 | android:layout_height="wrap_content" | ||
155 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
156 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | ||
157 | android:gravity="start" | ||
158 | android:lines="1" | ||
159 | android:text="@string/tvTituloArea" | ||
160 | android:textColor="@android:color/black" | ||
161 | android:textSize="@dimen/SubTitulos10" | ||
162 | app:fontFamily="sans-serif-condensed" | ||
163 | app:layout_constraintEnd_toEndOf="parent" | ||
164 | app:layout_constraintStart_toStartOf="parent" | ||
165 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> | ||
166 | |||
167 | <RadioGroup | ||
168 | android:id="@+id/rgFechaHora" | ||
169 | android:layout_width="0dp" | ||
170 | android:layout_height="wrap_content" | 11 | android:layout_height="wrap_content" |
12 | tools:context=".UI.configuracion.ConfiguracionFragment"> | ||
171 | 13 | ||
172 | android:gravity="center" | ||
173 | android:orientation="horizontal" | ||
174 | app:layout_constraintEnd_toEndOf="parent" | ||
175 | app:layout_constraintStart_toStartOf="parent" | ||
176 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> | ||
177 | 14 | ||
178 | <RadioButton | 15 | <androidx.appcompat.widget.AppCompatTextView |
179 | android:id="@+id/rbVentas" | 16 | android:id="@+id/textView2" |
180 | android:layout_width="wrap_content" | 17 | android:layout_width="match_parent" |
18 | android:layout_height="100dp" | ||
19 | android:layout_marginStart="8dp" | ||
20 | android:layout_marginEnd="8dp" | ||
21 | android:gravity="center" | ||
22 | android:lines="1" | ||
23 | android:text="@string/tvTituloConf" | ||
24 | android:textColor="@color/colorAccent" | ||
25 | android:textSize="60sp" | ||
26 | |||
27 | app:fontFamily="sans-serif-condensed" | ||
28 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | ||
29 | app:layout_constraintEnd_toEndOf="parent" | ||
30 | app:layout_constraintStart_toStartOf="parent" | ||
31 | app:layout_constraintTop_toTopOf="parent" /> | ||
32 | |||
33 | <TextView | ||
34 | android:id="@+id/tvSeleccioneServidor" | ||
35 | android:layout_width="0dp" | ||
36 | android:layout_height="wrap_content" | ||
37 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
38 | android:layout_marginTop="15dp" | ||
39 | android:gravity="start" | ||
40 | android:lines="1" | ||
41 | android:text="@string/tvSeleccioneServidor" | ||
42 | android:textColor="@android:color/black" | ||
43 | android:textSize="@dimen/SubTitulos10" | ||
44 | app:fontFamily="sans-serif-condensed" | ||
45 | app:layout_constraintBottom_toTopOf="@+id/spServidor" | ||
46 | app:layout_constraintEnd_toEndOf="parent" | ||
47 | app:layout_constraintStart_toStartOf="parent" | ||
48 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | ||
49 | |||
50 | <Spinner | ||
51 | android:id="@+id/spServidor" | ||
52 | style="@android:style/Widget.Holo.Light.Spinner" | ||
53 | android:layout_width="0dp" | ||
181 | android:layout_height="wrap_content" | 54 | android:layout_height="wrap_content" |
182 | android:layout_margin="5dp" | 55 | android:elevation="5dp" |
183 | android:checked="true" | 56 | android:textSize="@dimen/VentasDeposito10" |
184 | android:padding="5dp" | 57 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" |
185 | android:text="@string/rbVentas" | 58 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" |
186 | android:textSize="@dimen/SubTitulos10" /> | 59 | app:layout_constraintHorizontal_chainStyle="packed" |
187 | 60 | app:layout_constraintStart_toStartOf="parent" | |
188 | <RadioButton | 61 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> |
189 | android:id="@+id/rbDeposito" | 62 | |
63 | <Button | ||
64 | android:id="@+id/btnValidarServidor" | ||
190 | android:layout_width="wrap_content" | 65 | android:layout_width="wrap_content" |
191 | android:layout_height="wrap_content" | 66 | android:layout_height="wrap_content" |
192 | android:layout_margin="5dp" | 67 | android:background="@drawable/boton_borde_redondeado" |
193 | android:checked="false" | 68 | android:padding="10dp" |
194 | android:padding="5dp" | 69 | android:text="@string/btnValidarServidor" |
195 | android:text="@string/rbDeposito" | 70 | android:textColor="@android:color/white" |
196 | android:textSize="@dimen/SubTitulos10" /> | 71 | android:textSize="@dimen/SubTitulos10" |
197 | 72 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | |
198 | </RadioGroup> | 73 | app:layout_constraintEnd_toEndOf="parent" |
199 | 74 | app:layout_constraintHorizontal_chainStyle="packed" | |
200 | <TextView | 75 | app:layout_constraintStart_toEndOf="@id/spServidor" |
201 | android:id="@+id/tvLosProductos" | 76 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> |
202 | android:layout_width="0dp" | 77 | |
203 | android:layout_height="wrap_content" | 78 | <Button |
204 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 79 | android:id="@+id/btnAgregarServidor" |
205 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" | 80 | android:layout_width="0dp" |
206 | android:gravity="start" | 81 | android:layout_height="wrap_content" |
207 | android:lines="1" | 82 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
208 | android:text="@string/tvLosProductos" | 83 | android:layout_marginTop="10dp" |
209 | android:textColor="@android:color/black" | 84 | android:layout_marginEnd="@dimen/MarginBotAgreSer" |
210 | android:textSize="@dimen/SubTitulos10" | 85 | android:background="@drawable/boton_borde_redondeado" |
211 | app:fontFamily="sans-serif-condensed" | 86 | android:padding="10dp" |
212 | app:layout_constraintEnd_toEndOf="parent" | 87 | android:text="@string/btnAgregarServidor" |
213 | app:layout_constraintStart_toStartOf="parent" | 88 | android:textColor="@android:color/white" |
214 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | 89 | android:textSize="@dimen/SubTitulos10" |
215 | 90 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" | |
216 | <RadioGroup | 91 | app:layout_constraintEnd_toEndOf="parent" |
217 | android:id="@+id/rgLosProductos" | 92 | app:layout_constraintStart_toStartOf="parent" |
218 | android:layout_width="0dp" | 93 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> |
219 | android:layout_height="wrap_content" | 94 | |
95 | |||
96 | <TextView | ||
97 | android:id="@+id/tvUbicacionCarpetas" | ||
98 | android:layout_width="0dp" | ||
99 | android:layout_height="wrap_content" | ||
100 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
101 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | ||
102 | android:gravity="start" | ||
103 | android:lines="1" | ||
104 | android:text="@string/tvUbicacionCarpetas" | ||
105 | android:textColor="@android:color/black" | ||
106 | android:textSize="@dimen/SubTitulos" | ||
107 | android:visibility="gone" | ||
108 | app:fontFamily="sans-serif-condensed" | ||
109 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" | ||
110 | app:layout_constraintEnd_toEndOf="parent" | ||
111 | app:layout_constraintStart_toStartOf="parent" | ||
112 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> | ||
113 | |||
114 | <ImageButton | ||
115 | android:id="@+id/ibSearch" | ||
116 | android:layout_width="36dp" | ||
117 | android:layout_height="37dp" | ||
118 | android:layout_margin="10dp" | ||
119 | android:background="@drawable/boton_borde_redondeado" | ||
120 | android:padding="10dp" | ||
121 | android:src="@drawable/search" | ||
122 | android:textColor="@android:color/white" | ||
123 | android:visibility="gone" | ||
124 | app:layout_constraintEnd_toStartOf="@+id/etRuta" | ||
125 | app:layout_constraintStart_toStartOf="parent" | ||
126 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | ||
127 | |||
128 | <EditText | ||
129 | android:id="@+id/etRuta" | ||
130 | android:layout_width="0dp" | ||
131 | android:layout_height="wrap_content" | ||
132 | android:layout_marginTop="10dp" | ||
133 | android:layout_marginEnd="10dp" | ||
134 | android:clickable="true" | ||
135 | android:ems="10" | ||
136 | android:focusable="true" | ||
137 | android:inputType="textPersonName" | ||
138 | android:lines="1" | ||
139 | android:text="" | ||
140 | android:textSize="@dimen/NormalText" | ||
141 | android:visibility="gone" | ||
142 | app:layout_constraintEnd_toEndOf="parent" | ||
143 | app:layout_constraintStart_toEndOf="@id/ibSearch" | ||
144 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | ||
145 | |||
146 | <TextView | ||
147 | android:id="@+id/tvActuFecha" | ||
148 | android:layout_width="0dp" | ||
149 | android:layout_height="wrap_content" | ||
150 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
151 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | ||
152 | android:gravity="start" | ||
153 | android:lines="1" | ||
154 | android:text="@string/tvTituloArea" | ||
155 | android:textColor="@android:color/black" | ||
156 | android:textSize="@dimen/SubTitulos10" | ||
157 | app:fontFamily="sans-serif-condensed" | ||
158 | app:layout_constraintEnd_toEndOf="parent" | ||
159 | app:layout_constraintStart_toStartOf="parent" | ||
160 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> | ||
161 | |||
162 | <RadioGroup | ||
163 | android:id="@+id/rgFechaHora" | ||
164 | android:layout_width="0dp" | ||
165 | android:layout_height="wrap_content" | ||
220 | 166 | ||
221 | android:gravity="center" | 167 | android:gravity="center" |
222 | android:orientation="vertical" | 168 | android:orientation="horizontal" |
223 | app:layout_constraintEnd_toEndOf="parent" | 169 | app:layout_constraintEnd_toEndOf="parent" |
224 | app:layout_constraintStart_toStartOf="parent" | 170 | app:layout_constraintStart_toStartOf="parent" |
225 | app:layout_constraintTop_toBottomOf="@+id/tvLosProductos"> | 171 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> |
172 | |||
173 | <RadioButton | ||
174 | android:id="@+id/rbVentas" | ||
175 | android:layout_width="wrap_content" | ||
176 | android:layout_height="wrap_content" | ||
177 | android:layout_margin="5dp" | ||
178 | android:checked="true" | ||
179 | android:padding="5dp" | ||
180 | android:text="@string/rbVentas" | ||
181 | android:textSize="@dimen/SubTitulos10" /> | ||
182 | |||
183 | <RadioButton | ||
184 | android:id="@+id/rbDeposito" | ||
185 | android:layout_width="wrap_content" | ||
186 | android:layout_height="wrap_content" | ||
187 | android:layout_margin="5dp" | ||
188 | android:checked="false" | ||
189 | android:padding="5dp" | ||
190 | android:text="@string/rbDeposito" | ||
191 | android:textSize="@dimen/SubTitulos10" /> | ||
192 | |||
193 | </RadioGroup> | ||
194 | |||
195 | <TextView | ||
196 | android:id="@+id/tvLosProductos" | ||
197 | android:layout_width="0dp" | ||
198 | android:layout_height="wrap_content" | ||
199 | android:layout_marginStart="@dimen/MarginBotAgreSer" | ||
200 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" | ||
201 | android:gravity="start" | ||
202 | android:lines="1" | ||
203 | android:text="@string/tvLosProductos" | ||
204 | android:textColor="@android:color/black" | ||
205 | android:textSize="@dimen/SubTitulos10" | ||
206 | app:fontFamily="sans-serif-condensed" | ||
207 | app:layout_constraintEnd_toEndOf="parent" | ||
208 | app:layout_constraintStart_toStartOf="parent" | ||
209 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> |
app/src/main/res/layout-xlarge/fragment_detalle_art_sec.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | android:id="@+id/nsPedidosDatos" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="match_parent"> | ||
7 | |||
8 | <androidx.cardview.widget.CardView | ||
9 | android:id="@+id/cvItem1" | ||
10 | android:layout_width="match_parent" | ||
11 | android:layout_height="wrap_content" | ||
12 | android:layout_marginStart="5dp" | ||
13 | android:layout_marginTop="5dp" | ||
14 | android:layout_marginEnd="5dp" | ||
15 | app:cardBackgroundColor="@android:color/darker_gray" | ||
16 | app:cardCornerRadius="25dp" | ||
17 | app:cardElevation="10dp" | ||
18 | app:layout_constraintEnd_toEndOf="parent" | ||
19 | app:layout_constraintStart_toStartOf="parent" | ||
20 | app:layout_constraintTop_toTopOf="parent"> | ||
21 | |||
22 | <androidx.constraintlayout.widget.ConstraintLayout | ||
23 | android:id="@+id/clayout" | ||
24 | android:layout_width="match_parent" | ||
25 | android:layout_height="match_parent"> | ||
26 | |||
27 | <!-- <TextView--> | ||
28 | <!-- android:id="@+id/tvTime"--> | ||
29 | <!-- android:layout_width="0dp"--> | ||
30 | <!-- android:layout_height="wrap_content"--> | ||
31 | <!-- android:layout_marginTop="15dp"--> | ||
32 | <!-- android:gravity="center_horizontal"--> | ||
33 | <!-- android:orientation="horizontal"--> | ||
34 | <!-- android:text="Detalle del artículo"--> | ||
35 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
36 | <!-- android:textSize="@dimen/Titulos"--> | ||
37 | <!-- android:textStyle="bold"--> | ||
38 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
39 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
40 | <!-- app:layout_constraintTop_toTopOf="parent" />--> | ||
41 | |||
42 | <TextView | ||
43 | android:id="@+id/tvDescripcion" | ||
44 | android:layout_width="wrap_content" | ||
45 | android:layout_height="0dp" | ||
46 | android:layout_marginTop="10dp" | ||
47 | android:layout_marginBottom="30dp" | ||
48 | android:gravity="center_horizontal" | ||
49 | android:text="coaca" | ||
50 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
51 | android:textSize="30sp" | ||
52 | android:textStyle="bold" | ||
53 | app:layout_constraintEnd_toEndOf="parent" | ||
54 | app:layout_constraintStart_toStartOf="parent" | ||
55 | app:layout_constraintTop_toTopOf="parent" /> | ||
56 | |||
57 | |||
58 | <TextView | ||
59 | android:id="@+id/textView18" | ||
60 | android:layout_width="wrap_content" | ||
61 | android:layout_height="wrap_content" | ||
62 | android:layout_marginTop="10dp" | ||
63 | android:text="Códigos:" | ||
64 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
65 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
66 | app:layout_constraintStart_toStartOf="parent" | ||
67 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
68 | |||
69 | <TextView | ||
70 | android:id="@+id/textView19" | ||
71 | android:layout_width="wrap_content" | ||
72 | android:layout_height="wrap_content" | ||
73 | android:layout_marginStart="5dp" | ||
74 | android:text="DEBO:" | ||
75 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
76 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
77 | app:layout_constraintBaseline_toBaselineOf="@+id/textView18" | ||
78 | app:layout_constraintStart_toEndOf="@+id/textView18" /> | ||
79 | |||
80 | <TextView | ||
81 | android:id="@+id/tvSector" | ||
82 | android:layout_width="0dp" | ||
83 | android:layout_height="wrap_content" | ||
84 | android:layout_marginStart="5dp" | ||
85 | android:text="99" | ||
86 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
87 | android:textSize="@dimen/SubTitulos10" | ||
88 | android:textStyle="bold" | ||
89 | app:layout_constraintBaseline_toBaselineOf="@+id/textView19" | ||
90 | app:layout_constraintStart_toEndOf="@+id/textView19" /> | ||
91 | |||
92 | <TextView | ||
93 | android:id="@+id/tvCodigo" | ||
94 | android:layout_width="0dp" | ||
95 | android:layout_height="wrap_content" | ||
96 | android:layout_marginTop="10dp" | ||
97 | android:text="999999" | ||
98 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
99 | android:textSize="@dimen/SubTitulos10" | ||
100 | android:textStyle="bold" | ||
101 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" | ||
102 | app:layout_constraintStart_toEndOf="@id/tvSector" /> | ||
103 | |||
104 | |||
105 | <TextView | ||
106 | android:id="@+id/textView1" | ||
107 | android:layout_width="0dp" | ||
108 | android:layout_height="wrap_content" | ||
109 | android:layout_marginStart="5dp" | ||
110 | android:layout_marginTop="10dp" | ||
111 | android:text="barras:" | ||
112 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
113 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
114 | app:layout_constraintBaseline_toBaselineOf="@+id/tvCodigo" | ||
115 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | ||
116 | |||
117 | <TextView | ||
118 | android:id="@+id/tvCodigoBarras" | ||
119 | android:layout_width="wrap_content" | ||
120 | android:layout_height="wrap_content" | ||
121 | android:layout_marginStart="5dp" | ||
122 | android:text="12346579012345" | ||
123 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
124 | android:textSize="@dimen/SubTitulos10" | ||
125 | android:textStyle="bold" | ||
126 | app:layout_constraintBaseline_toBaselineOf="@+id/textView1" | ||
127 | app:layout_constraintStart_toEndOf="@id/textView1" /> | ||
128 | |||
129 | <TextView | ||
130 | android:id="@+id/textView2" | ||
131 | android:layout_width="wrap_content" | ||
132 | android:layout_height="wrap_content" | ||
133 | android:layout_marginStart="5dp" | ||
134 | android:layout_marginTop="10dp" | ||
135 | android:text="origen:" | ||
136 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
137 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
138 | app:layout_constraintStart_toEndOf="@+id/textView18" | ||
139 | app:layout_constraintTop_toBottomOf="@+id/textView18" /> | ||
140 | |||
141 | |||
142 | <TextView | ||
143 | android:id="@+id/tvCodigoOrigen" | ||
144 | android:layout_width="wrap_content" | ||
145 | android:layout_height="wrap_content" | ||
146 | android:layout_marginStart="5dp" | ||
147 | android:layout_marginTop="10dp" | ||
148 | android:text="1234567890123" | ||
149 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
150 | android:textSize="@dimen/SubTitulos10" | ||
151 | android:textStyle="bold" | ||
152 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | ||
153 | app:layout_constraintStart_toEndOf="@+id/textView2" | ||
154 | app:layout_constraintTop_toBottomOf="@+id/textView18" /> | ||
155 | |||
156 | <TextView | ||
157 | android:id="@+id/textView9" | ||
158 | android:layout_width="wrap_content" | ||
159 | android:layout_height="wrap_content" | ||
160 | android:layout_marginTop="10dp" | ||
161 | android:text="Precio:" | ||
162 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
163 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
164 | app:layout_constraintStart_toStartOf="parent" | ||
165 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | ||
166 | |||
167 | <TextView | ||
168 | android:id="@+id/textView12" | ||
169 | android:layout_width="wrap_content" | ||
170 | android:layout_height="wrap_content" | ||
171 | android:layout_marginStart="5dp" | ||
172 | android:layout_marginTop="10dp" | ||
173 | android:text="venta:" | ||
174 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
175 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
176 | app:layout_constraintBaseline_toBaselineOf="@+id/textView9" | ||
177 | app:layout_constraintStart_toEndOf="@+id/textView18" /> | ||
178 | |||
179 | <TextView | ||
180 | android:id="@+id/tvPrecio" | ||
181 | android:layout_width="wrap_content" | ||
182 | android:layout_height="wrap_content" | ||
183 | android:layout_marginStart="5dp" | ||
184 | android:layout_marginTop="10dp" | ||
185 | android:text="99999.99" | ||
186 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
187 | android:textSize="@dimen/SubTitulos10" | ||
188 | android:textStyle="bold" | ||
189 | app:layout_constraintBaseline_toBaselineOf="@+id/textView12" | ||
190 | app:layout_constraintStart_toEndOf="@+id/textView12" /> | ||
191 | |||
192 | <TextView | ||
193 | android:id="@+id/textView8" | ||
194 | android:layout_width="wrap_content" | ||
195 | android:layout_height="wrap_content" | ||
196 | android:text="Costo:" | ||
197 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
198 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
199 | app:layout_constraintBaseline_toBaselineOf="@+id/tvPrecio" | ||
200 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | ||
201 | |||
202 | <TextView | ||
203 | android:id="@+id/tvCosto" | ||
204 | android:layout_width="wrap_content" | ||
205 | android:layout_height="wrap_content" | ||
206 | android:layout_marginStart="5dp" | ||
207 | android:layout_marginTop="10dp" | ||
208 | android:text="9999.99" | ||
209 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
210 | android:textSize="@dimen/SubTitulos10" | ||
211 | android:textStyle="bold" | ||
212 | app:layout_constraintBaseline_toBaselineOf="@+id/textView8" | ||
213 | app:layout_constraintStart_toEndOf="@+id/textView8" /> | ||
214 | |||
215 | <TextView | ||
216 | android:id="@+id/textView3" | ||
217 | android:layout_width="wrap_content" | ||
218 | android:layout_height="wrap_content" | ||
219 | android:layout_marginTop="10dp" | ||
220 | android:text="Depósito:" | ||
221 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
222 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
223 | app:layout_constraintStart_toStartOf="parent" | ||
224 | app:layout_constraintTop_toBottomOf="@+id/textView9" /> | ||
225 | |||
226 | <TextView | ||
227 | android:id="@+id/tvDeposito" | ||
228 | android:layout_width="wrap_content" | ||
229 | android:layout_height="wrap_content" | ||
230 | android:layout_marginStart="5dp" | ||
231 | android:text="Si" | ||
232 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
233 | android:textSize="@dimen/SubTitulos10" | ||
234 | android:textStyle="bold" | ||
235 | app:layout_constraintBaseline_toBaselineOf="@+id/textView3" | ||
236 | app:layout_constraintStart_toEndOf="@+id/textView3" /> | ||
237 | |||
238 | <TextView | ||
239 | android:id="@+id/textView5" | ||
240 | android:layout_width="wrap_content" | ||
241 | android:layout_height="wrap_content" | ||
242 | android:layout_marginTop="10dp" | ||
243 | android:text="Stock:" | ||
244 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
245 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
246 | app:layout_constraintStart_toStartOf="parent" | ||
247 | app:layout_constraintTop_toBottomOf="@+id/textView3" /> | ||
248 | |||
249 | |||
250 | <TextView | ||
251 | android:id="@+id/textView15" | ||
252 | android:layout_width="wrap_content" | ||
253 | android:layout_height="wrap_content" | ||
254 | android:layout_marginStart="5dp" | ||
255 | android:layout_marginTop="10dp" | ||
256 | android:text="venta:" | ||
257 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
258 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
259 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" | ||
260 | app:layout_constraintStart_toEndOf="@+id/textView18" /> | ||
261 | |||
262 | <TextView | ||
263 | android:id="@+id/tvExiVenta" | ||
264 | android:layout_width="wrap_content" | ||
265 | android:layout_height="wrap_content" | ||
266 | android:layout_marginStart="5dp" | ||
267 | android:layout_marginTop="10dp" | ||
268 | android:text="99999.99" | ||
269 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
270 | android:textSize="@dimen/SubTitulos10" | ||
271 | android:textStyle="bold" | ||
272 | app:layout_constraintBaseline_toBaselineOf="@+id/textView15" | ||
273 | app:layout_constraintStart_toEndOf="@+id/textView15" /> | ||
274 | |||
275 | <TextView | ||
276 | android:id="@+id/textView7" | ||
277 | android:layout_width="wrap_content" | ||
278 | android:layout_height="wrap_content" | ||
279 | android:text="deposito:" | ||
280 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
281 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
282 | app:layout_constraintBaseline_toBaselineOf="@+id/tvExiVenta" | ||
283 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | ||
284 | |||
285 | <TextView | ||
286 | android:id="@+id/tvExiDeposito" | ||
287 | android:layout_width="wrap_content" | ||
288 | android:layout_height="wrap_content" | ||
289 | android:layout_marginStart="5dp" | ||
290 | android:layout_marginTop="10dp" | ||
291 | android:text="99999.99" | ||
292 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
293 | android:textSize="@dimen/SubTitulos10" | ||
294 | android:textStyle="bold" | ||
295 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" | ||
296 | app:layout_constraintStart_toEndOf="@+id/textView7" | ||
297 | app:layout_constraintTop_toBottomOf="@+id/tvCosto" /> | ||
298 | |||
299 | |||
300 | <TextView | ||
301 | android:id="@+id/textView10" | ||
302 | android:layout_width="wrap_content" | ||
303 | android:layout_height="wrap_content" | ||
304 | android:text="Unidad de venta:" | ||
305 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
306 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
307 | app:layout_constraintBaseline_toBaselineOf="@+id/tvDeposito" | ||
308 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | ||
309 | |||
310 | <TextView | ||
311 | android:id="@+id/tvBal" | ||
312 | android:layout_width="wrap_content" | ||
313 | android:layout_height="wrap_content" | ||
314 | android:layout_marginStart="5dp" | ||
315 | android:text="Unidades" | ||
316 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
317 | android:textSize="@dimen/SubTitulos10" | ||
318 | android:textStyle="bold" | ||
319 | app:layout_constraintBaseline_toBaselineOf="@+id/textView10" | ||
320 | app:layout_constraintStart_toEndOf="@+id/textView10" /> | ||
321 | |||
322 | |||
323 | <TextView | ||
324 | android:id="@+id/textView11" | ||
325 | android:layout_width="wrap_content" | ||
326 | android:layout_height="wrap_content" | ||
327 | android:layout_marginTop="10dp" | ||
328 | android:text="Imagen:" | ||
329 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
330 | android:textSize="@dimen/nav_header_vertical_spacing10" | ||
331 | app:layout_constraintStart_toStartOf="parent" | ||
332 | app:layout_constraintTop_toBottomOf="@+id/textView5" /> | ||
333 | |||
334 | <ImageView | ||
335 | android:id="@+id/ivImagen" | ||
336 | android:layout_width="400dp" | ||
337 | android:layout_height="400dp" | ||
338 | android:src="@drawable/no_imagen" | ||
339 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
340 | android:textSize="14sp" | ||
341 | app:layout_constraintEnd_toEndOf="parent" | ||
342 | app:layout_constraintStart_toStartOf="parent" | ||
343 | app:layout_constraintTop_toBottomOf="@+id/textView15" /> | ||
344 | |||
345 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
346 | </androidx.cardview.widget.CardView> | ||
347 | |||
348 | </ScrollView> | ||
349 |
app/src/main/res/layout-xlarge/fragment_inv_importados.xml
File was created | 1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="match_parent" | ||
7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> | ||
8 | |||
9 | |||
10 | <androidx.appcompat.widget.AppCompatTextView | ||
11 | android:id="@+id/tvActMaestros" | ||
12 | android:layout_width="0dp" | ||
13 | android:layout_height="wrap_content" | ||
14 | android:layout_marginTop="@dimen/MarginTopTitulos" | ||
15 | android:gravity="center" | ||
16 | android:text="@string/tvActMaestros" | ||
17 | android:textColor="@color/colorAccent" | ||
18 | android:textSize="65sp" | ||
19 | app:fontFamily="sans-serif-condensed" | ||
20 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccionInventario" | ||
21 | app:layout_constraintEnd_toEndOf="parent" | ||
22 | app:layout_constraintStart_toStartOf="parent" | ||
23 | app:layout_constraintTop_toTopOf="parent" /> | ||
24 | |||
25 | <TextView | ||
26 | android:id="@+id/tvSeleccionInventario" | ||
27 | android:layout_width="0dp" | ||
28 | android:layout_height="wrap_content" | ||
29 | android:layout_margin="30dp" | ||
30 | android:padding="15dp" | ||
31 | android:gravity="center" | ||
32 | android:text="@string/tvSeleccionInventario" | ||
33 | android:textColor="@android:color/black" | ||
34 | android:textSize="30sp" | ||
35 | app:fontFamily="sans-serif-condensed" | ||
36 | app:layout_constraintEnd_toEndOf="parent" | ||
37 | app:layout_constraintStart_toStartOf="parent" | ||
38 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> | ||
39 | |||
40 | <androidx.recyclerview.widget.RecyclerView | ||
41 | android:id="@+id/rcDescripcion" | ||
42 | android:layout_width="match_parent" | ||
43 | android:layout_height="0dp" | ||
44 | android:background="@android:color/darker_gray" | ||
45 | android:scrollbars="vertical" | ||
46 | android:visibility="visible" | ||
47 | app:layout_constraintBottom_toTopOf="@+id/guideline" | ||
48 | app:layout_constraintEnd_toEndOf="parent" | ||
49 | app:layout_constraintStart_toStartOf="parent" | ||
50 | app:layout_constraintTop_toBottomOf="@id/tvSeleccionInventario" | ||
51 | tools:listitem="@layout/item_inv_importados" /> | ||
52 | |||
53 | <Button | ||
54 | android:id="@+id/btnConfirmarAct" | ||
55 | android:layout_width="0dp" | ||
56 | android:layout_height="wrap_content" | ||
57 | android:layout_margin="20dp" | ||
58 | android:text="@string/btnConfirmarAct" | ||
59 | android:textSize="@dimen/TitulosMedios" | ||
60 | android:textColor="@android:color/white" | ||
61 | android:padding="10dp" | ||
62 | android:background="@drawable/boton_borde_redondeado" | ||
63 | app:layout_constraintBottom_toBottomOf="parent" | ||
64 | app:layout_constraintEnd_toEndOf="parent" | ||
65 | app:layout_constraintStart_toStartOf="parent" /> | ||
66 | |||
67 | |||
68 | <ProgressBar | ||
69 | android:id="@+id/pbInvSec" | ||
70 | android:layout_width="wrap_content" | ||
71 | android:layout_height="wrap_content" | ||
72 | android:layout_marginStart="8dp" | ||
73 | android:layout_marginLeft="8dp" | ||
74 | android:layout_marginTop="8dp" | ||
75 | android:layout_marginEnd="8dp" | ||
76 | android:layout_marginRight="8dp" | ||
77 | android:layout_marginBottom="8dp" | ||
78 | android:visibility="gone" | ||
79 | app:layout_constraintBottom_toBottomOf="parent" | ||
80 | app:layout_constraintEnd_toEndOf="parent" | ||
81 | app:layout_constraintStart_toStartOf="parent" | ||
82 | app:layout_constraintTop_toTopOf="parent" /> | ||
83 | |||
84 | <TextView | ||
85 | android:id="@+id/tvMensaje" | ||
86 | android:layout_width="0dp" | ||
87 | android:layout_height="wrap_content" | ||
88 | android:padding="15dp" | ||
89 | android:gravity="center" | ||
90 | android:text="@string/tvSeleccionInventario" | ||
91 | android:textColor="@android:color/black" | ||
92 | android:textSize="@dimen/TitulosMedios" | ||
93 | app:fontFamily="sans-serif-condensed" | ||
94 | android:visibility="gone" | ||
95 | app:layout_constraintBottom_toBottomOf="@+id/rcDescripcion" | ||
96 | app:layout_constraintEnd_toEndOf="parent" | ||
97 | app:layout_constraintStart_toStartOf="parent" | ||
98 | app:layout_constraintTop_toTopOf="@+id/rcDescripcion" /> | ||
99 | |||
100 | <androidx.constraintlayout.widget.Guideline | ||
101 | android:id="@+id/guideline" | ||
102 | android:layout_width="wrap_content" | ||
103 | android:layout_height="wrap_content" | ||
104 | android:orientation="horizontal" | ||
105 | app:layout_constraintGuide_percent="0.88" /> | ||
106 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
107 |
app/src/main/res/layout-xlarge/fragment_inv_sec.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout | ||
3 | xmlns:android="http://schemas.android.com/apk/res/android" | ||
4 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
5 | xmlns:tools="http://schemas.android.com/tools" | ||
6 | android:id="@+id/frameLayout" | ||
7 | android:layout_width="match_parent" | ||
8 | android:layout_height="match_parent" | ||
9 | tools:context=".UI.inventario.InventarioFragment"> | ||
10 | |||
11 | |||
12 | <!-- <androidx.appcompat.widget.AppCompatTextView--> | ||
13 | <!-- android:id="@+id/tvTituloSec"--> | ||
14 | <!-- android:layout_width="0dp"--> | ||
15 | <!-- android:layout_height="wrap_content"--> | ||
16 | <!-- android:layout_marginStart="8dp"--> | ||
17 | <!-- android:layout_marginEnd="8dp"--> | ||
18 | <!-- android:textSize="60sp"--> | ||
19 | <!-- android:gravity="center"--> | ||
20 | <!-- android:lines="1"--> | ||
21 | <!-- android:text="@string/invTitulo"--> | ||
22 | <!-- android:textColor="@color/colorAccent"--> | ||
23 | <!-- app:fontFamily="sans-serif-condensed"--> | ||
24 | <!-- app:layout_constraintBottom_toTopOf="@id/guideline2"--> | ||
25 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
26 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
27 | <!-- app:layout_constraintTop_toTopOf="@id/guideline" />--> | ||
28 | |||
29 | |||
30 | <!-- <androidx.recyclerview.widget.RecyclerView--> | ||
31 | <!-- android:id="@+id/rcInventariosSec"--> | ||
32 | <!-- android:layout_width="match_parent"--> | ||
33 | <!-- android:layout_height="0dp"--> | ||
34 | <!-- android:background="@android:color/darker_gray"--> | ||
35 | <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline5"--> | ||
36 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
37 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
38 | <!-- app:layout_constraintTop_toBottomOf="@+id/guideline2"--> | ||
39 | <!-- tools:listitem="@layout/item" />--> | ||
40 | |||
41 | |||
42 | <!-- <Button--> | ||
43 | <!-- android:id="@+id/btnExportarInvSec"--> | ||
44 | <!-- android:layout_width="wrap_content"--> | ||
45 | <!-- android:layout_height="wrap_content"--> | ||
46 | <!-- android:text="@string/btnExportarInv"--> | ||
47 | <!-- android:textColor="@android:color/white"--> | ||
48 | <!-- android:padding="10dp"--> | ||
49 | <!-- android:textSize="@dimen/SubTitulos10"--> | ||
50 | <!-- android:background="@drawable/boton_borde_redondeado"--> | ||
51 | <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> | ||
52 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
53 | <!-- app:layout_constraintHorizontal_chainStyle="spread"--> | ||
54 | <!-- app:layout_constraintStart_toEndOf="@+id/btnBorrarInv"--> | ||
55 | <!-- app:layout_constraintTop_toBottomOf="@+id/guideline5" />--> | ||
56 | |||
57 | <!-- <Button--> | ||
58 | <!-- android:id="@+id/btnBorrarInv"--> | ||
59 | <!-- android:layout_width="wrap_content"--> | ||
60 | <!-- android:layout_height="wrap_content"--> | ||
61 | <!-- android:text="@string/btnBorrarInv"--> | ||
62 | <!-- android:textSize="@dimen/SubTitulos10"--> | ||
63 | <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> | ||
64 | <!-- app:layout_constraintEnd_toStartOf="@id/btnExportarInvSec"--> | ||
65 | <!-- app:layout_constraintHorizontal_chainStyle="spread"--> | ||
66 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
67 | <!-- android:textColor="@android:color/white"--> | ||
68 | <!-- android:padding="10dp"--> | ||
69 | <!-- android:background="@drawable/boton_borde_redondeado"--> | ||
70 | <!-- app:layout_constraintTop_toBottomOf="@+id/guideline5" />--> | ||
71 | |||
72 | <!-- <androidx.constraintlayout.widget.Guideline--> | ||
73 | <!-- android:id="@+id/guideline"--> | ||
74 | <!-- android:layout_width="wrap_content"--> | ||
75 | <!-- android:layout_height="wrap_content"--> | ||
76 | <!-- android:orientation="horizontal"--> | ||
77 | <!-- app:layout_constraintGuide_percent="0.02" />--> | ||
78 | |||
79 | <!-- <androidx.constraintlayout.widget.Guideline--> | ||
80 | <!-- android:id="@+id/guideline2"--> | ||
81 | <!-- android:layout_width="wrap_content"--> | ||
82 | <!-- android:layout_height="wrap_content"--> | ||
83 | <!-- android:orientation="horizontal"--> | ||
84 | <!-- app:layout_constraintGuide_percent="0.12029161" />--> | ||
85 | |||
86 | <!-- <androidx.constraintlayout.widget.Guideline--> | ||
87 | <!-- android:id="@+id/guideline5"--> | ||
88 | <!-- android:layout_width="wrap_content"--> | ||
89 | <!-- android:layout_height="wrap_content"--> | ||
90 | <!-- android:orientation="horizontal"--> | ||
91 | <!-- app:layout_constraintGuide_percent="0.88" />--> | ||
92 | |||
93 | <!-- <androidx.constraintlayout.widget.Guideline--> | ||
94 | <!-- android:id="@+id/guideline6"--> | ||
95 | <!-- android:layout_width="wrap_content"--> | ||
96 | <!-- android:layout_height="wrap_content"--> | ||
97 | <!-- android:orientation="horizontal"--> | ||
98 | <!-- app:layout_constraintGuide_percent="0.97" />--> | ||
99 | |||
100 | |||
101 | <androidx.appcompat.widget.AppCompatTextView | ||
102 | android:id="@+id/tvTitulo" | ||
103 | android:layout_width="0dp" | ||
104 | android:layout_height="wrap_content" | ||
105 | android:layout_marginStart="8dp" | ||
106 | android:layout_marginEnd="8dp" | ||
107 | android:textSize="60sp" | ||
108 | android:gravity="center" | ||
109 | android:lines="1" | ||
110 | android:text="@string/invTitulo" | ||
111 | android:textColor="@color/colorAccent" | ||
112 | app:fontFamily="sans-serif-condensed" | ||
113 | app:layout_constraintBottom_toTopOf="@id/guideline2" | ||
114 | app:layout_constraintEnd_toEndOf="parent" | ||
115 | app:layout_constraintStart_toStartOf="parent" | ||
116 | app:layout_constraintTop_toTopOf="@id/guideline" /> | ||
117 | |||
118 | |||
119 | <ImageButton | ||
120 | android:id="@+id/ivCamara" | ||
121 | android:layout_width="@dimen/boton10" | ||
122 | android:layout_height="@dimen/boton10" | ||
123 | android:layout_marginTop="15dp" | ||
124 | android:clickable="true" | ||
125 | android:contentDescription="@string/ibBusCB" | ||
126 | android:elevation="5dp" | ||
127 | android:background="@drawable/boton_redondo" | ||
128 | android:layout_margin="10dp" | ||
129 | android:focusable="false" | ||
130 | android:scaleType="fitEnd" | ||
131 | app:layout_constraintCircleRadius="40dp" | ||
132 | android:src="@drawable/desc" | ||
133 | app:layout_constraintBottom_toTopOf="@id/guideline3" | ||
134 | app:layout_constraintEnd_toStartOf="@+id/etDescripcion" | ||
135 | app:layout_constraintHorizontal_bias="0.0" | ||
136 | app:layout_constraintStart_toStartOf="parent" | ||
137 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | ||
138 | |||
139 | <EditText | ||
140 | android:id="@+id/etDescripcion" | ||
141 | android:layout_width="0dp" | ||
142 | android:layout_height="wrap_content" | ||
143 | android:autofillHints="" | ||
144 | android:clickable="true" | ||
145 | android:ems="10" | ||
146 | android:focusable="true" | ||
147 | android:hint="@string/ibBusDesc" | ||
148 | android:inputType="textPersonName" | ||
149 | android:lines="1" | ||
150 | android:textAllCaps="true" | ||
151 | android:textSize="@dimen/textCantidad10" | ||
152 | app:layout_constraintBottom_toTopOf="@+id/guideline3" | ||
153 | app:layout_constraintEnd_toEndOf="parent" | ||
154 | app:layout_constraintHorizontal_bias="0.49" | ||
155 | app:layout_constraintHorizontal_chainStyle="packed" | ||
156 | app:layout_constraintStart_toEndOf="@+id/ivCamara" | ||
157 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | ||
158 | |||
159 | <androidx.recyclerview.widget.RecyclerView | ||
160 | android:id="@+id/rcInventarios" | ||
161 | android:layout_width="match_parent" | ||
162 | android:layout_height="0dp" | ||
163 | android:background="@android:color/darker_gray" | ||
164 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" | ||
165 | app:layout_constraintEnd_toEndOf="parent" | ||
166 | app:layout_constraintStart_toStartOf="parent" | ||
167 | app:layout_constraintTop_toBottomOf="@+id/guideline4" | ||
168 | tools:listitem="@layout/item" /> | ||
169 | |||
170 | <Button | ||
171 | android:id="@+id/btnExportarInv" | ||
172 | android:layout_width="wrap_content" | ||
173 | android:layout_height="wrap_content" | ||
174 | android:text="@string/btnExportarInv" | ||
175 | android:textColor="@android:color/white" | ||
176 | android:layout_marginTop="7dp" | ||
177 | android:padding="10dp" | ||
178 | android:textSize="@dimen/SubTitulos10" | ||
179 | android:background="@drawable/boton_borde_redondeado" | ||
180 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | ||
181 | app:layout_constraintEnd_toEndOf="parent" | ||
182 | app:layout_constraintHorizontal_chainStyle="spread" | ||
183 | app:layout_constraintStart_toEndOf="@+id/btnBorrarInv" | ||
184 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | ||
185 | |||
186 | <Button | ||
187 | android:id="@+id/btnBorrarInv" | ||
188 | android:layout_width="wrap_content" | ||
189 | android:layout_height="wrap_content" | ||
190 | android:layout_marginTop="7dp" | ||
191 | android:background="@drawable/boton_borde_redondeado" | ||
192 | android:padding="10dp" | ||
193 | android:text="@string/btnBorrarInv" | ||
194 | android:textColor="@android:color/white" | ||
195 | android:textSize="@dimen/SubTitulos10" | ||
196 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | ||
197 | app:layout_constraintEnd_toStartOf="@id/btnExportarInv" | ||
198 | app:layout_constraintHorizontal_chainStyle="spread" | ||
199 | app:layout_constraintStart_toStartOf="parent" | ||
200 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | ||
201 | |||
202 | <androidx.constraintlayout.widget.Guideline | ||
203 | android:id="@+id/guideline" | ||
204 | android:layout_width="wrap_content" | ||
205 | android:layout_height="wrap_content" | ||
206 | android:orientation="horizontal" | ||
207 | app:layout_constraintGuide_percent="0.02" /> | ||
208 | |||
209 | <androidx.constraintlayout.widget.Guideline | ||
210 | android:id="@+id/guideline2" | ||
211 | android:layout_width="wrap_content" | ||
212 | android:layout_height="wrap_content" | ||
213 | android:orientation="horizontal" | ||
214 | app:layout_constraintGuide_percent="0.12029161" /> | ||
215 | |||
216 | <androidx.constraintlayout.widget.Guideline | ||
217 | android:id="@+id/guideline3" | ||
218 | android:layout_width="wrap_content" | ||
219 | android:layout_height="wrap_content" | ||
220 | android:orientation="horizontal" | ||
221 | app:layout_constraintGuide_percent="0.27" /> | ||
222 | |||
223 | <androidx.constraintlayout.widget.Guideline | ||
224 | android:id="@+id/guideline4" | ||
225 | android:layout_width="wrap_content" | ||
226 | android:layout_height="wrap_content" | ||
227 | android:orientation="horizontal" | ||
228 | app:layout_constraintGuide_percent="0.32" /> | ||
229 | |||
230 | <androidx.constraintlayout.widget.Guideline | ||
231 | android:id="@+id/guideline5" | ||
232 | android:layout_width="wrap_content" | ||
233 | android:layout_height="wrap_content" | ||
234 | android:orientation="horizontal" | ||
235 | app:layout_constraintGuide_percent="0.88" /> | ||
236 | |||
237 | <androidx.constraintlayout.widget.Guideline | ||
238 | android:id="@+id/guideline6" | ||
239 | android:layout_width="wrap_content" | ||
240 | android:layout_height="wrap_content" | ||
241 | android:orientation="horizontal" | ||
242 | app:layout_constraintGuide_percent="0.97" /> | ||
243 | |||
244 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout-xlarge/fragment_inventario.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:id="@+id/frameLayout" | 5 | android:id="@+id/frameLayout" |
6 | android:layout_width="match_parent" | 6 | android:layout_width="match_parent" |
7 | android:layout_height="match_parent" | 7 | android:layout_height="match_parent" |
8 | tools:context=".UI.inventario.InventarioFragment"> | 8 | tools:context=".UI.inventario.InventarioFragment"> |
9 | 9 | ||
10 | 10 | ||
11 | <androidx.appcompat.widget.AppCompatTextView | 11 | <androidx.appcompat.widget.AppCompatTextView |
12 | android:id="@+id/tvTitulo" | 12 | android:id="@+id/tvTitulo" |
13 | android:layout_width="match_parent" | 13 | android:layout_width="0dp" |
14 | android:layout_height="90dp" | 14 | android:layout_height="wrap_content" |
15 | android:layout_marginStart="8dp" | 15 | android:layout_marginStart="8dp" |
16 | android:layout_marginEnd="8dp" | 16 | android:layout_marginEnd="8dp" |
17 | android:autoSizeMaxTextSize="100sp" | 17 | android:textSize="60sp" |
18 | android:autoSizeMinTextSize="20sp" | ||
19 | android:autoSizeStepGranularity="5sp" | ||
20 | android:autoSizeTextType="uniform" | ||
21 | android:gravity="center" | 18 | android:gravity="center" |
22 | android:lines="1" | 19 | android:lines="1" |
23 | android:text="@string/invTitulo" | 20 | android:text="@string/invTitulo" |
24 | android:textColor="@color/colorAccent" | 21 | android:textColor="@color/colorAccent" |
25 | app:fontFamily="sans-serif-condensed" | 22 | app:fontFamily="sans-serif-condensed" |
26 | app:layout_constraintBottom_toTopOf="@id/guideline2" | 23 | app:layout_constraintBottom_toTopOf="@id/guideline2" |
27 | app:layout_constraintEnd_toEndOf="parent" | 24 | app:layout_constraintEnd_toEndOf="parent" |
28 | app:layout_constraintStart_toStartOf="parent" | 25 | app:layout_constraintStart_toStartOf="parent" |
29 | app:layout_constraintTop_toTopOf="@id/guideline" /> | 26 | app:layout_constraintTop_toTopOf="@id/guideline" /> |
30 | 27 | ||
31 | 28 | ||
32 | <ImageButton | 29 | <ImageButton |
33 | android:id="@+id/ivCamara" | 30 | android:id="@+id/ivCamara" |
34 | android:layout_width="@dimen/boton10" | 31 | android:layout_width="@dimen/boton10" |
35 | android:layout_height="@dimen/boton10" | 32 | android:layout_height="@dimen/boton10" |
36 | android:layout_marginTop="15dp" | 33 | android:layout_marginTop="15dp" |
37 | android:clickable="true" | 34 | android:clickable="true" |
38 | android:contentDescription="@string/ibBusCB" | 35 | android:contentDescription="@string/ibBusCB" |
39 | android:elevation="5dp" | 36 | android:elevation="5dp" |
40 | android:background="@drawable/boton_redondo" | 37 | android:background="@drawable/boton_redondo" |
41 | android:layout_margin="10dp" | 38 | android:layout_margin="10dp" |
42 | android:focusable="false" | 39 | android:focusable="false" |
43 | android:scaleType="fitEnd" | 40 | android:scaleType="fitEnd" |
44 | app:layout_constraintCircleRadius="40dp" | 41 | app:layout_constraintCircleRadius="40dp" |
45 | android:src="@drawable/codbar" | 42 | android:src="@drawable/codbar" |
46 | app:layout_constraintBottom_toTopOf="@id/guideline3" | 43 | app:layout_constraintBottom_toTopOf="@id/guideline3" |
47 | app:layout_constraintEnd_toStartOf="@+id/etCodigoBarras" | 44 | app:layout_constraintEnd_toStartOf="@+id/etCodigoBarras" |
48 | app:layout_constraintHorizontal_bias="0.0" | 45 | app:layout_constraintHorizontal_bias="0.0" |
49 | app:layout_constraintStart_toStartOf="parent" | 46 | app:layout_constraintStart_toStartOf="parent" |
50 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | 47 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> |
51 | 48 | ||
52 | <EditText | 49 | <EditText |
53 | android:id="@+id/etCodigoBarras" | 50 | android:id="@+id/etCodigoBarras" |
54 | android:layout_width="0dp" | 51 | android:layout_width="0dp" |
55 | android:layout_height="wrap_content" | 52 | android:layout_height="wrap_content" |
56 | android:autofillHints="" | 53 | android:autofillHints="" |
57 | android:clickable="true" | 54 | android:clickable="true" |
58 | android:ems="10" | 55 | android:ems="10" |
59 | android:focusable="true" | 56 | android:focusable="true" |
60 | android:hint="@string/ibBusCB" | 57 | android:hint="@string/ibBusCB" |
61 | android:inputType="textPersonName" | 58 | android:inputType="textPersonName" |
62 | android:lines="1" | 59 | android:lines="1" |
63 | android:textAllCaps="true" | 60 | android:textAllCaps="true" |
64 | android:textSize="@dimen/textCantidad10" | 61 | android:textSize="@dimen/textCantidad10" |
65 | app:layout_constraintBottom_toTopOf="@+id/guideline3" | 62 | app:layout_constraintBottom_toTopOf="@+id/guideline3" |
66 | app:layout_constraintEnd_toStartOf="@+id/swSumaUno" | 63 | app:layout_constraintEnd_toStartOf="@+id/swSumaUno" |
67 | app:layout_constraintHorizontal_bias="0.49" | 64 | app:layout_constraintHorizontal_bias="0.49" |
68 | app:layout_constraintHorizontal_chainStyle="packed" | 65 | app:layout_constraintHorizontal_chainStyle="packed" |
69 | app:layout_constraintStart_toEndOf="@+id/ivCamara" | 66 | app:layout_constraintStart_toEndOf="@+id/ivCamara" |
70 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | 67 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> |
71 | 68 | ||
72 | 69 | ||
73 | <Switch | 70 | <Switch |
74 | android:id="@+id/swSumaUno" | 71 | android:id="@+id/swSumaUno" |
75 | android:layout_width="wrap_content" | 72 | android:layout_width="wrap_content" |
76 | android:layout_height="wrap_content" | 73 | android:layout_height="wrap_content" |
77 | android:text="@string/switch_1" | 74 | android:text="@string/switch_1" |
78 | android:textSize="@dimen/SubTitulos10" | 75 | android:textSize="@dimen/SubTitulos10" |
79 | app:layout_constraintBaseline_toBaselineOf="@+id/etCodigoBarras" | 76 | app:layout_constraintBaseline_toBaselineOf="@+id/etCodigoBarras" |
80 | app:layout_constraintEnd_toEndOf="parent" | 77 | app:layout_constraintEnd_toEndOf="parent" |
81 | app:layout_constraintStart_toEndOf="@id/etCodigoBarras" | 78 | app:layout_constraintStart_toEndOf="@id/etCodigoBarras" |
82 | tools:ignore="UseSwitchCompatOrMaterialXml" /> | 79 | tools:ignore="UseSwitchCompatOrMaterialXml" /> |
83 | 80 | ||
84 | <androidx.recyclerview.widget.RecyclerView | 81 | <androidx.recyclerview.widget.RecyclerView |
85 | android:id="@+id/rcInventarios" | 82 | android:id="@+id/rcInventarios" |
86 | android:layout_width="match_parent" | 83 | android:layout_width="match_parent" |
87 | android:layout_height="0dp" | 84 | android:layout_height="0dp" |
88 | android:background="@android:color/darker_gray" | 85 | android:background="@android:color/darker_gray" |
89 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" | 86 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" |
90 | app:layout_constraintEnd_toEndOf="parent" | 87 | app:layout_constraintEnd_toEndOf="parent" |
91 | app:layout_constraintStart_toStartOf="parent" | 88 | app:layout_constraintStart_toStartOf="parent" |
92 | app:layout_constraintTop_toBottomOf="@+id/guideline4" | 89 | app:layout_constraintTop_toBottomOf="@+id/guideline4" |
93 | tools:listitem="@layout/item" /> | 90 | tools:listitem="@layout/item" /> |
94 | 91 | ||
95 | 92 | ||
96 | <Button | 93 | <Button |
97 | android:id="@+id/btnExportarInv" | 94 | android:id="@+id/btnExportarInv" |
98 | android:layout_width="wrap_content" | 95 | android:layout_width="wrap_content" |
99 | android:layout_height="wrap_content" | 96 | android:layout_height="wrap_content" |
100 | android:text="@string/btnExportarInv" | 97 | android:text="@string/btnExportarInv" |
101 | android:textColor="@android:color/white" | 98 | android:textColor="@android:color/white" |
102 | android:layout_marginTop="7dp" | 99 | android:layout_marginTop="7dp" |
103 | android:padding="10dp" | 100 | android:padding="10dp" |
104 | android:textSize="@dimen/SubTitulos10" | 101 | android:textSize="@dimen/SubTitulos10" |
105 | android:background="@drawable/boton_borde_redondeado" | 102 | android:background="@drawable/boton_borde_redondeado" |
106 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | 103 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" |
107 | app:layout_constraintEnd_toEndOf="parent" | 104 | app:layout_constraintEnd_toEndOf="parent" |
108 | app:layout_constraintHorizontal_chainStyle="spread" | 105 | app:layout_constraintHorizontal_chainStyle="spread" |
109 | app:layout_constraintStart_toEndOf="@+id/btnBorrarInv" | 106 | app:layout_constraintStart_toEndOf="@+id/btnBorrarInv" |
110 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | 107 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> |
111 | 108 | ||
112 | <Button | 109 | <Button |
113 | android:id="@+id/btnBorrarInv" | 110 | android:id="@+id/btnBorrarInv" |
114 | android:layout_width="wrap_content" | 111 | android:layout_width="wrap_content" |
115 | android:layout_height="wrap_content" | 112 | android:layout_height="wrap_content" |
116 | android:layout_marginTop="7dp" | 113 | android:layout_marginTop="7dp" |
117 | android:background="@drawable/boton_borde_redondeado" | 114 | android:background="@drawable/boton_borde_redondeado" |
118 | android:padding="10dp" | 115 | android:padding="10dp" |
119 | android:text="@string/btnBorrarInv" | 116 | android:text="@string/btnBorrarInv" |
120 | android:textColor="@android:color/white" | 117 | android:textColor="@android:color/white" |
121 | android:textSize="@dimen/SubTitulos10" | 118 | android:textSize="@dimen/SubTitulos10" |
122 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | 119 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" |
123 | app:layout_constraintEnd_toStartOf="@id/btnExportarInv" | 120 | app:layout_constraintEnd_toStartOf="@id/btnExportarInv" |
124 | app:layout_constraintHorizontal_chainStyle="spread" | 121 | app:layout_constraintHorizontal_chainStyle="spread" |
125 | app:layout_constraintStart_toStartOf="parent" | 122 | app:layout_constraintStart_toStartOf="parent" |
126 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | 123 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> |
127 | 124 | ||
125 | |||
126 | <ProgressBar | ||
127 | android:id="@+id/loading_view" | ||
128 | android:layout_width="wrap_content" | ||
129 | android:layout_height="wrap_content" | ||
130 | android:layout_marginStart="8dp" | ||
131 | android:layout_marginLeft="8dp" | ||
132 | android:layout_marginTop="8dp" | ||
133 | android:layout_marginEnd="8dp" | ||
134 | android:layout_marginRight="8dp" | ||
135 | android:layout_marginBottom="8dp" | ||
136 | android:visibility="invisible" | ||
137 | app:layout_constraintBottom_toBottomOf="parent" | ||
138 | app:layout_constraintEnd_toEndOf="parent" | ||
139 | app:layout_constraintStart_toStartOf="parent" | ||
140 | app:layout_constraintTop_toTopOf="parent" /> | ||
141 | |||
128 | <androidx.constraintlayout.widget.Guideline | 142 | <androidx.constraintlayout.widget.Guideline |
129 | android:id="@+id/guideline" | 143 | android:id="@+id/guideline" |
130 | android:layout_width="wrap_content" | 144 | android:layout_width="wrap_content" |
131 | android:layout_height="wrap_content" | 145 | android:layout_height="wrap_content" |
132 | android:orientation="horizontal" | 146 | android:orientation="horizontal" |
133 | app:layout_constraintGuide_percent="0.02" /> | 147 | app:layout_constraintGuide_percent="0.02" /> |
134 | 148 | ||
135 | <androidx.constraintlayout.widget.Guideline | 149 | <androidx.constraintlayout.widget.Guideline |
136 | android:id="@+id/guideline2" | 150 | android:id="@+id/guideline2" |
137 | android:layout_width="wrap_content" | 151 | android:layout_width="wrap_content" |
138 | android:layout_height="wrap_content" | 152 | android:layout_height="wrap_content" |
139 | android:orientation="horizontal" | 153 | android:orientation="horizontal" |
140 | app:layout_constraintGuide_percent="0.12029161" /> | 154 | app:layout_constraintGuide_percent="0.12029161" /> |
141 | 155 | ||
142 | <androidx.constraintlayout.widget.Guideline | 156 | <androidx.constraintlayout.widget.Guideline |
143 | android:id="@+id/guideline3" | 157 | android:id="@+id/guideline3" |
144 | android:layout_width="wrap_content" | 158 | android:layout_width="wrap_content" |
145 | android:layout_height="wrap_content" | 159 | android:layout_height="wrap_content" |
146 | android:orientation="horizontal" | 160 | android:orientation="horizontal" |
147 | app:layout_constraintGuide_percent="0.27" /> | 161 | app:layout_constraintGuide_percent="0.27" /> |
148 | 162 | ||
149 | <androidx.constraintlayout.widget.Guideline | 163 | <androidx.constraintlayout.widget.Guideline |
150 | android:id="@+id/guideline4" | 164 | android:id="@+id/guideline4" |
151 | android:layout_width="wrap_content" | 165 | android:layout_width="wrap_content" |
152 | android:layout_height="wrap_content" | 166 | android:layout_height="wrap_content" |
153 | android:orientation="horizontal" | 167 | android:orientation="horizontal" |
154 | app:layout_constraintGuide_percent="0.32" /> | 168 | app:layout_constraintGuide_percent="0.32" /> |
155 | 169 | ||
156 | <androidx.constraintlayout.widget.Guideline | 170 | <androidx.constraintlayout.widget.Guideline |
157 | android:id="@+id/guideline5" | 171 | android:id="@+id/guideline5" |
158 | android:layout_width="wrap_content" | 172 | android:layout_width="wrap_content" |
159 | android:layout_height="wrap_content" | 173 | android:layout_height="wrap_content" |
160 | android:orientation="horizontal" | 174 | android:orientation="horizontal" |
161 | app:layout_constraintGuide_percent="0.88" /> | 175 | app:layout_constraintGuide_percent="0.88" /> |
162 | 176 | ||
163 | <androidx.constraintlayout.widget.Guideline | 177 | <androidx.constraintlayout.widget.Guideline |
164 | android:id="@+id/guideline6" | 178 | android:id="@+id/guideline6" |
165 | android:layout_width="wrap_content" | 179 | android:layout_width="wrap_content" |
166 | android:layout_height="wrap_content" | 180 | android:layout_height="wrap_content" |
167 | android:orientation="horizontal" | 181 | android:orientation="horizontal" |
168 | app:layout_constraintGuide_percent="0.97" /> | 182 | app:layout_constraintGuide_percent="0.97" /> |
app/src/main/res/layout-xlarge/fragment_main.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent"> | 6 | android:layout_height="match_parent"> |
7 | 7 | ||
8 | <androidx.appcompat.widget.AppCompatTextView | 8 | <androidx.appcompat.widget.AppCompatTextView |
9 | android:id="@+id/tvInvDinamicos" | 9 | android:id="@+id/tvInvDinamicos" |
10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
11 | android:layout_height="110dp" | 11 | android:layout_height="wrap_content" |
12 | android:autoSizeMaxTextSize="150sp" | 12 | android:textSize="60sp" |
13 | android:autoSizeMinTextSize="25sp" | ||
14 | android:autoSizeStepGranularity="5sp" | ||
15 | android:autoSizeTextType="uniform" | ||
16 | android:gravity="start" | 13 | android:gravity="start" |
17 | android:lines="1" | 14 | android:lines="1" |
18 | android:padding="10dp" | 15 | android:padding="10dp" |
19 | android:text="@string/invDinamicoVenta" | 16 | android:text="@string/invDinamicoVenta" |
20 | android:textColor="@color/colorAccent" | 17 | android:textColor="@color/colorAccent" |
21 | android:visibility="visible" | 18 | android:visibility="visible" |
22 | app:fontFamily="sans-serif-condensed" | 19 | app:fontFamily="sans-serif-condensed" |
23 | app:layout_constraintEnd_toEndOf="parent" | 20 | app:layout_constraintEnd_toEndOf="parent" |
24 | app:layout_constraintStart_toStartOf="parent" | 21 | app:layout_constraintStart_toStartOf="parent" |
25 | app:layout_constraintTop_toTopOf="parent" /> | 22 | app:layout_constraintTop_toTopOf="parent" /> |
26 | 23 | ||
27 | <androidx.appcompat.widget.AppCompatImageButton | 24 | <androidx.appcompat.widget.AppCompatImageButton |
28 | android:id="@+id/ivSort19" | 25 | android:id="@+id/ivSort19" |
29 | android:layout_width="@dimen/icon_dim10" | 26 | android:layout_width="@dimen/icon_dim10" |
30 | android:layout_height="@dimen/icon_dim10" | 27 | android:layout_height="@dimen/icon_dim10" |
31 | android:layout_marginStart="10dp" | 28 | android:layout_marginStart="10dp" |
32 | android:padding="5dp" | 29 | android:padding="5dp" |
33 | android:src="@drawable/ic_sort19" | 30 | android:src="@drawable/ic_sort19" |
34 | android:visibility="gone" | 31 | android:visibility="gone" |
35 | app:layout_constraintHorizontal_bias="0.0" | 32 | app:layout_constraintHorizontal_bias="0.0" |
36 | app:layout_constraintHorizontal_chainStyle="packed" | 33 | app:layout_constraintHorizontal_chainStyle="packed" |
37 | app:layout_constraintStart_toStartOf="parent" | 34 | app:layout_constraintStart_toStartOf="parent" |
38 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | 35 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> |
39 | 36 | ||
40 | <androidx.appcompat.widget.AppCompatImageButton | 37 | <androidx.appcompat.widget.AppCompatImageButton |
41 | android:id="@+id/ivSort91" | 38 | android:id="@+id/ivSort91" |
42 | android:layout_width="@dimen/icon_dim10" | 39 | android:layout_width="@dimen/icon_dim10" |
43 | android:layout_height="@dimen/icon_dim10" | 40 | android:layout_height="@dimen/icon_dim10" |
44 | android:layout_marginStart="10dp" | 41 | android:layout_marginStart="10dp" |
45 | android:padding="5dp" | 42 | android:padding="5dp" |
46 | android:src="@drawable/ic_sort91" | 43 | android:src="@drawable/ic_sort91" |
47 | android:visibility="gone" | 44 | android:visibility="gone" |
48 | app:layout_constraintHorizontal_chainStyle="packed" | 45 | app:layout_constraintHorizontal_chainStyle="packed" |
49 | app:layout_constraintStart_toStartOf="parent" | 46 | app:layout_constraintStart_toStartOf="parent" |
50 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | 47 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> |
51 | 48 | ||
52 | <TextView | 49 | <TextView |
53 | android:id="@+id/tvTipo" | 50 | android:id="@+id/tvTipo" |
54 | android:layout_width="wrap_content" | 51 | android:layout_width="wrap_content" |
55 | android:layout_height="wrap_content" | 52 | android:layout_height="wrap_content" |
56 | android:layout_margin="5dp" | 53 | android:layout_margin="5dp" |
57 | android:text="Tipo:" | ||
58 | android:layout_marginTop="12dp" | 54 | android:layout_marginTop="12dp" |
59 | android:textSize="@dimen/nav_header_vertical_spacing10" | 55 | android:text="Tipo:" |
56 | android:textSize="@dimen/md_message_textsize" | ||
60 | android:visibility="gone" | 57 | android:visibility="gone" |
61 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" | 58 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" |
62 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> | 59 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> |
63 | 60 | ||
64 | <com.google.android.material.checkbox.MaterialCheckBox | 61 | <com.google.android.material.checkbox.MaterialCheckBox |
65 | android:id="@+id/cbVentas" | 62 | android:id="@+id/cbVentas" |
66 | android:layout_width="wrap_content" | 63 | android:layout_width="wrap_content" |
67 | android:layout_height="wrap_content" | 64 | android:layout_height="wrap_content" |
68 | android:textSize="@dimen/SubTitulos10" | ||
69 | android:layout_margin="5dp" | 65 | android:layout_margin="5dp" |
66 | android:layout_marginTop="12dp" | ||
70 | android:checked="true" | 67 | android:checked="true" |
71 | android:text="Ventas" | 68 | android:text="Ventas" |
72 | android:layout_marginTop="12dp" | 69 | android:textSize="@dimen/SubTitulos10" |
73 | android:visibility="gone" | 70 | android:visibility="gone" |
74 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" | 71 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" |
75 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | 72 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> |
76 | 73 | ||
77 | <com.google.android.material.checkbox.MaterialCheckBox | 74 | <com.google.android.material.checkbox.MaterialCheckBox |
78 | android:id="@+id/cbDeposito" | 75 | android:id="@+id/cbDeposito" |
79 | android:layout_width="wrap_content" | 76 | android:layout_width="wrap_content" |
80 | android:layout_height="wrap_content" | 77 | android:layout_height="wrap_content" |
81 | android:textSize="@dimen/SubTitulos10" | ||
82 | android:layout_margin="5dp" | 78 | android:layout_margin="5dp" |
79 | android:layout_marginTop="12dp" | ||
83 | android:checked="true" | 80 | android:checked="true" |
84 | android:text="Deposito" | 81 | android:text="Deposito" |
85 | android:layout_marginTop="12dp" | 82 | android:textSize="@dimen/SubTitulos10" |
86 | android:visibility="gone" | 83 | android:visibility="gone" |
87 | app:layout_constraintEnd_toEndOf="parent" | 84 | app:layout_constraintEnd_toEndOf="parent" |
88 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | 85 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> |
89 | 86 | ||
90 | <androidx.recyclerview.widget.RecyclerView | 87 | <androidx.recyclerview.widget.RecyclerView |
91 | android:id="@+id/rcInventario" | 88 | android:id="@+id/rcInventario" |
92 | android:layout_width="match_parent" | 89 | android:layout_width="match_parent" |
93 | android:layout_height="0dp" | 90 | android:layout_height="0dp" |
94 | android:background="@android:color/darker_gray" | 91 | android:background="@android:color/darker_gray" |
95 | android:scrollbars="vertical" | 92 | android:scrollbars="vertical" |
96 | android:visibility="gone" | 93 | android:visibility="gone" |
94 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | ||
97 | app:layout_constraintEnd_toEndOf="parent" | 95 | app:layout_constraintEnd_toEndOf="parent" |
98 | app:layout_constraintStart_toStartOf="parent" | 96 | app:layout_constraintStart_toStartOf="parent" |
99 | app:layout_constraintTop_toBottomOf="@id/ivSort19" | 97 | app:layout_constraintTop_toBottomOf="@id/ivSort19" |
100 | tools:listitem="@layout/item_principal" | 98 | tools:listitem="@layout/item_principal" /> |
101 | app:layout_constraintBottom_toTopOf="@+id/guideline6"/> | ||
102 | 99 | ||
103 | 100 | ||
104 | <androidx.appcompat.widget.AppCompatTextView | 101 | <androidx.appcompat.widget.AppCompatTextView |
105 | android:id="@+id/txtDeposito" | 102 | android:id="@+id/tvInvImportados" |
106 | android:layout_width="match_parent" | 103 | android:layout_width="match_parent" |
107 | android:layout_height="110dp" | 104 | android:layout_height="110dp" |
108 | android:autoSizeMaxTextSize="150sp" | 105 | android:textSize="60sp" |
109 | android:autoSizeMinTextSize="25sp" | ||
110 | android:autoSizeStepGranularity="5sp" | ||
111 | android:autoSizeTextType="uniform" | ||
112 | android:gravity="start" | 106 | android:gravity="start" |
113 | android:lines="1" | 107 | android:lines="1" |
114 | android:padding="10dp" | 108 | android:padding="10dp" |
115 | android:text="@string/invDinamicoCompra" | 109 | android:text="@string/invDinamicoCompra" |
116 | android:textColor="@color/colorAccent" | 110 | android:textColor="@color/colorAccent" |
117 | android:visibility="visible" | 111 | android:visibility="visible" |
118 | app:fontFamily="sans-serif-condensed" | 112 | app:fontFamily="sans-serif-condensed" |
119 | app:layout_constraintBottom_toBottomOf="parent" | 113 | app:layout_constraintBottom_toBottomOf="parent" |
120 | app:layout_constraintEnd_toEndOf="parent" | 114 | app:layout_constraintEnd_toEndOf="parent" |
121 | app:layout_constraintStart_toStartOf="parent" | 115 | app:layout_constraintStart_toStartOf="parent" |
122 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" | 116 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" |
123 | app:layout_constraintVertical_bias="0.0" /> | 117 | app:layout_constraintVertical_bias="0.0" /> |
124 | 118 | ||
119 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | ||
120 | <!-- android:id="@+id/ivSort19II"--> | ||
121 | <!-- android:layout_width="@dimen/icon_dim10"--> | ||
122 | <!-- android:layout_height="@dimen/icon_dim10"--> | ||
123 | <!-- android:layout_marginStart="10dp"--> | ||
124 | <!-- android:padding="5dp"--> | ||
125 | <!-- android:src="@drawable/ic_sort19"--> | ||
126 | <!-- android:visibility="invisible"--> | ||
127 | <!-- app:layout_constraintHorizontal_bias="0.0"--> | ||
128 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
129 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
130 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | ||
131 | |||
132 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | ||
133 | <!-- android:id="@+id/ivSort91II"--> | ||
134 | <!-- android:layout_width="@dimen/icon_dim10"--> | ||
135 | <!-- android:layout_height="@dimen/icon_dim10"--> | ||
136 | <!-- android:layout_marginStart="10dp"--> | ||
137 | <!-- android:padding="5dp"--> | ||
138 | <!-- android:src="@drawable/ic_sort91"--> | ||
139 | <!-- android:visibility="invisible"--> | ||
140 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
141 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
142 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> | ||
143 | |||
144 | <androidx.recyclerview.widget.RecyclerView | ||
145 | android:id="@+id/rcInventarioII" | ||
146 | android:layout_width="match_parent" | ||
147 | android:layout_height="0dp" | ||
148 | android:background="@android:color/darker_gray" | ||
149 | android:scrollbars="vertical" | ||
150 | android:visibility="gone" | ||
151 | app:layout_constraintBottom_toTopOf="@+id/guideline6" | ||
152 | app:layout_constraintEnd_toEndOf="parent" | ||
153 | app:layout_constraintStart_toStartOf="parent" | ||
154 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" | ||
155 | tools:listitem="@layout/item_principal" /> | ||
156 | |||
125 | <androidx.constraintlayout.widget.Guideline | 157 | <androidx.constraintlayout.widget.Guideline |
126 | android:id="@+id/guideline6" | 158 | android:id="@+id/guideline6" |
127 | android:layout_width="wrap_content" | 159 | android:layout_width="wrap_content" |
128 | android:layout_height="wrap_content" | 160 | android:layout_height="wrap_content" |
129 | android:orientation="horizontal" | 161 | android:orientation="horizontal" |
130 | app:layout_constraintGuide_percent="0.97" /> | 162 | app:layout_constraintGuide_percent="0.97" /> |
163 | |||
164 | <ImageView | ||
165 | android:id="@+id/ivPortada" |
app/src/main/res/layout-xlarge/fragment_servidores.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | tools:context=".UI.servidores.ServidoresFragment"> | 7 | tools:context=".UI.servidores.ServidoresFragment"> |
8 | 8 | ||
9 | <androidx.appcompat.widget.AppCompatTextView | 9 | <androidx.appcompat.widget.AppCompatTextView |
10 | android:id="@+id/tvTitutloServer" | 10 | android:id="@+id/tvTitutloServer" |
11 | android:layout_width="match_parent" | 11 | android:layout_width="0dp" |
12 | android:layout_height="120dp" | 12 | android:layout_height="wrap_content" |
13 | android:layout_marginStart="8dp" | 13 | android:layout_marginStart="8dp" |
14 | android:layout_marginTop="15dp" | 14 | android:layout_marginTop="15dp" |
15 | android:layout_marginEnd="8dp" | 15 | android:layout_marginEnd="8dp" |
16 | android:autoSizeMaxTextSize="100sp" | 16 | android:textSize="60sp" |
17 | android:autoSizeMinTextSize="20sp" | ||
18 | android:autoSizeStepGranularity="5sp" | ||
19 | android:autoSizeTextType="uniform" | ||
20 | android:gravity="center" | 17 | android:gravity="center" |
21 | android:lines="1" | 18 | android:lines="1" |
22 | android:text="@string/tvTitutloServer" | 19 | android:text="@string/tvTitutloServer" |
23 | android:textColor="@color/colorAccent" | 20 | android:textColor="@color/colorAccent" |
24 | app:fontFamily="sans-serif-condensed" | 21 | app:fontFamily="sans-serif-condensed" |
25 | app:layout_constraintEnd_toEndOf="parent" | 22 | app:layout_constraintEnd_toEndOf="parent" |
26 | app:layout_constraintStart_toStartOf="parent" | 23 | app:layout_constraintStart_toStartOf="parent" |
27 | app:layout_constraintTop_toTopOf="parent" /> | 24 | app:layout_constraintTop_toTopOf="parent" /> |
28 | 25 | ||
29 | 26 | ||
30 | <TextView | 27 | <TextView |
31 | android:id="@+id/tvNomServer" | 28 | android:id="@+id/tvNomServer" |
32 | android:layout_width="match_parent" | 29 | android:layout_width="match_parent" |
33 | android:layout_height="wrap_content" | 30 | android:layout_height="wrap_content" |
34 | android:layout_margin="10dp" | 31 | android:layout_margin="10dp" |
35 | android:gravity="start" | 32 | android:gravity="start" |
36 | android:lines="1" | 33 | android:lines="1" |
37 | android:text="@string/tvNomServer" | 34 | android:text="@string/tvNomServer" |
38 | android:textColor="@android:color/black" | 35 | android:textColor="@android:color/black" |
39 | android:textSize="@dimen/SubTitulos10" | 36 | android:textSize="@dimen/SubTitulos10" |
40 | android:textStyle="bold|italic" | 37 | android:textStyle="bold|italic" |
41 | app:fontFamily="sans-serif-condensed" | 38 | app:fontFamily="sans-serif-condensed" |
42 | app:layout_constraintEnd_toEndOf="parent" | 39 | app:layout_constraintEnd_toEndOf="parent" |
43 | app:layout_constraintStart_toStartOf="parent" | 40 | app:layout_constraintStart_toStartOf="parent" |
44 | app:layout_constraintTop_toBottomOf="@id/tvTitutloServer" /> | 41 | app:layout_constraintTop_toBottomOf="@id/tvTitutloServer" /> |
45 | 42 | ||
46 | <EditText | 43 | <EditText |
47 | android:id="@+id/etNombreServidor" | 44 | android:id="@+id/etNombreServidor" |
48 | android:layout_width="match_parent" | 45 | android:layout_width="match_parent" |
49 | android:layout_height="wrap_content" | 46 | android:layout_height="wrap_content" |
50 | android:layout_margin="10dp" | 47 | android:layout_margin="10dp" |
51 | android:autofillHints="" | 48 | android:autofillHints="" |
52 | android:clickable="true" | 49 | android:clickable="true" |
53 | android:ems="10" | 50 | android:ems="10" |
54 | android:focusable="true" | 51 | android:focusable="true" |
55 | android:hint="Servidor Local" | 52 | android:hint="Servidor Local" |
56 | android:inputType="text" | 53 | android:inputType="text" |
57 | android:lines="1" | 54 | android:lines="1" |
58 | android:textSize="@dimen/SubTitulos10" | 55 | android:textSize="@dimen/SubTitulos10" |
59 | app:layout_constraintEnd_toEndOf="parent" | 56 | app:layout_constraintEnd_toEndOf="parent" |
60 | app:layout_constraintStart_toStartOf="parent" | 57 | app:layout_constraintStart_toStartOf="parent" |
61 | app:layout_constraintTop_toBottomOf="@+id/tvNomServer" /> | 58 | app:layout_constraintTop_toBottomOf="@+id/tvNomServer" /> |
62 | 59 | ||
63 | <TextView | 60 | <TextView |
64 | android:id="@+id/tvDirServer" | 61 | android:id="@+id/tvDirServer" |
65 | android:layout_width="wrap_content" | 62 | android:layout_width="wrap_content" |
66 | android:layout_height="wrap_content" | 63 | android:layout_height="wrap_content" |
67 | android:layout_margin="10dp" | 64 | android:layout_margin="10dp" |
68 | android:gravity="start" | 65 | android:gravity="start" |
69 | android:lines="1" | 66 | android:lines="1" |
70 | android:text="@string/tvDirServer" | 67 | android:text="@string/tvDirServer" |
71 | android:textColor="@android:color/black" | 68 | android:textColor="@android:color/black" |
72 | android:textSize="@dimen/SubTitulos10" | 69 | android:textSize="@dimen/SubTitulos10" |
73 | android:textStyle="bold|italic" | 70 | android:textStyle="bold|italic" |
74 | app:fontFamily="sans-serif-condensed" | 71 | app:fontFamily="sans-serif-condensed" |
75 | app:layout_constraintStart_toStartOf="parent" | 72 | app:layout_constraintStart_toStartOf="parent" |
76 | app:layout_constraintTop_toBottomOf="@+id/etNombreServidor" /> | 73 | app:layout_constraintTop_toBottomOf="@+id/etNombreServidor" /> |
77 | 74 | ||
78 | <EditText | 75 | <EditText |
79 | android:id="@+id/etDireccionServidor" | 76 | android:id="@+id/etDireccionServidor" |
80 | android:layout_width="wrap_content" | 77 | android:layout_width="0dp" |
81 | android:layout_height="wrap_content" | 78 | android:layout_height="wrap_content" |
82 | android:clickable="true" | 79 | android:clickable="true" |
83 | android:ems="10" | 80 | android:ems="10" |
84 | android:focusable="true" | 81 | android:focusable="true" |
85 | android:hint="192.168.100.100" | 82 | android:hint="192.168.100.100" |
86 | android:inputType="phone" | 83 | android:inputType="phone" |
87 | android:lines="1" | 84 | android:lines="1" |
85 | android:nextFocusLeft="@id/etPuertoSubida" | ||
86 | android:nextFocusRight="@id/etPuertoSubida" | ||
87 | android:nextFocusDown="@id/etPuertoSubida" | ||
88 | android:textSize="@dimen/SubTitulos10" | 88 | android:textSize="@dimen/SubTitulos10" |
89 | app:layout_constraintBaseline_toBaselineOf="@+id/tvDirServer" | 89 | app:layout_constraintBaseline_toBaselineOf="@+id/tvDirServer" |
90 | app:layout_constraintEnd_toEndOf="parent" | ||
90 | app:layout_constraintStart_toEndOf="@+id/tvDirServer" /> | 91 | app:layout_constraintStart_toEndOf="@+id/tvDirServer" /> |
91 | 92 | ||
92 | 93 | ||
94 | <EditText | ||
95 | android:id="@+id/etPuertoSubida" | ||
96 | android:layout_width="0dp" | ||
97 | android:layout_height="wrap_content" | ||
98 | android:layout_margin="10dp" | ||
99 | android:autofillHints="" | ||
100 | android:clickable="true" | ||
101 | android:ems="10" | ||
102 | android:focusable="true" | ||
103 | android:hint="Puerto de Subida" | ||
104 | android:inputType="number" | ||
105 | android:nextFocusDown="@id/etPuertoBajada" | ||
106 | android:nextFocusRight="@id/etPuertoBajada" | ||
107 | android:nextFocusLeft="@id/etPuertoBajada" | ||
108 | android:lines="1" | ||
109 | android:textSize="@dimen/SubTitulos10" | ||
110 | app:layout_constraintStart_toStartOf="parent" | ||
111 | app:layout_constraintTop_toBottomOf="@+id/tvDirServer" /> | ||
112 | |||
93 | <EditText | 113 | <EditText |
94 | android:id="@+id/etPuerto" | 114 | android:id="@+id/etPuertoBajada" |
95 | android:layout_width="wrap_content" | 115 | android:layout_width="0dp" |
96 | android:layout_height="wrap_content" | 116 | android:layout_height="wrap_content" |
117 | android:layout_margin="10dp" | ||
118 | android:autofillHints="" | ||
97 | android:clickable="true" | 119 | android:clickable="true" |
98 | android:ems="10" | 120 | android:ems="10" |
99 | android:focusable="true" | 121 | android:focusable="true" |
100 | android:hint="Puerto" | 122 | android:hint="Puerto de Bajada" |
101 | android:inputType="number" | 123 | android:inputType="number" |
102 | android:lines="1" | 124 | android:lines="1" |
125 | android:nextFocusLeft="@id/btnGuardarServidores" | ||
126 | android:nextFocusRight="@id/btnGuardarServidores" | ||
127 | android:nextFocusDown="@id/btnGuardarServidores" | ||
103 | android:textSize="@dimen/SubTitulos10" | 128 | android:textSize="@dimen/SubTitulos10" |
104 | app:layout_constraintBaseline_toBaselineOf="@+id/etDireccionServidor" | 129 | app:layout_constraintBaseline_toBaselineOf="@+id/etPuertoSubida" |
105 | app:layout_constraintStart_toEndOf="@+id/etDireccionServidor" | 130 | |
106 | android:autofillHints="" /> | 131 | app:layout_constraintEnd_toEndOf="parent" |
132 | app:layout_constraintStart_toEndOf="@+id/etPuertoSubida" /> | ||
133 | |||
107 | 134 | ||
108 | 135 | ||
109 | <androidx.recyclerview.widget.RecyclerView | 136 | <androidx.recyclerview.widget.RecyclerView |
110 | android:id="@+id/rvServidores" | 137 | android:id="@+id/rvServidores" |
111 | android:layout_width="match_parent" | 138 | android:layout_width="match_parent" |
112 | android:layout_height="0dp" | 139 | android:layout_height="0dp" |
113 | android:layout_marginTop="10dp" | 140 | android:layout_marginTop="10dp" |
114 | android:background="@android:color/darker_gray" | 141 | android:background="@android:color/darker_gray" |
115 | app:layout_constraintBottom_toTopOf="@+id/btnGuardarServidores" | 142 | app:layout_constraintBottom_toTopOf="@+id/btnGuardarServidores" |
116 | app:layout_constraintEnd_toEndOf="parent" | 143 | app:layout_constraintEnd_toEndOf="parent" |
117 | app:layout_constraintStart_toStartOf="parent" | 144 | app:layout_constraintStart_toStartOf="parent" |
118 | app:layout_constraintTop_toBottomOf="@+id/etPuerto" | 145 | app:layout_constraintTop_toBottomOf="@+id/etPuertoSubida" |
119 | app:layout_goneMarginEnd="10dp" | 146 | app:layout_goneMarginEnd="10dp" |
120 | tools:listitem="@layout/item_servidores" /> | 147 | tools:listitem="@layout/item_servidores" /> |
121 | 148 | ||
122 | <Button | 149 | <Button |
123 | android:id="@+id/btnGuardarServidores" | 150 | android:id="@+id/btnGuardarServidores" |
124 | android:layout_width="0dp" | 151 | android:layout_width="0dp" |
125 | android:layout_height="wrap_content" | 152 | android:layout_height="wrap_content" |
126 | android:layout_marginTop="10dp" | 153 | android:layout_marginTop="10dp" |
127 | android:layout_marginEnd="10dp" | 154 | android:layout_marginEnd="10dp" |
128 | android:layout_marginBottom="10dp" | 155 | android:layout_marginBottom="10dp" |
129 | android:background="@drawable/boton_borde_redondeado" | 156 | android:background="@drawable/boton_borde_redondeado" |
130 | android:padding="10dp" | 157 | android:padding="10dp" |
131 | android:text="@string/btnGuardarServidores" | 158 | android:text="@string/btnGuardarServidores" |
132 | android:textColor="@android:color/white" | 159 | android:textColor="@android:color/white" |
133 | android:textSize="@dimen/SubTitulos10" | 160 | android:textSize="@dimen/SubTitulos10" |
134 | app:layout_constraintBottom_toBottomOf="parent" | 161 | app:layout_constraintBottom_toBottomOf="parent" |
135 | app:layout_constraintEnd_toEndOf="parent" | 162 | app:layout_constraintEnd_toEndOf="parent" |
136 | app:layout_constraintStart_toStartOf="parent" | 163 | app:layout_constraintStart_toStartOf="parent" |
137 | app:layout_constraintTop_toBottomOf="@+id/rvServidores" /> | 164 | app:layout_constraintTop_toBottomOf="@+id/rvServidores" /> |
app/src/main/res/layout-xlarge/item_descripcion.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
5 | android:layout_height="wrap_content" | 5 | android:layout_height="wrap_content" |
6 | android:layout_margin="5dp" | 6 | android:layout_margin="5dp" |
7 | app:cardCornerRadius="15dp" | 7 | app:cardCornerRadius="15dp" |
8 | app:cardElevation="10dp" | 8 | app:cardElevation="10dp" |
9 | app:cardPreventCornerOverlap="false" | 9 | app:cardPreventCornerOverlap="false" |
10 | app:contentPadding="5dp"> | 10 | app:contentPadding="5dp"> |
11 | 11 | ||
12 | <androidx.constraintlayout.widget.ConstraintLayout | 12 | <androidx.constraintlayout.widget.ConstraintLayout |
13 | android:layout_width="match_parent" | 13 | android:layout_width="match_parent" |
14 | android:layout_height="wrap_content"> | 14 | android:layout_height="wrap_content"> |
15 | 15 | ||
16 | <TextView | 16 | <TextView |
17 | android:id="@+id/tvDescripcion" | 17 | android:id="@+id/tvDescripcion" |
18 | android:layout_width="0dp" | 18 | android:layout_width="0dp" |
19 | android:layout_height="wrap_content" | 19 | android:layout_height="wrap_content" |
20 | android:layout_marginStart="5dp" | 20 | android:layout_marginStart="5dp" |
21 | android:maxLines="2" | 21 | android:maxLines="2" |
22 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" | 22 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" |
23 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 23 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
24 | android:textSize="@dimen/SubTitulos10" | 24 | android:textSize="@dimen/SubTitulos10" |
25 | android:textStyle="bold" | 25 | android:textStyle="bold" |
26 | app:layout_constraintEnd_toEndOf="parent" | 26 | app:layout_constraintEnd_toEndOf="parent" |
27 | app:layout_constraintStart_toStartOf="parent" | 27 | app:layout_constraintStart_toStartOf="parent" |
28 | app:layout_constraintTop_toTopOf="parent" /> | 28 | app:layout_constraintTop_toTopOf="parent" /> |
29 | 29 | ||
30 | <TextView | 30 | <TextView |
31 | android:id="@+id/textView2" | 31 | android:id="@+id/textView2" |
32 | android:layout_width="wrap_content" | 32 | android:layout_width="wrap_content" |
33 | android:layout_height="wrap_content" | 33 | android:layout_height="wrap_content" |
34 | android:layout_marginStart="5dp" | 34 | android:layout_marginStart="5dp" |
35 | android:text="Código DEBO:" | 35 | android:text="Código DEBO:" |
36 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 36 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
37 | android:textSize="@dimen/nav_header_vertical_spacing10" | 37 | android:textSize="@dimen/md_message_textsize" |
38 | app:layout_constraintHorizontal_chainStyle="packed" | 38 | app:layout_constraintHorizontal_chainStyle="packed" |
39 | app:layout_constraintStart_toStartOf="parent" | 39 | app:layout_constraintStart_toStartOf="parent" |
40 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | 40 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
41 | 41 | ||
42 | 42 | ||
43 | <TextView | 43 | <TextView |
44 | android:id="@+id/tvSector" | 44 | android:id="@+id/tvSector" |
45 | android:layout_width="wrap_content" | 45 | android:layout_width="wrap_content" |
46 | android:layout_height="match_parent" | 46 | android:layout_height="match_parent" |
47 | android:text="9999" | 47 | android:text="9999" |
48 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 48 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
49 | android:textColorHint="@android:color/black" | 49 | android:textColorHint="@android:color/black" |
50 | android:textSize="@dimen/SubTitulos10" | 50 | android:textSize="@dimen/SubTitulos10" |
51 | android:textStyle="bold" | 51 | android:textStyle="bold" |
52 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | 52 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" |
53 | app:layout_constraintHorizontal_chainStyle="packed" | 53 | app:layout_constraintHorizontal_chainStyle="packed" |
54 | app:layout_constraintStart_toEndOf="@+id/textView2" | 54 | app:layout_constraintStart_toEndOf="@+id/textView2" |
55 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | 55 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
56 | 56 | ||
57 | <TextView | 57 | <TextView |
58 | android:id="@+id/tvCodigo" | 58 | android:id="@+id/tvCodigo" |
59 | android:layout_width="wrap_content" | 59 | android:layout_width="wrap_content" |
60 | android:layout_height="match_parent" | 60 | android:layout_height="match_parent" |
61 | android:layout_marginStart="2dp" | 61 | android:layout_marginStart="2dp" |
62 | android:text="99999999" | 62 | android:text="99999999" |
63 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 63 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
64 | android:textColorHint="@android:color/black" | 64 | android:textColorHint="@android:color/black" |
65 | android:textSize="@dimen/SubTitulos10" | 65 | android:textSize="@dimen/SubTitulos10" |
66 | android:textStyle="bold" | 66 | android:textStyle="bold" |
67 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" | 67 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" |
68 | app:layout_constraintHorizontal_chainStyle="packed" | 68 | app:layout_constraintHorizontal_chainStyle="packed" |
69 | app:layout_constraintStart_toEndOf="@+id/tvSector" | 69 | app:layout_constraintStart_toEndOf="@+id/tvSector" |
70 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | 70 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
71 | 71 | ||
72 | <TextView | 72 | <TextView |
73 | android:id="@+id/textView3" | 73 | android:id="@+id/textView3" |
74 | android:layout_width="wrap_content" | 74 | android:layout_width="wrap_content" |
75 | android:layout_height="wrap_content" | 75 | android:layout_height="wrap_content" |
76 | android:layout_marginStart="5dp" | 76 | android:layout_marginStart="5dp" |
77 | android:text="Código barras:" | 77 | android:text="Código barras:" |
78 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 78 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
79 | android:textSize="@dimen/nav_header_vertical_spacing10" | 79 | android:textSize="@dimen/nav_header_vertical_spacing10" |
80 | app:layout_constraintHorizontal_chainStyle="packed" | 80 | app:layout_constraintHorizontal_chainStyle="packed" |
81 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" | 81 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" |
82 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | 82 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
83 | 83 | ||
84 | <TextView | 84 | <TextView |
85 | android:id="@+id/tvCodigoBarras" | 85 | android:id="@+id/tvCodigoBarras" |
86 | android:layout_width="wrap_content" | 86 | android:layout_width="wrap_content" |
87 | android:layout_height="wrap_content" | 87 | android:layout_height="wrap_content" |
88 | android:layout_marginStart="3dp" | 88 | android:layout_marginStart="3dp" |
89 | android:maxLines="2" | 89 | android:maxLines="2" |
90 | android:text="1234567890123456" | 90 | android:text="1234567890123456" |
91 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 91 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
92 | android:textSize="@dimen/SubTitulos10" | 92 | android:textSize="@dimen/SubTitulos10" |
93 | android:textStyle="bold" | 93 | android:textStyle="bold" |
94 | android:visibility="visible" | 94 | android:visibility="visible" |
95 | app:layout_constraintBaseline_toBaselineOf="@+id/textView3" | 95 | app:layout_constraintBaseline_toBaselineOf="@+id/textView3" |
96 | app:layout_constraintStart_toEndOf="@+id/textView3" | 96 | app:layout_constraintStart_toEndOf="@+id/textView3" |
97 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | 97 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> |
98 | <!-- <TextView--> | 98 | <!-- <TextView--> |
99 | <!-- android:id="@+id/textView5"--> | 99 | <!-- android:id="@+id/textView5"--> |
100 | <!-- android:layout_width="wrap_content"--> | 100 | <!-- android:layout_width="wrap_content"--> |
101 | <!-- android:layout_height="wrap_content"--> | 101 | <!-- android:layout_height="wrap_content"--> |
102 | <!-- android:layout_marginStart="8dp"--> | 102 | <!-- android:layout_marginStart="8dp"--> |
103 | <!-- android:text="Cantidad:"--> | 103 | <!-- android:text="Cantidad:"--> |
104 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"--> | 104 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"--> |
105 | <!-- android:textSize="14sp"--> | 105 | <!-- android:textSize="14sp"--> |
106 | <!-- android:visibility="gone"--> | 106 | <!-- android:visibility="gone"--> |
107 | <!-- app:layout_constraintTop_toTopOf="parent"--> | 107 | <!-- app:layout_constraintTop_toTopOf="parent"--> |
108 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras"--> | 108 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras"--> |
109 | <!-- app:layout_constraintStart_toEndOf="@+id/tvCodigo" />--> | 109 | <!-- app:layout_constraintStart_toEndOf="@+id/tvCodigo" />--> |
110 | 110 | ||
111 | <!-- <TextView--> | 111 | <!-- <TextView--> |
112 | <!-- android:id="@+id/tvCantidad"--> | 112 | <!-- android:id="@+id/tvCantidad"--> |
113 | <!-- android:layout_width="wrap_content"--> | 113 | <!-- android:layout_width="wrap_content"--> |
114 | <!-- android:layout_height="match_parent"--> | 114 | <!-- android:layout_height="match_parent"--> |
115 | <!-- android:layout_marginStart="8dp"--> | 115 | <!-- android:layout_marginStart="8dp"--> |
116 | <!-- android:text="Código Barras:"--> | 116 | <!-- android:text="Código Barras:"--> |
117 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | 117 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> |
118 | <!-- android:textSize="14sp"--> | 118 | <!-- android:textSize="14sp"--> |
119 | <!-- android:textStyle="bold"--> | 119 | <!-- android:textStyle="bold"--> |
120 | <!-- android:visibility="visible"--> | 120 | <!-- android:visibility="visible"--> |
121 | <!-- app:layout_constraintEnd_toStartOf="@id/tvCodigoBarras"--> | 121 | <!-- app:layout_constraintEnd_toStartOf="@id/tvCodigoBarras"--> |
122 | <!-- app:layout_constraintStart_toEndOf="@id/textView5"--> | 122 | <!-- app:layout_constraintStart_toEndOf="@id/textView5"--> |
123 | <!-- app:layout_constraintTop_toTopOf="parent" />--> | 123 | <!-- app:layout_constraintTop_toTopOf="parent" />--> |
124 | 124 | ||
125 | 125 | ||
126 | <!-- <ImageView--> | 126 | <!-- <ImageView--> |
127 | <!-- android:id="@+id/ivHolder"--> | 127 | <!-- android:id="@+id/ivHolder"--> |
128 | <!-- android:layout_width="30dp"--> | 128 | <!-- android:layout_width="30dp"--> |
129 | <!-- android:layout_height="30dp"--> | 129 | <!-- android:layout_height="30dp"--> |
130 | <!-- android:visibility="gone"--> | 130 | <!-- android:visibility="gone"--> |
131 | <!-- android:src="@drawable/more"--> | 131 | <!-- android:src="@drawable/more"--> |
132 | <!-- app:layout_constraintBottom_toTopOf="@+id/tvDescripcion"--> | 132 | <!-- app:layout_constraintBottom_toTopOf="@+id/tvDescripcion"--> |
133 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | 133 | <!-- app:layout_constraintEnd_toEndOf="parent"--> |
134 | <!-- app:layout_constraintHorizontal_bias="0.968"--> | 134 | <!-- app:layout_constraintHorizontal_bias="0.968"--> |
135 | <!-- app:layout_constraintStart_toEndOf="@+id/tvCodigoBarras"--> | 135 | <!-- app:layout_constraintStart_toEndOf="@+id/tvCodigoBarras"--> |
136 | <!-- app:layout_constraintTop_toTopOf="parent"--> | 136 | <!-- app:layout_constraintTop_toTopOf="parent"--> |
137 | <!-- app:layout_constraintVertical_bias="0.0" />--> | 137 | <!-- app:layout_constraintVertical_bias="0.0" />--> |
138 | 138 | ||
139 | 139 | ||
140 | </androidx.constraintlayout.widget.ConstraintLayout> | 140 | </androidx.constraintlayout.widget.ConstraintLayout> |
141 | 141 | ||
142 | </androidx.cardview.widget.CardView> | 142 | </androidx.cardview.widget.CardView> |
app/src/main/res/layout-xlarge/item_inv_importados.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="wrap_content" | ||
7 | android:layout_margin="10dp" | ||
8 | app:cardCornerRadius="15dp" | ||
9 | app:cardElevation="10dp" | ||
10 | app:cardPreventCornerOverlap="false"> | ||
11 | |||
12 | <androidx.constraintlayout.widget.ConstraintLayout | ||
13 | android:layout_width="match_parent" | ||
14 | android:layout_height="wrap_content" | ||
15 | android:layout_gravity="center" | ||
16 | android:orientation="horizontal"> | ||
17 | |||
18 | <com.google.android.material.checkbox.MaterialCheckBox | ||
19 | android:id="@+id/tvPrincipalinventario" | ||
20 | android:layout_width="match_parent" | ||
21 | android:layout_height="wrap_content" | ||
22 | android:layout_margin="15dp" | ||
23 | android:background="@drawable/boton_redondo2" | ||
24 | android:gravity="center_vertical" | ||
25 | android:padding="5dp" | ||
26 | android:textColor="@android:color/black" | ||
27 | android:textSize="@dimen/VentasDeposito10" | ||
28 | android:textStyle="bold" | ||
29 | app:layout_constraintBottom_toBottomOf="parent" | ||
30 | app:layout_constraintStart_toStartOf="parent" | ||
31 | app:layout_constraintTop_toTopOf="parent" | ||
32 | tools:text="Inventario Sectorizado # 1487" /> | ||
33 | |||
34 | |||
35 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
36 | </androidx.cardview.widget.CardView> | ||
37 |
app/src/main/res/layout-xlarge/item_principal.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="wrap_content" | 6 | android:layout_height="wrap_content" |
7 | android:layout_margin="5dp" | 7 | android:layout_margin="5dp" |
8 | app:cardCornerRadius="15dp" | 8 | app:cardCornerRadius="15dp" |
9 | app:cardElevation="10dp" | 9 | app:cardElevation="10dp" |
10 | app:cardPreventCornerOverlap="false"> | 10 | app:cardPreventCornerOverlap="false"> |
11 | 11 | ||
12 | <androidx.constraintlayout.widget.ConstraintLayout | 12 | <androidx.constraintlayout.widget.ConstraintLayout |
13 | android:layout_width="match_parent" | 13 | android:layout_width="match_parent" |
14 | android:layout_height="wrap_content" | 14 | android:layout_height="wrap_content" |
15 | android:layout_gravity="center_horizontal|center_vertical" | 15 | android:layout_gravity="center_horizontal|center_vertical" |
16 | android:orientation="vertical"> | 16 | android:orientation="vertical"> |
17 | 17 | ||
18 | <TextView | 18 | <TextView |
19 | android:id="@+id/tvPrincipalinventario" | 19 | android:id="@+id/tvPrincipalinventario" |
20 | android:layout_width="@dimen/icon_dim10" | 20 | android:layout_width="@dimen/icon_dim10" |
21 | android:layout_height="@dimen/icon_dim10" | 21 | android:layout_height="@dimen/icon_dim10" |
22 | android:layout_margin="10dp" | 22 | android:layout_margin="10dp" |
23 | android:background="@drawable/boton_redondo2" | 23 | android:background="@drawable/boton_redondo2" |
24 | android:gravity="center" | 24 | android:gravity="center" |
25 | android:lines="2" | 25 | android:lines="2" |
26 | android:textColor="@android:color/black" | 26 | android:textColor="@android:color/black" |
27 | android:textSize="@dimen/TitulosMedios" | 27 | android:textSize="@dimen/TitulosMedios" |
28 | android:textStyle="bold" | 28 | android:textStyle="bold" |
29 | app:layout_constraintBottom_toTopOf="@+id/ivFondo" | 29 | app:layout_constraintBottom_toTopOf="@+id/ivFondo" |
30 | app:layout_constraintStart_toStartOf="parent" | 30 | app:layout_constraintStart_toStartOf="parent" |
31 | app:layout_constraintTop_toTopOf="parent" | 31 | app:layout_constraintTop_toTopOf="parent" |
32 | tools:text="99" /> | 32 | tools:text="99" /> |
33 | 33 | ||
34 | <TextView | 34 | <TextView |
35 | android:id="@+id/textView6" | 35 | android:id="@+id/textView6" |
36 | android:layout_width="wrap_content" | 36 | android:layout_width="wrap_content" |
37 | android:layout_height="wrap_content" | 37 | android:layout_height="wrap_content" |
38 | android:layout_marginTop="5dp" | 38 | android:layout_marginTop="5dp" |
39 | android:text="Fecha Inicio" | 39 | android:text="Fecha Inicio" |
40 | android:textSize="@dimen/textView510" | 40 | android:textSize="@dimen/textView510" |
41 | android:textStyle="bold" | 41 | android:textStyle="bold" |
42 | app:layout_constraintEnd_toEndOf="parent" | 42 | app:layout_constraintEnd_toEndOf="parent" |
43 | app:layout_constraintHorizontal_bias="0.217" | 43 | app:layout_constraintHorizontal_bias="0.217" |
44 | app:layout_constraintStart_toEndOf="@id/tvPrincipalinventario" | 44 | app:layout_constraintStart_toEndOf="@id/tvPrincipalinventario" |
45 | app:layout_constraintTop_toTopOf="parent" /> | 45 | app:layout_constraintTop_toTopOf="parent" /> |
46 | 46 | ||
47 | <TextView | 47 | <TextView |
48 | android:id="@+id/tvFecha" | 48 | android:id="@+id/tvFecha" |
49 | android:layout_width="wrap_content" | 49 | android:layout_width="wrap_content" |
50 | android:layout_height="wrap_content" | 50 | android:layout_height="wrap_content" |
51 | android:layout_marginStart="5dp" | 51 | android:layout_marginStart="5dp" |
52 | android:text="01/01/2020 12:20:20" | 52 | android:text="01/01/2020 12:20:20" |
53 | android:textSize="@dimen/textView510" | 53 | android:textSize="@dimen/textView510" |
54 | android:textStyle="bold" | 54 | android:textStyle="bold" |
55 | app:layout_constraintBaseline_toBaselineOf="@+id/textView6" | 55 | app:layout_constraintBaseline_toBaselineOf="@+id/textView6" |
56 | app:layout_constraintEnd_toEndOf="parent" | 56 | app:layout_constraintEnd_toEndOf="parent" |
57 | app:layout_constraintHorizontal_bias="0.0" | 57 | app:layout_constraintHorizontal_bias="0.0" |
58 | app:layout_constraintStart_toEndOf="@id/textView6" /> | 58 | app:layout_constraintStart_toEndOf="@id/textView6" /> |
59 | 59 | ||
60 | <TextView | 60 | <TextView |
61 | android:id="@+id/textView7" | 61 | android:id="@+id/textView7" |
62 | android:layout_width="wrap_content" | 62 | android:layout_width="wrap_content" |
63 | android:layout_height="wrap_content" | 63 | android:layout_height="wrap_content" |
64 | android:layout_marginTop="4dp" | 64 | android:layout_marginTop="4dp" |
65 | android:text="Art. Contados" | 65 | android:text="Cantidad Art." |
66 | android:textSize="@dimen/nav_header_vertical_spacing10" | 66 | android:textSize="@dimen/textView510" |
67 | android:textStyle="bold" | 67 | android:textStyle="bold" |
68 | app:layout_constraintEnd_toEndOf="parent" | 68 | app:layout_constraintEnd_toEndOf="parent" |
69 | app:layout_constraintHorizontal_bias="0.23" | 69 | app:layout_constraintHorizontal_bias="0.23" |
70 | app:layout_constraintStart_toEndOf="@+id/tvPrincipalinventario" | 70 | app:layout_constraintStart_toEndOf="@+id/tvPrincipalinventario" |
71 | app:layout_constraintTop_toBottomOf="@id/textView6" /> | 71 | app:layout_constraintTop_toBottomOf="@id/textView6" /> |
72 | 72 | ||
73 | <TextView | 73 | <TextView |
74 | android:id="@+id/tvCantContada" | 74 | android:id="@+id/tvCantContada" |
75 | android:layout_width="wrap_content" | 75 | android:layout_width="wrap_content" |
76 | android:layout_height="wrap_content" | 76 | android:layout_height="wrap_content" |
77 | android:layout_marginTop="4dp" | 77 | android:layout_marginTop="4dp" |
78 | android:layout_marginStart="5dp" | 78 | android:layout_marginStart="5dp" |
79 | android:text="002" | 79 | android:text="002" |
80 | android:textSize="@dimen/nav_header_vertical_spacing10" | 80 | android:textSize="@dimen/nav_header_vertical_spacing10" |
81 | android:textStyle="bold" | 81 | android:textStyle="bold" |
82 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" | 82 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" |
83 | app:layout_constraintStart_toEndOf="@+id/textView7" | 83 | app:layout_constraintStart_toEndOf="@+id/textView7" |
84 | app:layout_constraintTop_toBottomOf="@+id/tvFecha" /> | 84 | app:layout_constraintTop_toBottomOf="@+id/tvFecha" /> |
85 | 85 | ||
86 | <TextView | 86 | <TextView |
87 | android:id="@+id/tvDescription" | 87 | android:id="@+id/tvDescription" |
88 | android:layout_width="wrap_content" | 88 | android:layout_width="wrap_content" |
89 | android:layout_height="wrap_content" | 89 | android:layout_height="wrap_content" |
90 | android:text="prueba" | 90 | android:text="prueba" |
91 | android:textSize="@dimen/textView510" | 91 | android:textSize="@dimen/textView510" |
92 | app:layout_constraintBottom_toTopOf="@id/ivFondo" | 92 | app:layout_constraintBottom_toTopOf="@id/ivFondo" |
93 | app:layout_constraintEnd_toEndOf="parent" | 93 | app:layout_constraintEnd_toEndOf="parent" |
94 | app:layout_constraintHorizontal_bias="0.489" | 94 | app:layout_constraintHorizontal_bias="0.489" |
95 | app:layout_constraintStart_toEndOf="@id/tvPrincipalinventario" | 95 | app:layout_constraintStart_toEndOf="@id/tvPrincipalinventario" |
96 | app:layout_constraintTop_toBottomOf="@+id/tvFecha" | 96 | app:layout_constraintTop_toBottomOf="@+id/tvFecha" |
97 | app:layout_constraintVertical_bias="1.0" /> | 97 | app:layout_constraintVertical_bias="1.0" /> |
98 | 98 | ||
99 | 99 | ||
100 | <androidx.appcompat.widget.AppCompatImageView | 100 | <androidx.appcompat.widget.AppCompatImageView |
101 | android:id="@+id/ivFondo" | 101 | android:id="@+id/ivFondo" |
102 | android:layout_width="0dp" | 102 | android:layout_width="0dp" |
103 | android:layout_height="10dp" | 103 | android:layout_height="10dp" |
104 | android:background="@android:drawable/progress_horizontal" | 104 | android:background="@android:drawable/progress_horizontal" |
105 | android:elevation="10dp" | 105 | android:elevation="10dp" |
106 | app:layout_constraintBottom_toBottomOf="parent" | 106 | app:layout_constraintBottom_toBottomOf="parent" |
107 | app:layout_constraintCircleRadius="5dp" | 107 | app:layout_constraintCircleRadius="5dp" |
108 | app:layout_constraintEnd_toEndOf="parent" | 108 | app:layout_constraintEnd_toEndOf="parent" |
109 | app:layout_constraintStart_toStartOf="parent" | 109 | app:layout_constraintStart_toStartOf="parent" |
110 | tools:srcCompat="@android:drawable/progress_horizontal" /> | 110 | tools:srcCompat="@android:drawable/progress_horizontal" /> |
111 | </androidx.constraintlayout.widget.ConstraintLayout> | 111 | </androidx.constraintlayout.widget.ConstraintLayout> |
112 | </androidx.cardview.widget.CardView> | 112 | </androidx.cardview.widget.CardView> |
113 | 113 |
app/src/main/res/layout-xlarge/item_sec.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="wrap_content" | ||
7 | android:layout_margin="5dp" | ||
8 | app:cardCornerRadius="15dp" | ||
9 | app:cardElevation="10dp" | ||
10 | app:contentPadding="5dp" | ||
11 | app:cardPreventCornerOverlap="false"> | ||
12 | |||
13 | <androidx.constraintlayout.widget.ConstraintLayout | ||
14 | android:layout_width="match_parent" | ||
15 | android:layout_height="wrap_content"> | ||
16 | |||
17 | <TextView | ||
18 | android:id="@+id/tvDescripcion" | ||
19 | android:layout_width="0dp" | ||
20 | android:layout_height="wrap_content" | ||
21 | android:layout_marginStart="3dp" | ||
22 | android:maxLines="2" | ||
23 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" | ||
24 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
25 | android:textSize="@dimen/SubTitulos10" | ||
26 | android:textStyle="bold" | ||
27 | app:layout_constraintStart_toStartOf="parent" | ||
28 | app:layout_constraintTop_toTopOf="parent" /> | ||
29 | |||
30 | <!-- <TextView--> | ||
31 | <!-- android:id="@+id/textView2"--> | ||
32 | <!-- android:layout_width="wrap_content"--> | ||
33 | <!-- android:layout_height="wrap_content"--> | ||
34 | <!-- android:layout_marginStart="5dp"--> | ||
35 | <!-- android:text="Código:"--> | ||
36 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"--> | ||
37 | <!-- android:textSize="14sp"--> | ||
38 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvSector"--> | ||
39 | <!-- app:layout_constraintHorizontal_bias="0.01"--> | ||
40 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
41 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
42 | <!-- app:layout_constraintTop_toTopOf="parent" />--> | ||
43 | |||
44 | |||
45 | <!-- <TextView--> | ||
46 | <!-- android:id="@+id/tvSector"--> | ||
47 | <!-- android:layout_width="wrap_content"--> | ||
48 | <!-- android:layout_height="match_parent"--> | ||
49 | <!-- android:layout_marginStart="8dp"--> | ||
50 | <!-- android:text="9999"--> | ||
51 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
52 | <!-- android:textColorHint="@android:color/black"--> | ||
53 | <!-- android:textSize="18sp"--> | ||
54 | <!-- android:textStyle="bold"--> | ||
55 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
56 | <!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView2"--> | ||
57 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvCodigo"--> | ||
58 | <!-- app:layout_constraintStart_toEndOf="@+id/textView2" />--> | ||
59 | |||
60 | |||
61 | <!-- <TextView--> | ||
62 | <!-- android:id="@+id/tvCodigo"--> | ||
63 | <!-- android:layout_width="wrap_content"--> | ||
64 | <!-- android:layout_height="match_parent"--> | ||
65 | <!-- android:text="99999999"--> | ||
66 | <!-- android:layout_marginStart="8dp"--> | ||
67 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
68 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
69 | <!-- android:textColorHint="@android:color/black"--> | ||
70 | <!-- android:textSize="18sp"--> | ||
71 | <!-- android:textStyle="bold"--> | ||
72 | <!-- app:layout_constraintBaseline_toBaselineOf="@+id/tvSector"--> | ||
73 | <!-- app:layout_constraintEnd_toStartOf="@+id/textView5"--> | ||
74 | <!-- app:layout_constraintStart_toEndOf="@+id/tvSector" />--> | ||
75 | |||
76 | <TextView | ||
77 | android:id="@+id/textView5" | ||
78 | android:layout_width="wrap_content" | ||
79 | android:layout_height="wrap_content" | ||
80 | android:text="Cantidad:" | ||
81 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | ||
82 | android:textSize="@dimen/md_message_textsize" | ||
83 | android:layout_marginStart="5dp" | ||
84 | android:layout_marginTop="5dp" | ||
85 | app:layout_constraintStart_toStartOf="parent" | ||
86 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
87 | |||
88 | <TextView | ||
89 | android:id="@+id/tvCantidad" | ||
90 | android:layout_width="wrap_content" | ||
91 | android:layout_height="match_parent" | ||
92 | android:layout_marginTop="5dp" | ||
93 | android:text="12345.12" | ||
94 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
95 | android:textSize="@dimen/SubTitulos10" | ||
96 | android:textStyle="bold" | ||
97 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" | ||
98 | |||
99 | app:layout_constraintStart_toEndOf="@id/textView5" /> | ||
100 | |||
101 | <ImageView | ||
102 | android:id="@+id/ivPen" | ||
103 | android:layout_width="@dimen/iconosMedia10" | ||
104 | android:layout_height="@dimen/iconosMedia10" | ||
105 | android:layout_marginStart="3dp" | ||
106 | android:src="@drawable/pen" | ||
107 | android:visibility="visible" | ||
108 | app:layout_constraintStart_toEndOf="@+id/tvCantidad" | ||
109 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
110 | |||
111 | <ImageView | ||
112 | android:id="@+id/ivDots" | ||
113 | android:layout_width="30dp" | ||
114 | android:layout_height="30dp" | ||
115 | android:layout_marginEnd="3dp" | ||
116 | android:src="@drawable/more" | ||
117 | android:visibility="visible" | ||
118 | app:layout_constraintEnd_toEndOf="parent" | ||
119 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
120 | |||
121 | <!-- <TextView--> | ||
122 | <!-- android:id="@+id/textView85"--> | ||
123 | <!-- android:layout_width="wrap_content"--> | ||
124 | <!-- android:layout_height="wrap_content"--> | ||
125 | <!-- android:layout_marginStart="5dp"--> | ||
126 | <!-- android:layout_marginTop="8dp"--> | ||
127 | <!-- android:text="Desc:"--> | ||
128 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"--> | ||
129 | <!-- android:textSize="14sp"--> | ||
130 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvDescripcion"--> | ||
131 | <!-- app:layout_constraintHorizontal_bias="0.0"--> | ||
132 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
133 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
134 | <!-- app:layout_constraintTop_toBottomOf="@id/tvCodigo" />--> | ||
135 | |||
136 | |||
137 | <!-- <TextView--> | ||
138 | <!-- android:id="@+id/tvCodigoBarras"--> | ||
139 | <!-- android:layout_width="match_parent"--> | ||
140 | <!-- android:layout_height="wrap_content"--> | ||
141 | <!-- android:layout_marginStart="3dp"--> | ||
142 | <!-- android:layout_marginTop="8dp"--> | ||
143 | <!-- android:maxLines="2"--> | ||
144 | <!-- android:text=""--> | ||
145 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
146 | <!-- android:textSize="14sp"--> | ||
147 | <!-- android:visibility="gone"--> | ||
148 | <!-- android:textStyle="bold"--> | ||
149 | <!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView85"--> | ||
150 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
151 | <!-- app:layout_constraintStart_toEndOf="@+id/textView85"--> | ||
152 | <!-- app:layout_constraintTop_toBottomOf="@+id/tvCodigo" />--> | ||
153 | <!-- <TextView--> | ||
154 | <!-- android:id="@+id/tvCodigoOrigen"--> | ||
155 | <!-- android:layout_width="match_parent"--> | ||
156 | <!-- android:layout_height="wrap_content"--> | ||
157 | <!-- android:layout_marginStart="3dp"--> | ||
158 | <!-- android:layout_marginTop="8dp"--> | ||
159 | <!-- android:maxLines="2"--> | ||
160 | <!-- android:text=""--> | ||
161 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
162 | <!-- android:textSize="14sp"--> | ||
163 | <!-- android:visibility="gone"--> | ||
164 | <!-- android:textStyle="bold"--> | ||
165 | <!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView85"--> | ||
166 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
167 | <!-- app:layout_constraintStart_toEndOf="@+id/textView85"--> | ||
168 | <!-- app:layout_constraintTop_toBottomOf="@+id/tvCodigo" />--> | ||
169 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
170 | |||
171 | </androidx.cardview.widget.CardView> |
app/src/main/res/layout-xlarge/item_servidores.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
6 | android:layout_height="wrap_content" | 5 | android:layout_height="wrap_content" |
7 | android:layout_margin="5dp" | 6 | android:layout_margin="5dp" |
8 | app:cardCornerRadius="15dp" | 7 | app:cardCornerRadius="15dp" |
9 | app:cardElevation="10dp" | 8 | app:cardElevation="10dp" |
10 | app:contentPadding="5dp" | 9 | app:cardPreventCornerOverlap="false" |
11 | app:cardPreventCornerOverlap="false"> | 10 | app:contentPadding="5dp"> |
12 | 11 | ||
13 | <androidx.constraintlayout.widget.ConstraintLayout | 12 | <androidx.constraintlayout.widget.ConstraintLayout |
14 | android:layout_width="match_parent" | 13 | android:layout_width="match_parent" |
15 | android:layout_height="wrap_content"> | 14 | android:layout_height="wrap_content"> |
16 | 15 | ||
17 | <TextView | 16 | <TextView |
18 | android:id="@+id/textView2" | 17 | android:id="@+id/textView2" |
19 | android:layout_width="wrap_content" | 18 | android:layout_width="wrap_content" |
20 | android:layout_height="wrap_content" | 19 | android:layout_height="wrap_content" |
21 | android:layout_marginStart="5dp" | 20 | android:layout_marginStart="5dp" |
22 | android:text="Descripción:" | 21 | android:text="Descripción:" |
23 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 22 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
24 | android:textSize="20sp" | 23 | android:textSize="20sp" |
25 | app:layout_constraintEnd_toStartOf="@+id/tvCodigo" | 24 | app:layout_constraintEnd_toStartOf="@+id/tvCodigo" |
26 | app:layout_constraintHorizontal_bias="0.01" | 25 | app:layout_constraintHorizontal_bias="0.01" |
27 | app:layout_constraintHorizontal_chainStyle="packed" | 26 | app:layout_constraintHorizontal_chainStyle="packed" |
28 | app:layout_constraintStart_toStartOf="parent" | 27 | app:layout_constraintStart_toStartOf="parent" |
29 | app:layout_constraintTop_toTopOf="parent" /> | 28 | app:layout_constraintTop_toTopOf="parent" /> |
30 | 29 | ||
31 | <TextView | 30 | <TextView |
32 | android:id="@+id/tvDescServidor" | 31 | android:id="@+id/tvDescServidor" |
33 | android:layout_width="0dp" | 32 | android:layout_width="0dp" |
34 | android:layout_height="match_parent" | 33 | android:layout_height="match_parent" |
35 | android:layout_marginStart="8dp" | 34 | android:layout_marginStart="8dp" |
36 | android:text="Laboratorio Foca 1" | 35 | android:text="Laboratorio Foca 1" |
37 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 36 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
38 | android:textColorHint="@android:color/black" | 37 | android:textColorHint="@android:color/black" |
39 | android:textSize="25sp" | 38 | android:textSize="25sp" |
40 | android:textStyle="bold" | 39 | android:textStyle="bold" |
41 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | 40 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" |
42 | app:layout_constraintEnd_toEndOf="parent" | 41 | app:layout_constraintEnd_toEndOf="parent" |
43 | app:layout_constraintStart_toEndOf="@+id/textView2" /> | 42 | app:layout_constraintStart_toEndOf="@+id/textView2" /> |
44 | 43 | ||
45 | <TextView | 44 | <TextView |
46 | android:id="@+id/textView85" | 45 | android:id="@+id/textView85" |
47 | android:layout_width="wrap_content" | 46 | android:layout_width="wrap_content" |
48 | android:layout_height="wrap_content" | 47 | android:layout_height="wrap_content" |
49 | android:layout_marginStart="5dp" | 48 | android:layout_marginStart="5dp" |
50 | android:layout_marginTop="8dp" | 49 | android:layout_marginTop="8dp" |
51 | android:text="Dirección:" | 50 | android:text="Dirección:" |
52 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 51 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
53 | android:textSize="20sp" | 52 | android:textSize="20sp" |
54 | app:layout_constraintStart_toStartOf="parent" | 53 | app:layout_constraintStart_toStartOf="parent" |
55 | app:layout_constraintTop_toBottomOf="@id/tvDescServidor" /> | 54 | app:layout_constraintTop_toBottomOf="@id/tvDescServidor" /> |
56 | 55 | ||
57 | <TextView | 56 | <TextView |
58 | android:id="@+id/tvDireccionServidor" | 57 | android:id="@+id/tvDireccionServidor" |
59 | android:layout_width="wrap_content" | 58 | android:layout_width="wrap_content" |
60 | android:layout_height="wrap_content" | 59 | android:layout_height="wrap_content" |
61 | android:layout_marginStart="5dp" | 60 | android:layout_marginStart="5dp" |
62 | android:text="http://192.168.0.205" | 61 | android:text="http://192.168.0.205" |
63 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 62 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
64 | android:textColorHint="@android:color/black" | 63 | android:textColorHint="@android:color/black" |
65 | android:textSize="25sp" | 64 | android:textSize="25sp" |
66 | android:textStyle="bold" | 65 | android:textStyle="bold" |
67 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" | 66 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" |
68 | app:layout_constraintStart_toEndOf="@+id/textView85" /> | 67 | app:layout_constraintStart_toEndOf="@+id/textView85" /> |
69 | 68 | ||
70 | <TextView | 69 | <TextView |
71 | android:id="@+id/textView86" | 70 | android:id="@+id/textView86" |
72 | android:layout_width="wrap_content" | 71 | android:layout_width="wrap_content" |
73 | android:layout_height="wrap_content" | 72 | android:layout_height="wrap_content" |
74 | android:layout_marginTop="8dp" | 73 | android:layout_marginStart="5dp" |
75 | android:layout_marginStart="15dp" | 74 | android:layout_marginTop="3dp" |
76 | android:text="Puerto:" | 75 | android:text="Puerto Subida:" |
77 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 76 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
78 | android:textSize="20sp" | 77 | android:textSize="20sp" |
79 | app:layout_constraintHorizontal_chainStyle="packed" | 78 | app:layout_constraintHorizontal_chainStyle="packed" |
80 | app:layout_constraintStart_toEndOf="@+id/tvDireccionServidor" | 79 | app:layout_constraintStart_toStartOf="parent" |
81 | app:layout_constraintTop_toBottomOf="@id/tvDescServidor" /> | 80 | app:layout_constraintTop_toBottomOf="@+id/textView85" /> |
82 | 81 | ||
83 | <TextView | 82 | <TextView |
84 | android:id="@+id/tvPuertoServidor" | 83 | android:id="@+id/tvPuertoSubida" |
84 | android:layout_width="wrap_content" | ||
85 | android:layout_height="wrap_content" | ||
86 | android:text="9999" | ||
87 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
88 | android:textColorHint="@android:color/black" | ||
89 | android:textSize="25sp" | ||
90 | android:textStyle="bold" | ||
91 | app:layout_constraintBaseline_toBaselineOf="@+id/textView86" | ||
92 | app:layout_constraintStart_toEndOf="@+id/textView86" /> | ||
93 | |||
94 | <TextView | ||
95 | android:id="@+id/textView87" | ||
85 | android:layout_width="wrap_content" | 96 | android:layout_width="wrap_content" |
86 | android:layout_height="wrap_content" | 97 | android:layout_height="wrap_content" |
87 | android:layout_marginTop="8dp" | ||
88 | android:layout_marginStart="5dp" | 98 | android:layout_marginStart="5dp" |
89 | android:text="" | 99 | android:layout_marginTop="3dp" |
100 | android:text="Puerto Bajada:" | ||
101 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | ||
102 | android:textSize="20sp" | ||
103 | app:layout_constraintHorizontal_chainStyle="packed" | ||
104 | app:layout_constraintStart_toEndOf="@+id/tvPuertoSubida" | ||
105 | app:layout_constraintTop_toBottomOf="@+id/textView85" /> | ||
106 | |||
107 | <TextView | ||
108 | android:id="@+id/tvPuertoBajada" | ||
109 | android:layout_width="wrap_content" | ||
110 | android:layout_height="wrap_content" | ||
111 | android:text="9999" | ||
90 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 112 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
91 | android:textColorHint="@android:color/black" | 113 | android:textColorHint="@android:color/black" |
92 | android:textSize="25sp" | 114 | android:textSize="25sp" |
93 | android:textStyle="bold" | 115 | android:textStyle="bold" |
94 | app:layout_constraintStart_toEndOf="@+id/textView86" | 116 | app:layout_constraintBaseline_toBaselineOf="@+id/textView87" |
95 | app:layout_constraintTop_toBottomOf="@+id/tvDescServidor" /> | 117 | app:layout_constraintStart_toEndOf="@+id/textView87" /> |
96 | </androidx.constraintlayout.widget.ConstraintLayout> | 118 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout-xlarge/login_dialog.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
5 | android:layout_height="wrap_content" | 5 | android:layout_height="wrap_content" |
6 | android:orientation="vertical" | 6 | android:orientation="vertical" |
7 | android:padding="10dp"> | 7 | android:padding="10dp"> |
8 | 8 | ||
9 | <LinearLayout | 9 | <LinearLayout |
10 | android:id="@+id/barraSuperior" | 10 | android:id="@+id/barraSuperior" |
11 | android:layout_width="0dp" | 11 | android:layout_width="0dp" |
12 | android:layout_height="wrap_content" | 12 | android:layout_height="wrap_content" |
13 | android:background="@color/colorPrimaryDark" | 13 | android:background="@color/colorPrimaryDark" |
14 | android:orientation="horizontal" | 14 | android:orientation="horizontal" |
15 | app:layout_constraintEnd_toEndOf="parent" | 15 | app:layout_constraintEnd_toEndOf="parent" |
16 | app:layout_constraintStart_toStartOf="parent" | 16 | app:layout_constraintStart_toStartOf="parent" |
17 | app:layout_constraintTop_toTopOf="parent"> | 17 | app:layout_constraintTop_toTopOf="parent"> |
18 | 18 | ||
19 | <androidx.appcompat.widget.AppCompatTextView | 19 | <androidx.appcompat.widget.AppCompatTextView |
20 | android:id="@+id/tvTitulo2" | 20 | android:id="@+id/tvTitulo2" |
21 | android:layout_width="0dp" | 21 | android:layout_width="0dp" |
22 | android:layout_height="wrap_content" | 22 | android:layout_height="wrap_content" |
23 | android:layout_margin="10dp" | 23 | android:layout_margin="10dp" |
24 | android:layout_marginStart="5dp" | 24 | android:layout_marginStart="5dp" |
25 | android:layout_marginTop="10dp" | 25 | android:layout_marginTop="10dp" |
26 | android:layout_weight="1" | 26 | android:layout_weight="1" |
27 | android:text="@string/adv" | 27 | android:text="@string/adv" |
28 | android:background="@drawable/boton_borde_redondeado" | 28 | android:background="@drawable/boton_borde_redondeado" |
29 | android:textAlignment="center" | 29 | android:textAlignment="center" |
30 | android:textColor="@android:color/white" | 30 | android:textColor="@android:color/white" |
31 | android:textSize="25sp" /> | 31 | android:textSize="25sp" /> |
32 | </LinearLayout> | 32 | </LinearLayout> |
33 | 33 | ||
34 | <TextView | 34 | <TextView |
35 | android:id="@+id/dialogNameEt" | 35 | android:id="@+id/dialogNameEt" |
36 | android:layout_width="wrap_content" | 36 | android:layout_width="wrap_content" |
37 | android:layout_height="wrap_content" | 37 | android:layout_height="wrap_content" |
38 | android:layout_margin="5dp" | 38 | android:layout_margin="5dp" |
39 | android:layout_marginTop="4dp" | 39 | android:layout_marginTop="4dp" |
40 | android:text="Conteo actual :" | 40 | android:text="Conteo actual :" |
41 | android:textSize="25sp" | 41 | android:textSize="25sp" |
42 | app:layout_constraintEnd_toStartOf="@id/tvCantInicial" | 42 | app:layout_constraintEnd_toStartOf="@id/tvCantInicial" |
43 | app:layout_constraintHorizontal_bias="0.0" | 43 | app:layout_constraintHorizontal_bias="0.0" |
44 | app:layout_constraintHorizontal_chainStyle="packed" | 44 | app:layout_constraintHorizontal_chainStyle="packed" |
45 | app:layout_constraintStart_toStartOf="parent" | 45 | app:layout_constraintStart_toStartOf="parent" |
46 | app:layout_constraintTop_toBottomOf="@id/barraSuperior" /> | 46 | app:layout_constraintTop_toBottomOf="@id/barraSuperior" /> |
47 | 47 | ||
48 | <TextView | 48 | <TextView |
49 | android:id="@+id/tvCantInicial" | 49 | android:id="@+id/tvCantInicial" |
50 | android:layout_width="wrap_content" | 50 | android:layout_width="wrap_content" |
51 | android:layout_height="wrap_content" | 51 | android:layout_height="wrap_content" |
52 | android:layout_margin="5dp" | 52 | android:layout_margin="5dp" |
53 | android:text="" | 53 | android:text="" |
54 | android:textSize="20sp" | 54 | android:textSize="25sp" |
55 | app:layout_constraintBaseline_toBaselineOf="@+id/dialogNameEt" | 55 | app:layout_constraintBaseline_toBaselineOf="@+id/dialogNameEt" |
56 | app:layout_constraintEnd_toEndOf="parent" | 56 | app:layout_constraintEnd_toEndOf="parent" |
57 | app:layout_constraintHorizontal_chainStyle="packed" | 57 | app:layout_constraintHorizontal_chainStyle="packed" |
58 | app:layout_constraintStart_toEndOf="@id/dialogNameEt" /> | 58 | app:layout_constraintStart_toEndOf="@id/dialogNameEt" /> |
59 | 59 | ||
60 | <TextView | 60 | <TextView |
61 | android:id="@+id/tvgenerico" | 61 | android:id="@+id/tvgenerico" |
62 | android:layout_width="wrap_content" | 62 | android:layout_width="wrap_content" |
63 | android:layout_height="wrap_content" | 63 | android:layout_height="wrap_content" |
64 | android:layout_margin="5dp" | 64 | android:layout_margin="5dp" |
65 | android:text="Nueva cantidad:" | 65 | android:text="Nueva cantidad:" |
66 | android:textStyle="bold" | 66 | android:textStyle="bold" |
67 | android:textSize="25sp" | 67 | android:textSize="25sp" |
68 | app:layout_constraintStart_toStartOf="parent" | 68 | app:layout_constraintStart_toStartOf="parent" |
69 | app:layout_constraintTop_toBottomOf="@+id/tvCantInicial" /> | 69 | app:layout_constraintTop_toBottomOf="@+id/tvCantInicial" /> |
70 | 70 | ||
71 | <EditText | 71 | <EditText |
72 | android:id="@+id/tvNuevaCantidad" | 72 | android:id="@+id/tvNuevaCantidad" |
73 | android:layout_width="0dp" | 73 | android:layout_width="0dp" |
74 | android:layout_height="wrap_content" | 74 | android:layout_height="wrap_content" |
75 | android:autofillHints="" | 75 | android:autofillHints="" |
76 | android:hint="" | 76 | android:hint="" |
77 | android:textSize="20sp" | 77 | android:textSize="25sp" |
78 | android:focusable="true" | 78 | android:focusable="true" |
79 | android:clickable="true" | 79 | android:clickable="true" |
80 | android:inputType="numberDecimal" | 80 | android:inputType="numberDecimal" |
81 | app:layout_constraintBaseline_toBaselineOf="@+id/tvgenerico" | 81 | app:layout_constraintBaseline_toBaselineOf="@+id/tvgenerico" |
82 | app:layout_constraintEnd_toEndOf="parent" | 82 | app:layout_constraintEnd_toEndOf="parent" |
83 | app:layout_constraintStart_toEndOf="@id/tvgenerico" /> | 83 | app:layout_constraintStart_toEndOf="@id/tvgenerico" /> |
84 | 84 | ||
85 | <TextView | 85 | <TextView |
86 | android:id="@+id/tvgenerico2" | 86 | android:id="@+id/tvgenerico2" |
87 | android:layout_width="wrap_content" | 87 | android:layout_width="wrap_content" |
88 | android:layout_height="wrap_content" | 88 | android:layout_height="wrap_content" |
89 | android:layout_margin="5dp" | 89 | android:layout_margin="5dp" |
90 | android:gravity="center" | 90 | android:gravity="center" |
91 | android:text="@string/tvSeleccion" | 91 | android:text="@string/tvSeleccion" |
92 | android:textSize="20sp" | 92 | android:textSize="20sp" |
93 | android:visibility="gone" | 93 | android:visibility="gone" |
94 | app:layout_constraintStart_toStartOf="parent" | 94 | app:layout_constraintStart_toStartOf="parent" |
95 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico" /> | 95 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico" /> |
96 | 96 | ||
97 | <RadioGroup | 97 | <RadioGroup |
98 | android:id="@+id/rgFechaHora" | 98 | android:id="@+id/rgFechaHora" |
99 | android:layout_width="wrap_content" | 99 | android:layout_width="wrap_content" |
100 | android:layout_height="wrap_content" | 100 | android:layout_height="wrap_content" |
101 | android:gravity="start" | 101 | android:gravity="start" |
102 | android:orientation="horizontal" | 102 | android:orientation="horizontal" |
103 | app:layout_constraintEnd_toEndOf="parent" | 103 | app:layout_constraintEnd_toEndOf="parent" |
104 | app:layout_constraintHorizontal_bias="0.0" | 104 | app:layout_constraintHorizontal_bias="0.0" |
105 | app:layout_constraintStart_toStartOf="parent" | 105 | app:layout_constraintStart_toStartOf="parent" |
106 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico2"> | 106 | app:layout_constraintTop_toBottomOf="@+id/tvgenerico2"> |
107 | 107 | ||
108 | <RadioButton | 108 | <RadioButton |
109 | android:id="@+id/rbSumar" | 109 | android:id="@+id/rbSumar" |
110 | android:layout_width="wrap_content" | 110 | android:layout_width="wrap_content" |
111 | android:layout_height="wrap_content" | 111 | android:layout_height="wrap_content" |
112 | android:layout_margin="12dp" | 112 | android:layout_margin="12dp" |
113 | android:checked="true" | 113 | android:checked="true" |
114 | android:text="@string/rbSumar" | 114 | android:text="@string/rbSumar" |
115 | android:textSize="@dimen/activity_vertical_margin10" /> | 115 | android:textSize="@dimen/activity_vertical_margin10" /> |
116 | 116 | ||
117 | <RadioButton | 117 | <RadioButton |
118 | android:id="@+id/rbMdodificar" | 118 | android:id="@+id/rbMdodificar" |
119 | android:layout_width="wrap_content" | 119 | android:layout_width="wrap_content" |
120 | android:layout_height="wrap_content" | 120 | android:layout_height="wrap_content" |
121 | android:layout_margin="12dp" | 121 | android:layout_margin="12dp" |
122 | android:checked="false" | 122 | android:checked="false" |
123 | android:text="@string/rbModificar" | 123 | android:text="@string/rbModificar" |
124 | android:textSize="@dimen/activity_vertical_margin10" /> | 124 | android:textSize="@dimen/activity_vertical_margin10" /> |
125 | 125 | ||
126 | <RadioButton | 126 | <RadioButton |
127 | android:id="@+id/rbRestar" | 127 | android:id="@+id/rbRestar" |
128 | android:layout_width="wrap_content" | 128 | android:layout_width="wrap_content" |
129 | android:layout_height="wrap_content" | 129 | android:layout_height="wrap_content" |
130 | android:layout_margin="12dp" | 130 | android:layout_margin="12dp" |
131 | android:checked="false" | 131 | android:checked="false" |
132 | android:text="@string/rbRestar" | 132 | android:text="@string/rbRestar" |
133 | android:textSize="@dimen/activity_vertical_margin10" /> | 133 | android:textSize="@dimen/activity_vertical_margin10" /> |
134 | 134 | ||
135 | </RadioGroup> | 135 | </RadioGroup> |
136 | 136 | ||
137 | <TextView | 137 | <TextView |
138 | android:id="@+id/tvgenerico3" | 138 | android:id="@+id/tvgenerico3" |
139 | android:layout_width="wrap_content" | 139 | android:layout_width="wrap_content" |
140 | android:layout_height="wrap_content" | 140 | android:layout_height="wrap_content" |
141 | android:layout_margin="5dp" | 141 | android:layout_margin="5dp" |
142 | android:gravity="center" | 142 | android:gravity="center" |
143 | android:text="Resultado :" | 143 | android:text="Resultado :" |
144 | android:textStyle="bold" | 144 | android:textStyle="bold" |
145 | android:textSize="25sp" | 145 | android:textSize="25sp" |
146 | app:layout_constraintEnd_toEndOf="parent" | 146 | app:layout_constraintEnd_toEndOf="parent" |
147 | app:layout_constraintHorizontal_bias="0.0" | 147 | app:layout_constraintHorizontal_bias="0.0" |
148 | app:layout_constraintStart_toStartOf="parent" | 148 | app:layout_constraintStart_toStartOf="parent" |
149 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | 149 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> |
150 | 150 | ||
151 | <TextView | 151 | <TextView |
152 | android:id="@+id/tvResultado" | 152 | android:id="@+id/tvResultado" |
153 | android:layout_width="wrap_content" | 153 | android:layout_width="wrap_content" |
154 | android:layout_height="wrap_content" | 154 | android:layout_height="wrap_content" |
155 | android:layout_margin="5dp" | 155 | android:layout_margin="5dp" |
156 | android:gravity="center" | 156 | android:gravity="center" |
157 | android:text="" | 157 | android:text="" |
158 | android:textSize="20sp" | 158 | android:textSize="25sp" |
159 | app:layout_constraintEnd_toEndOf="parent" | 159 | app:layout_constraintEnd_toEndOf="parent" |
160 | app:layout_constraintHorizontal_bias="0.0" | 160 | app:layout_constraintHorizontal_bias="0.0" |
161 | app:layout_constraintStart_toEndOf="@+id/tvgenerico3" | 161 | app:layout_constraintStart_toEndOf="@+id/tvgenerico3" |
162 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | 162 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> |
163 | 163 | ||
164 | <LinearLayout | 164 | <LinearLayout |
165 | android:layout_width="match_parent" | 165 | android:layout_width="match_parent" |
166 | android:layout_height="wrap_content" | 166 | android:layout_height="wrap_content" |
167 | android:layout_margin="10dp" | 167 | android:layout_margin="10dp" |
168 | android:gravity="center" | 168 | android:gravity="center" |
169 | android:orientation="horizontal" | 169 | android:orientation="horizontal" |
170 | app:layout_constraintEnd_toEndOf="parent" | 170 | app:layout_constraintEnd_toEndOf="parent" |
171 | app:layout_constraintStart_toStartOf="parent" | 171 | app:layout_constraintStart_toStartOf="parent" |
172 | app:layout_constraintTop_toBottomOf="@+id/tvResultado"> | 172 | app:layout_constraintTop_toBottomOf="@+id/tvResultado"> |
173 | 173 | ||
174 | <Button | 174 | <Button |
175 | android:id="@+id/btnAceptar" | 175 | android:id="@+id/btnAceptar" |
176 | style="@style/Base.Widget.AppCompat.Button.Colored" | 176 | style="@style/Base.Widget.AppCompat.Button.Colored" |
177 | android:layout_width="wrap_content" | 177 | android:layout_width="wrap_content" |
178 | android:layout_height="wrap_content" | 178 | android:layout_height="wrap_content" |
179 | android:layout_margin="5dp" | 179 | android:layout_margin="5dp" |
180 | android:background="@drawable/boton_borde_redondeado" | 180 | android:background="@drawable/boton_borde_redondeado" |
181 | android:padding="20dp" | 181 | android:padding="20dp" |
182 | android:textSize="25sp" | 182 | android:textSize="25sp" |
183 | android:text="@string/btnConfirmar" | 183 | android:text="@string/btnConfirmar" |
184 | android:textColor="@android:color/white" /> | 184 | android:textColor="@android:color/white" /> |
185 | 185 | ||
186 | <Button | 186 | <Button |
187 | android:id="@+id/dialogCancelBtn" | 187 | android:id="@+id/dialogCancelBtn" |
188 | style="@style/Base.Widget.AppCompat.Button.Colored" | 188 | style="@style/Base.Widget.AppCompat.Button.Colored" |
189 | android:layout_width="wrap_content" | 189 | android:layout_width="wrap_content" |
190 | android:layout_height="wrap_content" | 190 | android:layout_height="wrap_content" |
191 | android:layout_margin="5dp" | 191 | android:layout_margin="5dp" |
192 | android:background="@drawable/boton_borde_redondeado" | 192 | android:background="@drawable/boton_borde_redondeado" |
193 | android:padding="20dp" | 193 | android:padding="20dp" |
194 | android:textSize="25sp" | 194 | android:textSize="25sp" |
195 | android:text="@string/btnCancelar" | 195 | android:text="@string/btnCancelar" |
196 | android:textColor="@android:color/white" /> | 196 | android:textColor="@android:color/white" /> |
197 | </LinearLayout> | 197 | </LinearLayout> |
198 | 198 | ||
199 | </androidx.constraintlayout.widget.ConstraintLayout> | 199 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/fragment_actua_maestros.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> | 7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> |
8 | 8 | ||
9 | |||
10 | <androidx.appcompat.widget.AppCompatTextView | 9 | <androidx.appcompat.widget.AppCompatTextView |
11 | android:id="@+id/tvActMaestros" | 10 | android:id="@+id/tvActMaestros" |
12 | android:layout_width="match_parent" | 11 | android:layout_width="match_parent" |
13 | android:layout_height="wrap_content" | 12 | android:layout_height="wrap_content" |
14 | android:layout_marginTop="@dimen/MarginTopTitulos" | 13 | android:layout_marginTop="@dimen/MarginTopTitulos" |
15 | android:gravity="center" | 14 | android:gravity="center" |
16 | |||
17 | android:text="@string/tvActMaestros" | 15 | android:text="@string/tvActMaestros" |
18 | android:textColor="@color/colorAccent" | 16 | android:textColor="@color/colorAccent" |
19 | android:textSize="@dimen/Titulos" | 17 | android:textSize="@dimen/Titulos" |
20 | app:fontFamily="sans-serif-condensed" | 18 | app:fontFamily="sans-serif-condensed" |
21 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | 19 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" |
22 | app:layout_constraintEnd_toEndOf="parent" | 20 | app:layout_constraintEnd_toEndOf="parent" |
23 | app:layout_constraintStart_toStartOf="parent" | 21 | app:layout_constraintStart_toStartOf="parent" |
24 | app:layout_constraintTop_toTopOf="parent" /> | 22 | app:layout_constraintTop_toTopOf="parent" /> |
25 | 23 | ||
26 | <TextView | 24 | <TextView |
27 | android:id="@+id/tvSeleccioneServidor" | 25 | android:id="@+id/tvSeleccioneServidor" |
28 | android:layout_width="0dp" | 26 | android:layout_width="0dp" |
29 | android:layout_height="wrap_content" | 27 | android:layout_height="wrap_content" |
30 | android:layout_margin="30dp" | 28 | android:layout_margin="30dp" |
31 | android:gravity="center" | 29 | android:gravity="center" |
32 | android:lines="2" | 30 | android:lines="2" |
33 | android:text="@string/tvMedio" | 31 | android:text="@string/tvMedio" |
34 | android:textColor="@android:color/black" | 32 | android:textColor="@android:color/black" |
35 | android:textSize="@dimen/SubTitulos" | 33 | android:textSize="@dimen/SubTitulos" |
36 | app:fontFamily="sans-serif-condensed" | 34 | app:fontFamily="sans-serif-condensed" |
37 | app:layout_constraintEnd_toEndOf="parent" | 35 | app:layout_constraintEnd_toEndOf="parent" |
38 | app:layout_constraintStart_toStartOf="parent" | 36 | app:layout_constraintStart_toStartOf="parent" |
39 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> | 37 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> |
40 | 38 | ||
41 | <RadioGroup | 39 | <RadioGroup |
42 | android:id="@+id/rgTipoActualizacion" | 40 | android:id="@+id/rgTipoActualizacion" |
43 | android:layout_width="0dp" | 41 | android:layout_width="0dp" |
44 | android:layout_height="wrap_content" | 42 | android:layout_height="wrap_content" |
45 | android:layout_margin="25dp" | 43 | android:layout_margin="25dp" |
46 | android:gravity="center" | 44 | android:gravity="center" |
47 | android:orientation="horizontal" | 45 | android:orientation="horizontal" |
48 | app:layout_constraintEnd_toEndOf="parent" | 46 | app:layout_constraintEnd_toEndOf="parent" |
49 | app:layout_constraintStart_toStartOf="parent" | 47 | app:layout_constraintStart_toStartOf="parent" |
50 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"> | 48 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"> |
51 | 49 | ||
52 | <RadioButton | 50 | <RadioButton |
53 | android:id="@+id/obPorWifi" | 51 | android:id="@+id/obPorWifi" |
54 | android:layout_width="wrap_content" | 52 | android:layout_width="wrap_content" |
55 | android:layout_height="wrap_content" | 53 | android:layout_height="wrap_content" |
56 | android:layout_margin="5dp" | 54 | android:layout_margin="5dp" |
57 | android:checked="true" | 55 | android:checked="true" |
58 | android:padding="5dp" | 56 | android:padding="5dp" |
59 | android:text="@string/obPorWifi" | 57 | android:text="@string/obPorWifi" |
60 | android:textSize="@dimen/NormalText" /> | 58 | android:textSize="@dimen/NormalText" /> |
61 | 59 | ||
62 | <RadioButton | 60 | <RadioButton |
63 | android:id="@+id/obImpInventarios" | 61 | android:id="@+id/obImpInventarios" |
64 | android:layout_width="wrap_content" | 62 | android:layout_width="wrap_content" |
65 | android:layout_height="wrap_content" | 63 | android:layout_height="wrap_content" |
66 | android:layout_margin="5dp" | 64 | android:layout_margin="5dp" |
67 | android:checked="false" | 65 | android:checked="false" |
68 | android:padding="5dp" | 66 | android:padding="5dp" |
69 | android:text="@string/obViaArchivo" | 67 | android:text="@string/obViaArchivo" |
70 | android:textSize="@dimen/NormalText" /> | 68 | android:textSize="@dimen/NormalText" /> |
71 | 69 | ||
72 | |||
73 | </RadioGroup> | 70 | </RadioGroup> |
74 | 71 | ||
75 | <TextView | 72 | <TextView |
76 | android:id="@+id/tvServerConectado" | 73 | android:id="@+id/tvServerConectado" |
77 | android:layout_width="match_parent" | 74 | android:layout_width="match_parent" |
78 | android:layout_height="wrap_content" | 75 | android:layout_height="wrap_content" |
79 | android:layout_margin="30dp" | 76 | android:layout_margin="30dp" |
80 | android:gravity="center" | 77 | android:gravity="center" |
81 | android:lines="2" | 78 | android:lines="2" |
82 | android:text="" | 79 | android:text="" |
83 | android:textColor="@android:color/black" | 80 | android:textColor="@android:color/black" |
84 | android:textSize="@dimen/SubTitulos" | 81 | android:textSize="@dimen/SubTitulos" |
85 | app:fontFamily="sans-serif-condensed" | 82 | app:fontFamily="sans-serif-condensed" |
86 | app:layout_constraintBottom_toTopOf="@+id/countriesList" | 83 | app:layout_constraintBottom_toTopOf="@+id/countriesList" |
87 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" /> | 84 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" /> |
88 | 85 | ||
89 | <TextView | 86 | <TextView |
90 | android:id="@+id/countriesList" | 87 | android:id="@+id/countriesList" |
91 | android:layout_width="0dp" | 88 | android:layout_width="0dp" |
92 | android:layout_height="wrap_content" | 89 | android:layout_height="wrap_content" |
93 | android:layout_marginTop="@dimen/MarginTopTitulos" | 90 | android:layout_marginTop="@dimen/MarginTopTitulos" |
94 | android:gravity="center" | 91 | android:gravity="center" |
95 | android:text="" | 92 | android:text="" |
96 | android:textColor="@android:color/black" | 93 | android:textColor="@android:color/black" |
97 | android:textSize="@dimen/SubTitulos" | 94 | android:textSize="@dimen/SubTitulos" |
98 | android:visibility="visible" | 95 | android:visibility="visible" |
99 | app:fontFamily="sans-serif-condensed" | 96 | app:fontFamily="sans-serif-condensed" |
100 | app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct" | 97 | app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct" |
101 | app:layout_constraintEnd_toEndOf="parent" | 98 | app:layout_constraintEnd_toEndOf="parent" |
102 | app:layout_constraintHorizontal_bias="0.0" | 99 | app:layout_constraintHorizontal_bias="0.0" |
103 | app:layout_constraintStart_toStartOf="parent" | 100 | app:layout_constraintStart_toStartOf="parent" |
104 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" | 101 | app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion" |
105 | app:layout_constraintVertical_bias="0.106" /> | 102 | app:layout_constraintVertical_bias="0.106" /> |
106 | 103 | ||
107 | <Button | 104 | <Button |
108 | android:id="@+id/btnConfirmarAct" | 105 | android:id="@+id/btnConfirmarAct" |
109 | android:layout_width="0dp" | 106 | android:layout_width="0dp" |
110 | android:layout_height="wrap_content" | 107 | android:layout_height="wrap_content" |
111 | android:layout_margin="20dp" | 108 | android:layout_margin="20dp" |
112 | android:text="@string/btnConfirmarAct" | 109 | android:text="@string/btnConfirmarAct" |
113 | android:textSize="@dimen/NormalText" | 110 | android:textSize="@dimen/NormalText" |
114 | android:textColor="@android:color/white" | 111 | android:textColor="@android:color/white" |
115 | android:padding="10dp" | 112 | android:padding="10dp" |
116 | android:background="@drawable/boton_borde_redondeado" | 113 | android:background="@drawable/boton_borde_redondeado" |
117 | app:layout_constraintBottom_toBottomOf="parent" | 114 | app:layout_constraintBottom_toBottomOf="parent" |
118 | app:layout_constraintEnd_toEndOf="parent" | 115 | app:layout_constraintEnd_toEndOf="parent" |
119 | app:layout_constraintStart_toStartOf="parent" /> | 116 | app:layout_constraintStart_toStartOf="parent" /> |
120 | 117 | ||
121 | |||
122 | <ProgressBar | 118 | <ProgressBar |
123 | android:id="@+id/loading_view" | 119 | android:id="@+id/loading_view" |
124 | android:layout_width="wrap_content" | 120 | android:layout_width="wrap_content" |
125 | android:layout_height="wrap_content" | 121 | android:layout_height="wrap_content" |
126 | android:layout_marginStart="8dp" | 122 | android:layout_marginStart="8dp" |
127 | android:layout_marginLeft="8dp" | 123 | android:layout_marginLeft="8dp" |
128 | android:layout_marginTop="8dp" | 124 | android:layout_marginTop="8dp" |
129 | android:layout_marginEnd="8dp" | 125 | android:layout_marginEnd="8dp" |
130 | android:layout_marginRight="8dp" | 126 | android:layout_marginRight="8dp" |
131 | android:layout_marginBottom="8dp" | 127 | android:layout_marginBottom="8dp" |
132 | android:visibility="gone" | 128 | android:visibility="invisible" |
133 | app:layout_constraintBottom_toBottomOf="parent" | 129 | app:layout_constraintBottom_toBottomOf="parent" |
134 | app:layout_constraintEnd_toEndOf="parent" | 130 | app:layout_constraintEnd_toEndOf="parent" |
135 | app:layout_constraintStart_toStartOf="parent" | 131 | app:layout_constraintStart_toStartOf="parent" |
136 | app:layout_constraintTop_toTopOf="parent" /> | 132 | app:layout_constraintTop_toTopOf="parent" /> |
137 | 133 | ||
138 | </androidx.constraintlayout.widget.ConstraintLayout> | 134 | </androidx.constraintlayout.widget.ConstraintLayout> |
139 | 135 |
app/src/main/res/layout/fragment_configuracion.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="wrap_content" | 6 | android:layout_height="wrap_content" |
7 | tools:context=".UI.configuracion.ConfiguracionFragment"> | 7 | tools:context=".UI.configuracion.ConfiguracionFragment"> |
8 | 8 | ||
9 | 9 | ||
10 | <androidx.appcompat.widget.AppCompatTextView | 10 | <androidx.appcompat.widget.AppCompatTextView |
11 | android:id="@+id/textView2" | 11 | android:id="@+id/textView2" |
12 | android:layout_width="match_parent" | 12 | android:layout_width="match_parent" |
13 | android:layout_height="wrap_content" | 13 | android:layout_height="wrap_content" |
14 | |||
15 | android:layout_marginTop="@dimen/MarginTopTitulos" | 14 | android:layout_marginTop="@dimen/MarginTopTitulos" |
16 | android:gravity="center" | 15 | android:gravity="center" |
17 | |||
18 | android:lines="1" | 16 | android:lines="1" |
19 | android:text="@string/tvTituloConf" | 17 | android:text="@string/tvTituloConf" |
20 | android:textColor="@color/colorAccent" | 18 | android:textColor="@color/colorAccent" |
21 | android:textSize="@dimen/Titulos" | 19 | android:textSize="@dimen/Titulos" |
22 | app:fontFamily="sans-serif-condensed" | 20 | app:fontFamily="sans-serif-condensed" |
23 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" | 21 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor" |
24 | app:layout_constraintEnd_toEndOf="parent" | 22 | app:layout_constraintEnd_toEndOf="parent" |
25 | app:layout_constraintStart_toStartOf="parent" | 23 | app:layout_constraintStart_toStartOf="parent" |
26 | app:layout_constraintTop_toTopOf="parent" /> | 24 | app:layout_constraintTop_toTopOf="parent" /> |
27 | 25 | ||
28 | <TextView | 26 | <TextView |
29 | android:id="@+id/tvSeleccioneServidor" | 27 | android:id="@+id/tvSeleccioneServidor" |
30 | android:layout_width="0dp" | 28 | android:layout_width="0dp" |
31 | android:layout_height="wrap_content" | 29 | android:layout_height="wrap_content" |
32 | 30 | ||
33 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 31 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
34 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 32 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
35 | android:gravity="start" | 33 | android:gravity="start" |
36 | android:lines="1" | 34 | android:lines="1" |
37 | android:text="@string/tvSeleccioneServidor" | 35 | android:text="@string/tvSeleccioneServidor" |
38 | android:textColor="@android:color/black" | 36 | android:textColor="@android:color/black" |
39 | android:textSize="@dimen/SubTitulos" | 37 | android:textSize="@dimen/SubTitulos" |
40 | app:fontFamily="sans-serif-condensed" | 38 | app:fontFamily="sans-serif-condensed" |
41 | app:layout_constraintBottom_toTopOf="@+id/spServidor" | 39 | app:layout_constraintBottom_toTopOf="@+id/spServidor" |
42 | app:layout_constraintEnd_toEndOf="parent" | 40 | app:layout_constraintEnd_toEndOf="parent" |
43 | app:layout_constraintStart_toStartOf="parent" | 41 | app:layout_constraintStart_toStartOf="parent" |
44 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | 42 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> |
45 | 43 | ||
46 | <Spinner | 44 | <Spinner |
47 | android:id="@+id/spServidor" | 45 | android:id="@+id/spServidor" |
48 | style="@android:style/Widget.Holo.Light.Spinner" | 46 | style="@android:style/Widget.Holo.Light.Spinner" |
49 | android:layout_width="0dp" | 47 | android:layout_width="0dp" |
50 | android:layout_height="wrap_content" | 48 | android:layout_height="wrap_content" |
51 | android:elevation="5dp" | 49 | android:elevation="5dp" |
52 | |||
53 | android:textSize="@dimen/NormalText" | 50 | android:textSize="@dimen/NormalText" |
54 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | 51 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" |
55 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" | 52 | app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor" |
56 | app:layout_constraintHorizontal_chainStyle="packed" | 53 | app:layout_constraintHorizontal_chainStyle="packed" |
57 | app:layout_constraintStart_toStartOf="parent" | 54 | app:layout_constraintStart_toStartOf="parent" |
58 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" | 55 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> |
59 | /> | ||
60 | 56 | ||
61 | <Button | 57 | <Button |
62 | android:id="@+id/btnValidarServidor" | 58 | android:id="@+id/btnValidarServidor" |
63 | android:layout_width="wrap_content" | 59 | android:layout_width="wrap_content" |
64 | android:layout_height="wrap_content" | 60 | android:layout_height="wrap_content" |
65 | android:textColor="@android:color/white" | ||
66 | android:padding="10dp" | ||
67 | android:background="@drawable/boton_borde_redondeado" | 61 | android:background="@drawable/boton_borde_redondeado" |
62 | android:padding="10dp" | ||
68 | android:text="@string/btnValidarServidor" | 63 | android:text="@string/btnValidarServidor" |
64 | android:textColor="@android:color/white" | ||
69 | android:textSize="@dimen/NormalText" | 65 | android:textSize="@dimen/NormalText" |
70 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" | 66 | app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor" |
71 | app:layout_constraintEnd_toEndOf="parent" | 67 | app:layout_constraintEnd_toEndOf="parent" |
72 | app:layout_constraintHorizontal_chainStyle="packed" | 68 | app:layout_constraintHorizontal_chainStyle="packed" |
73 | app:layout_constraintStart_toEndOf="@id/spServidor" | 69 | app:layout_constraintStart_toEndOf="@id/spServidor" |
74 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> | 70 | app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" /> |
75 | 71 | ||
76 | <Button | 72 | <Button |
77 | android:id="@+id/btnAgregarServidor" | 73 | android:id="@+id/btnAgregarServidor" |
78 | android:layout_width="0dp" | 74 | android:layout_width="0dp" |
79 | android:layout_height="wrap_content" | 75 | android:layout_height="wrap_content" |
80 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 76 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
81 | android:layout_marginEnd="@dimen/MarginBotAgreSer" | 77 | android:layout_marginEnd="@dimen/MarginBotAgreSer" |
78 | android:background="@drawable/boton_borde_redondeado" | ||
79 | android:padding="10dp" | ||
82 | android:text="@string/btnAgregarServidor" | 80 | android:text="@string/btnAgregarServidor" |
83 | android:textSize="@dimen/NormalText" | ||
84 | android:textColor="@android:color/white" | 81 | android:textColor="@android:color/white" |
85 | android:padding="10dp" | 82 | android:textSize="@dimen/NormalText" |
86 | android:background="@drawable/boton_borde_redondeado" | ||
87 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" | 83 | app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas" |
88 | app:layout_constraintEnd_toEndOf="parent" | 84 | app:layout_constraintEnd_toEndOf="parent" |
89 | app:layout_constraintStart_toStartOf="parent" | 85 | app:layout_constraintStart_toStartOf="parent" |
90 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> | 86 | app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" /> |
91 | 87 | ||
92 | 88 | ||
93 | <TextView | 89 | <TextView |
94 | android:id="@+id/tvUbicacionCarpetas" | 90 | android:id="@+id/tvUbicacionCarpetas" |
95 | android:layout_width="0dp" | 91 | android:layout_width="0dp" |
96 | android:layout_height="wrap_content" | 92 | android:layout_height="wrap_content" |
97 | android:visibility="gone" | ||
98 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 93 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
99 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 94 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
100 | android:gravity="start" | 95 | android:gravity="start" |
101 | android:lines="1" | 96 | android:lines="1" |
102 | android:text="@string/tvUbicacionCarpetas" | 97 | android:text="@string/tvUbicacionCarpetas" |
103 | android:textColor="@android:color/black" | 98 | android:textColor="@android:color/black" |
104 | android:textSize="@dimen/SubTitulos" | 99 | android:textSize="@dimen/SubTitulos" |
100 | android:visibility="gone" | ||
105 | app:fontFamily="sans-serif-condensed" | 101 | app:fontFamily="sans-serif-condensed" |
106 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" | 102 | app:layout_constraintBottom_toTopOf="@+id/ibSearch" |
107 | app:layout_constraintEnd_toEndOf="parent" | 103 | app:layout_constraintEnd_toEndOf="parent" |
108 | app:layout_constraintStart_toStartOf="parent" | 104 | app:layout_constraintStart_toStartOf="parent" |
109 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> | 105 | app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" /> |
110 | 106 | ||
111 | <ImageButton | 107 | <ImageButton |
112 | android:id="@+id/ibSearch" | 108 | android:id="@+id/ibSearch" |
113 | android:layout_width="36dp" | 109 | android:layout_width="36dp" |
114 | android:layout_height="37dp" | 110 | android:layout_height="37dp" |
115 | android:layout_margin="10dp" | 111 | android:layout_margin="10dp" |
112 | android:background="@drawable/boton_borde_redondeado" | ||
113 | android:padding="10dp" | ||
116 | android:src="@drawable/search" | 114 | android:src="@drawable/search" |
117 | android:textColor="@android:color/white" | 115 | android:textColor="@android:color/white" |
118 | android:padding="10dp" | ||
119 | android:visibility="gone" | 116 | android:visibility="gone" |
120 | android:background="@drawable/boton_borde_redondeado" | ||
121 | app:layout_constraintEnd_toStartOf="@+id/etRuta" | 117 | app:layout_constraintEnd_toStartOf="@+id/etRuta" |
122 | app:layout_constraintStart_toStartOf="parent" | 118 | app:layout_constraintStart_toStartOf="parent" |
123 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | 119 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> |
124 | 120 | ||
125 | <EditText | 121 | <EditText |
126 | android:id="@+id/etRuta" | 122 | android:id="@+id/etRuta" |
127 | android:layout_width="0dp" | 123 | android:layout_width="0dp" |
128 | android:layout_height="wrap_content" | 124 | android:layout_height="wrap_content" |
129 | android:layout_marginTop="10dp" | 125 | android:layout_marginTop="10dp" |
130 | android:layout_marginEnd="10dp" | 126 | android:layout_marginEnd="10dp" |
131 | android:clickable="true" | 127 | android:clickable="true" |
132 | android:ems="10" | 128 | android:ems="10" |
133 | android:focusable="true" | 129 | android:focusable="true" |
134 | android:visibility="gone" | ||
135 | android:inputType="textPersonName" | 130 | android:inputType="textPersonName" |
136 | android:lines="1" | 131 | android:lines="1" |
137 | android:text="" | 132 | android:text="" |
138 | android:textSize="@dimen/NormalText" | 133 | android:textSize="@dimen/NormalText" |
134 | android:visibility="gone" | ||
139 | app:layout_constraintEnd_toEndOf="parent" | 135 | app:layout_constraintEnd_toEndOf="parent" |
140 | app:layout_constraintStart_toEndOf="@id/ibSearch" | 136 | app:layout_constraintStart_toEndOf="@id/ibSearch" |
141 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> | 137 | app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" /> |
142 | 138 | ||
143 | <TextView | 139 | <TextView |
144 | android:id="@+id/tvActuFecha" | 140 | android:id="@+id/tvActuFecha" |
145 | android:layout_width="0dp" | 141 | android:layout_width="0dp" |
146 | android:layout_height="wrap_content" | 142 | android:layout_height="wrap_content" |
147 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 143 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
148 | android:layout_marginTop="@dimen/MarginTopSubTitulos" | 144 | android:layout_marginTop="@dimen/MarginTopSubTitulos" |
149 | android:gravity="start" | 145 | android:gravity="start" |
150 | android:lines="1" | 146 | android:lines="1" |
151 | android:text="@string/tvTituloArea" | 147 | android:text="@string/tvTituloArea" |
152 | android:textColor="@android:color/black" | 148 | android:textColor="@android:color/black" |
153 | android:textSize="@dimen/SubTitulos" | 149 | android:textSize="@dimen/SubTitulos" |
154 | app:fontFamily="sans-serif-condensed" | 150 | app:fontFamily="sans-serif-condensed" |
155 | app:layout_constraintEnd_toEndOf="parent" | 151 | app:layout_constraintEnd_toEndOf="parent" |
156 | app:layout_constraintStart_toStartOf="parent" | 152 | app:layout_constraintStart_toStartOf="parent" |
157 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> | 153 | app:layout_constraintTop_toBottomOf="@+id/etRuta" /> |
158 | 154 | ||
159 | <RadioGroup | 155 | <RadioGroup |
160 | android:id="@+id/rgFechaHora" | 156 | android:id="@+id/rgFechaHora" |
161 | android:layout_width="0dp" | 157 | android:layout_width="0dp" |
162 | android:layout_height="wrap_content" | 158 | android:layout_height="wrap_content" |
163 | 159 | ||
164 | android:gravity="center" | 160 | android:gravity="center" |
165 | android:orientation="horizontal" | 161 | android:orientation="horizontal" |
166 | app:layout_constraintEnd_toEndOf="parent" | 162 | app:layout_constraintEnd_toEndOf="parent" |
167 | app:layout_constraintStart_toStartOf="parent" | 163 | app:layout_constraintStart_toStartOf="parent" |
168 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> | 164 | app:layout_constraintTop_toBottomOf="@+id/tvActuFecha"> |
169 | 165 | ||
170 | <RadioButton | 166 | <RadioButton |
171 | android:id="@+id/rbVentas" | 167 | android:id="@+id/rbVentas" |
172 | android:layout_width="wrap_content" | 168 | android:layout_width="wrap_content" |
173 | android:layout_height="wrap_content" | 169 | android:layout_height="wrap_content" |
174 | android:layout_margin="5dp" | 170 | android:layout_margin="5dp" |
175 | android:checked="true" | 171 | android:checked="true" |
176 | android:padding="5dp" | 172 | android:padding="5dp" |
177 | android:text="@string/rbVentas" | 173 | android:text="@string/rbVentas" |
178 | android:textSize="@dimen/NormalText" /> | 174 | android:textSize="@dimen/NormalText" /> |
179 | 175 | ||
180 | <RadioButton | 176 | <RadioButton |
181 | android:id="@+id/rbDeposito" | 177 | android:id="@+id/rbDeposito" |
182 | android:layout_width="wrap_content" | 178 | android:layout_width="wrap_content" |
183 | android:layout_height="wrap_content" | 179 | android:layout_height="wrap_content" |
184 | android:layout_margin="5dp" | 180 | android:layout_margin="5dp" |
185 | android:checked="false" | 181 | android:checked="false" |
186 | android:padding="5dp" | 182 | android:padding="5dp" |
187 | android:text="@string/rbDeposito" | 183 | android:text="@string/rbDeposito" |
188 | android:textSize="@dimen/NormalText" /> | 184 | android:textSize="@dimen/NormalText" /> |
189 | 185 | ||
190 | </RadioGroup> | 186 | </RadioGroup> |
191 | 187 | ||
192 | <TextView | 188 | <TextView |
193 | android:id="@+id/tvLosProductos" | 189 | android:id="@+id/tvLosProductos" |
194 | android:layout_width="0dp" | 190 | android:layout_width="0dp" |
195 | android:layout_height="wrap_content" | 191 | android:layout_height="wrap_content" |
196 | 192 | ||
197 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 193 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
198 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" | 194 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" |
199 | android:gravity="start" | 195 | android:gravity="start" |
200 | android:lines="1" | 196 | android:lines="1" |
201 | android:text="@string/tvLosProductos" | 197 | android:text="@string/tvLosProductos" |
202 | android:textColor="@android:color/black" | 198 | android:textColor="@android:color/black" |
203 | android:textSize="@dimen/SubTitulos" | 199 | android:textSize="@dimen/SubTitulos" |
204 | app:fontFamily="sans-serif-condensed" | 200 | app:fontFamily="sans-serif-condensed" |
205 | app:layout_constraintEnd_toEndOf="parent" | 201 | app:layout_constraintEnd_toEndOf="parent" |
206 | app:layout_constraintStart_toStartOf="parent" | 202 | app:layout_constraintStart_toStartOf="parent" |
207 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> | 203 | app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" /> |
208 | 204 | ||
209 | <RadioGroup | 205 | <RadioGroup |
210 | android:id="@+id/rgLosProductos" | 206 | android:id="@+id/rgLosProductos" |
211 | android:layout_width="0dp" | 207 | android:layout_width="0dp" |
212 | android:layout_height="wrap_content" | 208 | android:layout_height="wrap_content" |
213 | 209 | ||
214 | android:gravity="center" | 210 | android:gravity="center" |
215 | android:orientation="vertical" | 211 | android:orientation="vertical" |
216 | app:layout_constraintEnd_toEndOf="parent" | 212 | app:layout_constraintEnd_toEndOf="parent" |
217 | app:layout_constraintStart_toStartOf="parent" | 213 | app:layout_constraintStart_toStartOf="parent" |
218 | app:layout_constraintTop_toBottomOf="@+id/tvLosProductos"> | 214 | app:layout_constraintTop_toBottomOf="@+id/tvLosProductos"> |
219 | 215 | ||
220 | <RadioButton | 216 | <RadioButton |
221 | android:id="@+id/rbProInclu" | 217 | android:id="@+id/rbProInclu" |
222 | android:layout_width="match_parent" | 218 | android:layout_width="match_parent" |
223 | android:layout_height="wrap_content" | 219 | android:layout_height="wrap_content" |
224 | |||
225 | android:layout_margin="@dimen/PadingCbyRb" | 220 | android:layout_margin="@dimen/PadingCbyRb" |
226 | android:checked="true" | 221 | android:checked="true" |
227 | android:padding="@dimen/PadingCbyRb" | 222 | android:padding="@dimen/PadingCbyRb" |
228 | android:text="@string/rbProInclu" | 223 | android:text="@string/rbProInclu" |
229 | android:textSize="@dimen/NormalText" /> | 224 | android:textSize="@dimen/NormalText" /> |
230 | 225 | ||
231 | <RadioButton | 226 | <RadioButton |
232 | android:id="@+id/rbProNoInclu" | 227 | android:id="@+id/rbProNoInclu" |
233 | android:layout_width="match_parent" | 228 | android:layout_width="match_parent" |
234 | android:layout_height="wrap_content" | 229 | android:layout_height="wrap_content" |
235 | android:layout_margin="@dimen/PadingCbyRb" | 230 | android:layout_margin="@dimen/PadingCbyRb" |
236 | android:checked="false" | 231 | android:checked="false" |
237 | android:padding="@dimen/PadingCbyRb" | 232 | android:padding="@dimen/PadingCbyRb" |
238 | android:text="@string/rbProNoInclu" | 233 | android:text="@string/rbProNoInclu" |
239 | android:textSize="@dimen/NormalText" /> | 234 | android:textSize="@dimen/NormalText" /> |
240 | 235 | ||
241 | </RadioGroup> | 236 | </RadioGroup> |
242 | 237 | ||
243 | <CheckBox | 238 | <CheckBox |
244 | android:id="@+id/cbHabiLectura" | 239 | android:id="@+id/cbHabiLectura" |
245 | android:layout_width="0dp" | 240 | android:layout_width="0dp" |
246 | android:layout_height="wrap_content" | 241 | android:layout_height="wrap_content" |
247 | android:layout_margin="@dimen/PadingCbyRb" | 242 | android:layout_margin="@dimen/PadingCbyRb" |
248 | android:padding="@dimen/PadingCbyRb" | 243 | android:padding="@dimen/PadingCbyRb" |
249 | android:text="@string/cbHabiLectura" | 244 | android:text="@string/cbHabiLectura" |
250 | android:textSize="@dimen/NormalText" | 245 | android:textSize="@dimen/NormalText" |
251 | app:layout_constraintEnd_toEndOf="parent" | 246 | app:layout_constraintEnd_toEndOf="parent" |
252 | app:layout_constraintStart_toStartOf="parent" | 247 | app:layout_constraintStart_toStartOf="parent" |
253 | app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" /> | 248 | app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" /> |
254 | 249 | ||
255 | <CheckBox | 250 | <CheckBox |
256 | android:id="@+id/cbMostrarStock" | 251 | android:id="@+id/cbMostrarStock" |
257 | android:layout_width="0dp" | 252 | android:layout_width="0dp" |
258 | android:layout_height="wrap_content" | 253 | android:layout_height="wrap_content" |
259 | android:layout_margin="@dimen/PadingCbyRb" | 254 | android:layout_margin="@dimen/PadingCbyRb" |
260 | android:padding="@dimen/PadingCbyRb" | 255 | android:padding="@dimen/PadingCbyRb" |
261 | android:text="@string/cbMostrarStock" | 256 | android:text="@string/cbMostrarStock" |
262 | android:textSize="@dimen/NormalText" | 257 | android:textSize="@dimen/NormalText" |
263 | app:layout_constraintEnd_toEndOf="parent" | 258 | app:layout_constraintEnd_toEndOf="parent" |
264 | app:layout_constraintStart_toStartOf="parent" | 259 | app:layout_constraintStart_toStartOf="parent" |
265 | app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" /> | 260 | app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" /> |
266 | 261 | ||
267 | <TextView | 262 | <TextView |
268 | android:id="@+id/tvColumMostrar" | 263 | android:id="@+id/tvColumMostrar" |
269 | android:layout_width="0dp" | 264 | android:layout_width="0dp" |
270 | android:layout_height="wrap_content" | 265 | android:layout_height="wrap_content" |
271 | |||
272 | android:layout_marginStart="@dimen/MarginBotAgreSer" | 266 | android:layout_marginStart="@dimen/MarginBotAgreSer" |
273 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" | 267 | android:layout_marginEnd="@dimen/MarginTopSubTitulos" |
274 | android:gravity="start" | 268 | android:gravity="start" |
275 | android:lines="1" | 269 | android:lines="1" |
276 | android:text="@string/tvColumMostrar" | 270 | android:text="@string/tvColumMostrar" |
277 | android:textColor="@android:color/black" | 271 | android:textColor="@android:color/black" |
278 | android:textSize="@dimen/SubTitulos" | 272 | android:textSize="@dimen/SubTitulos" |
273 | android:visibility="gone" | ||
279 | app:fontFamily="sans-serif-condensed" | 274 | app:fontFamily="sans-serif-condensed" |
280 | app:layout_constraintEnd_toEndOf="parent" | 275 | app:layout_constraintEnd_toEndOf="parent" |
281 | app:layout_constraintStart_toStartOf="parent" | 276 | app:layout_constraintStart_toStartOf="parent" |
282 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> | 277 | app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" /> |
283 | 278 | ||
284 | <RadioGroup | 279 | <!-- <RadioGroup--> |
285 | android:id="@+id/rgCodigosMostrar" | 280 | <!-- android:id="@+id/rgCodigosMostrar"--> |
286 | android:layout_width="0dp" | 281 | <!-- android:layout_width="0dp"--> |
287 | android:layout_height="wrap_content" | 282 | <!-- android:layout_height="wrap_content"--> |
283 | <!-- android:gravity="center"--> | ||
284 | <!-- android:orientation="horizontal"--> | ||
285 | <!-- android:visibility="gone"--> | ||
286 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
287 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
288 | <!-- app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar">--> | ||
289 | |||
290 | <!-- <RadioButton--> | ||
291 | <!-- android:id="@+id/rbCodigoDebo"--> | ||
292 | <!-- android:layout_width="wrap_content"--> | ||
293 | <!-- android:layout_height="wrap_content"--> | ||
294 | <!-- android:layout_margin="5dp"--> | ||
295 | <!-- android:checked="true"--> | ||
296 | <!-- android:padding="5dp"--> | ||
297 | <!-- android:text="@string/rbCodigoDebo"--> | ||
298 | <!-- android:textSize="@dimen/NormalText" />--> | ||
299 | |||
300 | <!-- <RadioButton--> | ||
301 | <!-- android:id="@+id/rbCodigoOrigen"--> | ||
302 | <!-- android:layout_width="wrap_content"--> | ||
303 | <!-- android:layout_height="wrap_content"--> | ||
304 | <!-- android:layout_margin="5dp"--> | ||
305 | <!-- android:checked="false"--> | ||
306 | <!-- android:padding="5dp"--> | ||
307 | <!-- android:text="@string/rbCodigoOrigen"--> | ||
308 | <!-- android:textSize="@dimen/NormalText" />--> | ||
309 | |||
310 | <!-- <RadioButton--> | ||
311 | <!-- android:id="@+id/rbCodigoBarras"--> | ||
312 | <!-- android:layout_width="wrap_content"--> | ||
313 | <!-- android:layout_height="wrap_content"--> | ||
314 | <!-- android:layout_margin="5dp"--> | ||
315 | <!-- android:padding="5dp"--> | ||
316 | <!-- android:text="@string/rbCodigoBarras"--> | ||
317 | <!-- android:textSize="@dimen/NormalText" />--> | ||
318 | <!-- </RadioGroup>--> | ||
288 | 319 | ||
289 | android:gravity="center" | 320 | <Button |
290 | android:orientation="horizontal" | 321 | android:id="@+id/btnAskTimeServer" |
291 | app:layout_constraintEnd_toEndOf="parent" | ||
292 | app:layout_constraintStart_toStartOf="parent" | ||
293 | app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar"> | ||
294 | |||
295 | <RadioButton | ||
296 | android:id="@+id/rbCodigoDebo" | ||
297 | android:layout_width="wrap_content" | ||
298 | android:layout_height="wrap_content" | ||
299 | android:layout_margin="5dp" | ||
300 | android:checked="true" | ||
301 | android:padding="5dp" | ||
302 | android:text="@string/rbCodigoDebo" | ||
303 | android:textSize="@dimen/NormalText" /> | ||
304 | |||
305 | <RadioButton | ||
306 | android:id="@+id/rbCodigoOrigen" | ||
307 | android:layout_width="wrap_content" | ||
308 | android:layout_height="wrap_content" | ||
309 | android:layout_margin="5dp" | ||
310 | android:checked="false" | ||
311 | android:padding="5dp" | ||
312 | android:text="@string/rbCodigoOrigen" | ||
313 | android:textSize="@dimen/NormalText" /> | ||
314 | |||
315 | <RadioButton | ||
316 | android:id="@+id/rbCodigoBarras" | ||
317 | android:layout_width="wrap_content" | ||
318 | android:layout_height="wrap_content" | ||
319 | android:layout_margin="5dp" | ||
320 | android:padding="5dp" | ||
321 | android:text="@string/rbCodigoBarras" |
app/src/main/res/layout/fragment_detalle_art_sec.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | android:id="@+id/nsPedidosDatos" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="match_parent"> | ||
7 | |||
8 | <androidx.cardview.widget.CardView | ||
9 | android:id="@+id/cvItem1" | ||
10 | android:layout_width="match_parent" | ||
11 | android:layout_height="wrap_content" | ||
12 | android:layout_marginStart="5dp" | ||
13 | android:layout_marginTop="5dp" | ||
14 | android:layout_marginEnd="5dp" | ||
15 | app:cardBackgroundColor="@android:color/darker_gray" | ||
16 | app:cardCornerRadius="25dp" | ||
17 | app:cardElevation="10dp" | ||
18 | app:layout_constraintEnd_toEndOf="parent" | ||
19 | app:layout_constraintStart_toStartOf="parent" | ||
20 | app:layout_constraintTop_toTopOf="parent"> | ||
21 | |||
22 | <androidx.constraintlayout.widget.ConstraintLayout | ||
23 | android:id="@+id/clayout" | ||
24 | android:layout_width="match_parent" | ||
25 | android:layout_height="match_parent"> | ||
26 | |||
27 | <TextView | ||
28 | android:id="@+id/tvDescripcion" | ||
29 | android:layout_width="wrap_content" | ||
30 | android:layout_height="0dp" | ||
31 | android:layout_marginTop="10dp" | ||
32 | android:gravity="center_horizontal" | ||
33 | |||
34 | android:text="coaca" | ||
35 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
36 | android:textSize="25sp" | ||
37 | android:textStyle="bold" | ||
38 | app:layout_constraintEnd_toEndOf="parent" | ||
39 | app:layout_constraintStart_toStartOf="parent" | ||
40 | app:layout_constraintTop_toTopOf="parent" /> | ||
41 | |||
42 | |||
43 | <TextView | ||
44 | android:id="@+id/textView18" | ||
45 | android:layout_width="wrap_content" | ||
46 | android:layout_height="wrap_content" | ||
47 | android:layout_marginTop="10dp" | ||
48 | android:text="Códigos:" | ||
49 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
50 | android:textSize="15sp" | ||
51 | app:layout_constraintStart_toStartOf="parent" | ||
52 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
53 | |||
54 | <TextView | ||
55 | android:id="@+id/textView19" | ||
56 | android:layout_width="wrap_content" | ||
57 | android:layout_height="wrap_content" | ||
58 | android:layout_marginStart="5dp" | ||
59 | android:text="DEBO:" | ||
60 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
61 | android:textSize="15sp" | ||
62 | app:layout_constraintBaseline_toBaselineOf="@+id/textView18" | ||
63 | app:layout_constraintStart_toEndOf="@+id/textView18" /> | ||
64 | |||
65 | <TextView | ||
66 | android:id="@+id/tvSector" | ||
67 | android:layout_width="0dp" | ||
68 | android:layout_height="wrap_content" | ||
69 | android:layout_marginStart="5dp" | ||
70 | android:text="99" | ||
71 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
72 | android:textSize="18sp" | ||
73 | android:textStyle="bold" | ||
74 | app:layout_constraintBaseline_toBaselineOf="@+id/textView19" | ||
75 | app:layout_constraintStart_toEndOf="@+id/textView19" /> | ||
76 | |||
77 | <TextView | ||
78 | android:id="@+id/tvCodigo" | ||
79 | android:layout_width="0dp" | ||
80 | android:layout_height="wrap_content" | ||
81 | android:layout_marginStart="3dp" | ||
82 | android:layout_marginTop="10dp" | ||
83 | android:text="999999" | ||
84 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
85 | android:textSize="18sp" | ||
86 | android:textStyle="bold" | ||
87 | app:layout_constraintBaseline_toBaselineOf="@+id/tvSector" | ||
88 | app:layout_constraintStart_toEndOf="@id/tvSector" /> | ||
89 | |||
90 | |||
91 | <TextView | ||
92 | android:id="@+id/textView1" | ||
93 | android:layout_width="0dp" | ||
94 | android:layout_height="wrap_content" | ||
95 | android:layout_marginStart="5dp" | ||
96 | android:layout_marginTop="10dp" | ||
97 | android:text="barras:" | ||
98 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
99 | android:textSize="15sp" | ||
100 | app:layout_constraintBaseline_toBaselineOf="@+id/tvCodigo" | ||
101 | app:layout_constraintStart_toEndOf="@+id/tvCodigo" /> | ||
102 | |||
103 | <TextView | ||
104 | android:id="@+id/tvCodigoBarras" | ||
105 | android:layout_width="wrap_content" | ||
106 | android:layout_height="wrap_content" | ||
107 | android:layout_marginStart="5dp" | ||
108 | android:text="12346579012345" | ||
109 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
110 | android:textSize="18sp" | ||
111 | android:textStyle="bold" | ||
112 | app:layout_constraintBaseline_toBaselineOf="@+id/textView1" | ||
113 | app:layout_constraintStart_toEndOf="@id/textView1" /> | ||
114 | |||
115 | <TextView | ||
116 | android:id="@+id/textView2" | ||
117 | android:layout_width="wrap_content" | ||
118 | android:layout_height="wrap_content" | ||
119 | android:layout_marginStart="5dp" | ||
120 | android:layout_marginTop="10dp" | ||
121 | android:text="origen:" | ||
122 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
123 | android:textSize="15sp" | ||
124 | app:layout_constraintStart_toEndOf="@+id/textView18" | ||
125 | app:layout_constraintTop_toBottomOf="@+id/textView18" /> | ||
126 | |||
127 | |||
128 | <TextView | ||
129 | android:id="@+id/tvCodigoOrigen" | ||
130 | android:layout_width="wrap_content" | ||
131 | android:layout_height="wrap_content" | ||
132 | android:layout_marginStart="5dp" | ||
133 | android:layout_marginTop="10dp" | ||
134 | android:text="1234567890123" | ||
135 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
136 | android:textSize="18sp" | ||
137 | android:textStyle="bold" | ||
138 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | ||
139 | app:layout_constraintStart_toEndOf="@+id/textView2" | ||
140 | app:layout_constraintTop_toBottomOf="@+id/textView18" /> | ||
141 | |||
142 | <TextView | ||
143 | android:id="@+id/textView9" | ||
144 | android:layout_width="wrap_content" | ||
145 | android:layout_height="wrap_content" | ||
146 | android:layout_marginTop="10dp" | ||
147 | android:text="Precio:" | ||
148 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
149 | android:textSize="15sp" | ||
150 | app:layout_constraintStart_toStartOf="parent" | ||
151 | app:layout_constraintTop_toBottomOf="@+id/textView2" /> | ||
152 | |||
153 | <TextView | ||
154 | android:id="@+id/textView12" | ||
155 | android:layout_width="wrap_content" | ||
156 | android:layout_height="wrap_content" | ||
157 | android:layout_marginStart="5dp" | ||
158 | android:layout_marginTop="10dp" | ||
159 | android:text="venta:" | ||
160 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
161 | android:textSize="15sp" | ||
162 | app:layout_constraintBaseline_toBaselineOf="@+id/textView9" | ||
163 | app:layout_constraintStart_toEndOf="@+id/textView18" /> | ||
164 | |||
165 | <TextView | ||
166 | android:id="@+id/tvPrecio" | ||
167 | android:layout_width="wrap_content" | ||
168 | android:layout_height="wrap_content" | ||
169 | android:layout_marginStart="5dp" | ||
170 | android:layout_marginTop="10dp" | ||
171 | android:text="99999.99" | ||
172 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
173 | android:textSize="18sp" | ||
174 | android:textStyle="bold" | ||
175 | app:layout_constraintBaseline_toBaselineOf="@+id/textView12" | ||
176 | app:layout_constraintStart_toEndOf="@+id/textView12" /> | ||
177 | |||
178 | <TextView | ||
179 | android:id="@+id/textView8" | ||
180 | android:layout_width="wrap_content" | ||
181 | android:layout_height="wrap_content" | ||
182 | android:layout_marginStart="5dp" | ||
183 | android:layout_marginTop="10dp" | ||
184 | android:text="Costo:" | ||
185 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
186 | android:textSize="15sp" | ||
187 | app:layout_constraintBaseline_toBaselineOf="@+id/tvPrecio" | ||
188 | app:layout_constraintStart_toEndOf="@+id/tvPrecio" /> | ||
189 | |||
190 | <TextView | ||
191 | android:id="@+id/tvCosto" | ||
192 | android:layout_width="wrap_content" | ||
193 | android:layout_height="wrap_content" | ||
194 | android:layout_marginStart="5dp" | ||
195 | android:layout_marginTop="10dp" | ||
196 | android:text="9999.99" | ||
197 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
198 | android:textSize="18sp" | ||
199 | android:textStyle="bold" | ||
200 | app:layout_constraintBaseline_toBaselineOf="@+id/textView8" | ||
201 | app:layout_constraintStart_toEndOf="@+id/textView8" /> | ||
202 | |||
203 | <TextView | ||
204 | android:id="@+id/textView3" | ||
205 | android:layout_width="wrap_content" | ||
206 | android:layout_height="wrap_content" | ||
207 | android:layout_marginTop="10dp" | ||
208 | android:text="Depósito:" | ||
209 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
210 | android:textSize="15sp" | ||
211 | app:layout_constraintStart_toStartOf="parent" | ||
212 | app:layout_constraintTop_toBottomOf="@+id/textView9" /> | ||
213 | |||
214 | <TextView | ||
215 | android:id="@+id/tvDeposito" | ||
216 | android:layout_width="wrap_content" | ||
217 | android:layout_height="wrap_content" | ||
218 | android:layout_marginStart="5dp" | ||
219 | android:text="Si" | ||
220 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
221 | android:textSize="18sp" | ||
222 | android:textStyle="bold" | ||
223 | app:layout_constraintBaseline_toBaselineOf="@+id/textView3" | ||
224 | app:layout_constraintStart_toEndOf="@+id/textView3" /> | ||
225 | |||
226 | <TextView | ||
227 | android:id="@+id/textView5" | ||
228 | android:layout_width="wrap_content" | ||
229 | android:layout_height="wrap_content" | ||
230 | android:layout_marginTop="10dp" | ||
231 | android:text="Stock:" | ||
232 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
233 | android:textSize="15sp" | ||
234 | app:layout_constraintStart_toStartOf="parent" | ||
235 | app:layout_constraintTop_toBottomOf="@+id/textView3" /> | ||
236 | |||
237 | |||
238 | <TextView | ||
239 | android:id="@+id/textView15" | ||
240 | android:layout_width="wrap_content" | ||
241 | android:layout_height="wrap_content" | ||
242 | android:layout_marginStart="5dp" | ||
243 | android:layout_marginTop="10dp" | ||
244 | android:text="venta:" | ||
245 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
246 | android:textSize="15sp" | ||
247 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" | ||
248 | app:layout_constraintStart_toEndOf="@+id/textView18" /> | ||
249 | |||
250 | <TextView | ||
251 | android:id="@+id/tvExiVenta" | ||
252 | android:layout_width="wrap_content" | ||
253 | android:layout_height="wrap_content" | ||
254 | android:layout_marginStart="5dp" | ||
255 | android:layout_marginTop="10dp" | ||
256 | android:text="99999.99" | ||
257 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
258 | android:textSize="18sp" | ||
259 | android:textStyle="bold" | ||
260 | app:layout_constraintBaseline_toBaselineOf="@+id/textView15" | ||
261 | app:layout_constraintStart_toEndOf="@+id/textView15" /> | ||
262 | |||
263 | <TextView | ||
264 | android:id="@+id/textView7" | ||
265 | android:layout_width="wrap_content" | ||
266 | android:layout_height="wrap_content" | ||
267 | android:layout_marginStart="5dp" | ||
268 | android:text="deposito:" | ||
269 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
270 | android:textSize="15sp" | ||
271 | app:layout_constraintBaseline_toBaselineOf="@+id/tvExiVenta" | ||
272 | app:layout_constraintStart_toEndOf="@+id/tvExiVenta" /> | ||
273 | |||
274 | <TextView | ||
275 | android:id="@+id/tvExiDeposito" | ||
276 | android:layout_width="wrap_content" | ||
277 | android:layout_height="wrap_content" | ||
278 | android:layout_marginStart="5dp" | ||
279 | android:layout_marginTop="10dp" | ||
280 | android:text="99999.99" | ||
281 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
282 | android:textSize="18sp" | ||
283 | android:textStyle="bold" | ||
284 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" | ||
285 | app:layout_constraintStart_toEndOf="@+id/textView7" | ||
286 | app:layout_constraintTop_toBottomOf="@+id/tvCosto" /> | ||
287 | |||
288 | |||
289 | <TextView | ||
290 | android:id="@+id/textView10" | ||
291 | android:layout_width="wrap_content" | ||
292 | android:layout_height="wrap_content" | ||
293 | android:layout_marginStart="5dp" | ||
294 | android:layout_marginTop="10dp" | ||
295 | android:text="Unidad de venta:" | ||
296 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
297 | android:textSize="15sp" | ||
298 | app:layout_constraintBaseline_toBaselineOf="@+id/tvDeposito" | ||
299 | app:layout_constraintStart_toEndOf="@+id/tvPrecio" /> | ||
300 | |||
301 | <TextView | ||
302 | android:id="@+id/tvBal" | ||
303 | android:layout_width="wrap_content" | ||
304 | android:layout_height="wrap_content" | ||
305 | android:layout_marginStart="5dp" | ||
306 | android:text="Unidades" | ||
307 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
308 | android:textSize="15sp" | ||
309 | app:layout_constraintBaseline_toBaselineOf="@+id/textView10" | ||
310 | app:layout_constraintStart_toEndOf="@+id/textView10" /> | ||
311 | |||
312 | |||
313 | <TextView | ||
314 | android:id="@+id/textView11" | ||
315 | android:layout_width="wrap_content" | ||
316 | android:layout_height="wrap_content" | ||
317 | android:layout_marginTop="10dp" | ||
318 | android:text="Imagen:" | ||
319 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
320 | android:textSize="14sp" | ||
321 | app:layout_constraintStart_toStartOf="parent" | ||
322 | app:layout_constraintTop_toBottomOf="@+id/textView5" /> | ||
323 | |||
324 | <ImageView | ||
325 | android:id="@+id/ivImagen" | ||
326 | android:layout_width="300dp" | ||
327 | android:layout_height="300dp" | ||
328 | android:layout_marginStart="5dp" | ||
329 | android:src="@drawable/no_imagen" | ||
330 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
331 | android:textSize="14sp" | ||
332 | app:layout_constraintStart_toEndOf="@+id/textView11" | ||
333 | app:layout_constraintTop_toBottomOf="@+id/textView15" /> | ||
334 | |||
335 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
336 | </androidx.cardview.widget.CardView> | ||
337 | |||
338 | </ScrollView> | ||
339 |
app/src/main/res/layout/fragment_inv_importados.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> | 7 | tools:context=".UI.actualizacionMaestros.ActuaMaestrosFragment"> |
8 | 8 | ||
9 | 9 | ||
10 | <androidx.appcompat.widget.AppCompatTextView | 10 | <androidx.appcompat.widget.AppCompatTextView |
11 | android:id="@+id/tvActMaestros" | 11 | android:id="@+id/tvActMaestros" |
12 | android:layout_width="match_parent" | 12 | android:layout_width="match_parent" |
13 | android:layout_height="wrap_content" | 13 | android:layout_height="wrap_content" |
14 | android:layout_marginTop="@dimen/MarginTopTitulos" | 14 | android:layout_marginTop="@dimen/MarginTopTitulos" |
15 | android:gravity="center" | 15 | android:gravity="center" |
16 | android:text="@string/tvActMaestros" | 16 | android:text="@string/tvActMaestros" |
17 | android:textColor="@color/colorAccent" | 17 | android:textColor="@color/colorAccent" |
18 | android:textSize="@dimen/Titulos" | 18 | android:textSize="@dimen/Titulos" |
19 | app:fontFamily="sans-serif-condensed" | 19 | app:fontFamily="sans-serif-condensed" |
20 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccionInventario" | 20 | app:layout_constraintBottom_toTopOf="@+id/tvSeleccionInventario" |
21 | app:layout_constraintEnd_toEndOf="parent" | 21 | app:layout_constraintEnd_toEndOf="parent" |
22 | app:layout_constraintStart_toStartOf="parent" | 22 | app:layout_constraintStart_toStartOf="parent" |
23 | app:layout_constraintTop_toTopOf="parent" /> | 23 | app:layout_constraintTop_toTopOf="parent" /> |
24 | 24 | ||
25 | <TextView | 25 | <TextView |
26 | android:id="@+id/tvSeleccionInventario" | 26 | android:id="@+id/tvSeleccionInventario" |
27 | android:layout_width="0dp" | 27 | android:layout_width="355dp" |
28 | android:layout_height="wrap_content" | 28 | android:layout_height="wrap_content" |
29 | android:layout_margin="30dp" | 29 | android:layout_marginTop="15dp" |
30 | android:layout_marginTop="28dp" | 30 | android:layout_marginBottom="15dp" |
31 | android:gravity="center" | 31 | android:gravity="center" |
32 | android:padding="5dp" | ||
32 | android:text="@string/tvSeleccionInventario" | 33 | android:text="@string/tvSeleccionInventario" |
33 | android:textColor="@android:color/black" | 34 | android:textColor="@android:color/black" |
34 | android:textSize="@dimen/MarginTopTitulos" | 35 | android:textSize="@dimen/TitulosMedios" |
35 | app:fontFamily="sans-serif-condensed" | 36 | app:fontFamily="sans-serif-condensed" |
36 | app:layout_constraintEnd_toEndOf="parent" | 37 | app:layout_constraintEnd_toEndOf="parent" |
37 | app:layout_constraintStart_toStartOf="parent" | 38 | app:layout_constraintStart_toStartOf="parent" |
38 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> | 39 | app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" /> |
39 | 40 | ||
40 | <androidx.recyclerview.widget.RecyclerView | 41 | <androidx.recyclerview.widget.RecyclerView |
41 | android:id="@+id/rcDescripcion" | 42 | android:id="@+id/rcDescripcion" |
42 | android:layout_width="match_parent" | 43 | android:layout_width="match_parent" |
43 | android:layout_height="0dp" | 44 | android:layout_height="0dp" |
44 | android:background="@android:color/darker_gray" | 45 | android:background="@android:color/darker_gray" |
45 | android:scrollbars="vertical" | 46 | android:scrollbars="vertical" |
47 | android:visibility="visible" | ||
46 | app:layout_constraintBottom_toTopOf="@+id/guideline" | 48 | app:layout_constraintBottom_toTopOf="@+id/guideline" |
47 | app:layout_constraintEnd_toEndOf="parent" | 49 | app:layout_constraintEnd_toEndOf="parent" |
48 | app:layout_constraintStart_toStartOf="parent" | 50 | app:layout_constraintStart_toStartOf="parent" |
49 | app:layout_constraintTop_toBottomOf="@id/tvSeleccionInventario" | 51 | app:layout_constraintTop_toBottomOf="@id/tvSeleccionInventario" |
50 | tools:listitem="@layout/item_inv_importados" /> | 52 | tools:listitem="@layout/item_inv_importados" /> |
51 | 53 | ||
52 | <Button | 54 | <Button |
53 | android:id="@+id/btnConfirmarAct" | 55 | android:id="@+id/btnConfirmarAct" |
54 | android:layout_width="0dp" | 56 | android:layout_width="0dp" |
55 | android:layout_height="wrap_content" | 57 | android:layout_height="wrap_content" |
56 | android:layout_margin="20dp" | 58 | android:layout_margin="20dp" |
57 | android:text="@string/btnConfirmarAct" | 59 | android:text="@string/btnConfirmarAct" |
58 | android:textSize="@dimen/MarginTopTitulos" | 60 | android:textSize="@dimen/SubTitulos" |
59 | android:textColor="@android:color/white" | 61 | android:textColor="@android:color/white" |
60 | android:padding="10dp" | 62 | android:padding="10dp" |
61 | android:background="@drawable/boton_borde_redondeado" | 63 | android:background="@drawable/boton_borde_redondeado" |
62 | app:layout_constraintBottom_toBottomOf="parent" | 64 | app:layout_constraintBottom_toBottomOf="parent" |
63 | app:layout_constraintEnd_toEndOf="parent" | 65 | app:layout_constraintEnd_toEndOf="parent" |
64 | app:layout_constraintStart_toStartOf="parent" /> | 66 | app:layout_constraintStart_toStartOf="parent" /> |
65 | 67 | ||
66 | 68 | ||
67 | <ProgressBar | 69 | <ProgressBar |
68 | android:id="@+id/loading_view" | 70 | android:id="@+id/pbInvSec" |
69 | android:layout_width="wrap_content" | 71 | android:layout_width="wrap_content" |
70 | android:layout_height="wrap_content" | 72 | android:layout_height="wrap_content" |
71 | android:layout_marginStart="8dp" | 73 | android:layout_marginStart="8dp" |
72 | android:layout_marginLeft="8dp" | 74 | android:layout_marginLeft="8dp" |
73 | android:layout_marginTop="8dp" | 75 | android:layout_marginTop="8dp" |
74 | android:layout_marginEnd="8dp" | 76 | android:layout_marginEnd="8dp" |
75 | android:layout_marginRight="8dp" | 77 | android:layout_marginRight="8dp" |
76 | android:layout_marginBottom="8dp" | 78 | android:layout_marginBottom="8dp" |
77 | android:visibility="gone" | 79 | android:visibility="gone" |
78 | app:layout_constraintBottom_toBottomOf="parent" | 80 | app:layout_constraintBottom_toBottomOf="parent" |
79 | app:layout_constraintEnd_toEndOf="parent" | 81 | app:layout_constraintEnd_toEndOf="parent" |
80 | app:layout_constraintStart_toStartOf="parent" | 82 | app:layout_constraintStart_toStartOf="parent" |
81 | app:layout_constraintTop_toTopOf="parent" /> | 83 | app:layout_constraintTop_toTopOf="parent" /> |
84 | |||
85 | <TextView | ||
86 | android:id="@+id/tvMensaje" | ||
87 | android:layout_width="0dp" | ||
88 | android:layout_height="wrap_content" | ||
89 | android:padding="15dp" | ||
90 | android:gravity="center" | ||
91 | android:text="@string/tvSeleccionInventario" | ||
92 | android:textColor="@android:color/black" | ||
93 | android:textSize="@dimen/TitulosMedios" | ||
94 | app:fontFamily="sans-serif-condensed" | ||
95 | android:visibility="gone" | ||
96 | app:layout_constraintBottom_toBottomOf="@+id/rcDescripcion" | ||
97 | app:layout_constraintEnd_toEndOf="parent" | ||
98 | app:layout_constraintStart_toStartOf="parent" | ||
99 | app:layout_constraintTop_toTopOf="@+id/rcDescripcion" /> | ||
100 | |||
82 | <androidx.constraintlayout.widget.Guideline | 101 | <androidx.constraintlayout.widget.Guideline |
83 | android:id="@+id/guideline" | 102 | android:id="@+id/guideline" |
84 | android:layout_width="wrap_content" | 103 | android:layout_width="wrap_content" |
85 | android:layout_height="wrap_content" | 104 | android:layout_height="wrap_content" |
86 | android:orientation="horizontal" | 105 | android:orientation="horizontal" |
87 | app:layout_constraintGuide_percent="0.88" /> | 106 | app:layout_constraintGuide_percent="0.88" /> |
88 | </androidx.constraintlayout.widget.ConstraintLayout> | 107 | </androidx.constraintlayout.widget.ConstraintLayout> |
89 | 108 |
app/src/main/res/layout/fragment_inv_sec.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout | ||
3 | xmlns:android="http://schemas.android.com/apk/res/android" | ||
4 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
5 | xmlns:tools="http://schemas.android.com/tools" | ||
6 | android:id="@+id/frameLayout" | ||
7 | android:layout_width="match_parent" | ||
8 | android:layout_height="match_parent" | ||
9 | tools:context=".UI.inventario.InventarioFragment"> | ||
10 | |||
11 | |||
12 | <!-- <androidx.appcompat.widget.AppCompatTextView--> | ||
13 | <!-- android:id="@+id/tvTituloSec"--> | ||
14 | <!-- android:layout_width="0dp"--> | ||
15 | <!-- android:layout_height="wrap_content"--> | ||
16 | <!-- android:layout_marginStart="8dp"--> | ||
17 | <!-- android:layout_marginEnd="8dp"--> | ||
18 | <!-- android:textSize="60sp"--> | ||
19 | <!-- android:gravity="center"--> | ||
20 | <!-- android:lines="1"--> | ||
21 | <!-- android:text="@string/invTitulo"--> | ||
22 | <!-- android:textColor="@color/colorAccent"--> | ||
23 | <!-- app:fontFamily="sans-serif-condensed"--> | ||
24 | <!-- app:layout_constraintBottom_toTopOf="@id/guideline2"--> | ||
25 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
26 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
27 | <!-- app:layout_constraintTop_toTopOf="@id/guideline" />--> | ||
28 | |||
29 | |||
30 | <!-- <androidx.recyclerview.widget.RecyclerView--> | ||
31 | <!-- android:id="@+id/rcInventariosSec"--> | ||
32 | <!-- android:layout_width="match_parent"--> | ||
33 | <!-- android:layout_height="0dp"--> | ||
34 | <!-- android:background="@android:color/darker_gray"--> | ||
35 | <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline5"--> | ||
36 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
37 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
38 | <!-- app:layout_constraintTop_toBottomOf="@+id/guideline2"--> | ||
39 | <!-- tools:listitem="@layout/item" />--> | ||
40 | |||
41 | |||
42 | <!-- <Button--> | ||
43 | <!-- android:id="@+id/btnExportarInvSec"--> | ||
44 | <!-- android:layout_width="wrap_content"--> | ||
45 | <!-- android:layout_height="wrap_content"--> | ||
46 | <!-- android:text="@string/btnExportarInv"--> | ||
47 | <!-- android:textColor="@android:color/white"--> | ||
48 | <!-- android:padding="10dp"--> | ||
49 | <!-- android:background="@drawable/boton_borde_redondeado"--> | ||
50 | <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> | ||
51 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
52 | <!-- app:layout_constraintHorizontal_chainStyle="spread"--> | ||
53 | <!-- app:layout_constraintStart_toEndOf="@+id/btnBorrarInv"--> | ||
54 | <!-- app:layout_constraintTop_toBottomOf="@+id/guideline5" />--> | ||
55 | |||
56 | <!-- <Button--> | ||
57 | <!-- android:id="@+id/btnBorrarInv"--> | ||
58 | <!-- android:layout_width="wrap_content"--> | ||
59 | <!-- android:layout_height="wrap_content"--> | ||
60 | <!-- android:text="@string/btnBorrarInv"--> | ||
61 | <!-- app:layout_constraintBottom_toBottomOf="@+id/guideline6"--> | ||
62 | <!-- app:layout_constraintEnd_toStartOf="@id/btnExportarInvSec"--> | ||
63 | <!-- app:layout_constraintHorizontal_chainStyle="spread"--> | ||
64 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
65 | <!-- android:textColor="@android:color/white"--> | ||
66 | <!-- android:padding="10dp"--> | ||
67 | <!-- android:background="@drawable/boton_borde_redondeado"--> | ||
68 | <!-- app:layout_constraintTop_toBottomOf="@+id/guideline5" />--> | ||
69 | |||
70 | <!-- <androidx.constraintlayout.widget.Guideline--> | ||
71 | <!-- android:id="@+id/guideline"--> | ||
72 | <!-- android:layout_width="wrap_content"--> | ||
73 | <!-- android:layout_height="wrap_content"--> | ||
74 | <!-- android:orientation="horizontal"--> | ||
75 | <!-- app:layout_constraintGuide_percent="0.02" />--> | ||
76 | |||
77 | <!-- <androidx.constraintlayout.widget.Guideline--> | ||
78 | <!-- android:id="@+id/guideline2"--> | ||
79 | <!-- android:layout_width="wrap_content"--> | ||
80 | <!-- android:layout_height="wrap_content"--> | ||
81 | <!-- android:orientation="horizontal"--> | ||
82 | <!-- app:layout_constraintGuide_percent="0.12029161" />--> | ||
83 | |||
84 | <!-- <androidx.constraintlayout.widget.Guideline--> | ||
85 | <!-- android:id="@+id/guideline5"--> | ||
86 | <!-- android:layout_width="wrap_content"--> | ||
87 | <!-- android:layout_height="wrap_content"--> | ||
88 | <!-- android:orientation="horizontal"--> | ||
89 | <!-- app:layout_constraintGuide_percent="0.88" />--> | ||
90 | |||
91 | <!-- <androidx.constraintlayout.widget.Guideline--> | ||
92 | <!-- android:id="@+id/guideline6"--> | ||
93 | <!-- android:layout_width="wrap_content"--> | ||
94 | <!-- android:layout_height="wrap_content"--> | ||
95 | <!-- android:orientation="horizontal"--> | ||
96 | <!-- app:layout_constraintGuide_percent="0.97" />--> | ||
97 | |||
98 | |||
99 | |||
100 | <androidx.appcompat.widget.AppCompatTextView | ||
101 | android:id="@+id/tvTitulo" | ||
102 | android:layout_width="0dp" | ||
103 | android:layout_height="50dp" | ||
104 | android:layout_marginStart="8dp" | ||
105 | android:layout_marginEnd="8dp" | ||
106 | android:autoSizeMaxTextSize="100sp" | ||
107 | android:autoSizeMinTextSize="20sp" | ||
108 | android:autoSizeStepGranularity="5sp" | ||
109 | android:autoSizeTextType="uniform" | ||
110 | android:gravity="center" | ||
111 | android:lines="1" | ||
112 | android:text="@string/invTitulo" | ||
113 | android:textColor="@color/colorAccent" | ||
114 | app:fontFamily="sans-serif-condensed" | ||
115 | app:layout_constraintBottom_toTopOf="@id/guideline2" | ||
116 | app:layout_constraintEnd_toEndOf="parent" | ||
117 | app:layout_constraintStart_toStartOf="parent" | ||
118 | app:layout_constraintTop_toTopOf="@id/guideline" /> | ||
119 | |||
120 | |||
121 | <ImageButton | ||
122 | android:id="@+id/ivCamara" | ||
123 | android:layout_width="80dp" | ||
124 | android:layout_height="80dp" | ||
125 | android:layout_marginTop="15dp" | ||
126 | android:clickable="true" | ||
127 | android:contentDescription="@string/ibBusCB" | ||
128 | android:elevation="5dp" | ||
129 | android:background="@drawable/boton_redondo" | ||
130 | android:layout_margin="10dp" | ||
131 | android:focusable="false" | ||
132 | android:scaleType="fitEnd" | ||
133 | app:layout_constraintCircleRadius="40dp" | ||
134 | android:src="@drawable/desc" | ||
135 | app:layout_constraintBottom_toTopOf="@id/guideline3" | ||
136 | app:layout_constraintEnd_toStartOf="@+id/etDescripcion" | ||
137 | app:layout_constraintHorizontal_bias="0.0" | ||
138 | app:layout_constraintStart_toStartOf="parent" | ||
139 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | ||
140 | |||
141 | <EditText | ||
142 | android:id="@+id/etDescripcion" | ||
143 | android:layout_width="0dp" | ||
144 | android:layout_height="wrap_content" | ||
145 | android:autofillHints="" | ||
146 | android:clickable="true" | ||
147 | android:ems="10" | ||
148 | android:focusable="true" | ||
149 | android:hint="@string/ibBusDesc" | ||
150 | android:inputType="textPersonName" | ||
151 | android:lines="1" | ||
152 | android:textAllCaps="true" | ||
153 | android:textSize="20sp" | ||
154 | app:layout_constraintBottom_toTopOf="@+id/guideline3" | ||
155 | app:layout_constraintEnd_toEndOf="parent" | ||
156 | app:layout_constraintHorizontal_bias="0.49" | ||
157 | app:layout_constraintHorizontal_chainStyle="packed" | ||
158 | app:layout_constraintStart_toEndOf="@+id/ivCamara" | ||
159 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | ||
160 | |||
161 | |||
162 | <androidx.recyclerview.widget.RecyclerView | ||
163 | android:id="@+id/rcInventarios" | ||
164 | android:layout_width="match_parent" | ||
165 | android:layout_height="0dp" | ||
166 | android:background="@android:color/darker_gray" | ||
167 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" | ||
168 | app:layout_constraintEnd_toEndOf="parent" | ||
169 | app:layout_constraintStart_toStartOf="parent" | ||
170 | app:layout_constraintTop_toBottomOf="@+id/guideline4" | ||
171 | tools:listitem="@layout/item" /> | ||
172 | |||
173 | |||
174 | <Button | ||
175 | android:id="@+id/btnExportarInv" | ||
176 | android:layout_width="wrap_content" | ||
177 | android:layout_height="wrap_content" | ||
178 | android:text="@string/btnExportarInv" | ||
179 | android:textColor="@android:color/white" | ||
180 | android:padding="10dp" | ||
181 | android:background="@drawable/boton_borde_redondeado" | ||
182 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | ||
183 | app:layout_constraintEnd_toEndOf="parent" | ||
184 | app:layout_constraintHorizontal_chainStyle="spread" | ||
185 | app:layout_constraintStart_toEndOf="@+id/btnBorrarInv" | ||
186 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | ||
187 | |||
188 | <Button | ||
189 | android:id="@+id/btnBorrarInv" | ||
190 | android:layout_width="wrap_content" | ||
191 | android:layout_height="wrap_content" | ||
192 | android:text="@string/btnBorrarInv" | ||
193 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | ||
194 | app:layout_constraintEnd_toStartOf="@id/btnExportarInv" | ||
195 | app:layout_constraintHorizontal_chainStyle="spread" | ||
196 | app:layout_constraintStart_toStartOf="parent" | ||
197 | android:textColor="@android:color/white" | ||
198 | android:padding="10dp" | ||
199 | android:background="@drawable/boton_borde_redondeado" | ||
200 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | ||
201 | |||
202 | <androidx.constraintlayout.widget.Guideline | ||
203 | android:id="@+id/guideline" | ||
204 | android:layout_width="wrap_content" | ||
205 | android:layout_height="wrap_content" | ||
206 | android:orientation="horizontal" | ||
207 | app:layout_constraintGuide_percent="0.02" /> | ||
208 | |||
209 | <androidx.constraintlayout.widget.Guideline | ||
210 | android:id="@+id/guideline2" | ||
211 | android:layout_width="wrap_content" | ||
212 | android:layout_height="wrap_content" | ||
213 | android:orientation="horizontal" | ||
214 | app:layout_constraintGuide_percent="0.12029161" /> | ||
215 | |||
216 | <androidx.constraintlayout.widget.Guideline | ||
217 | android:id="@+id/guideline3" | ||
218 | android:layout_width="wrap_content" | ||
219 | android:layout_height="wrap_content" | ||
220 | android:orientation="horizontal" | ||
221 | app:layout_constraintGuide_percent="0.27" /> | ||
222 | |||
223 | <androidx.constraintlayout.widget.Guideline | ||
224 | android:id="@+id/guideline4" | ||
225 | android:layout_width="wrap_content" | ||
226 | android:layout_height="wrap_content" | ||
227 | android:orientation="horizontal" | ||
228 | app:layout_constraintGuide_percent="0.32" /> | ||
229 | |||
230 | <androidx.constraintlayout.widget.Guideline | ||
231 | android:id="@+id/guideline5" | ||
232 | android:layout_width="wrap_content" | ||
233 | android:layout_height="wrap_content" | ||
234 | android:orientation="horizontal" | ||
235 | app:layout_constraintGuide_percent="0.88" /> | ||
236 | |||
237 | <androidx.constraintlayout.widget.Guideline | ||
238 | android:id="@+id/guideline6" | ||
239 | android:layout_width="wrap_content" | ||
240 | android:layout_height="wrap_content" | ||
241 | android:orientation="horizontal" | ||
242 | app:layout_constraintGuide_percent="0.97" /> | ||
243 | |||
244 | |||
245 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/fragment_inventario.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:id="@+id/frameLayout" | 5 | android:id="@+id/frameLayout" |
6 | android:layout_width="match_parent" | 6 | android:layout_width="match_parent" |
7 | android:layout_height="match_parent" | 7 | android:layout_height="match_parent" |
8 | tools:context=".UI.inventario.InventarioFragment"> | 8 | tools:context=".UI.inventario.InventarioFragment"> |
9 | 9 | ||
10 | 10 | ||
11 | <androidx.appcompat.widget.AppCompatTextView | 11 | <androidx.appcompat.widget.AppCompatTextView |
12 | android:id="@+id/tvTitulo" | 12 | android:id="@+id/tvTitulo" |
13 | android:layout_width="match_parent" | 13 | android:layout_width="match_parent" |
14 | android:layout_height="50dp" | 14 | android:layout_height="50dp" |
15 | android:layout_marginStart="8dp" | 15 | android:layout_marginStart="8dp" |
16 | android:layout_marginEnd="8dp" | 16 | android:layout_marginEnd="8dp" |
17 | android:autoSizeMaxTextSize="100sp" | 17 | android:autoSizeMaxTextSize="100sp" |
18 | android:autoSizeMinTextSize="20sp" | 18 | android:autoSizeMinTextSize="20sp" |
19 | android:autoSizeStepGranularity="5sp" | 19 | android:autoSizeStepGranularity="5sp" |
20 | android:autoSizeTextType="uniform" | 20 | android:autoSizeTextType="uniform" |
21 | android:gravity="center" | 21 | android:gravity="center" |
22 | android:lines="1" | 22 | android:lines="1" |
23 | android:text="@string/invTitulo" | 23 | android:text="@string/invTitulo" |
24 | android:textColor="@color/colorAccent" | 24 | android:textColor="@color/colorAccent" |
25 | app:fontFamily="sans-serif-condensed" | 25 | app:fontFamily="sans-serif-condensed" |
26 | app:layout_constraintBottom_toTopOf="@id/guideline2" | 26 | app:layout_constraintBottom_toTopOf="@id/guideline2" |
27 | app:layout_constraintEnd_toEndOf="parent" | 27 | app:layout_constraintEnd_toEndOf="parent" |
28 | app:layout_constraintStart_toStartOf="parent" | 28 | app:layout_constraintStart_toStartOf="parent" |
29 | app:layout_constraintTop_toTopOf="@id/guideline" /> | 29 | app:layout_constraintTop_toTopOf="@id/guideline" /> |
30 | 30 | ||
31 | 31 | ||
32 | <ImageButton | 32 | <ImageButton |
33 | android:id="@+id/ivCamara" | 33 | android:id="@+id/ivCamara" |
34 | android:layout_width="80dp" | 34 | android:layout_width="80dp" |
35 | android:layout_height="80dp" | 35 | android:layout_height="80dp" |
36 | android:layout_marginTop="15dp" | 36 | android:layout_marginTop="15dp" |
37 | android:clickable="true" | 37 | android:clickable="true" |
38 | android:contentDescription="@string/ibBusCB" | 38 | android:contentDescription="@string/ibBusCB" |
39 | android:elevation="5dp" | 39 | android:elevation="5dp" |
40 | android:background="@drawable/boton_redondo" | 40 | android:background="@drawable/boton_redondo" |
41 | android:layout_margin="10dp" | 41 | android:layout_margin="10dp" |
42 | android:focusable="false" | 42 | android:focusable="false" |
43 | android:scaleType="fitEnd" | 43 | android:scaleType="fitEnd" |
44 | app:layout_constraintCircleRadius="40dp" | 44 | app:layout_constraintCircleRadius="40dp" |
45 | android:src="@drawable/codbar" | 45 | android:src="@drawable/codbar" |
46 | app:layout_constraintBottom_toTopOf="@id/guideline3" | 46 | app:layout_constraintBottom_toTopOf="@id/guideline3" |
47 | app:layout_constraintEnd_toStartOf="@+id/etCodigoBarras" | 47 | app:layout_constraintEnd_toStartOf="@+id/etCodigoBarras" |
48 | app:layout_constraintHorizontal_bias="0.0" | 48 | app:layout_constraintHorizontal_bias="0.0" |
49 | app:layout_constraintStart_toStartOf="parent" | 49 | app:layout_constraintStart_toStartOf="parent" |
50 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | 50 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> |
51 | 51 | ||
52 | <EditText | 52 | <EditText |
53 | android:id="@+id/etCodigoBarras" | 53 | android:id="@+id/etCodigoBarras" |
54 | android:layout_width="0dp" | 54 | android:layout_width="0dp" |
55 | android:layout_height="wrap_content" | 55 | android:layout_height="wrap_content" |
56 | android:autofillHints="" | 56 | android:autofillHints="" |
57 | android:clickable="true" | 57 | android:clickable="true" |
58 | android:ems="10" | 58 | android:ems="10" |
59 | android:focusable="true" | 59 | android:focusable="true" |
60 | android:hint="@string/ibBusCB" | 60 | android:hint="@string/ibBusCB" |
61 | android:inputType="textPersonName" | 61 | android:inputType="textPersonName" |
62 | android:lines="1" | 62 | android:lines="1" |
63 | android:textAllCaps="true" | 63 | android:textAllCaps="true" |
64 | android:textSize="20sp" | 64 | android:textSize="20sp" |
65 | app:layout_constraintBottom_toTopOf="@+id/guideline3" | 65 | app:layout_constraintBottom_toTopOf="@+id/guideline3" |
66 | app:layout_constraintEnd_toStartOf="@+id/swSumaUno" | 66 | app:layout_constraintEnd_toStartOf="@+id/swSumaUno" |
67 | app:layout_constraintHorizontal_bias="0.49" | 67 | app:layout_constraintHorizontal_bias="0.49" |
68 | app:layout_constraintHorizontal_chainStyle="packed" | 68 | app:layout_constraintHorizontal_chainStyle="packed" |
69 | app:layout_constraintStart_toEndOf="@+id/ivCamara" | 69 | app:layout_constraintStart_toEndOf="@+id/ivCamara" |
70 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> | 70 | app:layout_constraintTop_toBottomOf="@+id/guideline2" /> |
71 | 71 | ||
72 | 72 | ||
73 | <Switch | 73 | <Switch |
74 | android:id="@+id/swSumaUno" | 74 | android:id="@+id/swSumaUno" |
75 | android:layout_width="wrap_content" | 75 | android:layout_width="wrap_content" |
76 | android:layout_height="wrap_content" | 76 | android:layout_height="wrap_content" |
77 | android:text="@string/switch_1" | 77 | android:text="@string/switch_1" |
78 | app:layout_constraintBaseline_toBaselineOf="@+id/etCodigoBarras" | 78 | app:layout_constraintBaseline_toBaselineOf="@+id/etCodigoBarras" |
79 | app:layout_constraintEnd_toEndOf="parent" | 79 | app:layout_constraintEnd_toEndOf="parent" |
80 | app:layout_constraintStart_toEndOf="@id/etCodigoBarras" | 80 | app:layout_constraintStart_toEndOf="@id/etCodigoBarras" |
81 | tools:ignore="UseSwitchCompatOrMaterialXml" /> | 81 | tools:ignore="UseSwitchCompatOrMaterialXml" /> |
82 | 82 | ||
83 | <androidx.recyclerview.widget.RecyclerView | 83 | <androidx.recyclerview.widget.RecyclerView |
84 | android:id="@+id/rcInventarios" | 84 | android:id="@+id/rcInventarios" |
85 | android:layout_width="match_parent" | 85 | android:layout_width="match_parent" |
86 | android:layout_height="0dp" | 86 | android:layout_height="0dp" |
87 | android:background="@android:color/darker_gray" | 87 | android:background="@android:color/darker_gray" |
88 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" | 88 | app:layout_constraintBottom_toBottomOf="@+id/guideline5" |
89 | app:layout_constraintEnd_toEndOf="parent" | 89 | app:layout_constraintEnd_toEndOf="parent" |
90 | app:layout_constraintStart_toStartOf="parent" | 90 | app:layout_constraintStart_toStartOf="parent" |
91 | app:layout_constraintTop_toBottomOf="@+id/guideline4" | 91 | app:layout_constraintTop_toBottomOf="@+id/guideline4" |
92 | tools:listitem="@layout/item" /> | 92 | tools:listitem="@layout/item" /> |
93 | 93 | ||
94 | 94 | ||
95 | <Button | 95 | <Button |
96 | android:id="@+id/btnExportarInv" | 96 | android:id="@+id/btnExportarInv" |
97 | android:layout_width="wrap_content" | 97 | android:layout_width="wrap_content" |
98 | android:layout_height="wrap_content" | 98 | android:layout_height="wrap_content" |
99 | android:text="@string/btnExportarInv" | 99 | android:text="@string/btnExportarInv" |
100 | android:textColor="@android:color/white" | 100 | android:textColor="@android:color/white" |
101 | android:padding="10dp" | 101 | android:padding="10dp" |
102 | android:background="@drawable/boton_borde_redondeado" | 102 | android:background="@drawable/boton_borde_redondeado" |
103 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | 103 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" |
104 | app:layout_constraintEnd_toEndOf="parent" | 104 | app:layout_constraintEnd_toEndOf="parent" |
105 | app:layout_constraintHorizontal_chainStyle="spread" | 105 | app:layout_constraintHorizontal_chainStyle="spread" |
106 | app:layout_constraintStart_toEndOf="@+id/btnBorrarInv" | 106 | app:layout_constraintStart_toEndOf="@+id/btnBorrarInv" |
107 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | 107 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> |
108 | 108 | ||
109 | <Button | 109 | <Button |
110 | android:id="@+id/btnBorrarInv" | 110 | android:id="@+id/btnBorrarInv" |
111 | android:layout_width="wrap_content" | 111 | android:layout_width="wrap_content" |
112 | android:layout_height="wrap_content" | 112 | android:layout_height="wrap_content" |
113 | android:text="@string/btnBorrarInv" | 113 | android:text="@string/btnBorrarInv" |
114 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" | 114 | app:layout_constraintBottom_toBottomOf="@+id/guideline6" |
115 | app:layout_constraintEnd_toStartOf="@id/btnExportarInv" | 115 | app:layout_constraintEnd_toStartOf="@id/btnExportarInv" |
116 | app:layout_constraintHorizontal_chainStyle="spread" | 116 | app:layout_constraintHorizontal_chainStyle="spread" |
117 | app:layout_constraintStart_toStartOf="parent" | 117 | app:layout_constraintStart_toStartOf="parent" |
118 | android:textColor="@android:color/white" | 118 | android:textColor="@android:color/white" |
119 | android:padding="10dp" | 119 | android:padding="10dp" |
120 | android:background="@drawable/boton_borde_redondeado" | 120 | android:background="@drawable/boton_borde_redondeado" |
121 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> | 121 | app:layout_constraintTop_toBottomOf="@+id/guideline5" /> |
122 | 122 | ||
123 | |||
124 | <ProgressBar | ||
125 | android:id="@+id/loading_view" | ||
126 | android:layout_width="wrap_content" | ||
127 | android:layout_height="wrap_content" | ||
128 | android:layout_marginStart="8dp" | ||
129 | android:layout_marginLeft="8dp" | ||
130 | android:layout_marginTop="8dp" | ||
131 | android:layout_marginEnd="8dp" | ||
132 | android:layout_marginRight="8dp" | ||
133 | android:layout_marginBottom="8dp" | ||
134 | android:visibility="gone" | ||
135 | app:layout_constraintBottom_toBottomOf="parent" | ||
136 | app:layout_constraintEnd_toEndOf="parent" | ||
137 | app:layout_constraintStart_toStartOf="parent" | ||
138 | app:layout_constraintTop_toTopOf="parent" /> | ||
139 | |||
123 | <androidx.constraintlayout.widget.Guideline | 140 | <androidx.constraintlayout.widget.Guideline |
124 | android:id="@+id/guideline" | 141 | android:id="@+id/guideline" |
125 | android:layout_width="wrap_content" | 142 | android:layout_width="wrap_content" |
126 | android:layout_height="wrap_content" | 143 | android:layout_height="wrap_content" |
127 | android:orientation="horizontal" | 144 | android:orientation="horizontal" |
128 | app:layout_constraintGuide_percent="0.02" /> | 145 | app:layout_constraintGuide_percent="0.02" /> |
129 | 146 | ||
130 | <androidx.constraintlayout.widget.Guideline | 147 | <androidx.constraintlayout.widget.Guideline |
131 | android:id="@+id/guideline2" | 148 | android:id="@+id/guideline2" |
132 | android:layout_width="wrap_content" | 149 | android:layout_width="wrap_content" |
133 | android:layout_height="wrap_content" | 150 | android:layout_height="wrap_content" |
134 | android:orientation="horizontal" | 151 | android:orientation="horizontal" |
135 | app:layout_constraintGuide_percent="0.12029161" /> | 152 | app:layout_constraintGuide_percent="0.12029161" /> |
136 | 153 | ||
137 | <androidx.constraintlayout.widget.Guideline | 154 | <androidx.constraintlayout.widget.Guideline |
138 | android:id="@+id/guideline3" | 155 | android:id="@+id/guideline3" |
139 | android:layout_width="wrap_content" | 156 | android:layout_width="wrap_content" |
140 | android:layout_height="wrap_content" | 157 | android:layout_height="wrap_content" |
141 | android:orientation="horizontal" | 158 | android:orientation="horizontal" |
142 | app:layout_constraintGuide_percent="0.27" /> | 159 | app:layout_constraintGuide_percent="0.27" /> |
143 | 160 | ||
144 | <androidx.constraintlayout.widget.Guideline | 161 | <androidx.constraintlayout.widget.Guideline |
145 | android:id="@+id/guideline4" | 162 | android:id="@+id/guideline4" |
146 | android:layout_width="wrap_content" | 163 | android:layout_width="wrap_content" |
147 | android:layout_height="wrap_content" | 164 | android:layout_height="wrap_content" |
148 | android:orientation="horizontal" | 165 | android:orientation="horizontal" |
149 | app:layout_constraintGuide_percent="0.32" /> | 166 | app:layout_constraintGuide_percent="0.32" /> |
150 | 167 | ||
151 | <androidx.constraintlayout.widget.Guideline | 168 | <androidx.constraintlayout.widget.Guideline |
152 | android:id="@+id/guideline5" | 169 | android:id="@+id/guideline5" |
153 | android:layout_width="wrap_content" | 170 | android:layout_width="wrap_content" |
154 | android:layout_height="wrap_content" | 171 | android:layout_height="wrap_content" |
155 | android:orientation="horizontal" | 172 | android:orientation="horizontal" |
156 | app:layout_constraintGuide_percent="0.88" /> | 173 | app:layout_constraintGuide_percent="0.88" /> |
157 | 174 | ||
158 | <androidx.constraintlayout.widget.Guideline | 175 | <androidx.constraintlayout.widget.Guideline |
159 | android:id="@+id/guideline6" | 176 | android:id="@+id/guideline6" |
160 | android:layout_width="wrap_content" | 177 | android:layout_width="wrap_content" |
161 | android:layout_height="wrap_content" | 178 | android:layout_height="wrap_content" |
162 | android:orientation="horizontal" | 179 | android:orientation="horizontal" |
163 | app:layout_constraintGuide_percent="0.97" /> | 180 | app:layout_constraintGuide_percent="0.97" /> |
164 | 181 | ||
165 | 182 | ||
166 | </androidx.constraintlayout.widget.ConstraintLayout> | 183 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/fragment_main.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent"> | 6 | android:layout_height="match_parent"> |
7 | 7 | ||
8 | <androidx.appcompat.widget.AppCompatTextView | 8 | <androidx.appcompat.widget.AppCompatTextView |
9 | android:id="@+id/tvInvDinamicos" | 9 | android:id="@+id/tvInvDinamicos" |
10 | android:layout_width="match_parent" | 10 | android:layout_width="match_parent" |
11 | android:layout_height="90dp" | 11 | android:layout_height="90dp" |
12 | android:autoSizeMaxTextSize="150sp" | 12 | android:autoSizeMaxTextSize="150sp" |
13 | android:autoSizeMinTextSize="25sp" | 13 | android:autoSizeMinTextSize="25sp" |
14 | android:autoSizeStepGranularity="5sp" | 14 | android:autoSizeStepGranularity="5sp" |
15 | android:autoSizeTextType="uniform" | 15 | android:autoSizeTextType="uniform" |
16 | android:gravity="start" | 16 | android:gravity="start" |
17 | android:lines="1" | 17 | android:lines="1" |
18 | android:padding="10dp" | 18 | android:padding="10dp" |
19 | android:text="@string/invDinamicoVenta" | 19 | android:text="@string/invDinamicoVenta" |
20 | android:textColor="@color/colorAccent" | 20 | android:textColor="@color/colorAccent" |
21 | android:visibility="visible" | 21 | android:visibility="visible" |
22 | app:fontFamily="sans-serif-condensed" | 22 | app:fontFamily="sans-serif-condensed" |
23 | app:layout_constraintEnd_toEndOf="parent" | 23 | app:layout_constraintEnd_toEndOf="parent" |
24 | app:layout_constraintStart_toStartOf="parent" | 24 | app:layout_constraintStart_toStartOf="parent" |
25 | app:layout_constraintTop_toTopOf="parent" /> | 25 | app:layout_constraintTop_toTopOf="parent" /> |
26 | 26 | ||
27 | <androidx.appcompat.widget.AppCompatImageButton | 27 | <androidx.appcompat.widget.AppCompatImageButton |
28 | android:id="@+id/ivSort19" | 28 | android:id="@+id/ivSort19" |
29 | android:layout_width="50dp" | 29 | android:layout_width="50dp" |
30 | android:layout_height="50dp" | 30 | android:layout_height="50dp" |
31 | android:layout_marginStart="10dp" | 31 | android:layout_marginStart="10dp" |
32 | android:padding="5dp" | 32 | android:padding="5dp" |
33 | android:src="@drawable/ic_sort19" | 33 | android:src="@drawable/ic_sort19" |
34 | android:visibility="gone" | 34 | android:visibility="gone" |
35 | app:layout_constraintHorizontal_bias="0.0" | 35 | app:layout_constraintHorizontal_bias="0.0" |
36 | app:layout_constraintHorizontal_chainStyle="packed" | 36 | app:layout_constraintHorizontal_chainStyle="packed" |
37 | app:layout_constraintStart_toStartOf="parent" | 37 | app:layout_constraintStart_toStartOf="parent" |
38 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | 38 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> |
39 | 39 | ||
40 | <androidx.appcompat.widget.AppCompatImageButton | 40 | <androidx.appcompat.widget.AppCompatImageButton |
41 | android:id="@+id/ivSort91" | 41 | android:id="@+id/ivSort91" |
42 | android:layout_width="50dp" | 42 | android:layout_width="50dp" |
43 | android:layout_height="50dp" | 43 | android:layout_height="50dp" |
44 | android:layout_marginStart="10dp" | 44 | android:layout_marginStart="10dp" |
45 | android:padding="5dp" | 45 | android:padding="5dp" |
46 | android:src="@drawable/ic_sort91" | 46 | android:src="@drawable/ic_sort91" |
47 | android:visibility="gone" | 47 | android:visibility="gone" |
48 | app:layout_constraintHorizontal_chainStyle="packed" | 48 | app:layout_constraintHorizontal_chainStyle="packed" |
49 | app:layout_constraintStart_toStartOf="parent" | 49 | app:layout_constraintStart_toStartOf="parent" |
50 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> | 50 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" /> |
51 | 51 | ||
52 | <TextView | 52 | <TextView |
53 | android:id="@+id/tvTipo" | 53 | android:id="@+id/tvTipo" |
54 | android:layout_width="wrap_content" | 54 | android:layout_width="wrap_content" |
55 | android:layout_height="wrap_content" | 55 | android:layout_height="wrap_content" |
56 | android:layout_margin="5dp" | 56 | android:layout_margin="5dp" |
57 | android:text="Tipo:" | 57 | android:text="Tipo:" |
58 | android:layout_marginTop="12dp" | 58 | android:layout_marginTop="12dp" |
59 | android:textSize="15sp" | 59 | android:textSize="15sp" |
60 | android:visibility="gone" | 60 | android:visibility="gone" |
61 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" | 61 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentas" |
62 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> | 62 | app:layout_constraintEnd_toStartOf="@+id/cbVentas" /> |
63 | 63 | ||
64 | <com.google.android.material.checkbox.MaterialCheckBox | 64 | <com.google.android.material.checkbox.MaterialCheckBox |
65 | android:id="@+id/cbVentas" | 65 | android:id="@+id/cbVentas" |
66 | android:layout_width="wrap_content" | 66 | android:layout_width="wrap_content" |
67 | android:layout_height="wrap_content" | 67 | android:layout_height="wrap_content" |
68 | android:layout_margin="5dp" | 68 | android:layout_margin="5dp" |
69 | android:checked="true" | 69 | android:checked="true" |
70 | android:text="Ventas" | 70 | android:text="Ventas" |
71 | android:layout_marginTop="12dp" | 71 | android:layout_marginTop="12dp" |
72 | android:visibility="gone" | 72 | android:visibility="gone" |
73 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" | 73 | app:layout_constraintEnd_toStartOf="@+id/cbDeposito" |
74 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | 74 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> |
75 | 75 | ||
76 | <com.google.android.material.checkbox.MaterialCheckBox | 76 | <com.google.android.material.checkbox.MaterialCheckBox |
77 | android:id="@+id/cbDeposito" | 77 | android:id="@+id/cbDeposito" |
78 | android:layout_width="wrap_content" | 78 | android:layout_width="wrap_content" |
79 | android:layout_height="wrap_content" | 79 | android:layout_height="wrap_content" |
80 | android:layout_margin="5dp" | 80 | android:layout_margin="5dp" |
81 | android:checked="true" | 81 | android:checked="true" |
82 | android:text="Deposito" | 82 | android:text="Deposito" |
83 | android:layout_marginTop="12dp" | 83 | android:layout_marginTop="12dp" |
84 | android:visibility="gone" | 84 | android:visibility="gone" |
85 | app:layout_constraintEnd_toEndOf="parent" | 85 | app:layout_constraintEnd_toEndOf="parent" |
86 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> | 86 | app:layout_constraintTop_toBottomOf="@+id/tvInvDinamicos" /> |
87 | 87 | ||
88 | <androidx.recyclerview.widget.RecyclerView | 88 | <androidx.recyclerview.widget.RecyclerView |
89 | android:id="@+id/rcInventario" | 89 | android:id="@+id/rcInventario" |
90 | android:layout_width="match_parent" | 90 | android:layout_width="match_parent" |
91 | android:layout_height="0dp" | 91 | android:layout_height="0dp" |
92 | android:background="@android:color/darker_gray" | 92 | android:background="@android:color/darker_gray" |
93 | android:scrollbars="vertical" | 93 | android:scrollbars="vertical" |
94 | android:visibility="gone" | 94 | android:visibility="gone" |
95 | app:layout_constraintEnd_toEndOf="parent" | 95 | app:layout_constraintEnd_toEndOf="parent" |
96 | app:layout_constraintStart_toStartOf="parent" | 96 | app:layout_constraintStart_toStartOf="parent" |
97 | app:layout_constraintTop_toBottomOf="@id/ivSort19" | 97 | app:layout_constraintTop_toBottomOf="@id/ivSort19" |
98 | tools:listitem="@layout/item_principal" | 98 | tools:listitem="@layout/item_principal" |
99 | app:layout_constraintBottom_toTopOf="@+id/guideline1"/> | 99 | app:layout_constraintBottom_toTopOf="@+id/guideline1"/> |
100 | 100 | ||
101 | 101 | ||
102 | <androidx.appcompat.widget.AppCompatTextView | 102 | <androidx.appcompat.widget.AppCompatTextView |
103 | android:id="@+id/tvInvImportados" | 103 | android:id="@+id/tvInvImportados" |
104 | android:layout_width="match_parent" | 104 | android:layout_width="match_parent" |
105 | android:layout_height="90dp" | 105 | android:layout_height="90dp" |
106 | android:autoSizeMaxTextSize="150sp" | 106 | android:autoSizeMaxTextSize="150sp" |
107 | android:autoSizeMinTextSize="25sp" | 107 | android:autoSizeMinTextSize="25sp" |
108 | android:autoSizeStepGranularity="5sp" | 108 | android:autoSizeStepGranularity="5sp" |
109 | android:autoSizeTextType="uniform" | 109 | android:autoSizeTextType="uniform" |
110 | android:gravity="start" | 110 | android:gravity="start" |
111 | android:lines="1" | 111 | android:lines="1" |
112 | android:padding="10dp" | 112 | android:padding="10dp" |
113 | android:text="@string/invDinamicoCompra" | 113 | android:text="@string/invDinamicoCompra" |
114 | android:textColor="@color/colorAccent" | 114 | android:textColor="@color/colorAccent" |
115 | android:visibility="visible" | 115 | android:visibility="visible" |
116 | app:fontFamily="sans-serif-condensed" | 116 | app:fontFamily="sans-serif-condensed" |
117 | app:layout_constraintBottom_toBottomOf="parent" | 117 | app:layout_constraintBottom_toBottomOf="parent" |
118 | app:layout_constraintEnd_toEndOf="parent" | 118 | app:layout_constraintEnd_toEndOf="parent" |
119 | app:layout_constraintStart_toStartOf="parent" | 119 | app:layout_constraintStart_toStartOf="parent" |
120 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" | 120 | app:layout_constraintTop_toBottomOf="@id/tvInvDinamicos" |
121 | app:layout_constraintVertical_bias="0.0" /> | 121 | app:layout_constraintVertical_bias="0.0" /> |
122 | 122 | ||
123 | <androidx.appcompat.widget.AppCompatImageButton | 123 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> |
124 | android:id="@+id/ivSort19II" | 124 | <!-- android:id="@+id/ivSort19II"--> |
125 | android:layout_width="50dp" | 125 | <!-- android:layout_width="50dp"--> |
126 | android:layout_height="50dp" | 126 | <!-- android:layout_height="50dp"--> |
127 | android:layout_marginStart="10dp" | 127 | <!-- android:layout_marginStart="10dp"--> |
128 | android:padding="5dp" | 128 | <!-- android:padding="5dp"--> |
129 | android:src="@drawable/ic_sort19" | 129 | <!-- android:src="@drawable/ic_sort19"--> |
130 | android:visibility="gone" | 130 | <!-- android:visibility="gone"--> |
131 | app:layout_constraintHorizontal_bias="0.0" | 131 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> |
132 | app:layout_constraintHorizontal_chainStyle="packed" | 132 | <!-- app:layout_constraintStart_toStartOf="parent"--> |
133 | app:layout_constraintStart_toStartOf="parent" | 133 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> |
134 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" /> | 134 | |
135 | 135 | <!-- <androidx.appcompat.widget.AppCompatImageButton--> | |
136 | <androidx.appcompat.widget.AppCompatImageButton | 136 | <!-- android:id="@+id/ivSort91II"--> |
137 | android:id="@+id/ivSort91II" | 137 | <!-- android:layout_width="50dp"--> |
138 | android:layout_width="50dp" | 138 | <!-- android:layout_height="50dp"--> |
139 | android:layout_height="50dp" | 139 | <!-- android:layout_marginStart="10dp"--> |
140 | android:layout_marginStart="10dp" | 140 | <!-- android:padding="5dp"--> |
141 | android:padding="5dp" | 141 | <!-- android:src="@drawable/ic_sort91"--> |
142 | android:src="@drawable/ic_sort91" | 142 | <!-- android:visibility="invisible"--> |
143 | android:visibility="gone" | 143 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> |
144 | app:layout_constraintHorizontal_chainStyle="packed" | 144 | <!-- app:layout_constraintStart_toStartOf="parent"--> |
145 | app:layout_constraintStart_toStartOf="parent" | 145 | <!-- app:layout_constraintTop_toBottomOf="@id/tvInvImportados" />--> |
146 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" /> | 146 | <ImageView |
147 | 147 | android:id="@+id/ivPortada" | |
148 | <TextView | 148 | android:layout_width="404dp" |
149 | android:id="@+id/tvTipoII" | 149 | android:layout_height="248dp" |
150 | android:layout_width="wrap_content" | 150 | android:elevation="10dp" |
151 | android:layout_height="wrap_content" | 151 | android:visibility="visible" |
152 | android:layout_margin="5dp" | 152 | app:layout_constraintBottom_toBottomOf="parent" |
153 | android:text="Tipo:" | 153 | app:layout_constraintEnd_toEndOf="parent" |
154 | android:layout_marginTop="12dp" | 154 | app:layout_constraintStart_toStartOf="parent" |
155 | android:textSize="15sp" | 155 | app:layout_constraintTop_toBottomOf="@+id/tvInvImportados" |
156 | android:visibility="gone" | 156 | tools:srcCompat="@drawable/imagen_portada" /> |
157 | app:layout_constraintBaseline_toBaselineOf="@+id/cbVentasII" | ||
158 | app:layout_constraintEnd_toStartOf="@+id/cbVentasII" /> | ||
159 | |||
160 | <com.google.android.material.checkbox.MaterialCheckBox | ||
161 | android:id="@+id/cbVentasII" | ||
162 | android:layout_width="wrap_content" | ||
163 | android:layout_height="wrap_content" | ||
164 | android:layout_margin="5dp" | ||
165 | android:checked="true" | ||
166 | android:text="Ventas" | ||
167 | android:layout_marginTop="12dp" | ||
168 | android:visibility="gone" | ||
169 | app:layout_constraintEnd_toStartOf="@+id/cbDepositoII" | ||
170 | app:layout_constraintTop_toBottomOf="@+id/tvInvImportados" /> | ||
171 | |||
172 | <com.google.android.material.checkbox.MaterialCheckBox | ||
173 | android:id="@+id/cbDepositoII" | ||
174 | android:layout_width="wrap_content" | ||
175 | android:layout_height="wrap_content" | ||
176 | android:layout_margin="5dp" | ||
177 | android:checked="true" | ||
178 | android:text="Deposito" | ||
179 | android:layout_marginTop="12dp" | ||
180 | android:visibility="gone" | ||
181 | app:layout_constraintEnd_toEndOf="parent" | ||
182 | app:layout_constraintTop_toBottomOf="@+id/tvInvImportados" /> | ||
183 | |||
184 | 157 | ||
185 | <androidx.recyclerview.widget.RecyclerView | 158 | <androidx.recyclerview.widget.RecyclerView |
186 | android:id="@+id/rcInventarioII" | 159 | android:id="@+id/rcInventarioII" |
187 | android:layout_width="match_parent" | 160 | android:layout_width="match_parent" |
188 | android:layout_height="0dp" | 161 | android:layout_height="0dp" |
189 | android:background="@android:color/darker_gray" | 162 | android:background="@android:color/darker_gray" |
190 | android:scrollbars="vertical" | 163 | android:scrollbars="vertical" |
191 | android:visibility="gone" | 164 | android:visibility="gone" |
192 | app:layout_constraintEnd_toEndOf="parent" | 165 | app:layout_constraintEnd_toEndOf="parent" |
193 | app:layout_constraintStart_toStartOf="parent" | 166 | app:layout_constraintStart_toStartOf="parent" |
194 | app:layout_constraintTop_toBottomOf="@id/ivSort19II" | 167 | app:layout_constraintTop_toBottomOf="@id/tvInvImportados" |
195 | tools:listitem="@layout/item_principal" | 168 | tools:listitem="@layout/item_principal" |
196 | app:layout_constraintBottom_toTopOf="@+id/guideline1"/> | 169 | app:layout_constraintBottom_toTopOf="@+id/guideline1"/> |
197 | 170 | ||
198 | <androidx.constraintlayout.widget.Guideline | 171 | <androidx.constraintlayout.widget.Guideline |
199 | android:id="@+id/guideline1" | 172 | android:id="@+id/guideline1" |
200 | android:layout_width="wrap_content" | 173 | android:layout_width="wrap_content" |
201 | android:layout_height="wrap_content" | 174 | android:layout_height="wrap_content" |
202 | android:orientation="horizontal" | 175 | android:orientation="horizontal" |
203 | app:layout_constraintGuide_percent="0.97" /> | 176 | app:layout_constraintGuide_percent="0.97" /> |
204 | </androidx.constraintlayout.widget.ConstraintLayout> | 177 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/fragment_servidores.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="match_parent" | 6 | android:layout_height="match_parent" |
7 | tools:context=".UI.servidores.ServidoresFragment"> | 7 | tools:context=".UI.servidores.ServidoresFragment"> |
8 | 8 | ||
9 | <androidx.appcompat.widget.AppCompatTextView | 9 | <androidx.appcompat.widget.AppCompatTextView |
10 | android:id="@+id/tvTitutloServer" | 10 | android:id="@+id/tvTitutloServer" |
11 | android:layout_width="match_parent" | 11 | android:layout_width="match_parent" |
12 | android:layout_height="90dp" | 12 | android:layout_height="90dp" |
13 | android:layout_marginStart="8dp" | 13 | android:layout_marginStart="8dp" |
14 | android:layout_marginTop="15dp" | 14 | android:layout_marginTop="15dp" |
15 | android:layout_marginEnd="8dp" | 15 | android:layout_marginEnd="8dp" |
16 | android:autoSizeMaxTextSize="100sp" | 16 | android:autoSizeMaxTextSize="100sp" |
17 | android:autoSizeMinTextSize="20sp" | 17 | android:autoSizeMinTextSize="20sp" |
18 | android:autoSizeStepGranularity="5sp" | 18 | android:autoSizeStepGranularity="5sp" |
19 | android:autoSizeTextType="uniform" | 19 | android:autoSizeTextType="uniform" |
20 | android:gravity="center" | 20 | android:gravity="center" |
21 | android:lines="1" | 21 | android:lines="1" |
22 | android:text="@string/tvTitutloServer" | 22 | android:text="@string/tvTitutloServer" |
23 | android:textColor="@color/colorAccent" | 23 | android:textColor="@color/colorAccent" |
24 | app:fontFamily="sans-serif-condensed" | 24 | app:fontFamily="sans-serif-condensed" |
25 | app:layout_constraintEnd_toEndOf="parent" | 25 | app:layout_constraintEnd_toEndOf="parent" |
26 | app:layout_constraintStart_toStartOf="parent" | 26 | app:layout_constraintStart_toStartOf="parent" |
27 | app:layout_constraintTop_toTopOf="parent" /> | 27 | app:layout_constraintTop_toTopOf="parent" /> |
28 | 28 | ||
29 | 29 | ||
30 | <TextView | 30 | <TextView |
31 | android:id="@+id/tvNomServer" | 31 | android:id="@+id/tvNomServer" |
32 | android:layout_width="match_parent" | 32 | android:layout_width="match_parent" |
33 | android:layout_height="wrap_content" | 33 | android:layout_height="wrap_content" |
34 | android:layout_margin="10dp" | 34 | android:layout_margin="10dp" |
35 | android:gravity="start" | 35 | android:gravity="start" |
36 | android:lines="1" | 36 | android:lines="1" |
37 | android:text="@string/tvNomServer" | 37 | android:text="@string/tvNomServer" |
38 | android:textColor="@android:color/black" | 38 | android:textColor="@android:color/black" |
39 | android:textSize="@dimen/SubTitulos" | 39 | android:textSize="@dimen/SubTitulos" |
40 | android:textStyle="bold|italic" | 40 | android:textStyle="bold|italic" |
41 | app:fontFamily="sans-serif-condensed" | 41 | app:fontFamily="sans-serif-condensed" |
42 | app:layout_constraintEnd_toEndOf="parent" | 42 | app:layout_constraintEnd_toEndOf="parent" |
43 | app:layout_constraintStart_toStartOf="parent" | 43 | app:layout_constraintStart_toStartOf="parent" |
44 | app:layout_constraintTop_toBottomOf="@id/tvTitutloServer" /> | 44 | app:layout_constraintTop_toBottomOf="@id/tvTitutloServer" /> |
45 | 45 | ||
46 | <EditText | 46 | <EditText |
47 | android:id="@+id/etNombreServidor" | 47 | android:id="@+id/etNombreServidor" |
48 | android:layout_width="match_parent" | 48 | android:layout_width="match_parent" |
49 | android:layout_height="wrap_content" | 49 | android:layout_height="wrap_content" |
50 | android:layout_margin="10dp" | 50 | android:layout_margin="10dp" |
51 | android:autofillHints="" | 51 | android:autofillHints="" |
52 | android:clickable="true" | 52 | android:clickable="true" |
53 | android:ems="10" | 53 | android:ems="10" |
54 | android:focusable="true" | 54 | android:focusable="true" |
55 | android:hint="Servidor Local" | 55 | android:hint="Servidor Local" |
56 | android:inputType="text" | 56 | android:inputType="text" |
57 | android:lines="1" | 57 | android:lines="1" |
58 | android:textSize="15sp" | 58 | android:textSize="15sp" |
59 | app:layout_constraintEnd_toEndOf="parent" | 59 | app:layout_constraintEnd_toEndOf="parent" |
60 | app:layout_constraintStart_toStartOf="parent" | 60 | app:layout_constraintStart_toStartOf="parent" |
61 | app:layout_constraintTop_toBottomOf="@+id/tvNomServer" /> | 61 | app:layout_constraintTop_toBottomOf="@+id/tvNomServer" /> |
62 | 62 | ||
63 | <TextView | 63 | <TextView |
64 | android:id="@+id/tvDirServer" | 64 | android:id="@+id/tvDirServer" |
65 | android:layout_width="wrap_content" | 65 | android:layout_width="wrap_content" |
66 | android:layout_height="wrap_content" | 66 | android:layout_height="wrap_content" |
67 | android:layout_margin="10dp" | 67 | android:layout_margin="10dp" |
68 | android:gravity="start" | 68 | android:gravity="start" |
69 | android:lines="1" | 69 | android:lines="1" |
70 | android:text="@string/tvDirServer" | 70 | android:text="@string/tvDirServer" |
71 | android:textColor="@android:color/black" | 71 | android:textColor="@android:color/black" |
72 | android:textSize="@dimen/SubTitulos" | 72 | android:textSize="@dimen/SubTitulos" |
73 | android:textStyle="bold|italic" | 73 | android:textStyle="bold|italic" |
74 | app:fontFamily="sans-serif-condensed" | 74 | app:fontFamily="sans-serif-condensed" |
75 | app:layout_constraintStart_toStartOf="parent" | 75 | app:layout_constraintStart_toStartOf="parent" |
76 | app:layout_constraintTop_toBottomOf="@+id/etNombreServidor" /> | 76 | app:layout_constraintTop_toBottomOf="@+id/etNombreServidor" /> |
77 | 77 | ||
78 | |||
78 | <EditText | 79 | <EditText |
79 | android:id="@+id/etDireccionServidor" | 80 | android:id="@+id/etDireccionServidor" |
80 | android:layout_width="130dp" | 81 | android:layout_width="150dp" |
81 | android:layout_height="wrap_content" | 82 | android:layout_height="wrap_content" |
83 | android:layout_marginStart="44dp" | ||
82 | android:clickable="true" | 84 | android:clickable="true" |
83 | android:ems="10" | 85 | android:ems="10" |
84 | android:focusable="true" | 86 | android:focusable="true" |
85 | android:hint="192.168.100.100" | 87 | android:hint="192.168.100.100" |
86 | android:inputType="phone" | 88 | android:inputType="phone" |
89 | android:nextFocusDown="@id/etPuertoSubida" | ||
90 | android:nextFocusRight="@id/etPuertoSubida" | ||
91 | android:nextFocusLeft="@id/etPuertoSubida" | ||
87 | android:lines="1" | 92 | android:lines="1" |
88 | android:textSize="15sp" | 93 | android:textSize="15sp" |
89 | app:layout_constraintBaseline_toBaselineOf="@+id/tvDirServer" | 94 | app:layout_constraintBaseline_toBaselineOf="@+id/tvDirServer" |
90 | app:layout_constraintStart_toEndOf="@+id/tvDirServer" /> | 95 | app:layout_constraintStart_toEndOf="@+id/tvDirServer" /> |
91 | 96 | ||
97 | <EditText | ||
98 | android:id="@+id/etPuertoSubida" | ||
99 | android:layout_width="150dp" | ||
100 | android:layout_height="wrap_content" | ||
101 | android:layout_margin="10dp" | ||
102 | android:autofillHints="" | ||
103 | android:clickable="true" | ||
104 | android:ems="9" | ||
105 | android:focusable="true" | ||
106 | android:hint="Puerto de Subida" | ||
107 | android:inputType="number" | ||
108 | android:nextFocusDown="@id/etPuertoBajada" | ||
109 | android:nextFocusRight="@id/etPuertoBajada" | ||
110 | android:nextFocusLeft="@id/etPuertoBajada" | ||
111 | android:lines="1" | ||
112 | android:textSize="15sp" | ||
113 | app:layout_constraintStart_toStartOf="parent" | ||
114 | app:layout_constraintTop_toBottomOf="@+id/tvDirServer" /> | ||
92 | 115 | ||
93 | <EditText | 116 | <EditText |
94 | android:id="@+id/etPuerto" | 117 | android:id="@+id/etPuertoBajada" |
95 | android:layout_width="80dp" | 118 | android:layout_width="150dp" |
96 | android:layout_height="wrap_content" | 119 | android:layout_height="wrap_content" |
120 | android:layout_margin="10dp" | ||
121 | android:autofillHints="" | ||
97 | android:clickable="true" | 122 | android:clickable="true" |
98 | android:ems="10" | 123 | android:ems="10" |
99 | android:focusable="true" | 124 | android:focusable="true" |
100 | android:hint="Puerto" | 125 | android:hint="Puerto de Bajada" |
126 | android:nextFocusDown="@id/btnGuardarServidores" | ||
127 | android:nextFocusRight="@id/btnGuardarServidores" | ||
128 | android:nextFocusLeft="@id/btnGuardarServidores" | ||
101 | android:inputType="number" | 129 | android:inputType="number" |
102 | android:lines="1" | 130 | android:lines="1" |
103 | android:textSize="15sp" | 131 | android:textSize="15sp" |
104 | app:layout_constraintBaseline_toBaselineOf="@+id/etDireccionServidor" | 132 | app:layout_constraintBaseline_toBaselineOf="@+id/etPuertoSubida" |
105 | app:layout_constraintStart_toEndOf="@+id/etDireccionServidor" | 133 | app:layout_constraintEnd_toEndOf="parent" |
106 | android:autofillHints="" /> | 134 | app:layout_constraintStart_toEndOf="@+id/etPuertoSubida" /> |
107 | 135 | ||
108 | 136 | ||
109 | <androidx.recyclerview.widget.RecyclerView | 137 | <androidx.recyclerview.widget.RecyclerView |
110 | android:id="@+id/rvServidores" | 138 | android:id="@+id/rvServidores" |
111 | android:layout_width="match_parent" | 139 | android:layout_width="match_parent" |
112 | android:layout_height="0dp" | 140 | android:layout_height="0dp" |
113 | android:layout_marginTop="10dp" | 141 | android:layout_marginTop="10dp" |
114 | android:background="@android:color/darker_gray" | 142 | android:background="@android:color/darker_gray" |
115 | app:layout_constraintBottom_toTopOf="@+id/btnGuardarServidores" | 143 | app:layout_constraintBottom_toTopOf="@+id/btnGuardarServidores" |
116 | app:layout_constraintEnd_toEndOf="parent" | 144 | app:layout_constraintEnd_toEndOf="parent" |
117 | app:layout_constraintStart_toStartOf="parent" | 145 | app:layout_constraintStart_toStartOf="parent" |
118 | app:layout_constraintTop_toBottomOf="@+id/etPuerto" | 146 | app:layout_constraintTop_toBottomOf="@+id/etPuertoSubida" |
119 | app:layout_goneMarginEnd="10dp" | 147 | app:layout_goneMarginEnd="10dp" |
120 | tools:listitem="@layout/item_servidores" /> | 148 | tools:listitem="@layout/item_servidores" /> |
121 | 149 | ||
122 | <Button | 150 | <Button |
123 | android:id="@+id/btnGuardarServidores" | 151 | android:id="@+id/btnGuardarServidores" |
124 | android:layout_width="0dp" | 152 | android:layout_width="0dp" |
125 | android:layout_height="wrap_content" | 153 | android:layout_height="wrap_content" |
126 | android:layout_marginTop="10dp" | 154 | android:layout_marginTop="10dp" |
127 | android:layout_marginEnd="10dp" | 155 | android:layout_marginEnd="10dp" |
128 | android:background="@drawable/boton_borde_redondeado" | 156 | android:background="@drawable/boton_borde_redondeado" |
129 | android:padding="10dp" | 157 | android:padding="10dp" |
130 | android:text="@string/btnGuardarServidores" | 158 | android:text="@string/btnGuardarServidores" |
131 | android:textColor="@android:color/white" | 159 | android:textColor="@android:color/white" |
132 | app:layout_constraintBottom_toBottomOf="parent" | 160 | app:layout_constraintBottom_toBottomOf="parent" |
133 | app:layout_constraintEnd_toEndOf="parent" | 161 | app:layout_constraintEnd_toEndOf="parent" |
134 | app:layout_constraintStart_toStartOf="parent" | 162 | app:layout_constraintStart_toStartOf="parent" |
135 | app:layout_constraintTop_toBottomOf="@+id/rvServidores" /> | 163 | app:layout_constraintTop_toBottomOf="@+id/rvServidores" /> |
136 | 164 | ||
137 | </androidx.constraintlayout.widget.ConstraintLayout> | 165 | </androidx.constraintlayout.widget.ConstraintLayout> |
138 | 166 |
app/src/main/res/layout/item_inv_importados.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.constraintlayout.widget.ConstraintLayout | 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | android:layout_height="match_parent"> | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="wrap_content" | ||
7 | android:layout_margin="10dp" | ||
8 | app:cardCornerRadius="15dp" | ||
9 | app:cardElevation="10dp" | ||
10 | app:cardPreventCornerOverlap="false"> | ||
5 | 11 | ||
6 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
12 | <androidx.constraintlayout.widget.ConstraintLayout | ||
13 | android:layout_width="match_parent" | ||
14 | android:layout_height="wrap_content" | ||
15 | android:layout_gravity="center" | ||
16 | android:orientation="horizontal"> | ||
17 | |||
18 | <com.google.android.material.checkbox.MaterialCheckBox | ||
19 | android:id="@+id/tvPrincipalinventario" | ||
20 | android:layout_width="match_parent" | ||
21 | android:layout_height="wrap_content" | ||
22 | android:layout_margin="15dp" | ||
23 | android:background="@drawable/boton_redondo2" | ||
24 | android:gravity="center_vertical" | ||
25 | android:padding="5dp" | ||
26 | android:textColor="@android:color/black" | ||
27 | android:textSize="@dimen/TitulosActMa" | ||
28 | android:textStyle="bold" | ||
29 | app:layout_constraintBottom_toBottomOf="parent" | ||
30 | app:layout_constraintStart_toStartOf="parent" | ||
31 | app:layout_constraintTop_toTopOf="parent" | ||
32 | tools:text="Inventario Sectorizado # 1487" /> | ||
33 | |||
34 | |||
35 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
36 | </androidx.cardview.widget.CardView> |
app/src/main/res/layout/item_principal.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:layout_width="match_parent" | 5 | android:layout_width="match_parent" |
6 | android:layout_height="wrap_content" | 6 | android:layout_height="wrap_content" |
7 | android:layout_margin="5dp" | 7 | android:layout_margin="5dp" |
8 | app:cardCornerRadius="15dp" | 8 | app:cardCornerRadius="15dp" |
9 | app:cardElevation="10dp" | 9 | app:cardElevation="10dp" |
10 | app:cardPreventCornerOverlap="false"> | 10 | app:cardPreventCornerOverlap="false"> |
11 | 11 | ||
12 | <androidx.constraintlayout.widget.ConstraintLayout | 12 | <androidx.constraintlayout.widget.ConstraintLayout |
13 | android:layout_width="match_parent" | 13 | android:layout_width="match_parent" |
14 | android:layout_height="wrap_content" | 14 | android:layout_height="wrap_content" |
15 | android:layout_gravity="center_horizontal|center_vertical" | 15 | android:layout_gravity="center_horizontal|center_vertical" |
16 | android:orientation="vertical"> | 16 | android:orientation="vertical"> |
17 | 17 | ||
18 | <TextView | 18 | <TextView |
19 | android:id="@+id/tvPrincipalinventario" | 19 | android:id="@+id/tvPrincipalinventario" |
20 | android:layout_width="50dp" | 20 | android:layout_width="50dp" |
21 | android:layout_height="50dp" | 21 | android:layout_height="50dp" |
22 | android:layout_margin="10dp" | 22 | android:layout_margin="10dp" |
23 | android:background="@drawable/boton_redondo2" | 23 | android:background="@drawable/boton_redondo2" |
24 | android:gravity="center" | 24 | android:gravity="center" |
25 | android:lines="2" | 25 | android:lines="2" |
26 | android:textColor="@android:color/black" | 26 | android:textColor="@android:color/black" |
27 | android:textSize="@dimen/TitulosMedios" | 27 | android:textSize="@dimen/TitulosMedios" |
28 | android:textStyle="bold" | 28 | android:textStyle="bold" |
29 | app:layout_constraintBottom_toTopOf="@+id/ivFondo" | 29 | app:layout_constraintBottom_toTopOf="@+id/ivFondo" |
30 | app:layout_constraintStart_toStartOf="parent" | 30 | app:layout_constraintStart_toStartOf="parent" |
31 | app:layout_constraintTop_toTopOf="parent" | 31 | app:layout_constraintTop_toTopOf="parent" |
32 | tools:text="99" /> | 32 | tools:text="99" /> |
33 | 33 | ||
34 | <TextView | 34 | <TextView |
35 | android:id="@+id/textView6" | 35 | android:id="@+id/textView6" |
36 | android:layout_width="wrap_content" | 36 | android:layout_width="wrap_content" |
37 | android:layout_height="wrap_content" | 37 | android:layout_height="wrap_content" |
38 | android:layout_marginTop="5dp" | 38 | android:layout_marginTop="5dp" |
39 | android:text="Fecha Inicio" | 39 | android:text="Fecha Inicio" |
40 | android:textSize="15sp" | 40 | android:textSize="15sp" |
41 | android:textStyle="bold" | 41 | android:textStyle="bold" |
42 | app:layout_constraintEnd_toEndOf="parent" | 42 | app:layout_constraintEnd_toEndOf="parent" |
43 | app:layout_constraintHorizontal_bias="0.217" | 43 | app:layout_constraintHorizontal_bias="0.217" |
44 | app:layout_constraintStart_toEndOf="@id/tvPrincipalinventario" | 44 | app:layout_constraintStart_toEndOf="@id/tvPrincipalinventario" |
45 | app:layout_constraintTop_toTopOf="parent" /> | 45 | app:layout_constraintTop_toTopOf="parent" /> |
46 | 46 | ||
47 | <TextView | 47 | <TextView |
48 | android:id="@+id/tvFecha" | 48 | android:id="@+id/tvFecha" |
49 | android:layout_width="wrap_content" | 49 | android:layout_width="wrap_content" |
50 | android:layout_height="wrap_content" | 50 | android:layout_height="wrap_content" |
51 | android:layout_marginStart="5dp" | 51 | android:layout_marginStart="5dp" |
52 | android:text="01/01/2020 12:20:20" | 52 | android:text="01/01/2020 12:20:20" |
53 | android:textSize="15sp" | 53 | android:textSize="15sp" |
54 | android:textStyle="bold" | 54 | android:textStyle="bold" |
55 | app:layout_constraintBaseline_toBaselineOf="@+id/textView6" | 55 | app:layout_constraintBaseline_toBaselineOf="@+id/textView6" |
56 | app:layout_constraintEnd_toEndOf="parent" | 56 | app:layout_constraintEnd_toEndOf="parent" |
57 | app:layout_constraintHorizontal_bias="0.0" | 57 | app:layout_constraintHorizontal_bias="0.0" |
58 | app:layout_constraintStart_toEndOf="@id/textView6" /> | 58 | app:layout_constraintStart_toEndOf="@id/textView6" /> |
59 | 59 | ||
60 | <TextView | 60 | <TextView |
61 | android:id="@+id/textView7" | 61 | android:id="@+id/textView7" |
62 | android:layout_width="wrap_content" | 62 | android:layout_width="wrap_content" |
63 | android:layout_height="wrap_content" | 63 | android:layout_height="wrap_content" |
64 | android:layout_marginTop="4dp" | 64 | android:layout_marginTop="4dp" |
65 | android:text="Art. Contados" | 65 | android:text="Cantidad Art." |
66 | android:textSize="15sp" | 66 | android:textSize="15sp" |
67 | android:textStyle="bold" | 67 | android:textStyle="bold" |
68 | app:layout_constraintEnd_toEndOf="parent" | 68 | app:layout_constraintEnd_toEndOf="parent" |
69 | app:layout_constraintHorizontal_bias="0.23" | 69 | app:layout_constraintHorizontal_bias="0.23" |
70 | app:layout_constraintStart_toEndOf="@+id/tvPrincipalinventario" | 70 | app:layout_constraintStart_toEndOf="@+id/tvPrincipalinventario" |
71 | app:layout_constraintTop_toBottomOf="@id/textView6" /> | 71 | app:layout_constraintTop_toBottomOf="@id/textView6" /> |
72 | 72 | ||
73 | <TextView | 73 | <TextView |
74 | android:id="@+id/tvCantContada" | 74 | android:id="@+id/tvCantContada" |
75 | android:layout_width="wrap_content" | 75 | android:layout_width="wrap_content" |
76 | android:layout_height="wrap_content" | 76 | android:layout_height="wrap_content" |
77 | android:layout_marginTop="4dp" | 77 | android:layout_marginTop="4dp" |
78 | android:layout_marginStart="5dp" | 78 | android:layout_marginStart="5dp" |
79 | android:text="002" | 79 | android:text="002" |
80 | android:textSize="15sp" | 80 | android:textSize="15sp" |
81 | android:textStyle="bold" | 81 | android:textStyle="bold" |
82 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" | 82 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" |
83 | app:layout_constraintStart_toEndOf="@+id/textView7" | 83 | app:layout_constraintStart_toEndOf="@+id/textView7" |
84 | app:layout_constraintTop_toBottomOf="@+id/tvFecha" /> | 84 | app:layout_constraintTop_toBottomOf="@+id/tvFecha" /> |
85 | 85 | ||
86 | <TextView | 86 | <TextView |
87 | android:id="@+id/tvDescription" | 87 | android:id="@+id/tvDescription" |
88 | android:layout_width="wrap_content" | 88 | android:layout_width="wrap_content" |
89 | android:layout_height="wrap_content" | 89 | android:layout_height="wrap_content" |
90 | android:text="prueba" | 90 | android:text="prueba" |
91 | app:layout_constraintBottom_toTopOf="@id/ivFondo" | 91 | app:layout_constraintBottom_toTopOf="@id/ivFondo" |
92 | app:layout_constraintEnd_toEndOf="parent" | 92 | app:layout_constraintEnd_toEndOf="parent" |
93 | app:layout_constraintHorizontal_bias="0.489" | 93 | app:layout_constraintHorizontal_bias="0.489" |
94 | app:layout_constraintStart_toEndOf="@id/tvPrincipalinventario" | 94 | app:layout_constraintStart_toEndOf="@id/tvPrincipalinventario" |
95 | app:layout_constraintTop_toBottomOf="@+id/tvFecha" | 95 | app:layout_constraintTop_toBottomOf="@+id/tvFecha" |
96 | app:layout_constraintVertical_bias="1.0" /> | 96 | app:layout_constraintVertical_bias="1.0" /> |
97 | 97 | ||
98 | 98 | ||
99 | <androidx.appcompat.widget.AppCompatImageView | 99 | <androidx.appcompat.widget.AppCompatImageView |
100 | android:id="@+id/ivFondo" | 100 | android:id="@+id/ivFondo" |
101 | android:layout_width="0dp" | 101 | android:layout_width="0dp" |
102 | android:layout_height="10dp" | 102 | android:layout_height="10dp" |
103 | android:background="@android:drawable/progress_horizontal" | 103 | android:background="@android:drawable/progress_horizontal" |
104 | android:elevation="10dp" | 104 | android:elevation="10dp" |
105 | app:layout_constraintBottom_toBottomOf="parent" | 105 | app:layout_constraintBottom_toBottomOf="parent" |
106 | app:layout_constraintCircleRadius="5dp" | 106 | app:layout_constraintCircleRadius="5dp" |
107 | app:layout_constraintEnd_toEndOf="parent" | 107 | app:layout_constraintEnd_toEndOf="parent" |
108 | app:layout_constraintStart_toStartOf="parent" | 108 | app:layout_constraintStart_toStartOf="parent" |
109 | tools:srcCompat="@android:drawable/progress_horizontal" /> | 109 | tools:srcCompat="@android:drawable/progress_horizontal" /> |
110 | </androidx.constraintlayout.widget.ConstraintLayout> | 110 | </androidx.constraintlayout.widget.ConstraintLayout> |
111 | </androidx.cardview.widget.CardView> | 111 | </androidx.cardview.widget.CardView> |
112 | 112 |
app/src/main/res/layout/item_sec.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | ||
6 | android:layout_height="wrap_content" | ||
7 | android:layout_margin="5dp" | ||
8 | app:cardCornerRadius="15dp" | ||
9 | app:cardElevation="10dp" | ||
10 | app:contentPadding="5dp" | ||
11 | app:cardPreventCornerOverlap="false"> | ||
12 | |||
13 | <androidx.constraintlayout.widget.ConstraintLayout | ||
14 | android:layout_width="match_parent" | ||
15 | android:layout_height="wrap_content"> | ||
16 | |||
17 | <TextView | ||
18 | android:id="@+id/tvDescripcion" | ||
19 | android:layout_width="0dp" | ||
20 | android:layout_height="wrap_content" | ||
21 | android:layout_marginStart="3dp" | ||
22 | android:maxLines="2" | ||
23 | android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz" | ||
24 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
25 | android:textSize="16sp" | ||
26 | android:textStyle="bold" | ||
27 | app:layout_constraintStart_toStartOf="parent" | ||
28 | app:layout_constraintTop_toTopOf="parent" /> | ||
29 | |||
30 | <!-- <TextView--> | ||
31 | <!-- android:id="@+id/textView2"--> | ||
32 | <!-- android:layout_width="wrap_content"--> | ||
33 | <!-- android:layout_height="wrap_content"--> | ||
34 | <!-- android:layout_marginStart="5dp"--> | ||
35 | <!-- android:text="Código:"--> | ||
36 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"--> | ||
37 | <!-- android:textSize="14sp"--> | ||
38 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvSector"--> | ||
39 | <!-- app:layout_constraintHorizontal_bias="0.01"--> | ||
40 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
41 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
42 | <!-- app:layout_constraintTop_toTopOf="parent" />--> | ||
43 | |||
44 | |||
45 | <!-- <TextView--> | ||
46 | <!-- android:id="@+id/tvSector"--> | ||
47 | <!-- android:layout_width="wrap_content"--> | ||
48 | <!-- android:layout_height="match_parent"--> | ||
49 | <!-- android:layout_marginStart="8dp"--> | ||
50 | <!-- android:text="9999"--> | ||
51 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
52 | <!-- android:textColorHint="@android:color/black"--> | ||
53 | <!-- android:textSize="18sp"--> | ||
54 | <!-- android:textStyle="bold"--> | ||
55 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
56 | <!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView2"--> | ||
57 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvCodigo"--> | ||
58 | <!-- app:layout_constraintStart_toEndOf="@+id/textView2" />--> | ||
59 | |||
60 | |||
61 | <!-- <TextView--> | ||
62 | <!-- android:id="@+id/tvCodigo"--> | ||
63 | <!-- android:layout_width="wrap_content"--> | ||
64 | <!-- android:layout_height="match_parent"--> | ||
65 | <!-- android:text="99999999"--> | ||
66 | <!-- android:layout_marginStart="8dp"--> | ||
67 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
68 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
69 | <!-- android:textColorHint="@android:color/black"--> | ||
70 | <!-- android:textSize="18sp"--> | ||
71 | <!-- android:textStyle="bold"--> | ||
72 | <!-- app:layout_constraintBaseline_toBaselineOf="@+id/tvSector"--> | ||
73 | <!-- app:layout_constraintEnd_toStartOf="@+id/textView5"--> | ||
74 | <!-- app:layout_constraintStart_toEndOf="@+id/tvSector" />--> | ||
75 | |||
76 | <TextView | ||
77 | android:id="@+id/textView5" | ||
78 | android:layout_width="wrap_content" | ||
79 | android:layout_height="wrap_content" | ||
80 | android:text="Cantidad:" | ||
81 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | ||
82 | android:textSize="14sp" | ||
83 | android:layout_marginStart="5dp" | ||
84 | android:layout_marginTop="5dp" | ||
85 | app:layout_constraintStart_toStartOf="parent" | ||
86 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
87 | |||
88 | <TextView | ||
89 | android:id="@+id/tvCantidad" | ||
90 | android:layout_width="wrap_content" | ||
91 | android:layout_height="match_parent" | ||
92 | android:layout_marginTop="5dp" | ||
93 | android:text="12345.12" | ||
94 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
95 | android:textSize="18sp" | ||
96 | android:textStyle="bold" | ||
97 | app:layout_constraintBaseline_toBaselineOf="@+id/textView5" | ||
98 | |||
99 | app:layout_constraintStart_toEndOf="@id/textView5" /> | ||
100 | |||
101 | <ImageView | ||
102 | android:id="@+id/ivPen" | ||
103 | android:layout_width="30dp" | ||
104 | android:layout_height="30dp" | ||
105 | android:layout_marginStart="3dp" | ||
106 | android:src="@drawable/pen" | ||
107 | android:visibility="visible" | ||
108 | app:layout_constraintStart_toEndOf="@+id/tvCantidad" | ||
109 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
110 | |||
111 | <ImageView | ||
112 | android:id="@+id/ivDots" | ||
113 | android:layout_width="30dp" | ||
114 | android:layout_height="30dp" | ||
115 | android:layout_marginEnd="3dp" | ||
116 | android:src="@drawable/more" | ||
117 | android:visibility="visible" | ||
118 | app:layout_constraintEnd_toEndOf="parent" | ||
119 | app:layout_constraintTop_toBottomOf="@+id/tvDescripcion" /> | ||
120 | |||
121 | <!-- <TextView--> | ||
122 | <!-- android:id="@+id/textView85"--> | ||
123 | <!-- android:layout_width="wrap_content"--> | ||
124 | <!-- android:layout_height="wrap_content"--> | ||
125 | <!-- android:layout_marginStart="5dp"--> | ||
126 | <!-- android:layout_marginTop="8dp"--> | ||
127 | <!-- android:text="Desc:"--> | ||
128 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"--> | ||
129 | <!-- android:textSize="14sp"--> | ||
130 | <!-- app:layout_constraintEnd_toStartOf="@+id/tvDescripcion"--> | ||
131 | <!-- app:layout_constraintHorizontal_bias="0.0"--> | ||
132 | <!-- app:layout_constraintHorizontal_chainStyle="packed"--> | ||
133 | <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
134 | <!-- app:layout_constraintTop_toBottomOf="@id/tvCodigo" />--> | ||
135 | |||
136 | |||
137 | <!-- <TextView--> | ||
138 | <!-- android:id="@+id/tvCodigoBarras"--> | ||
139 | <!-- android:layout_width="match_parent"--> | ||
140 | <!-- android:layout_height="wrap_content"--> | ||
141 | <!-- android:layout_marginStart="3dp"--> | ||
142 | <!-- android:layout_marginTop="8dp"--> | ||
143 | <!-- android:maxLines="2"--> | ||
144 | <!-- android:text=""--> | ||
145 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
146 | <!-- android:textSize="14sp"--> | ||
147 | <!-- android:visibility="gone"--> | ||
148 | <!-- android:textStyle="bold"--> | ||
149 | <!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView85"--> | ||
150 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
151 | <!-- app:layout_constraintStart_toEndOf="@+id/textView85"--> | ||
152 | <!-- app:layout_constraintTop_toBottomOf="@+id/tvCodigo" />--> | ||
153 | <!-- <TextView--> | ||
154 | <!-- android:id="@+id/tvCodigoOrigen"--> | ||
155 | <!-- android:layout_width="match_parent"--> | ||
156 | <!-- android:layout_height="wrap_content"--> | ||
157 | <!-- android:layout_marginStart="3dp"--> | ||
158 | <!-- android:layout_marginTop="8dp"--> | ||
159 | <!-- android:maxLines="2"--> | ||
160 | <!-- android:text=""--> | ||
161 | <!-- android:textAppearance="@style/TextAppearance.AppCompat.Large"--> | ||
162 | <!-- android:textSize="14sp"--> | ||
163 | <!-- android:visibility="gone"--> | ||
164 | <!-- android:textStyle="bold"--> | ||
165 | <!-- app:layout_constraintBaseline_toBaselineOf="@+id/textView85"--> | ||
166 | <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
167 | <!-- app:layout_constraintStart_toEndOf="@+id/textView85"--> | ||
168 | <!-- app:layout_constraintTop_toBottomOf="@+id/tvCodigo" />--> | ||
169 | </androidx.constraintlayout.widget.ConstraintLayout> | ||
170 | |||
171 | </androidx.cardview.widget.CardView> |
app/src/main/res/layout/item_servidores.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | ||
5 | android:layout_width="match_parent" | 4 | android:layout_width="match_parent" |
6 | android:layout_height="wrap_content" | 5 | android:layout_height="wrap_content" |
7 | android:layout_margin="5dp" | 6 | android:layout_margin="5dp" |
8 | app:cardCornerRadius="15dp" | 7 | app:cardCornerRadius="15dp" |
9 | app:cardElevation="10dp" | 8 | app:cardElevation="10dp" |
10 | app:contentPadding="5dp" | 9 | app:cardPreventCornerOverlap="false" |
11 | app:cardPreventCornerOverlap="false"> | 10 | app:contentPadding="5dp"> |
12 | 11 | ||
13 | <androidx.constraintlayout.widget.ConstraintLayout | 12 | <androidx.constraintlayout.widget.ConstraintLayout |
14 | android:layout_width="match_parent" | 13 | android:layout_width="match_parent" |
15 | android:layout_height="wrap_content"> | 14 | android:layout_height="wrap_content"> |
16 | 15 | ||
17 | <TextView | 16 | <TextView |
18 | android:id="@+id/textView2" | 17 | android:id="@+id/textView2" |
19 | android:layout_width="wrap_content" | 18 | android:layout_width="wrap_content" |
20 | android:layout_height="wrap_content" | 19 | android:layout_height="wrap_content" |
21 | android:layout_marginStart="5dp" | 20 | android:layout_marginStart="5dp" |
22 | android:text="Descripción:" | 21 | android:text="Descripción:" |
23 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 22 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
24 | android:textSize="14sp" | 23 | android:textSize="14sp" |
25 | app:layout_constraintEnd_toStartOf="@+id/tvCodigo" | 24 | app:layout_constraintEnd_toStartOf="@+id/tvCodigo" |
26 | app:layout_constraintHorizontal_bias="0.01" | 25 | app:layout_constraintHorizontal_bias="0.01" |
27 | app:layout_constraintHorizontal_chainStyle="packed" | 26 | app:layout_constraintHorizontal_chainStyle="packed" |
28 | app:layout_constraintStart_toStartOf="parent" | 27 | app:layout_constraintStart_toStartOf="parent" |
29 | app:layout_constraintTop_toTopOf="parent" /> | 28 | app:layout_constraintTop_toTopOf="parent" /> |
30 | 29 | ||
31 | <TextView | 30 | <TextView |
32 | android:id="@+id/tvDescServidor" | 31 | android:id="@+id/tvDescServidor" |
33 | android:layout_width="0dp" | 32 | android:layout_width="0dp" |
34 | android:layout_height="match_parent" | 33 | android:layout_height="match_parent" |
35 | android:layout_marginStart="8dp" | 34 | android:layout_marginStart="8dp" |
36 | android:text="Laboratorio Foca 1" | 35 | android:text="Laboratorio Foca 1" |
37 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 36 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
38 | android:textColorHint="@android:color/black" | 37 | android:textColorHint="@android:color/black" |
39 | android:textSize="14sp" | 38 | android:textSize="14sp" |
40 | android:textStyle="bold" | 39 | android:textStyle="bold" |
41 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" | 40 | app:layout_constraintBaseline_toBaselineOf="@+id/textView2" |
42 | app:layout_constraintEnd_toEndOf="parent" | 41 | app:layout_constraintEnd_toEndOf="parent" |
43 | app:layout_constraintStart_toEndOf="@+id/textView2" /> | 42 | app:layout_constraintStart_toEndOf="@+id/textView2" /> |
44 | 43 | ||
45 | <TextView | 44 | <TextView |
46 | android:id="@+id/textView85" | 45 | android:id="@+id/textView85" |
47 | android:layout_width="wrap_content" | 46 | android:layout_width="wrap_content" |
48 | android:layout_height="wrap_content" | 47 | android:layout_height="wrap_content" |
49 | android:layout_marginStart="5dp" | 48 | android:layout_marginStart="5dp" |
50 | android:layout_marginTop="8dp" | 49 | android:layout_marginTop="3dp" |
51 | android:text="Dirección:" | 50 | android:text="Dirección:" |
52 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 51 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
53 | android:textSize="14sp" | 52 | android:textSize="14sp" |
54 | app:layout_constraintStart_toStartOf="parent" | 53 | app:layout_constraintStart_toStartOf="parent" |
55 | app:layout_constraintTop_toBottomOf="@id/tvDescServidor" /> | 54 | app:layout_constraintTop_toBottomOf="@id/tvDescServidor" /> |
56 | 55 | ||
57 | <TextView | 56 | <TextView |
58 | android:id="@+id/tvDireccionServidor" | 57 | android:id="@+id/tvDireccionServidor" |
59 | android:layout_width="wrap_content" | 58 | android:layout_width="wrap_content" |
60 | android:layout_height="wrap_content" | 59 | android:layout_height="wrap_content" |
61 | android:layout_marginStart="5dp" | 60 | android:layout_marginStart="5dp" |
62 | android:text="http://192.168.0.205" | 61 | android:text="http://192.168.0.205" |
63 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 62 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
64 | android:textColorHint="@android:color/black" | 63 | android:textColorHint="@android:color/black" |
65 | android:textSize="14sp" | 64 | android:textSize="14sp" |
66 | android:textStyle="bold" | 65 | android:textStyle="bold" |
67 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" | 66 | app:layout_constraintBaseline_toBaselineOf="@+id/textView85" |
68 | app:layout_constraintStart_toEndOf="@+id/textView85" /> | 67 | app:layout_constraintStart_toEndOf="@+id/textView85" /> |
69 | 68 | ||
70 | <TextView | 69 | <TextView |
71 | android:id="@+id/textView86" | 70 | android:id="@+id/textView86" |
72 | android:layout_width="wrap_content" | 71 | android:layout_width="wrap_content" |
73 | android:layout_height="wrap_content" | 72 | android:layout_height="wrap_content" |
74 | android:layout_marginTop="8dp" | 73 | android:layout_marginStart="5dp" |
75 | android:layout_marginStart="10dp" | 74 | android:layout_marginTop="3dp" |
76 | android:text="Puerto:" | 75 | android:text="Puerto Subida:" |
77 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | 76 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" |
78 | android:textSize="14sp" | 77 | android:textSize="14sp" |
79 | app:layout_constraintHorizontal_chainStyle="packed" | 78 | app:layout_constraintHorizontal_chainStyle="packed" |
80 | app:layout_constraintStart_toEndOf="@+id/tvDireccionServidor" | 79 | app:layout_constraintStart_toStartOf="parent" |
81 | app:layout_constraintTop_toBottomOf="@id/tvDescServidor" /> | 80 | app:layout_constraintTop_toBottomOf="@+id/textView85" /> |
81 | |||
82 | <TextView | ||
83 | android:id="@+id/tvPuertoSubida" | ||
84 | android:layout_width="wrap_content" | ||
85 | android:layout_height="wrap_content" | ||
86 | android:text="9999" | ||
87 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | ||
88 | android:textColorHint="@android:color/black" | ||
89 | android:textSize="14sp" | ||
90 | android:textStyle="bold" | ||
91 | app:layout_constraintBaseline_toBaselineOf="@+id/textView86" | ||
92 | app:layout_constraintStart_toEndOf="@+id/textView86" /> | ||
82 | 93 | ||
83 | <TextView | 94 | <TextView |
84 | android:id="@+id/tvPuertoServidor" | 95 | android:id="@+id/textView87" |
85 | android:layout_width="wrap_content" | 96 | android:layout_width="wrap_content" |
86 | android:layout_height="wrap_content" | 97 | android:layout_height="wrap_content" |
87 | android:layout_marginTop="8dp" | 98 | android:layout_marginTop="3dp" |
88 | android:layout_marginStart="5dp" | 99 | android:layout_marginStart="5dp" |
89 | android:text="" | 100 | android:text="Puerto Bajada:" |
101 | android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large" | ||
102 | android:textSize="14sp" | ||
103 | app:layout_constraintHorizontal_chainStyle="packed" | ||
104 | app:layout_constraintStart_toEndOf="@+id/tvPuertoSubida" | ||
105 | app:layout_constraintTop_toBottomOf="@+id/textView85" /> | ||
106 | |||
107 | <TextView | ||
108 | android:id="@+id/tvPuertoBajada" | ||
109 | android:layout_width="wrap_content" | ||
110 | android:layout_height="wrap_content" | ||
111 | android:text="9999" | ||
90 | android:textAppearance="@style/TextAppearance.AppCompat.Large" | 112 | android:textAppearance="@style/TextAppearance.AppCompat.Large" |
91 | android:textColorHint="@android:color/black" | 113 | android:textColorHint="@android:color/black" |
92 | android:textSize="14sp" | 114 | android:textSize="14sp" |
93 | android:textStyle="bold" | 115 | android:textStyle="bold" |
94 | app:layout_constraintStart_toEndOf="@+id/textView86" | 116 | app:layout_constraintBaseline_toBaselineOf="@+id/textView87" |
95 | app:layout_constraintTop_toBottomOf="@+id/tvDescServidor" /> | 117 | app:layout_constraintStart_toEndOf="@+id/textView87" /> |
96 | </androidx.constraintlayout.widget.ConstraintLayout> | 118 | </androidx.constraintlayout.widget.ConstraintLayout> |
97 | 119 |
app/src/main/res/layout/solicitar_fecha.xml
File was created | 1 | <?xml version="1.0" encoding="utf-8"?> | |
2 | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | android:layout_width="match_parent" | ||
5 | android:layout_height="wrap_content" | ||
6 | android:focusable="false" | ||
7 | android:focusableInTouchMode="false" | ||
8 | android:orientation="vertical" | ||
9 | android:padding="10dp"> | ||
10 | |||
11 | <LinearLayout | ||
12 | android:id="@+id/barraSuperior" | ||
13 | android:layout_width="0dp" | ||
14 | android:layout_height="wrap_content" | ||
15 | android:background="@color/colorPrimaryDark" | ||
16 | android:focusable="false" | ||
17 | android:focusableInTouchMode="false" | ||
18 | android:orientation="horizontal" | ||
19 | app:layout_constraintEnd_toEndOf="parent" | ||
20 | app:layout_constraintStart_toStartOf="parent" | ||
21 | app:layout_constraintTop_toTopOf="parent"> | ||
22 | |||
23 | <androidx.appcompat.widget.AppCompatImageView | ||
24 | android:layout_width="50dp" | ||
25 | android:layout_height="60dp" | ||
26 | android:layout_marginStart="25dp" | ||
27 | android:focusable="false" | ||
28 | android:focusableInTouchMode="false" | ||
29 | android:src="@drawable/error" /> | ||
30 | |||
31 | <androidx.appcompat.widget.AppCompatTextView | ||
32 | android:id="@+id/tvFechayHora" | ||
33 | android:layout_width="0dp" | ||
34 | android:layout_height="wrap_content" | ||
35 | android:layout_marginTop="15dp" | ||
36 | android:layout_weight="1" | ||
37 | android:background="@drawable/boton_borde_redondeado" | ||
38 | android:focusable="false" | ||
39 | android:focusableInTouchMode="false" | ||
40 | android:text="@string/tvFechayHora" | ||
41 | android:textAlignment="center" | ||
42 | android:textColor="@android:color/white" | ||
43 | android:textSize="25sp" /> | ||
44 | </LinearLayout> | ||
45 | |||
46 | <TextView | ||
47 | android:id="@+id/textView6" | ||
48 | android:layout_width="wrap_content" | ||
49 | android:layout_height="wrap_content" | ||
50 | android:layout_margin="5dp" | ||
51 | android:focusable="false" | ||
52 | android:focusableInTouchMode="false" | ||
53 | android:gravity="center" | ||
54 | android:text="La fecha y hora del Servidor no coinciden con la fecha y hora del dispositivo." | ||
55 | android:textColor="@android:color/holo_red_dark" | ||
56 | android:textSize="20sp" | ||
57 | android:textStyle="bold" | ||
58 | app:layout_constraintEnd_toEndOf="parent" | ||
59 | app:layout_constraintHorizontal_bias="0.0" | ||
60 | app:layout_constraintHorizontal_chainStyle="packed" | ||
61 | app:layout_constraintStart_toStartOf="parent" | ||
62 | app:layout_constraintTop_toBottomOf="@id/barraSuperior" /> | ||
63 | |||
64 | <TextView | ||
65 | android:id="@+id/textView7" | ||
66 | android:layout_width="wrap_content" | ||
67 | android:layout_height="wrap_content" | ||
68 | android:layout_margin="5dp" | ||
69 | android:focusable="false" | ||
70 | android:focusableInTouchMode="false" | ||
71 | android:text="Servidor:" | ||
72 | android:textSize="20sp" | ||
73 | app:layout_constraintHorizontal_chainStyle="packed" | ||
74 | app:layout_constraintStart_toStartOf="parent" | ||
75 | app:layout_constraintTop_toBottomOf="@+id/textView6" /> | ||
76 | |||
77 | <TextView | ||
78 | android:id="@+id/tvHoraServidor" | ||
79 | android:layout_width="wrap_content" | ||
80 | android:layout_height="wrap_content" | ||
81 | android:layout_margin="5dp" | ||
82 | android:focusable="false" | ||
83 | android:focusableInTouchMode="false" | ||
84 | android:text="99/99/9999 99:99:99" | ||
85 | android:textSize="20sp" | ||
86 | app:layout_constraintBaseline_toBaselineOf="@+id/textView7" | ||
87 | app:layout_constraintStart_toEndOf="@+id/textView7" /> | ||
88 | |||
89 | |||
90 | <TextView | ||
91 | android:id="@+id/textView8" | ||
92 | android:layout_width="wrap_content" | ||
93 | android:layout_height="wrap_content" | ||
94 | android:layout_margin="5dp" | ||
95 | android:focusable="false" | ||
96 | android:focusableInTouchMode="false" | ||
97 | android:text="Dispositivo:" | ||
98 | android:textSize="20sp" | ||
99 | app:layout_constraintStart_toStartOf="parent" | ||
100 | app:layout_constraintTop_toBottomOf="@+id/textView7" /> | ||
101 | |||
102 | <TextView | ||
103 | android:id="@+id/tvHoraDispositivo" | ||
104 | android:layout_width="wrap_content" | ||
105 | android:layout_height="wrap_content" | ||
106 | android:layout_margin="5dp" | ||
107 | android:focusable="false" | ||
108 | android:focusableInTouchMode="false" | ||
109 | android:text="99/99/9999 99:99:99" | ||
110 | android:textSize="20sp" | ||
111 | app:layout_constraintBaseline_toBaselineOf="@+id/textView8" | ||
112 | app:layout_constraintStart_toEndOf="@+id/textView8" /> | ||
113 | |||
114 | <Button | ||
115 | android:id="@+id/btnCambiarHora" | ||
116 | style="@style/Base.Widget.AppCompat.Button.Colored" | ||
117 | android:layout_width="0dp" | ||
118 | android:layout_height="wrap_content" | ||
119 | android:layout_margin="15dp" | ||
120 | android:background="@drawable/boton_borde_redondeado" | ||
121 | android:focusable="false" | ||
122 | android:focusableInTouchMode="false" | ||
123 | android:padding="20dp" | ||
124 | android:text="@string/btnCambiarHora" | ||
125 | android:textColor="@android:color/white" | ||
126 | app:layout_constraintEnd_toEndOf="parent" | ||
127 | app:layout_constraintStart_toStartOf="parent" | ||
128 | app:layout_constraintTop_toBottomOf="@+id/tvHoraDispositivo" /> | ||
129 | |||
130 | |||
131 | <Button | ||
132 | android:id="@+id/btnSalir" | ||
133 | style="@style/Base.Widget.AppCompat.Button.Colored" | ||
134 | android:layout_width="140dp" | ||
135 | android:layout_height="wrap_content" | ||
136 | android:layout_margin="5dp" | ||
137 | android:background="@drawable/boton_borde_redondeado" | ||
138 | android:focusable="false" | ||
139 | android:focusableInTouchMode="false" | ||
140 | android:padding="20dp" | ||
141 | android:text="@string/btnSalir" | ||
142 | android:textColor="@android:color/white" | ||
143 | app:layout_constraintEnd_toEndOf="parent" | ||
144 | app:layout_constraintStart_toStartOf="parent" | ||
145 | app:layout_constraintTop_toBottomOf="@+id/btnCambiarHora" /> | ||
146 | |||
147 | |||
148 | </androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/navigation/mobile_navigation.xml
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <navigation xmlns:android="http://schemas.android.com/apk/res/android" | 2 | <navigation xmlns:android="http://schemas.android.com/apk/res/android" |
3 | xmlns:app="http://schemas.android.com/apk/res-auto" | 3 | xmlns:app="http://schemas.android.com/apk/res-auto" |
4 | xmlns:tools="http://schemas.android.com/tools" | 4 | xmlns:tools="http://schemas.android.com/tools" |
5 | android:id="@+id/mobile_navigation" | 5 | android:id="@+id/mobile_navigation" |
6 | app:startDestination="@id/mainFragment2"> | 6 | app:startDestination="@id/mainFragment2"> |
7 | 7 | ||
8 | <activity | 8 | <activity |
9 | android:id="@+id/mainActivity" | 9 | android:id="@+id/mainActivity" |
10 | android:name="com.focasoftware.deboinventariov20.UI.MainActivity" | 10 | android:name="com.focasoftware.deboinventariov20.UI.MainActivity" |
11 | android:label="app_bar_main" | 11 | android:label="app_bar_main" |
12 | tools:layout="@layout/app_bar_main" /> | 12 | tools:layout="@layout/app_bar_main" /> |
13 | 13 | ||
14 | <fragment | 14 | <fragment |
15 | android:id="@+id/mainFragment2" | 15 | android:id="@+id/mainFragment2" |
16 | android:name="com.focasoftware.deboinventariov20.UI.main.MainFragment" | 16 | android:name="com.focasoftware.deboinventariov20.UI.main.MainFragment" |
17 | android:label="Principal" | 17 | android:label="Principal" |
18 | tools:layout="@layout/fragment_main" > | 18 | tools:layout="@layout/fragment_main"> |
19 | <action | 19 | <action |
20 | android:id="@+id/action_mainFragment2_to_configuracionFragment" | 20 | android:id="@+id/action_mainFragment2_to_configuracionFragment" |
21 | app:destination="@id/configuracionFragment" | 21 | app:destination="@id/configuracionFragment" |
22 | app:popEnterAnim="@anim/slide_in_left" | ||
23 | app:popExitAnim="@anim/slide_out_right" | ||
24 | app:enterAnim="@anim/slide_in_right" | 22 | app:enterAnim="@anim/slide_in_right" |
25 | app:exitAnim="@anim/slide_out_left" /> | 23 | app:exitAnim="@anim/slide_out_left" |
24 | app:popEnterAnim="@anim/slide_in_left" | ||
25 | app:popExitAnim="@anim/slide_out_right" /> | ||
26 | <action | 26 | <action |
27 | android:id="@+id/action_mainFragment2_to_actuaMaestrosFragment" | 27 | android:id="@+id/action_mainFragment2_to_actuaMaestrosFragment" |
28 | app:destination="@id/actuaMaestrosFragment" | 28 | app:destination="@id/actuaMaestrosFragment" |
29 | app:enterAnim="@anim/slide_in_right" | ||
30 | app:exitAnim="@anim/slide_out_left" | ||
29 | app:popEnterAnim="@anim/slide_in_left" | 31 | app:popEnterAnim="@anim/slide_in_left" |
30 | app:popExitAnim="@anim/slide_out_right" | 32 | app:popExitAnim="@anim/slide_out_right" |
31 | app:enterAnim="@anim/slide_in_right" | 33 | app:popUpTo="@id/mainFragment2" |
32 | app:exitAnim="@anim/slide_out_left" /> | 34 | app:popUpToInclusive="false" /> |
33 | <action | 35 | <action |
34 | android:id="@+id/action_mainFragment2_to_inventarioFragment" | 36 | android:id="@+id/action_mainFragment2_to_inventarioFragment" |
35 | app:destination="@id/inventarioFragment" | 37 | app:destination="@id/inventarioFragment" |
38 | app:enterAnim="@anim/slide_in_right" | ||
39 | app:exitAnim="@anim/slide_out_left" | ||
36 | app:popEnterAnim="@anim/slide_in_left" | 40 | app:popEnterAnim="@anim/slide_in_left" |
37 | app:popExitAnim="@anim/slide_out_right" | 41 | app:popExitAnim="@anim/slide_out_right" |
42 | app:popUpTo="@id/mainFragment2" | ||
43 | app:popUpToInclusive="false" /> | ||
44 | <action | ||
45 | android:id="@+id/action_mainFragment2_to_invSecFragment" | ||
46 | app:destination="@id/invSecFragment" | ||
38 | app:enterAnim="@anim/slide_in_right" | 47 | app:enterAnim="@anim/slide_in_right" |
39 | app:exitAnim="@anim/slide_out_left" /> | 48 | app:exitAnim="@anim/slide_out_left" |
49 | app:popEnterAnim="@anim/slide_in_left" | ||
50 | app:popExitAnim="@anim/slide_out_right" | ||
51 | app:popUpTo="@id/mainFragment2" | ||
52 | app:popUpToInclusive="false" /> | ||
40 | </fragment> | 53 | </fragment> |
41 | 54 | ||
42 | <fragment | 55 | <fragment |
43 | android:id="@+id/actuaMaestrosFragment" | 56 | android:id="@+id/actuaMaestrosFragment" |
44 | android:name="com.focasoftware.deboinventariov20.UI.actualizacionMaestros.ActuaMaestrosFragment" | 57 | android:name="com.focasoftware.deboinventariov20.UI.actualizacionMaestros.ActuaMaestrosFragment" |
45 | android:label="Importaciones Varias" | 58 | android:label="Importaciones Varias" |
46 | tools:layout="@layout/fragment_actua_maestros" > | 59 | tools:layout="@layout/fragment_actua_maestros"> |
47 | <action | 60 | <action |
48 | android:id="@+id/action_actuaMaestrosFragment_to_invImportadosFragment" | 61 | android:id="@+id/action_actuaMaestrosFragment_to_invSecImpFragment" |
49 | app:destination="@id/invImportadosFragment" /> | 62 | app:destination="@id/invSecImpFragment" |
63 | app:popUpTo="@id/actuaMaestrosFragment" | ||
64 | app:popUpToInclusive="true" /> | ||
50 | </fragment> | 65 | </fragment> |
51 | 66 | ||
52 | 67 | ||
53 | <fragment | 68 | <fragment |
54 | android:id="@+id/inventarioFragment" | 69 | android:id="@+id/inventarioFragment" |
55 | android:name="com.focasoftware.deboinventariov20.UI.inventario.InventarioFragment" | 70 | android:name="com.focasoftware.deboinventariov20.UI.inventario.InventarioFragment" |
56 | android:label="Inventario Dinamico" | 71 | android:label="Inventario Dinámico" |
57 | tools:layout="@layout/fragment_inventario" > | 72 | tools:layout="@layout/fragment_inventario"> |
58 | <action | 73 | <action |
59 | android:id="@+id/action_inventarioFragment_to_descripcionFragment" | 74 | android:id="@+id/action_inventarioFragment_to_descripcionFragment" |
60 | app:destination="@id/descripcionFragment" | 75 | app:destination="@id/descripcionFragment" |
61 | app:popEnterAnim="@anim/slide_in_left" | ||
62 | app:popExitAnim="@anim/slide_out_right" | ||
63 | app:enterAnim="@anim/slide_in_right" | 76 | app:enterAnim="@anim/slide_in_right" |
64 | app:exitAnim="@anim/slide_out_left" | 77 | app:exitAnim="@anim/slide_out_left" |
65 | /> | 78 | app:popEnterAnim="@anim/slide_in_left" |
79 | app:popExitAnim="@anim/slide_out_right" /> | ||
66 | <action | 80 | <action |
67 | android:id="@+id/action_inventarioFragment_to_mainFragment2" | 81 | android:id="@+id/action_inventarioFragment_to_mainFragment2" |
68 | app:destination="@id/mainFragment2" | 82 | app:destination="@id/mainFragment2" |
69 | app:popEnterAnim="@anim/slide_in_left" | ||
70 | app:popExitAnim="@anim/slide_out_right" | ||
71 | app:enterAnim="@anim/slide_in_right" | 83 | app:enterAnim="@anim/slide_in_right" |
72 | app:exitAnim="@anim/slide_out_left"/> | 84 | app:exitAnim="@anim/slide_out_left" |
85 | app:popEnterAnim="@anim/slide_in_left" | ||
86 | app:popExitAnim="@anim/slide_out_right" /> | ||
73 | <action | 87 | <action |
74 | android:id="@+id/action_inventarioFragment_to_detalleArtFragment" | 88 | android:id="@+id/action_inventarioFragment_to_detalleArtFragment" |
75 | app:destination="@id/detalleArtFragment" /> | 89 | app:destination="@id/detalleArtFragment" /> |
76 | <action | 90 | <action |
77 | android:id="@+id/action_inventarioFragment_to_codigoOriFragment" | 91 | android:id="@+id/action_inventarioFragment_to_codigoOriFragment" |
78 | app:destination="@id/codigoOriFragment" /> | 92 | app:destination="@id/codigoOriFragment" /> |
79 | </fragment> | 93 | </fragment> |
80 | 94 | ||
81 | <fragment | 95 | <fragment |
82 | android:id="@+id/descripcionFragment" | 96 | android:id="@+id/descripcionFragment" |
83 | android:name="com.focasoftware.deboinventariov20.UI.descripcionFragment.DescripcionFragment" | 97 | android:name="com.focasoftware.deboinventariov20.UI.descripcionFragment.DescripcionFragment" |
84 | android:label="Busqueda por Descripción"> | 98 | android:label="Busqueda por Descripción"> |
85 | <action | 99 | <action |
86 | android:id="@+id/action_descripcionFragment_to_inventarioFragment" | 100 | android:id="@+id/action_descripcionFragment_to_inventarioFragment" |
87 | app:destination="@id/inventarioFragment" | 101 | app:destination="@id/inventarioFragment" |
88 | app:enterAnim="@anim/slide_in_right" | 102 | app:enterAnim="@anim/slide_in_right" |
89 | app:exitAnim="@anim/slide_out_left" | 103 | app:exitAnim="@anim/slide_out_left" |
90 | app:popEnterAnim="@anim/slide_in_left" | 104 | app:popEnterAnim="@anim/slide_in_left" |
91 | app:popExitAnim="@anim/slide_out_right" /> | 105 | app:popExitAnim="@anim/slide_out_right" /> |
92 | </fragment> | 106 | </fragment> |
93 | 107 | ||
94 | <fragment | 108 | <fragment |
95 | android:id="@+id/detalleArtFragment" | 109 | android:id="@+id/detalleArtFragment" |
96 | android:name="com.focasoftware.deboinventariov20.UI.detalleProducto.DetalleArtFragment" | 110 | android:name="com.focasoftware.deboinventariov20.UI.detalleProducto.DetalleArtFragment" |
97 | android:label="Información Artículo" | 111 | android:label="Información Artículo" |
98 | tools:layout="@layout/fragment_detalle_art"> | 112 | tools:layout="@layout/fragment_detalle_art"> |
99 | <action | 113 | <action |
100 | android:id="@+id/action_detalleArtFragment_to_inventarioFragment" | 114 | android:id="@+id/action_detalleArtFragment_to_inventarioFragment" |
101 | app:destination="@id/inventarioFragment" /> | 115 | app:destination="@id/inventarioFragment" /> |
102 | </fragment> | 116 | </fragment> |
103 | <fragment | 117 | <fragment |
104 | android:id="@+id/configuracionFragment" | 118 | android:id="@+id/configuracionFragment" |
105 | android:name="com.focasoftware.deboinventariov20.UI.configuracion.ConfiguracionFragment" | 119 | android:name="com.focasoftware.deboinventariov20.UI.configuracion.ConfiguracionFragment" |
106 | android:label="Configuraciones" | 120 | android:label="Configuraciones" |
107 | tools:layout="@layout/fragment_configuracion" > | 121 | tools:layout="@layout/fragment_configuracion"> |
108 | <action | 122 | <action |
109 | android:id="@+id/action_configuracionFragment_to_servidoresFragment" | 123 | android:id="@+id/action_configuracionFragment_to_servidoresFragment" |
110 | app:destination="@id/servidoresFragment" | 124 | app:destination="@id/servidoresFragment" |
111 | app:popEnterAnim="@anim/slide_in_left" | 125 | app:enterAnim="@anim/slide_in_right" |
112 | app:popExitAnim="@anim/slide_out_right" | 126 | app:exitAnim="@anim/slide_out_left" |
113 | app:enterAnim="@anim/slide_in_right" | 127 | app:popEnterAnim="@anim/slide_in_left" |
114 | app:exitAnim="@anim/slide_out_left" /> | 128 | app:popExitAnim="@anim/slide_out_right" /> |
115 | <action | 129 | <action |
116 | android:id="@+id/action_configuracionFragment_to_mainFragment2" | 130 | android:id="@+id/action_configuracionFragment_to_mainFragment2" |
117 | app:destination="@id/mainFragment2" | 131 | app:destination="@id/mainFragment2" |
118 | app:popUpTo="@id/configuracionFragment" | 132 | app:popUpTo="@id/configuracionFragment" |
119 | app:popUpToInclusive="false" /> | 133 | app:popUpToInclusive="false" /> |
120 | </fragment> | 134 | </fragment> |
121 | 135 | ||
122 | <fragment | 136 | <fragment |
123 | android:id="@+id/servidoresFragment" | 137 | android:id="@+id/servidoresFragment" |
124 | android:name="com.focasoftware.deboinventariov20.UI.servidores.ServidoresFragment" | 138 | android:name="com.focasoftware.deboinventariov20.UI.servidores.ServidoresFragment" |
125 | android:label="Alta Servidores" | 139 | android:label="Alta Servidores" |
126 | tools:layout="@layout/fragment_servidores"> | 140 | tools:layout="@layout/fragment_servidores"> |
127 | <action | 141 | <action |
128 | android:id="@+id/action_servidoresFragment_to_configuracionFragment" | 142 | android:id="@+id/action_servidoresFragment_to_configuracionFragment" |
129 | app:destination="@id/configuracionFragment" | 143 | app:destination="@id/configuracionFragment" |
130 | app:popUpTo="@id/servidoresFragment" | 144 | app:popUpTo="@id/servidoresFragment" |
131 | app:popUpToInclusive="false" /> | 145 | app:popUpToInclusive="false" /> |
132 | </fragment> | 146 | </fragment> |
133 | <fragment | 147 | <fragment |
134 | android:id="@+id/codigoOriFragment" | 148 | android:id="@+id/codigoOriFragment" |
135 | android:name="com.focasoftware.deboinventariov20.UI.descripCorigenFragment.CodigoOriFragment" | 149 | android:name="com.focasoftware.deboinventariov20.UI.descripCorigenFragment.CodigoOriFragment" |
136 | android:label="Busqueda por Código de Origen"> | 150 | android:label="Busqueda por Código de Origen"> |
137 | <action | 151 | <action |
138 | android:id="@+id/action_codigoOriFragment_to_inventarioFragment" | 152 | android:id="@+id/action_codigoOriFragment_to_inventarioFragment" |
139 | app:destination="@id/inventarioFragment" /> | 153 | app:destination="@id/inventarioFragment" /> |
140 | </fragment> | 154 | </fragment> |
141 | <fragment | 155 | <fragment |
142 | android:id="@+id/invImportadosFragment" | 156 | android:id="@+id/invSecFragment" |
143 | android:name="com.focasoftware.deboinventariov20.UI.actualizacionMaestros.InvImportadosFragment" | 157 | android:name="com.focasoftware.deboinventariov20.UI.inventario.InvSecFragment" |
144 | android:label="Inventarios Importados" | 158 | android:label="Inventarios por Sector"> |
145 | tools:layout="@layout/fragment_inv_importados"> | ||
146 | <action | 159 | <action |
147 | android:id="@+id/action_invImportadosFragment_to_mainFragment2" | 160 | android:id="@+id/action_invSecFragment_to_mainFragment2" |
148 | app:destination="@id/mainFragment2" /> | 161 | app:destination="@id/mainFragment2" |
162 | app:popUpTo="@id/invSecFragment" | ||
163 | app:popUpToInclusive="false" /> | ||
164 | <action | ||
165 | android:id="@+id/action_invSecFragment_to_detalleArtSecFragment" | ||
166 | app:destination="@id/detalleArtSecFragment" | ||
167 | app:popUpTo="@id/invSecFragment" | ||
168 | app:popUpToInclusive="false" /> | ||
169 | </fragment> | ||
170 | <fragment | ||
171 | android:id="@+id/detalleArtSecFragment" | ||
172 | android:name="com.focasoftware.deboinventariov20.UI.detalleProducto.DetalleArtSecFragment" | ||
173 | android:label="Detalle de Artículos"> | ||
174 | <action | ||
175 | android:id="@+id/action_detalleArtSecFragment_to_invSecFragment" | ||
176 | app:destination="@id/invSecFragment" | ||
177 | app:popUpTo="@id/detalleArtSecFragment" | ||
178 | app:popUpToInclusive="false" /> | ||
179 | </fragment> | ||
180 | <fragment | ||
181 | android:id="@+id/invSecImpFragment" | ||
182 | android:name="com.focasoftware.deboinventariov20.UI.actualizacionMaestros.InvSecImpFragment" | ||
183 | android:label="Inventarios por Sector"> | ||
184 | <action |
app/src/main/res/values/dimens.xml
1 | <resources> | 1 | <resources> |
2 | <!-- Default screen margins, per the Android Design guidelines. --> | 2 | <!-- Default screen margins, per the Android Design guidelines. --> |
3 | <dimen name="activity_horizontal_margin">16dp</dimen> | 3 | <dimen name="activity_horizontal_margin">16dp</dimen> |
4 | <dimen name="activity_vertical_margin">16dp</dimen> | 4 | <dimen name="activity_vertical_margin">16dp</dimen> |
5 | <dimen name="nav_header_vertical_spacing">8dp</dimen> | 5 | <dimen name="nav_header_vertical_spacing">8dp</dimen> |
6 | <dimen name="nav_header_height">176dp</dimen> | 6 | <dimen name="nav_header_height">176dp</dimen> |
7 | <dimen name="fab_margin">16dp</dimen> | 7 | <dimen name="fab_margin">16dp</dimen> |
8 | 8 | ||
9 | <!-- // Tamaño de los iconos--> | 9 | <!-- // Tamaño de los iconos--> |
10 | <dimen name="icon_dim">80dp</dimen> | 10 | <dimen name="icon_dim">80dp</dimen> |
11 | <dimen name="icon_top">20dp</dimen> | 11 | <dimen name="icon_top">20dp</dimen> |
12 | <dimen name="text_size">12sp</dimen> | 12 | <dimen name="text_size">12sp</dimen> |
13 | 13 | ||
14 | <!-- //fragment inventario--> | 14 | <!-- //fragment inventario--> |
15 | <dimen name="subTitulos">20sp</dimen> | 15 | <dimen name="subTitulos">20sp</dimen> |
16 | 16 | ||
17 | <!-- //Normal Size--> | 17 | <!-- //Normal Size--> |
18 | <dimen name="Titulos">40sp</dimen> | 18 | <dimen name="Titulos">40sp</dimen> |
19 | <dimen name="TitulosExtra">50sp</dimen> | ||
19 | <dimen name="TitulosMedios">25sp</dimen> | 20 | <dimen name="TitulosMedios">25sp</dimen> |
20 | <dimen name="SubTitulos">15sp</dimen> | 21 | <dimen name="SubTitulos">15sp</dimen> |
21 | 22 | ||
22 | <dimen name="MarginTopSubTitulos">5dp</dimen> | 23 | <dimen name="MarginTopSubTitulos">5dp</dimen> |
23 | <dimen name="MarginTopTitulos">30dp</dimen> | 24 | <dimen name="MarginTopTitulos">30dp</dimen> |
24 | 25 | ||
25 | <dimen name="MarginBotAgreSer">10dp</dimen> | 26 | <dimen name="MarginBotAgreSer">10dp</dimen> |
26 | <dimen name="NormalText">10sp</dimen> | 27 | <dimen name="NormalText">10sp</dimen> |
27 | 28 | ||
28 | <dimen name="PadingCbyRb">5dp</dimen> | 29 | <dimen name="PadingCbyRb">5dp</dimen> |
29 | 30 | ||
30 | <!-- //fragemnt Actualizacion de Maestros--> | 31 | <!-- //fragemnt Actualizacion de Maestros--> |
31 | <dimen name="TitulosActMa">20sp</dimen> | 32 | <dimen name="TitulosActMa">20sp</dimen> |
32 | 33 | ||
33 | 34 | ||
34 | <dimen name="md_message_textsize">20sp</dimen> | 35 | <dimen name="md_message_textsize">20sp</dimen> |
35 | <dimen name="text_size2">16sp</dimen> | 36 | <dimen name="text_size2">16sp</dimen> |
36 | <dimen name="list_item_spacing">16dp</dimen> | 37 | <dimen name="list_item_spacing">16dp</dimen> |
37 | <dimen name="list_item_spacing_half">8dp</dimen> | 38 | <dimen name="list_item_spacing_half">8dp</dimen> |
38 | 39 | ||
39 | //TODO: DIMENSIONES DE 10 PULGADAS | 40 | //TODO: DIMENSIONES DE 10 PULGADAS |
40 | 41 | ||
41 | //FRAGMENT MAIN | 42 | //FRAGMENT MAIN |
42 | <dimen name="icon_dim10">90dp</dimen> | 43 | <dimen name="icon_dim10">90dp</dimen> |
43 | <dimen name="SubTitulos10">25sp</dimen> | 44 | <dimen name="SubTitulos10">25sp</dimen> |
44 | <dimen name="VentasDeposito10">30sp</dimen> | 45 | <dimen name="VentasDeposito10">30sp</dimen> |
45 | 46 | ||
46 | //TOOL BAR | 47 | //TOOL BAR |
47 | <dimen name="activity_horizontal_margin10">26dp</dimen> | 48 | <dimen name="activity_horizontal_margin10">26dp</dimen> |
48 | <dimen name="activity_vertical_margin10">26dp</dimen> | 49 | <dimen name="activity_vertical_margin10">26dp</dimen> |
49 | <dimen name="nav_header_vertical_spacing10">20dp</dimen> | 50 | <dimen name="nav_header_vertical_spacing10">20dp</dimen> |
50 | <dimen name="nav_header_height10">276dp</dimen> | 51 | <dimen name="nav_header_height10">276dp</dimen> |
51 | <dimen name="fab_margin10">26dp</dimen> | 52 | <dimen name="fab_margin10">26dp</dimen> |
52 | 53 | ||
53 | <dimen name="md_message_textsize10">30sp</dimen> | 54 | <dimen name="md_message_textsize10">30sp</dimen> |
54 | 55 | ||
55 | 56 | ||
56 | //INVENTARIO | 57 | //INVENTARIO |
57 | <dimen name="boton10">120dp</dimen> | 58 | <dimen name="boton10">120dp</dimen> |
58 | <dimen name="textCantidadDesc10">26sp</dimen> | 59 | <dimen name="textCantidadDesc10">26sp</dimen> |
59 | <dimen name="textCantidad10">30sp</dimen> | 60 | <dimen name="textCantidad10">30sp</dimen> |
60 | <dimen name="iconos">60dp</dimen> | 61 | <dimen name="iconos">60dp</dimen> |
61 | <dimen name="iconosMedia10">40dp</dimen> | 62 | <dimen name="iconosMedia10">40dp</dimen> |
62 | <dimen name="tvServerConectado">35sp</dimen> | 63 | <dimen name="tvServerConectado">35sp</dimen> |
63 | <dimen name="textView510">23sp</dimen> | 64 | <dimen name="textView510">23sp</dimen> |
64 | </resources> | 65 | </resources> |
app/src/main/res/values/strings.xml
1 | <resources> | 1 | <resources> |
2 | 2 | ||
3 | <string name="action_settings">Ayuda</string> | 3 | <string name="action_settings">Ayuda</string> |
4 | <string name="app_name">DEBO Inventarios</string> | 4 | <string name="app_name">DEBO Inventarios</string> |
5 | 5 | ||
6 | <!-- menu--> | 6 | <!-- menu--> |
7 | <string name="menuInicio">Principal</string> | 7 | <string name="menuInicio">Principal</string> |
8 | <string name="menuNueInv">Nuevo Inventario</string> | 8 | <string name="menuNueInv">Nuevo Inventario</string> |
9 | <string name="menuActMae">Importaciones</string> | 9 | <string name="menuActMae">Importaciones</string> |
10 | <string name="menuConf">Configuraciones</string> | 10 | <string name="menuConf">Configuraciones</string> |
11 | <string name="menuSal">Salir</string> | 11 | <string name="menuSal">Salir</string> |
12 | 12 | ||
13 | <!-- Menu header--> | 13 | <!-- Menu header--> |
14 | <string name="menuLeyenda">Debo Inventario</string> | 14 | <string name="menuLeyenda">Debo Inventario</string> |
15 | 15 | ||
16 | <string name="navigation_drawer_open">Open navigation drawer</string> | 16 | <string name="navigation_drawer_open">Open navigation drawer</string> |
17 | <string name="navigation_drawer_close">Close navigation drawer</string> | 17 | <string name="navigation_drawer_close">Close navigation drawer</string> |
18 | 18 | ||
19 | <!-- Pantalla de inicio--> | 19 | <!-- Pantalla de inicio--> |
20 | <string name="bien">Bienvenido</string> | 20 | <string name="bien">Bienvenido</string> |
21 | <string name="debo">DEBO®</string> | 21 | <string name="debo">DEBO®</string> |
22 | <string name="inventario">Inventario</string> | 22 | <string name="inventario">Inventario</string> |
23 | 23 | ||
24 | <!-- inventarios dinamicos--> | 24 | <!-- inventarios dinamicos--> |
25 | <string name="invDinamicoVenta">Inventarios Dinámicos</string> | 25 | <string name="invDinamicoVenta">Inventarios Dinámicos (0) +</string> |
26 | <string name="invDinamicoCompra">Inventarios Importados(0) +</string> | 26 | <string name="invDinamicoCompra">Inventarios Importados(0) +</string> |
27 | 27 | ||
28 | <!-- ventana emergente--> | 28 | <!-- ventana emergente--> |
29 | <string name="adv">Ingrese la cantidad contada</string> | 29 | <string name="adv">Ingrese la cantidad contada</string> |
30 | <string name="tvFechayHora">Error de fecha y hora</string> | ||
30 | <string name="invVentas">Inventarios Dinámicos de Ventas</string> | 31 | <string name="invVentas">Inventarios Dinámicos de Ventas</string> |
31 | <string name="btnCancela">Cancelar</string> | 32 | <string name="btnCancela">Cancelar</string> |
32 | 33 | ||
33 | 34 | ||
34 | <!-- Fragment Inventario--> | 35 | <!-- Fragment Inventario--> |
35 | <string name="invTitulo">Inventarios Dinámicos</string> | 36 | <string name="invTitulo">Inventarios Dinámicos</string> |
36 | <string name="invTituloV">Inventarios de Ventas</string> | 37 | <string name="invTituloV">Inventarios de Ventas</string> |
37 | <string name="invTituloD">Inventarios de Depósitos</string> | 38 | <string name="invTituloD">Inventarios de Depósitos</string> |
38 | <string name="invCodigoBarras">Código Barras:</string> | 39 | <string name="invCodigoBarras">Código Barras:</string> |
39 | <string name="btnExportarInv">Exportar Inventario</string> | 40 | <string name="btnExportarInv">Exportar Inventario</string> |
40 | <string name="btnBorrarInv">Borrar Inventario</string> | 41 | <string name="btnBorrarInv">Borrar Inventario</string> |
41 | <string name="ibBusDesc">Búsqueda por Descripción</string> | 42 | <string name="ibBusDesc">Búsqueda por Descripción</string> |
42 | <string name="ibBusCB">Búsqueda por Código Barras</string> | 43 | <string name="ibBusCB">Búsqueda por Código Barras</string> |
43 | <string name="ibBusCO">Búsqueda por Código de Origen</string> | 44 | <string name="ibBusCO">Búsqueda por Código de Origen</string> |
44 | <string name="switch_1">+ 1</string> | 45 | <string name="switch_1">+ 1</string> |
45 | 46 | ||
46 | <!-- Fragmento Configuraciones--> | 47 | <!-- Fragmento Configuraciones--> |
47 | <string name="tvTituloConf">Configuraciones</string> | 48 | <string name="tvTituloConf">Configuraciones</string> |
48 | <string name="tvSeleccioneServidor">Seleccione un Servidor</string> | 49 | <string name="tvSeleccioneServidor">Seleccione un Servidor</string> |
49 | <string name="btnValidarServidor">Validar</string> | 50 | <string name="btnValidarServidor">Validar</string> |
50 | <string name="btnAgregarServidor">Agregar un nuevo servidor</string> | 51 | <string name="btnAgregarServidor">Agregar un nuevo servidor</string> |
51 | <string name="tvUbicacionCarpetas">Ubicación de las carpetas de uso interno</string> | 52 | <string name="tvUbicacionCarpetas">Ubicación de las carpetas de uso interno</string> |
52 | <string name="tvTituloArea">Area de Invetnario</string> | 53 | <string name="tvTituloArea">Area de Inventario</string> |
53 | <string name="rbVentas">Inventarios de Ventas</string> | 54 | <string name="rbVentas">Inventarios de Ventas</string> |
54 | <string name="rbDeposito">Inventarios de Depositos</string> | 55 | <string name="rbDeposito">Inventarios de Depositos</string> |
55 | <string name="tvLosProductos">Los productos no contabilizados en Inventarios</string> | 56 | <string name="tvLosProductos">Los productos no contabilizados en Inventarios</string> |
56 | <string name="tvColumnas">Columnas a Visualizar</string> | 57 | <string name="tvColumnas">Columnas a Visualizar</string> |
57 | 58 | ||
58 | <string name="rbProInclu">Solo se ajustan los productos incluidos en el conteo.</string> | 59 | <string name="rbProInclu">Solo se ajustan los productos incluidos en el conteo.</string> |
59 | <string name="rbProNoInclu">Ajusta productos no incluidos en el conteo con stock en cero.</string> | 60 | <string name="rbProNoInclu">Ajusta productos no incluidos en el conteo con stock en cero.</string> |
60 | 61 | ||
61 | <string name="cbMostrarStock">Mostror stock en el sistema al momento de la descarga del maestro.</string> | 62 | <string name="cbMostrarStock">Mostror stock en el sistema al momento de la descarga del maestro.</string> |
62 | <string name="cbHabiLectura">Habilitar Lectura de codigo de barras en balanza.</string> | 63 | <string name="cbHabiLectura">Habilitar Lectura de código de barras en balanza.</string> |
63 | 64 | ||
64 | <string name="tvColumMostrar">Columnas a mostrar en inventario</string> | 65 | <string name="tvColumMostrar">Columnas a mostrar en inventario</string> |
65 | 66 | ||
66 | <string name="rbCodigoDebo">Código DEBO</string> | 67 | <string name="rbCodigoDebo">Código DEBO</string> |
67 | <string name="rbCodigoOrigen">Código Origen</string> | 68 | <string name="rbCodigoOrigen">Código Origen</string> |
68 | <string name="rbCodigoBarras">Código de Barras</string> | 69 | <string name="rbCodigoBarras">Código de Barras</string> |
69 | 70 | ||
70 | <string name="leyendaSpinner">Seleccione Servidor Predeterminado</string> | 71 | <string name="leyendaSpinner">Seleccione Servidor Predeterminado</string> |
71 | 72 | ||
72 | <string name="cbMostrarExistencia">Existencia</string> | 73 | <string name="btnAskTimeServer">Fecha y hora Servidor</string> |
73 | <string name="cbMostrarPrecio">Precio</string> | 74 | <string name="cbAskTimeServerToStart">Verificar fecha y hora al iniciar.</string> |
74 | 75 | ||
75 | <string name="btnGuardar">Guardar Cambios</string> | 76 | <string name="btnGuardar">Guardar Cambios</string> |
76 | <string name="todo"> </string> | 77 | <string name="todo"> </string> |
77 | todo | 78 | todo |
78 | <!-- fragment Actualizacion de Maestros--> | 79 | <!-- fragment Actualizacion de Maestros--> |
79 | <string name="tvActMaestros">Importaciones</string> | 80 | <string name="tvActMaestros">Importaciones</string> |
80 | <string name="tvMedio">Seleccione que tipo de importación desea realizar</string> | 81 | <string name="tvMedio">Seleccione que tipo de importación desea realizar</string> |
81 | <string name="tvSeleccionInventario"> Seleccione el inventario a importar</string> | 82 | <string name="tvSeleccionInventario"> Seleccione el inventario a importar</string> |
82 | 83 | ||
83 | <string name="obPorWifi">Importación de artículos</string> | 84 | <string name="obPorWifi">Importación de artículos</string> |
84 | <string name="obViaArchivo">Importación de inventarios</string> | 85 | <string name="obViaArchivo">Importación de inventarios</string> |
85 | 86 | ||
86 | <string name="btnConfirmarAct">Confirmar Importación</string> | 87 | <string name="btnConfirmarAct">Confirmar Importación</string> |
87 | <string name="btnConfirmarInv">Confirmar Inventarios</string> | 88 | <string name="btnConfirmarInv">Confirmar Inventarios</string> |
88 | 89 | ||
89 | <!-- Fragment Save--> | 90 | <!-- Fragment Save--> |
90 | <string name="tvConfServi">Configuración de Servidores</string> | 91 | <string name="tvConfServi">Configuración de Servidores</string> |
91 | <string name="server">Ingrese la dirección del servidor</string> | 92 | <string name="server">Ingrese la dirección del servidor</string> |
92 | <string name="etNomServer">Ingrese una descripción para la conexión</string> | 93 | <string name="etNomServer">Ingrese una descripción para la conexión</string> |
93 | <string name="btnGuardarConfServ">Guardar Conexión</string> | 94 | <string name="btnGuardarConfServ">Guardar Conexión</string> |
94 | 95 | ||
95 | <!-- Dialog--> | 96 | <!-- Dialog--> |
96 | <string name="sTitulo">Producto Buscado</string> | 97 | <string name="sTitulo">Producto Buscado</string> |
97 | <string name="btnOk">Aceptar</string> | 98 | <string name="btnOk">Aceptar</string> |
99 | <string name="btnSalir">Salir</string> | ||
100 | <string name="btnCambiarHora">Configura aquí la fecha y hora </string> | ||
101 | |||
98 | <string name="btnConfirmar">Confirmar</string> | 102 | <string name="btnConfirmar">Confirmar</string> |
99 | <string name="btnCancelar">Cancelar</string> | 103 | <string name="btnCancelar">Cancelar</string> |
100 | <string name="sMensaje">¡No se encontro el producto ingresado!</string> | 104 | <string name="sMensaje">¡No se encontro el producto ingresado!</string> |
101 | <string name="sMensajeEncontrado">¡Ingrese nueva cantidad!</string> | 105 | <string name="sMensajeEncontrado">¡Ingrese nueva cantidad!</string> |
102 | <string name="sTituloNueva">Producto ingresado esta cargado</string> | 106 | <string name="sTituloNueva">Producto ingresado esta cargado</string> |
103 | <string name="sCantidadNueva">¡Por favor ingrese la nueva Cantidad!</string> | 107 | <string name="sCantidadNueva">¡Por favor ingrese la nueva Cantidad!</string> |
104 | 108 | ||
105 | <string name="sMensajeExportar">¡Confirma que exporta el Inventario!</string> | 109 | <string name="sMensajeExportar">¡Confirma que exporta el Inventario!</string> |
106 | <string name="sTituloExportar">Exportación de Inventarios</string> | 110 | <string name="sTituloExportar">Exportación de Inventarios</string> |
107 | 111 | ||
108 | <!-- FRAGMENT SERVIDOR--> | 112 | <!-- FRAGMENT SERVIDOR--> |
109 | <string name="tvTitutloServer">Alta de Servidores</string> | 113 | <string name="tvTitutloServer">Alta de Servidores</string> |
110 | <string name="tvNomServer">Descripción para identificar al servidor</string> | 114 | <string name="tvNomServer">Descripción para identificar al servidor</string> |
111 | <string name="tvDirServer">Dirección del servidor</string> | 115 | <string name="tvDirServer">Dirección del servidor</string> |
112 | <string name="btnGuardarServidores">Guardar Servidor</string> | 116 | <string name="btnGuardarServidores">Guardar Servidor</string> |
113 | 117 | ||
114 | <string name="tvSeleccion">Toque sobre la operación que desea realizar</string> | 118 | <string name="tvSeleccion">Toque sobre la operación que desea realizar</string> |
115 | <string name="rbSumar">Sumar</string> | 119 | <string name="rbSumar">Sumar</string> |
116 | <string name="rbRestar">Restar</string> | 120 | <string name="rbRestar">Restar</string> |
117 | <string name="rbModificar">Reemplazar</string> | 121 | <string name="rbModificar">Reemplazar</string> |
118 | <string name="tvTotal">Cantidad Final</string>tvTotal | 122 | <string name="tvTotal">Cantidad Final</string>tvTotal |
119 | <string name="tvResultado">Resultado:</string>tvTotal | 123 | <string name="tvResultado">Resultado:</string>tvTotal |
120 | 124 | ||
121 | <string name="large_text"> | 125 | <string name="large_text"> |
122 | "Material is the metaphor.\n\n" | 126 | "Material is the metaphor.\n\n" |
123 | 127 | ||
124 | "A material metaphor is the unifying theory of a rationalized space and a system of motion." | 128 | "A material metaphor is the unifying theory of a rationalized space and a system of motion." |
125 | "The material is grounded in tactile reality, inspired by the study of paper and ink, yet " | 129 | "The material is grounded in tactile reality, inspired by the study of paper and ink, yet " |
126 | "technologically advanced and open to imagination and magic.\n" | 130 | "technologically advanced and open to imagination and magic.\n" |
127 | "Surfaces and edges of the material provide visual cues that are grounded in reality. The " | 131 | "Surfaces and edges of the material provide visual cues that are grounded in reality. The " |
128 | "use of familiar tactile attributes helps users quickly understand affordances. Yet the " | 132 | "use of familiar tactile attributes helps users quickly understand affordances. Yet the " |
129 | "flexibility of the material creates new affordances that supercede those in the physical " | 133 | "flexibility of the material creates new affordances that supercede those in the physical " |
130 | "world, without breaking the rules of physics.\n" | 134 | "world, without breaking the rules of physics.\n" |
131 | "The fundamentals of light, surface, and movement are key to conveying how objects move, " | 135 | "The fundamentals of light, surface, and movement are key to conveying how objects move, " |
132 | "interact, and exist in space and in relation to each other. Realistic lighting shows " | 136 | "interact, and exist in space and in relation to each other. Realistic lighting shows " |
133 | "seams, divides space, and indicates moving parts.\n\n" | 137 | "seams, divides space, and indicates moving parts.\n\n" |
134 | 138 | ||
135 | "Bold, graphic, intentional.\n\n" | 139 | "Bold, graphic, intentional.\n\n" |
136 | 140 | ||
137 | "The foundational elements of print based design typography, grids, space, scale, color, " | 141 | "The foundational elements of print based design typography, grids, space, scale, color, " |
138 | "and use of imagery guide visual treatments. These elements do far more than please the " | 142 | "and use of imagery guide visual treatments. These elements do far more than please the " |
139 | "eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge " | 143 | "eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge " |
140 | "imagery, large scale typography, and intentional white space create a bold and graphic " | 144 | "imagery, large scale typography, and intentional white space create a bold and graphic " |
141 | "interface that immerse the user in the experience.\n" | 145 | "interface that immerse the user in the experience.\n" |
142 | "An emphasis on user actions makes core functionality immediately apparent and provides " | 146 | "An emphasis on user actions makes core functionality immediately apparent and provides " |
143 | "waypoints for the user.\n\n" | 147 | "waypoints for the user.\n\n" |
144 | 148 | ||
145 | "Motion provides meaning.\n\n" | 149 | "Motion provides meaning.\n\n" |
146 | 150 | ||
147 | "Motion respects and reinforces the user as the prime mover. Primary user actions are " | 151 | "Motion respects and reinforces the user as the prime mover. Primary user actions are " |
148 | "inflection points that initiate motion, transforming the whole design.\n" | 152 | "inflection points that initiate motion, transforming the whole design.\n" |
149 | "All action takes place in a single environment. Objects are presented to the user without " | 153 | "All action takes place in a single environment. Objects are presented to the user without " |
150 | "breaking the continuity of experience even as they transform and reorganize.\n" | 154 | "breaking the continuity of experience even as they transform and reorganize.\n" |
151 | "Motion is meaningful and appropriate, serving to focus attention and maintain continuity. " | 155 | "Motion is meaningful and appropriate, serving to focus attention and maintain continuity. " |
152 | "Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n" | 156 | "Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n" |
153 | 157 | ||
154 | "3D world.\n\n" | 158 | "3D world.\n\n" |
155 | 159 | ||
156 | "The material environment is a 3D space, which means all objects have x, y, and z " | 160 | "The material environment is a 3D space, which means all objects have x, y, and z " |
157 | "dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the " | 161 | "dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the " |
158 | "positive z-axis extending towards the viewer. Every sheet of material occupies a single " | 162 | "positive z-axis extending towards the viewer. Every sheet of material occupies a single " |
159 | "position along the z-axis and has a standard 1dp thickness.\n" | 163 | "position along the z-axis and has a standard 1dp thickness.\n" |
160 | "On the web, the z-axis is used for layering and not for perspective. The 3D world is " | 164 | "On the web, the z-axis is used for layering and not for perspective. The 3D world is " |
161 | "emulated by manipulating the y-axis.\n\n" | 165 | "emulated by manipulating the y-axis.\n\n" |
162 | 166 | ||
163 | "Light and shadow.\n\n" | 167 | "Light and shadow.\n\n" |
164 | 168 | ||
165 | "Within the material environment, virtual lights illuminate the scene. Key lights create " | 169 | "Within the material environment, virtual lights illuminate the scene. Key lights create " |
166 | "directional shadows, while ambient light creates soft shadows from all angles.\n" | 170 | "directional shadows, while ambient light creates soft shadows from all angles.\n" |
167 | "Shadows in the material environment are cast by these two light sources. In Android " | 171 | "Shadows in the material environment are cast by these two light sources. In Android " |
168 | "development, shadows occur when light sources are blocked by sheets of material at " | 172 | "development, shadows occur when light sources are blocked by sheets of material at " |
169 | "various positions along the z-axis. On the web, shadows are depicted by manipulating the " | 173 | "various positions along the z-axis. On the web, shadows are depicted by manipulating the " |
170 | "y-axis only. The following example shows the card with a height of 6dp.\n\n" | 174 | "y-axis only. The following example shows the card with a height of 6dp.\n\n" |
171 | 175 | ||
172 | "Resting elevation.\n\n" | 176 | "Resting elevation.\n\n" |
173 | 177 | ||
174 | "All material objects, regardless of size, have a resting elevation, or default elevation " | 178 | "All material objects, regardless of size, have a resting elevation, or default elevation " |
175 | "that does not change. If an object changes elevation, it should return to its resting " | 179 | "that does not change. If an object changes elevation, it should return to its resting " |
176 | "elevation as soon as possible.\n\n" | 180 | "elevation as soon as possible.\n\n" |
177 | 181 | ||
178 | "Component elevations.\n\n" | 182 | "Component elevations.\n\n" |
179 | 183 | ||
180 | "The resting elevation for a component type is consistent across apps (e.g., FAB elevation " | 184 | "The resting elevation for a component type is consistent across apps (e.g., FAB elevation " |
181 | "does not vary from 6dp in one app to 16dp in another app).\n" | 185 | "does not vary from 6dp in one app to 16dp in another app).\n" |
182 | "Components may have different resting elevations across platforms, depending on the depth " | 186 | "Components may have different resting elevations across platforms, depending on the depth " |
183 | "of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n" | 187 | "of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n" |
184 | 188 | ||
185 | "Responsive elevation and dynamic elevation offsets.\n\n" | 189 | "Responsive elevation and dynamic elevation offsets.\n\n" |
186 | 190 | ||
187 | "Some component types have responsive elevation, meaning they change elevation in response " | 191 | "Some component types have responsive elevation, meaning they change elevation in response " |
188 | "to user input (e.g., normal, focused, and pressed) or system events. These elevation " | 192 | "to user input (e.g., normal, focused, and pressed) or system events. These elevation " |
189 | "changes are consistently implemented using dynamic elevation offsets.\n" | 193 | "changes are consistently implemented using dynamic elevation offsets.\n" |
190 | "Dynamic elevation offsets are the goal elevation that a component moves towards, relative " | 194 | "Dynamic elevation offsets are the goal elevation that a component moves towards, relative " |
191 | "to the component’s resting state. They ensure that elevation changes are consistent " | 195 | "to the component’s resting state. They ensure that elevation changes are consistent " |
192 | "across actions and component types. For example, all components that lift on press have " | 196 | "across actions and component types. For example, all components that lift on press have " |
193 | "the same elevation change relative to their resting elevation.\n" | 197 | "the same elevation change relative to their resting elevation.\n" |
194 | "Once the input event is completed or cancelled, the component will return to its resting " | 198 | "Once the input event is completed or cancelled, the component will return to its resting " |
195 | "elevation.\n\n" | 199 | "elevation.\n\n" |
196 | 200 | ||
197 | "Avoiding elevation interference.\n\n" | 201 | "Avoiding elevation interference.\n\n" |
198 | 202 | ||
199 | "Components with responsive elevations may encounter other components as they move between " | 203 | "Components with responsive elevations may encounter other components as they move between " |
200 | "their resting elevations and dynamic elevation offsets. Because material cannot pass " | 204 | "their resting elevations and dynamic elevation offsets. Because material cannot pass " |
201 | "through other material, components avoid interfering with one another any number of ways, " | 205 | "through other material, components avoid interfering with one another any number of ways, " |
202 | "whether on a per component basis or using the entire app layout.\n" | 206 | "whether on a per component basis or using the entire app layout.\n" |
203 | "On a component level, components can move or be removed before they cause interference. " | 207 | "On a component level, components can move or be removed before they cause interference. " |
204 | "For example, a floating action button (FAB) can disappear or move off screen before a " | 208 | "For example, a floating action button (FAB) can disappear or move off screen before a " |
205 | "user picks up a card, or it can move if a snackbar appears.\n" | 209 | "user picks up a card, or it can move if a snackbar appears.\n" |
206 | "On the layout level, design your app layout to minimize opportunities for interference. " | 210 | "On the layout level, design your app layout to minimize opportunities for interference. " |
207 | "For example, position the FAB to one side of stream of a cards so the FAB won’t interfere " | 211 | "For example, position the FAB to one side of stream of a cards so the FAB won’t interfere " |
208 | "when a user tries to pick up one of cards.\n\n" | 212 | "when a user tries to pick up one of cards.\n\n" |
209 | </string> | 213 | </string> |
214 | <!-- TODO: Remove or change this placeholder text --> | ||
215 | <string name="hello_blank_fragment">Hello blank fragment</string> | ||
210 | </resources> | 216 | </resources> |
build.gradle
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. | 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. |
2 | buildscript { | 2 | buildscript { |
3 | ext.kotlin_version = '1.4.0' | 3 | ext.kotlin_version = '1.4.0' |
4 | repositories { | 4 | repositories { |
5 | google() | 5 | google() |
6 | jcenter() | 6 | jcenter() |
7 | } | 7 | } |
8 | dependencies { | 8 | dependencies { |
9 | classpath "com.android.tools.build:gradle:4.0.1" | 9 | classpath 'com.android.tools.build:gradle:4.1.0' |
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
11 | 11 | ||
12 | // NOTE: Do not place your application dependencies here; they belong | 12 | // NOTE: Do not place your application dependencies here; they belong |
13 | // in the individual module build.gradle files | 13 | // in the individual module build.gradle files |
14 | } | 14 | } |
15 | } | 15 | } |
16 | 16 | ||
17 | allprojects { | 17 | allprojects { |
18 | repositories { | 18 | repositories { |
19 | google() | 19 | google() |
20 | jcenter() | 20 | jcenter() |
21 | maven { | 21 | maven { |
22 | url 'http://www.idescout.com/maven/repo/' | 22 | url 'http://www.idescout.com/maven/repo/' |
23 | name 'IDEScout, Inc.' | 23 | name 'IDEScout, Inc.' |
24 | } | 24 | } |
25 | } | 25 | } |
26 | } | 26 | } |
27 | 27 | ||
28 | task clean(type: Delete) { | 28 | task clean(type: Delete) { |
29 | delete rootProject.buildDir | 29 | delete rootProject.buildDir |
30 | } | 30 | } |
gradle/wrapper/gradle-wrapper.properties
1 | #Thu Aug 13 18:28:21 ART 2020 | 1 | #Fri Oct 16 18:23:55 ART 2020 |
2 | distributionBase=GRADLE_USER_HOME | ||
3 | distributionPath=wrapper/dists | ||
4 | zipStoreBase=GRADLE_USER_HOME | ||
5 | zipStorePath=wrapper/dists | 2 | zipStorePath=wrapper/dists |
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip | 3 | zipStoreBase=GRADLE_USER_HOME |
7 | 4 | kapt.verbose=true | |
8 | # Enable Kapt Incremental annotation processing requeste | ||
9 | kapt.incremental.apt=true | ||
10 | |||
11 | # Enable android.databinding.annotationprocessor.ProcessDataBinding (DYNAMIC) | ||
12 | android.databinding.incremental=true | 5 | android.databinding.incremental=true |
13 | 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip | |
14 | # Decrease gradle builds time | ||
15 | kapt.use.worker.api=true | ||
16 | |||
17 | # turn off AP discovery in compile path, and therefore turn on Compile Avoidance | ||
18 | kapt.include.compile.classpath=false | 7 | kapt.include.compile.classpath=false |
19 | |||
20 | # Enable In Logcat to determine Kapt | ||
21 | kapt.verbose=true |