Commit c8fab9ae774769deecb37266b87776de9f9e5058

Authored by Mauricio Sanchez
0 parents
Exists in master

first commit

Showing 109 changed files with 5780 additions and 0 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 109 files displayed.

File was created 1 *.iml
2 .gradle
3 /local.properties
4 /.idea/caches
5 /.idea/libraries
6 /.idea/modules.xml
7 /.idea/workspace.xml
8 /.idea/navEditor.xml
9 /.idea/assetWizardSettings.xml
10 .DS_Store
11 /build
12 /captures
13 .externalNativeBuild
14 .cxx
15
File was created 1 DeboInventarioV2020
.idea/codeStyles/Project.xml
File was created 1 <component name="ProjectCodeStyleConfiguration">
2 <code_scheme name="Project" version="173">
3 <JetCodeStyleSettings>
4 <option name="PACKAGES_TO_USE_STAR_IMPORTS">
5 <value>
6 <package name="java.util" alias="false" withSubpackages="false" />
7 <package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
8 <package name="io.ktor" alias="false" withSubpackages="true" />
9 </value>
10 </option>
11 <option name="PACKAGES_IMPORT_LAYOUT">
12 <value>
13 <package name="" alias="false" withSubpackages="true" />
14 <package name="java" alias="false" withSubpackages="true" />
15 <package name="javax" alias="false" withSubpackages="true" />
16 <package name="kotlin" alias="false" withSubpackages="true" />
17 <package name="" alias="true" withSubpackages="true" />
18 </value>
19 </option>
20 <option name="IF_RPAREN_ON_NEW_LINE" value="false" />
21 <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
22 </JetCodeStyleSettings>
23 <codeStyleSettings language="XML">
24 <indentOptions>
25 <option name="CONTINUATION_INDENT_SIZE" value="4" />
26 </indentOptions>
27 <arrangement>
28 <rules>
29 <section>
30 <rule>
31 <match>
32 <AND>
33 <NAME>xmlns:android</NAME>
34 <XML_ATTRIBUTE />
35 <XML_NAMESPACE>^$</XML_NAMESPACE>
36 </AND>
37 </match>
38 </rule>
39 </section>
40 <section>
41 <rule>
42 <match>
43 <AND>
44 <NAME>xmlns:.*</NAME>
45 <XML_ATTRIBUTE />
46 <XML_NAMESPACE>^$</XML_NAMESPACE>
47 </AND>
48 </match>
49 <order>BY_NAME</order>
50 </rule>
51 </section>
52 <section>
53 <rule>
54 <match>
55 <AND>
56 <NAME>.*:id</NAME>
57 <XML_ATTRIBUTE />
58 <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
59 </AND>
60 </match>
61 </rule>
62 </section>
63 <section>
64 <rule>
65 <match>
66 <AND>
67 <NAME>.*:name</NAME>
68 <XML_ATTRIBUTE />
69 <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
70 </AND>
71 </match>
72 </rule>
73 </section>
74 <section>
75 <rule>
76 <match>
77 <AND>
78 <NAME>name</NAME>
79 <XML_ATTRIBUTE />
80 <XML_NAMESPACE>^$</XML_NAMESPACE>
81 </AND>
82 </match>
83 </rule>
84 </section>
85 <section>
86 <rule>
87 <match>
88 <AND>
89 <NAME>style</NAME>
90 <XML_ATTRIBUTE />
91 <XML_NAMESPACE>^$</XML_NAMESPACE>
92 </AND>
93 </match>
94 </rule>
95 </section>
96 <section>
97 <rule>
98 <match>
99 <AND>
100 <NAME>.*</NAME>
101 <XML_ATTRIBUTE />
102 <XML_NAMESPACE>^$</XML_NAMESPACE>
103 </AND>
104 </match>
105 <order>BY_NAME</order>
106 </rule>
107 </section>
108 <section>
109 <rule>
110 <match>
111 <AND>
112 <NAME>.*</NAME>
113 <XML_ATTRIBUTE />
114 <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
115 </AND>
116 </match>
117 <order>ANDROID_ATTRIBUTE_ORDER</order>
118 </rule>
119 </section>
120 <section>
121 <rule>
122 <match>
123 <AND>
124 <NAME>.*</NAME>
125 <XML_ATTRIBUTE />
126 <XML_NAMESPACE>.*</XML_NAMESPACE>
127 </AND>
128 </match>
129 <order>BY_NAME</order>
130 </rule>
131 </section>
132 </rules>
133 </arrangement>
134 </codeStyleSettings>
135 <codeStyleSettings language="kotlin">
136 <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
137 <option name="RIGHT_MARGIN" value="200" />
138 <option name="KEEP_LINE_BREAKS" value="false" />
139 <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
140 <option name="CALL_PARAMETERS_LPAREN_ON_NEXT_LINE" value="false" />
141 <option name="CALL_PARAMETERS_RPAREN_ON_NEXT_LINE" value="false" />
142 <option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="false" />
143 <option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="false" />
144 <option name="WRAP_ON_TYPING" value="1" />
145 </codeStyleSettings>
146 </code_scheme>
147 </component>
.idea/codeStyles/codeStyleConfig.xml
File was created 1 <component name="ProjectCodeStyleConfiguration">
2 <state>
3 <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4 </state>
5 </component>
File was created 1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4">
3 <component name="GradleMigrationSettings" migrationVersion="1" />
4 <component name="GradleSettings">
5 <option name="linkedExternalProjectsSettings">
6 <GradleProjectSettings>
7 <option name="testRunner" value="PLATFORM" />
8 <option name="distributionType" value="DEFAULT_WRAPPED" />
9 <option name="externalProjectPath" value="$PROJECT_DIR$" />
10 <option name="gradleHome" value="C:/Gradle" />
11 <option name="gradleJvm" value="11" />
12 <option name="modules">
13 <set>
14 <option value="$PROJECT_DIR$" />
15 <option value="$PROJECT_DIR$/app" />
16 </set>
17 </option>
18 <option name="resolveModulePerSourceSet" value="false" />
19 </GradleProjectSettings>
20 </option>
21 </component>
22 </project>
.idea/inspectionProfiles/Project_Default.xml
File was created 1 <component name="InspectionProjectProfileManager">
2 <profile version="1.0">
3 <option name="myName" value="Project Default" />
4 <inspection_tool class="AndroidUnresolvedRoomSqlReference" enabled="false" level="ERROR" enabled_by_default="false" />
5 </profile>
6 </component>
.idea/jarRepositories.xml
File was created 1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4">
3 <component name="RemoteRepositoriesConfiguration">
4 <remote-repository>
5 <option name="id" value="central" />
6 <option name="name" value="Maven Central repository" />
7 <option name="url" value="https://repo1.maven.org/maven2" />
8 </remote-repository>
9 <remote-repository>
10 <option name="id" value="jboss.community" />
11 <option name="name" value="JBoss Community repository" />
12 <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
13 </remote-repository>
14 <remote-repository>
15 <option name="id" value="BintrayJCenter" />
16 <option name="name" value="BintrayJCenter" />
17 <option name="url" value="https://jcenter.bintray.com/" />
18 </remote-repository>
19 <remote-repository>
20 <option name="id" value="Google" />
21 <option name="name" value="Google" />
22 <option name="url" value="https://dl.google.com/dl/android/maven2/" />
23 </remote-repository>
24 </component>
25 </project>
File was created 1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4">
3 <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="11" project-jdk-type="JavaSDK">
4 <output url="file://$PROJECT_DIR$/build/classes" />
5 </component>
6 <component name="ProjectType">
7 <option name="id" value="Android" />
8 </component>
9 </project>
.idea/runConfigurations.xml
File was created 1 <?xml version="1.0" encoding="UTF-8"?>
2 <project version="4">
3 <component name="RunConfigurationProducerService">
4 <option name="ignoredProducers">
5 <set>
6 <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
7 <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
8 <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
9 </set>
10 </option>
11 </component>
12 </project>
Logica carga articulos con CB.docx
No preview for this file type
File was created 1 /build
File was created 1 apply plugin: 'com.android.application'
2 apply plugin: 'kotlin-android'
3 apply plugin: 'kotlin-android-extensions'
4 apply plugin: 'kotlin-kapt'
5
6 android {
7 compileSdkVersion 30
8 buildToolsVersion "29.0.3"
9
10 defaultConfig {
11 applicationId "com.focasoftware.deboinventariov20"
12 minSdkVersion 26
13 targetSdkVersion 30
14 versionCode 1
15 versionName "1.0"
16
17 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18 }
19
20 buildTypes {
21 release {
22 minifyEnabled false
23 proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24 }
25 }
26 compileOptions {
27 sourceCompatibility JavaVersion.VERSION_1_8
28 targetCompatibility JavaVersion.VERSION_1_8
29 }
30 kotlinOptions {
31 jvmTarget = '1.8'
32 }
33 }
34
35 dependencies {
36 implementation fileTree(dir: "libs", include: ["*.jar"])
37 implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
38 implementation 'androidx.core:core-ktx:1.3.1'
39 implementation 'androidx.appcompat:appcompat:1.2.0'
40 implementation 'androidx.legacy:legacy-support-v4:1.0.0'
41 implementation 'com.google.android.material:material:1.2.0'
42 implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
43 implementation 'androidx.navigation:navigation-fragment:2.3.0'
44 implementation 'androidx.navigation:navigation-ui:2.3.0'
45 implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
46 implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0'
47 implementation 'androidx.navigation:navigation-ui-ktx:2.3.0'
48 implementation 'androidx.recyclerview:recyclerview:1.1.0'
49 testImplementation 'junit:junit:4.13'
50 androidTestImplementation 'androidx.test.ext:junit:1.1.1'
51 androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
52
53
54 //Room
55 implementation 'androidx.room:room-ktx:2.2.5'
56 implementation "androidx.room:room-runtime:2.2.5"
57 kapt "androidx.room:room-compiler:2.2.5"
58
59 //Retrofit
60 implementation 'com.squareup.retrofit2:retrofit:2.9.0'
61 implementation 'com.google.code.gson:gson:2.8.6'
62 implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
63 implementation 'com.squareup.okhttp3:logging-interceptor:4.8.1'
64
65 //Gson library
66 implementation "com.google.code.gson:gson:2.8.6"
67 annotationProcessor 'androidx.room:room-compiler:2.2.5'
68
69
70
71 implementation 'com.afollestad.material-dialogs:core:3.3.0'
72 implementation 'com.afollestad.material-dialogs:input:3.3.0'
73 }
app/proguard-rules.pro
File was created 1 # Add project specific ProGuard rules here.
2 # You can control the set of applied configuration files using the
3 # proguardFiles setting in build.gradle.
4 #
5 # For more details, see
6 # http://developer.android.com/guide/developing/tools/proguard.html
7
8 # If your project uses WebView with JS, uncomment the following
9 # and specify the fully qualified class name to the JavaScript interface
10 # class:
11 #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 # public *;
13 #}
14
15 # Uncomment this to preserve the line number information for
16 # debugging stack traces.
17 #-keepattributes SourceFile,LineNumberTable
18
19 # If you keep the line number information, uncomment this to
20 # hide the original source file name.
21 #-renamesourcefileattribute SourceFile
app/src/androidTest/java/com/focasoftware/deboinventariov20/ExampleInstrumentedTest.kt
File was created 1 package com.focasoftware.deboinventariov20
2
3 import androidx.test.platform.app.InstrumentationRegistry
4 import androidx.test.ext.junit.runners.AndroidJUnit4
5
6 import org.junit.Test
7 import org.junit.runner.RunWith
8
9 import org.junit.Assert.*
10
11 /**
12 * Instrumented test, which will execute on an Android device.
13 *
14 * See [testing documentation](http://d.android.com/tools/testing).
15 */
16 @RunWith(AndroidJUnit4::class)
17 class ExampleInstrumentedTest {
18 @Test
19 fun useAppContext() {
20 // Context of the app under test.
21 val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 assertEquals("com.focasoftware.deboinventariov20", appContext.packageName)
23 }
24 }
app/src/main/AndroidManifest.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 package="com.focasoftware.deboinventariov20">
4
5 <uses-permission android:name="android.permission.VIBRATE" />
6 <uses-permission android:name="android.permission.INTERNET" />
7
8 <application
9 android:allowBackup="true"
10 android:icon="@mipmap/ic_launcher"
11 android:label="@string/app_name"
12 android:roundIcon="@mipmap/ic_launcher_round"
13 android:supportsRtl="true"
14 android:theme="@style/AppTheme"
15 android:usesCleartextTraffic="true">
16 <activity
17 android:name=".MainActivity"
18 android:label="@string/app_name"
19 android:theme="@style/AppTheme.NoActionBar">
20 <intent-filter>
21 <action android:name="android.intent.action.MAIN" />
22
23 <category android:name="android.intent.category.LAUNCHER" />
24 </intent-filter>
25 </activity>
26 </application>
27
28 </manifest>
app/src/main/java/com/focasoftware/deboinventariov20/DB/Constans/Constans.kt
File was created 1 package com.focasoftware.deboinventario.ui.actualizacionMaestros
2
3 class Constans {
4
5 companion object {
6 const val DB_NAME="DebInv"
7 const val TABLA_ART="Articles"
8 const val TABLA_INV_H="InvHead"
9 const val TABLA_INV_B="InvBody"
10 const val TABLA_SERV_INV="ServeInv"
11 }
12
13 }
app/src/main/java/com/focasoftware/deboinventariov20/DB/DAO/ArticulosDAO.kt
File was created 1 package com.focasoftware.deboinventariov20.DB.DAO
2
3 import androidx.room.*
4 import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_ART
5 import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_INV_B
6 import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_INV_H
7 import com.focasoftware.deboinventariov20.Model.*
8
9 @Dao
10 interface ArticulosDAO {
11
12 // TABLA ARTICULOS
13 @Insert(onConflict = OnConflictStrategy.REPLACE)
14 suspend fun insertArticulos(articulos: Articles?)
15
16 @Query("SELECT * FROM $TABLA_ART ORDER BY DES DESC")
17 suspend fun findAllArticulos(): List<Articles>
18
19 @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND DES LIKE '%' || :description || '%'")
20 suspend fun findArticuloByDesc(description: String?, dep: Int): List<Articles>
21
22 @Query("SELECT * FROM $TABLA_ART WHERE DEPSN=:dep AND CB LIKE :codBarra")
23 suspend fun findArticuloByCodBar(codBarra: String?, dep: Int): Articles?
24
25 @Query("DELETE FROM $TABLA_ART")
26 suspend fun deleteAllArticulos()
27 }
28
29 @Dao
30 interface InvHeadDAO {
31 @Insert()
32 suspend fun insertInvHead(invHead: InvHead?)
33
34 @Query("SELECT INV_NUM FROM $TABLA_INV_H ORDER BY INV_NUM DESC")
35 suspend fun findLastInv(): Int
36
37 @Query("DELETE FROM $TABLA_INV_H")
38 suspend fun deleteAllArticulos()
39
40 @Query("DELETE FROM $TABLA_INV_H WHERE INV_NUM=:inven")
41 suspend fun deleteinvHead(inven: Int)
42
43 @Query("SELECT * FROM $TABLA_INV_H ORDER BY INV_FEI")
44 suspend fun fetchAllInvHead(): List<InvHead>
45 }
46
47 @Dao
48 interface InvBodyDAO {
49 @Insert()
50 suspend fun insertInvBody(invBody: InvBody?)
51
52 @Query("DELETE FROM $TABLA_INV_B")
53 suspend fun deleteAllInvBody()
54
55 @Query("DELETE FROM $TABLA_INV_B WHERE INV_NUM =:inven")
56 suspend fun deleteInvBody(inven: Int)
57
58 @Query("UPDATE $TABLA_INV_B SET CANT=:cant WHERE SEC=:sec AND COD=:cod")
59 suspend fun UpdateInvBody(cant: Float, sec: String, cod: String)
60
61 @Query("SELECT * FROM $TABLA_INV_B WHERE INV_NUM =:inven ORDER BY INV_FEI DESC")
62 suspend fun fetchAllInvBody(inven:Int): List<InvBody>
63 }
64 @Dao
65 interface ServeInvDao {
66 @Insert(onConflict = OnConflictStrategy.REPLACE)
67 fun insertServer(servidor: ServeInv)
68
69 @Query("SELECT SER_NUM,SER_DESC, SER_DIR FROM ServeInv")
70 suspend fun findAllServers(): List<ServeInv>
71 }
app/src/main/java/com/focasoftware/deboinventariov20/DB/DataBase/AppDb.kt
File was created 1 package com.focasoftware.deboinventariov20.DB.DataBase
2
3 import android.content.Context
4 import androidx.room.Database
5 import androidx.room.Room
6 import androidx.room.RoomDatabase
7 import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans
8 import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_ART
9 import com.focasoftware.deboinventariov20.DB.DAO.*
10 import com.focasoftware.deboinventariov20.Model.Articles
11 import com.focasoftware.deboinventariov20.Model.InvBody
12 import com.focasoftware.deboinventariov20.Model.InvHead
13 import com.focasoftware.deboinventariov20.Model.ServeInv
14
15
16 @Database(entities = [Articles::class, InvHead::class, InvBody::class, ServeInv::class], version = 1, exportSchema = false)
17 abstract class AppDb : RoomDatabase() {
18 abstract fun ArticulosDAO(): ArticulosDAO?
19 abstract fun InvHeadDAO(): InvHeadDAO?
20 abstract fun InvBodyDAO(): InvBodyDAO?
21 abstract fun ServeInvDao(): ServeInvDao?
22
23 companion object {
24 private var INSTANCE: AppDb? = null
25 fun getAppDb(context: Context): AppDb? {
26 if (INSTANCE == null) {
27 INSTANCE = Room.databaseBuilder(
28 context.applicationContext,
29 AppDb::class.java,
30 Constans.DB_NAME
31 )
32 .allowMainThreadQueries()
33 .build()
34 }
35 return INSTANCE
36 }
37
38 fun destroyInstance() {
39 INSTANCE = null
40 }
41 }
42 }
app/src/main/java/com/focasoftware/deboinventariov20/MainActivity.kt
File was created 1 package com.focasoftware.deboinventariov20
2
3 import android.os.Bundle
4 import android.view.Menu
5 import com.google.android.material.floatingactionbutton.FloatingActionButton
6 import com.google.android.material.snackbar.Snackbar
7 import com.google.android.material.navigation.NavigationView
8 import androidx.navigation.findNavController
9 import androidx.navigation.ui.AppBarConfiguration
10 import androidx.navigation.ui.navigateUp
11 import androidx.navigation.ui.setupActionBarWithNavController
12 import androidx.navigation.ui.setupWithNavController
13 import androidx.drawerlayout.widget.DrawerLayout
14 import androidx.appcompat.app.AppCompatActivity
15 import androidx.appcompat.widget.Toolbar
16
17 class MainActivity : AppCompatActivity() {
18
19 private lateinit var appBarConfiguration: AppBarConfiguration
20
21 override fun onCreate(savedInstanceState: Bundle?) {
22 super.onCreate(savedInstanceState)
23 setContentView(R.layout.activity_main)
24 val toolbar: Toolbar = findViewById(R.id.toolbar)
25 setSupportActionBar(toolbar)
26
27
28 val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout)
29 val navView: NavigationView = findViewById(R.id.nav_view)
30 val navController = findNavController(R.id.nav_host_fragment)
31
32 appBarConfiguration = AppBarConfiguration(setOf(
33 R.id.mainFragment2,R.id.inventarioFragment, R.id.actuaMaestrosFragment, R.id.configuracionFragment), drawerLayout)
34 setupActionBarWithNavController(navController, appBarConfiguration)
35 navView.setupWithNavController(navController)
36 }
37
38 override fun onCreateOptionsMenu(menu: Menu): Boolean {
39 // Inflate the menu; this adds items to the action bar if it is present.
40 menuInflater.inflate(R.menu.main, menu)
41 return true
42 }
43
44 override fun onSupportNavigateUp(): Boolean {
45 val navController = findNavController(R.id.nav_host_fragment)
46 return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp()
47 }
48 }
app/src/main/java/com/focasoftware/deboinventariov20/Model/ProductosApi.kt
File was created 1 package com.focasoftware.deboinventariov20.Model
2
3 import retrofit2.Response
4 import retrofit2.http.GET
5
6 interface ProductosApi {
7
8 @GET("api/articulos")
9 suspend fun getProductos(): Response<List<Productos>>
10
11 }
app/src/main/java/com/focasoftware/deboinventariov20/Model/ProductosService.kt
File was created 1 package com.focasoftware.deboinventariov20.Model
2
3 import retrofit2.Retrofit
4 import retrofit2.converter.gson.GsonConverterFactory
5
6 object ProductosService {
7 private val BASE_URL ="http://10.0.2.2:3000/"
8 //"http://10.231.45.83:3000/"
9
10
11 fun getProductosService(): ProductosApi {
12 return Retrofit.Builder()
13 .baseUrl(BASE_URL)
14 .addConverterFactory(GsonConverterFactory.create())
15 .build()
16 .create(ProductosApi::class.java)
17 }
18 }
app/src/main/java/com/focasoftware/deboinventariov20/Model/Tablas.kt
File was created 1 package com.focasoftware.deboinventariov20.Model
2
3 import androidx.room.ColumnInfo
4 import androidx.room.Entity
5 import androidx.room.PrimaryKey
6 import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_ART
7 import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_INV_B
8 import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_INV_H
9 import com.focasoftware.deboinventario.ui.actualizacionMaestros.Constans.Companion.TABLA_SERV_INV
10 import com.google.gson.annotations.SerializedName
11 import java.io.Serializable
12
13 data class Productos(
14 @SerializedName("SEC")var sector: String?,
15 @SerializedName("COD") var codigo: String?,
16 @SerializedName("DESC") var descripcion: String?,
17 @SerializedName("CB") var codBar: String?,
18 @SerializedName("CBC") var codOrigen: String?,
19 @SerializedName("PRE_VTA") var precio: String?,
20 @SerializedName("PRE_COS") var costo: String?,
21 @SerializedName("BAL") var balanza: Int?,
22 @SerializedName("DEPSN") var depSn: Int?,
23 @SerializedName("FOTO") var imagen: String?)
24
25 @Entity(tableName = TABLA_ART)
26 data class Articles(
27 @ColumnInfo(name = "SEC") var sector: String?,
28 @ColumnInfo(name = "COD") var codigo: String?,
29 @ColumnInfo(name = "DES") var descripcion: String?,
30 @ColumnInfo(name = "CB") var codBar: String?,
31 @ColumnInfo(name = "CBC") var codOrigen: String?,
32 @ColumnInfo(name = "PRE_VTA") var precio: String?,
33 @ColumnInfo(name = "PRE_COS") var costo: String?,
34 @ColumnInfo(name = "BAL") var balanza: Int?,
35 @ColumnInfo(name = "DEPSN") var depSn: Int?,
36 @ColumnInfo(name = "FOTO") var imagen: String?) : Serializable {
37 @PrimaryKey(autoGenerate = true)
38 @ColumnInfo(name = "id") var id: Long = 0
39 }
40
41
42 @Entity(tableName = TABLA_INV_H)
43 data class InvHead(@PrimaryKey(autoGenerate = true) @ColumnInfo(name = "INV_NUM") var invNum: Int,
44 @ColumnInfo(name = "INV_DESC") var descripcion: String?,
45 @ColumnInfo(name = "ESTADO") var estado: Int?,
46 @ColumnInfo(name = "INV_FEI") var fechaInicio: String?,
47 @ColumnInfo(name = "INV_FEF") var fechaFinal: String?,
48 // productos contados en el inventario
49 @ColumnInfo(name = "INV_PRODCONT") var prodContados: Long?,
50 @ColumnInfo(name = "INV_LUG") var lugar: Int?,
51 // Solo se ajustan los productos incluidos en el conteo=0
52 // Ajusta productos no incluidos en el conteo con stock en cero=1
53 @ColumnInfo(name = "PRO_NO_CONTA") var stDesc: Int?,
54 // Mostror stock en el sistema al momento de la descarga del maestro.
55 @ColumnInfo(name = "MOSTRAR_STOCK") var proNoCont: Int?)
56
57
58 @Entity(tableName = TABLA_INV_B)
59 data class InvBody(
60 @ColumnInfo(name = "INV_NUM") var invNum: Int,
61 @ColumnInfo(name = "SEC") var sector: String?,
62 @ColumnInfo(name = "COD") var codigo: String?,
63 @ColumnInfo(name = "DES") var descripcion: String?,
64 @ColumnInfo(name = "CANT") var cantTomada: String?,
65 @ColumnInfo(name = "CB") var codBar: String?,
66 @ColumnInfo(name = "CBC") var codOrigen: String?,
67 @ColumnInfo(name = "PRE_VTA") var precio: String?,
68 @ColumnInfo(name = "PRE_COS") var costo: String?,
69 @ColumnInfo(name = "BAL") var balanza: Int?,
70 @ColumnInfo(name = "DSN") var depSn: Int?,
71 @ColumnInfo(name = "INV_FEI") var fechaInicio: String?,
72 @ColumnInfo(name = "INV_FEF") var fechaFinal: String?):Serializable{
73 @PrimaryKey(autoGenerate = true) @ColumnInfo(name = "id") var id: Long = 0
74 }
75
76 @Entity(tableName = TABLA_SERV_INV)
77 data class ServeInv(
78
79 @ColumnInfo(name = "SER_DESC") var descripcion: String?, @ColumnInfo(name = "SER_DIR") var direccion: String?, @ColumnInfo(name = "SER_PRE") var predeterminado: String?) : Serializable {
80 @PrimaryKey(autoGenerate = true)
81 @ColumnInfo(name = "SER_NUM")
82 var ID: Int = 0
83 }
84
app/src/main/java/com/focasoftware/deboinventariov20/ui/actualizacionMaestros/ActuaMaestrosFragment.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.actualizacionMaestros
2
3 import android.os.Bundle
4 import android.view.LayoutInflater
5 import android.view.View
6 import android.view.ViewGroup
7 import android.widget.Button
8 import androidx.fragment.app.Fragment
9 import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
10 import com.focasoftware.deboinventariov20.Model.Articles
11 import com.focasoftware.deboinventariov20.Model.Productos
12 import com.focasoftware.deboinventariov20.Model.ProductosService
13 import com.focasoftware.deboinventariov20.R
14 import kotlinx.android.synthetic.main.fragment_actua_maestros.*
15 import kotlinx.coroutines.*
16
17 class ActuaMaestrosFragment : Fragment() {
18
19 var job: Job? = null
20
21
22 override fun onCreate(savedInstanceState: Bundle?) {
23 super.onCreate(savedInstanceState)
24
25
26 //mostrarArticulos()
27 }
28
29
30 override fun onCreateView(
31 inflater: LayoutInflater, container: ViewGroup?,
32 savedInstanceState: Bundle?
33 ): View? {
34 // Inflate the layout for this fragment
35 val v = inflater.inflate(R.layout.fragment_actua_maestros, container, false)
36 val bConfirmarAct = v.findViewById<Button>(R.id.btnConfirmarAct)
37 bConfirmarAct.setOnClickListener {
38 loading_view.visibility = View.VISIBLE
39 countriesList.text = "Obteniendo Maestros Aguarde,por favor."
40 obtenerArticulos()
41 }
42 return v
43 }
44
45
46 private fun obtenerArticulos() {
47
48 val productosService = ProductosService.getProductosService()
49 var index: Long = 1
50 job = CoroutineScope(Dispatchers.IO).launch {
51 AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!
52 .deleteAllArticulos()
53 val response = productosService.getProductos()
54 if (response.isSuccessful) {
55 for (pro in response.body()!!) {
56 val artiAcargar = Articles(
57 pro.sector,
58 pro.codigo,
59 pro.descripcion,
60 pro.codBar,
61 pro.codOrigen,
62 pro.precio,
63 pro.costo,
64 pro.balanza,
65 pro.depSn,
66 pro.imagen
67 )
68 index += index
69
70 AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!
71 .insertArticulos(artiAcargar)
72 }
73 withContext(Dispatchers.Main) {
74 countriesList.visibility = View.VISIBLE
75 countriesList.text = "¡Datos Importados Correctamente!"
76 loading_view.visibility = View.GONE
77 }
78 //
79 } else {
80 countriesList.text = "Error: ${response.message()}"
81 }
82 }
83
84 // withContext(Dispatchers.Main) {
85 // if (response.isSuccessful) {
86 // val call = WebService
87 // .instance
88 // ?.createService(WebServiceApi::class.java)
89 // ?.articulos
90 // call?.enqueue(object : Callback<List<productos?>?> {
91 // override fun onResponse(
92 // call: Call<List<productos?>?>,
93 // response: Response<List<productos?>?>
94 // ) {
95 // if (response.code() == 200) {
96 // for (i in response.body()!!.indices) {
97 // //AppDb.getAppDb(requireActivity())!!.ArticulosDAO()?.insertArticulos(response.body()!![i])
98 // cargarArticulos(2, 500, "sfas", "66666","2,2", "2,2", false, false, "")
99 //// Log.d(
100 //// "TAG1", "Nombre Curso: " + response.body()!![i]?.sector
101 //// + "Codigo Profesor: " + response.body()!![i]?.descripcion
102 //// )
103 // mostrarArticulos()
104 // }
105 // } else if (response.code() == 404) {
106 // Log.d("TAG1", "No hay cursos")
107 // }
108 //
109 // }
110 //
111 // override fun onFailure(call: Call<List<productos?>?>, t: Throwable) {}
112 // })
113 }
114
115 fun mostrarArticulos() {
116 val Job = GlobalScope.launch {
117 var listArticulos: List<Articles>? = null
118 var temp: String = ""
119 listArticulos =
120 AppDb.getAppDb(requireActivity())?.ArticulosDAO()?.findAllArticulos()
121 if (listArticulos != null) {
122
123 for (i in listArticulos.indices)
124 temp += listArticulos[i].codigo.toString()
125 }
126 withContext(Dispatchers.Main) {
127 countriesList.visibility = View.VISIBLE
128 loading_view.visibility = View.GONE
129 countriesList?.text = temp
130 }
131 }
132 // for (professor in listArticulos!!) {
133 // editT.text= professor.id.toString()
134 // }
135 }
136
137
138 // fun observeViewModel() {
139 //
140 // val productosService = ProductosService.getProductosService()
141 // var job: Job? = null
142 //
143 //
144 // //countriesList.text="Procesando..."
145 // //countriesList.visibility = View.VISIBLE
146 // // GlobalScope1.launch(Dispatchers.IO) {
147 // val response = productosService.getProductos()
148 // if (response.isSuccessful) {
149 //// countriesList.layoutManager = LinearLayoutManager(context)
150 //// countriesList.itemAnimator = DefaultItemAnimator()
151 //
152 //// ProductAdapter.updateCountries(it)
153 // // cargarArticulos(response.body())
154 //
155 //
156 // val artiAcargar: Articulos? = null
157 // var index: Long = 1
158 //
159 // for (pro in response.body()!!) {
160 // //artiAcargar.id =index+1
161 // artiAcargar!!.sector = pro.sector
162 // artiAcargar.codigo = pro.codigo
163 // artiAcargar.descripcion = pro.descripcion
164 // artiAcargar.codBar = pro.codBar
165 // artiAcargar.precio = pro.precio
166 // artiAcargar.costo = pro.costo
167 // artiAcargar.balanza = pro.balanza
168 // artiAcargar.depSn = pro.depSn
169 // artiAcargar.imagen = pro.imagen
170 // index += index
171 //
172 // AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!
173 // .insertArticulos(artiAcargar)
174 // }
175 // }
176 // // }
177 //
178 // //job.cancel()
179 //
180 //
181 // }
182
183 // fun cargarArticulos(Productos: List<Productos>?) {
184 // val artiAcargar: Articulos? = null
185 // var index: Long = 1
186 // //val job4 = CoroutineScope(Dispatchers.Default).launch {
187 // for (pro in Productos!!) {
188 // //artiAcargar.id =index+1
189 // artiAcargar!!.sector = pro.sector
190 // artiAcargar.codigo = pro.codigo
191 // artiAcargar.descripcion = pro.descripcion
192 // artiAcargar.codBar = pro.codBar
193 // artiAcargar.precio = pro.precio
194 // artiAcargar.costo = pro.costo
195 // artiAcargar.balanza = pro.balanza
196 // artiAcargar.depSn = pro.depSn
197 // artiAcargar.imagen = pro.imagen
198 // index += index
199 //
200 // AppDb.getAppDb(requireActivity())!!.ArticulosDAO()!!
201 // .insertArticulos(artiAcargar)
202 // }
203 // }
204 }
205
206
app/src/main/java/com/focasoftware/deboinventariov20/ui/configuracion/ConfiguracionFragment.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.configuracion
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.widget.*
11 import androidx.navigation.fragment.findNavController
12 import com.focasoftware.deboinventariov20.R
13 import kotlinx.android.synthetic.main.fragment_configuracion.*
14
15 class ConfiguracionFragment : Fragment() {
16
17 lateinit var sharedPreferences: SharedPreferences
18
19 override fun onCreate(savedInstanceState: Bundle?) {
20 super.onCreate(savedInstanceState)
21 sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
22 }
23
24 override fun onCreateView(
25 inflater: LayoutInflater, container: ViewGroup?,
26 savedInstanceState: Bundle?
27 ): View? {
28 val v = inflater.inflate(R.layout.fragment_configuracion, container, false)
29
30 val etRuta = v.findViewById<EditText>(R.id.etRuta)
31 val btnGuardar = v.findViewById<Button>(R.id.btnGuardar)
32 val rbProInclu = v.findViewById<RadioButton>(R.id.rbProInclu)
33 val rbProNoInclu = v.findViewById<RadioButton>(R.id.rbProNoInclu)
34 val cbHabiLectura = v.findViewById<CheckBox>(R.id.cbHabiLectura)
35 val cbMostrarStock = v.findViewById<CheckBox>(R.id.cbMostrarStock)
36 val rbCodigoBarras = v.findViewById<RadioButton>(R.id.rbCodigoBarras)
37 val rbCodigoDebo = v.findViewById<RadioButton>(R.id.rbCodigoDebo)
38 val rbCodigoOrigen = v.findViewById<RadioButton>(R.id.rbCodigoOrigen)
39 val rbDeposito = v.findViewById<RadioButton>(R.id.rbDeposito)
40 val rbVentas = v.findViewById<RadioButton>(R.id.rbVentas)
41 val cbMostrarExistencia = v.findViewById<CheckBox>(R.id.cbMostrarExistencia)
42 val cbMostrarPrecio = v.findViewById<CheckBox>(R.id.cbMostrarPrecio)
43 val btnAgregarServidor = v.findViewById<Button>(R.id.btnAgregarServidor)
44
45 if (sharedPreferences.contains("etRuta")) etRuta.setText(
46 sharedPreferences.getString("etRuta", "").toString()
47 )
48
49 if (sharedPreferences.contains("rbProInclu")) {
50 if (sharedPreferences.getString("rbProInclu", "").toString() == "0") {
51 rbProInclu.isChecked=false
52 rbProNoInclu.isChecked = true
53 } else if (sharedPreferences.getString("rbProInclu", "").toString() == "1") {
54 rbProInclu.isChecked = true
55 rbProNoInclu.isChecked = false
56 }
57 } else (sharedPreferences.getString("rbProInclu", "").toString() == "")
58
59 if (sharedPreferences.contains("rbProNoInclu")) {
60 if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") {
61 rbProNoInclu.isChecked = false
62 rbProInclu.isChecked = true
63 } else if (sharedPreferences.getString("rbProNoInclu", "").toString() == "1") {
64 rbProNoInclu.isChecked = true
65 rbProInclu.isChecked=false
66 }
67 } else (sharedPreferences.getString("rbProNoInclu", "").toString() == "")
68
69
70 if (sharedPreferences.contains("cbHabiLectura")) {
71 if (sharedPreferences.getString("cbHabiLectura", "").toString() == "0") {
72 cbHabiLectura.isChecked=false
73 } else if (sharedPreferences.getString("cbHabiLectura", "").toString() == "1") {
74 cbHabiLectura.isChecked = true
75 }
76 } else (sharedPreferences.getString("cbHabiLectura", "").toString() == "")
77
78
79 if (sharedPreferences.contains("cbMostrarStock")) {
80 if (sharedPreferences.getString("cbMostrarStock", "").toString() == "0") {
81 cbMostrarStock.isChecked = false
82 } else if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") {
83 cbMostrarStock.isChecked = true
84 }
85 } else (sharedPreferences.getString("cbMostrarStock", "").toString() == "")
86
87
88 if (sharedPreferences.contains("rbVentas")) {
89 if (sharedPreferences.getString("rbVentas", "").toString() == "0") {
90 rbVentas.isChecked=false
91 rbDeposito.isChecked = true
92 } else if (sharedPreferences.getString("rbVentas", "").toString() == "1") {
93 rbVentas.isChecked = true
94 rbDeposito.isChecked = false
95 }
96 } else (sharedPreferences.getString("rbVentas", "").toString() == "")
97
98 if (sharedPreferences.contains("rbDeposito")) {
99 if (sharedPreferences.getString("rbDeposito", "").toString() == "0") {
100 rbDeposito.isChecked = false
101 rbVentas.isChecked = true
102 } else if (sharedPreferences.getString("rbDeposito", "").toString() == "1") {
103 rbDeposito.isChecked = true
104 rbVentas.isChecked=false
105 }
106 } else (sharedPreferences.getString("rbDeposito", "").toString() == "")
107
108
109
110 if (sharedPreferences.contains("rbCodigoDebo")) {
111 if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "0") {
112 rbCodigoDebo.isChecked=false
113 rbCodigoOrigen.isChecked = false
114 rbCodigoBarras.isChecked = false
115 } else if (sharedPreferences.getString("rbCodigoDebo", "").toString() == "1") {
116 rbCodigoDebo.isChecked = true
117 rbCodigoOrigen.isChecked = false
118 rbCodigoBarras.isChecked = false
119 }
120 } else (sharedPreferences.getString("rbCodigoDebo", "").toString() == "")
121
122 if (sharedPreferences.contains("rbCodigoOrigen")) {
123 if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "0") {
124 rbCodigoOrigen.isChecked = false
125 } else if (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "1") {
126 rbCodigoOrigen.isChecked = true
127 }
128 } else (sharedPreferences.getString("rbCodigoOrigen", "").toString() == "")
129 if (sharedPreferences.contains("rbCodigoBarras")) {
130 if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "0") {
131 rbCodigoBarras.isChecked = false
132 } else if (sharedPreferences.getString("rbCodigoBarras", "").toString() == "1") {
133 rbCodigoBarras.isChecked = true
134 }
135 } else (sharedPreferences.getString("rbCodigoBarras", "").toString() == "")
136
137
138 if (sharedPreferences.contains("cbMostrarExistencia")) {
139 if (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "0") {
140 cbMostrarExistencia.isChecked=false
141 } else if (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "1") {
142 cbMostrarExistencia.isChecked = true
143 }
144 } else (sharedPreferences.getString("cbMostrarExistencia", "").toString() == "")
145
146
147 if (sharedPreferences.contains("cbMostrarPrecio")) {
148 if (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "0") {
149 cbMostrarPrecio.isChecked = false
150 } else if (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "1") {
151 cbMostrarPrecio.isChecked = true
152 }
153 } else (sharedPreferences.getString("cbMostrarPrecio", "").toString() == "")
154
155 btnGuardar.setOnClickListener {
156 guardarPreferencias()
157 Toast.makeText(v.context, "Los Datos se guardaron correctamente", Toast.LENGTH_LONG)
158 .show()
159 }
160 btnAgregarServidor.setOnClickListener {
161
162 findNavController().navigate(R.id.servidoresFragment)
163 }
164
165 return v
166 }
167
168 fun guardarPreferencias() {
169 try {
170 val editor = sharedPreferences.edit()
171
172 if (etRuta.text.isNotEmpty()) editor?.putString("etRuta", etRuta.text.toString())
173
174 if (rbProInclu.isChecked) editor?.putString("rbProInclu", "1") else editor?.putString("rbProInclu", "0")
175 if (rbProNoInclu.isChecked) editor?.putString("rbProNoInclu", "1") else editor?.putString("rbProNoInclu", "0")
176
177 if (cbHabiLectura.isChecked) editor?.putString(
178 "cbHabiLectura", "1"
179 ) else editor?.putString("cbHabiLectura", "0")
180 if (cbMostrarStock.isChecked) editor?.putString(
181 "cbMostrarStock", "1"
182 ) else editor?.putString("cbMostrarStock", "0")
183 if (rbVentas.isChecked) editor?.putString(
184 "rbVentas", "1"
185 ) else editor?.putString("rbVentas", "0")
186 if (rbDeposito.isChecked) editor?.putString(
187 "rbDeposito", "1"
188 ) else editor?.putString("rbDeposito", "0")
189 if (rbCodigoDebo.isChecked) editor?.putString(
190 "rbCodigoDebo", "1"
191 ) else editor?.putString("rbCodigoDebo", "0")
192 if (rbCodigoOrigen.isChecked) editor?.putString(
193 "rbCodigoOrigen", "1"
194 ) else editor?.putString("rbCodigoOrigen", "0")
195 if (rbCodigoBarras.isChecked) editor?.putString(
196 "rbCodigoBarras", "1"
197 ) else editor?.putString("rbCodigoBarras", "0")
198 if (cbMostrarExistencia.isChecked) editor?.putString(
199 "cbMostrarExistencia", "1"
200 ) else editor?.putString("cbMostrarExistencia", "0")
201 if (cbMostrarPrecio.isChecked) editor?.putString(
202 "cbMostrarPrecio", "1"
203 ) else editor?.putString("cbMostrarPrecio", "0")
204
205 editor?.apply()
206 editor.commit()
207 } catch (e: Exception) {
208 e.printStackTrace()
209 }
210 }
211 }
app/src/main/java/com/focasoftware/deboinventariov20/ui/dialogos/SingleChoiceAlertDialog.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.dialogos
2
3 import android.app.AlertDialog
4 import android.app.Dialog
5 import android.os.Bundle
6 import androidx.fragment.app.DialogFragment
7
8 class SingleChoiceAlertDialog : DialogFragment() {
9
10 interface OnDialogSelectorListener {
11 fun onSelectedOption(dialogId: Int)
12 }
13
14
15 var mDialogSelectorCallback: OnDialogSelectorListener? = null
16
17 fun newInstance(title: String, values: Array<String>, selected: Int = -1): SingleChoiceAlertDialog? {
18 val dialog = SingleChoiceAlertDialog()
19
20 val args = Bundle()
21 args.putString("title", title)
22 args.putStringArray("values", values)
23 args.putInt("selected", selected)
24 dialog.arguments = args
25
26 return dialog
27
28 }
29
30 override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
31
32 return activity?.let {
33
34 val args = requireArguments()
35 val title = args.getString("title")
36 val values = args.getStringArray("values")
37 val selectedIndex = args.getInt("selected")
38
39 val builder: AlertDialog.Builder = AlertDialog.Builder(requireActivity())
40
41 builder.setSingleChoiceItems(values, selectedIndex) { _, which ->
42 //val item = values?.get(which)
43 mDialogSelectorCallback?.onSelectedOption(which)
44 dialog?.dismiss()
45 }
46 builder.setTitle(title)
47
48 return builder.create()
49 } ?: throw IllegalStateException("Activity cannot be null")
50 }
51
52
53 }
app/src/main/java/com/focasoftware/deboinventariov20/ui/dialogos/dialogoLogin.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.dialogos
2
3 import android.app.AlertDialog
4 import android.app.Dialog
5 import android.content.Context
6 import android.content.DialogInterface
7 import android.content.SharedPreferences
8 import android.os.Bundle
9 import androidx.fragment.app.DialogFragment
10 import com.focasoftware.deboinventariov20.R
11
12 class dialogoLogin() : DialogFragment() {
13 private lateinit var sharedPreferences: SharedPreferences
14 interface OnContinueCancelClickListener {
15 fun onPositiveClick()
16 fun onCancelClick()
17 }
18 // interface onDialogPositiveClick {
19 // abstract fun onDialogPositiveClick()
20 //
21 //// fun onDialogNegativeClick(dialog: DialogFragment)
22 // }
23 // var mDialogSelectorCallback: dialogoLogin.onDialogPositiveClick? = null
24 fun newInstance(s: String): dialogoLogin? {
25 val dialog = dialogoLogin()
26
27 val args = Bundle()
28 args.putString("title", s)
29 dialog.arguments = args
30
31 return dialog
32 }
33 override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
34 return activity?.let {
35 val builder = AlertDialog.Builder(it)
36 // val args = requireArguments()
37 // val title = args.getString("title")
38 val inflater = requireActivity().layoutInflater;
39
40 builder.setView(inflater.inflate(R.layout.dialog_signin, null))
41 .setTitle("El producto ya fue escaneado")
42 // .setMessage("La cantidad cargada es $title")
43 .setPositiveButton(android.R.string.ok) { _, _ ->
44 val listener = activity as OnContinueCancelClickListener?
45 listener!!.onPositiveClick()
46 }
47 .setNegativeButton(android.R.string.cancel) { _, _ ->
48 val listener = activity as OnContinueCancelClickListener?
49 listener!!.onCancelClick()
50 }
51 // builder.setPositiveButton(android.R.string.ok) { _, _ ->
52 // mDialogSelectorCallback!!.onDialogPositiveClick()
53 // }
54 // .setPositiveButton(R.string.btnOk,
55 // DialogInterface.OnClickListener { dialog, id ->
56 // mDialogSelectorCallback!!.onDialogPositiveClick()
57 // sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
58 // val editor = sharedPreferences.edit()
59 // editor?.putString("cantArtIng", R.id.username.toString())
60 //// editor?.putString("TitArtIng", "")
61 // editor?.apply()
62 // editor.commit()
63 // })
64 // .setNegativeButton(R.string.btnCancela,
65 // DialogInterface.OnClickListener { dialog, id ->
66 // getDialog()!!.cancel()
67 // })
68 builder.create()
69 } ?: throw IllegalStateException("Activity cannot be null")
70 }
71 }
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/BaseFragment.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.inventario
2
3 import android.os.Bundle
4 import androidx.fragment.app.Fragment
5 import kotlinx.coroutines.CoroutineScope
6 import kotlinx.coroutines.Dispatchers
7 import kotlinx.coroutines.Job
8 import kotlin.coroutines.CoroutineContext
9
10 abstract class BaseFragment : Fragment(), CoroutineScope {
11
12
13 lateinit var job: Job
14
15 override val coroutineContext: CoroutineContext
16 get() = job + Dispatchers.Main
17
18 override fun onCreate(savedInstanceState: Bundle?) {
19 super.onCreate(savedInstanceState)
20 job = Job()
21 }
22
23 override fun onDestroy() {
24 super.onDestroy()
25 job.cancel()
26 }
27
28
29 }
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/DescripcionFragment.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.inventario
2
3 import android.content.Context
4 import android.content.SharedPreferences
5 import android.graphics.Canvas
6 import android.graphics.Color
7 import android.graphics.drawable.ColorDrawable
8 import android.os.Bundle
9 import android.view.LayoutInflater
10 import android.view.View
11 import android.view.ViewGroup
12 import android.widget.Button
13 import androidx.fragment.app.Fragment
14 import androidx.lifecycle.lifecycleScope
15 import androidx.navigation.NavController
16 import androidx.navigation.Navigation
17 import androidx.recyclerview.widget.ItemTouchHelper
18 import androidx.recyclerview.widget.LinearLayoutManager
19 import androidx.recyclerview.widget.RecyclerView
20 import com.afollestad.materialdialogs.MaterialDialog
21 import com.afollestad.materialdialogs.input.input
22 import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
23 import com.focasoftware.deboinventariov20.Model.Articles
24 import com.focasoftware.deboinventariov20.Model.InvBody
25 import com.focasoftware.deboinventariov20.R
26 import kotlinx.coroutines.Dispatchers
27 import kotlinx.coroutines.launch
28 import kotlinx.coroutines.withContext
29
30 class DescripcionFragment : Fragment() {
31 private var artAcargar2: List<Articles>? = null
32 private var listArticulos2: List<Articles>? = null
33 lateinit var viewAdapter2: RecyclerView.Adapter<*>
34 private lateinit var viewManager2: RecyclerView.LayoutManager
35 private lateinit var rcDescripcion: RecyclerView
36 private var swipeBackground: ColorDrawable = ColorDrawable(Color.YELLOW)
37 private var cantidad = 0F
38 private var numeroInventario = 0
39 lateinit var navController: NavController
40 lateinit var sharedPreferences: SharedPreferences
41
42 override fun onCreate(savedInstanceState: Bundle?) {
43 super.onCreate(savedInstanceState)
44 sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
45 arguments.apply {
46 artAcargar2 = requireArguments().getSerializable("ArrayDesc") as List<Articles>
47 numeroInventario = requireArguments().getInt("numeroInv")
48 }
49 }
50
51 override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
52 super.onViewCreated(view, savedInstanceState)
53 navController = Navigation.findNavController(view)
54 }
55
56 override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
57 // Inflate the layout for this fragment
58 val v = inflater.inflate(R.layout.fragment_descripcion, container, false)
59 rcDescripcion = v.findViewById(R.id.rcDescripcion)
60 val btnSalir = v.findViewById<Button>(R.id.btnSalir)
61
62 IngresarRecicler(artAcargar2)
63
64 btnSalir.setOnClickListener {
65 requireActivity().onBackPressed()
66 }
67 return v
68 }
69
70 fun IngresarRecicler(articulos: List<Articles>?) {
71
72 viewAdapter2 = DescripcionListAdapter(articulos)
73 viewManager2 = LinearLayoutManager(requireContext())
74
75 rcDescripcion.apply {
76 adapter = viewAdapter2
77 layoutManager = viewManager2
78 }
79 val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT or ItemTouchHelper.RIGHT) {
80 override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean {
81 return false
82 }
83
84 override fun onSwiped(viewHolder: RecyclerView.ViewHolder, position: Int) {
85 MaterialDialog(requireContext()).show {
86 title(R.string.sTitulo)
87 message(R.string.sMensajeEncontrado)
88 input { materialDialog, charSequence ->
89 cantidad = 0F
90 cantidad = charSequence.toString().toFloat()
91 }
92 // .input("Cantidad",1,,1,0,InputType.TYPE_CLASS_NUMBER,0,waitForPositiveButton = true,false,positiveButton ())
93 positiveButton(R.string.btnOk) {
94 dismiss()
95 var indice = 0
96 indice=viewHolder.layoutPosition
97
98 val body = InvBody(numeroInventario,
99 (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.sector,
100 // TODO PREPARO PARA MANDAR A CARGAR EN LA BD
101 (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.codigo,
102 (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.descripcion,
103 cantidad.toString(),
104 (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.codBar,
105 (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.codOrigen,
106 (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.precio,
107 (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.precio,
108 (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.balanza,
109 (viewAdapter2 as DescripcionListAdapter).items2?.get(indice)!!.depSn,
110 InventarioFragment().ObtenerFechaActual(),
111 InventarioFragment().ObtenerFechaActual())
112 InsertarArtEnDB(body)// TODO: MANDO A CARGAR A LA BASE DE DATOS
113 val editor = sharedPreferences.edit()
114 editor?.putString("Inventario", numeroInventario.toString())
115 editor?.apply()
116 editor.commit()
117 navController.navigate(R.id.action_descripcionFragment_to_inventarioFragment)
118 }
119 }.cancelOnTouchOutside(false).cornerRadius(10F)
120 }
121
122 override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) {
123 super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive)
124 val itemView = viewHolder.itemView
125
126 c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat())
127
128 if (dX > 0) {
129
130 c.drawColor(Color.RED)
131 } else if (dX < 0) {
132 // swipeBackground.setBounds(itemView.right+dX.toInt(),itemView.top,itemView.right,itemView.bottom)
133 c.drawColor(Color.YELLOW)
134 }
135 swipeBackground.draw(c)
136 super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive)
137 }
138 }
139 val itemTouchHelper2 = ItemTouchHelper(itemTouchHelperCallback)
140 itemTouchHelper2.attachToRecyclerView(rcDescripcion)
141
142 }
143
144 fun InsertarArtEnDB(cuarpoInventario: InvBody) {
145 lifecycleScope.launch {
146 withContext(Dispatchers.IO) {
147 AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario)
148 }
149 }
150 }
151 }
152
153
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/DescripcionListAdapter.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.inventario
2
3 import android.view.LayoutInflater
4 import android.view.View
5 import android.view.ViewGroup
6 import androidx.recyclerview.widget.RecyclerView
7 import com.focasoftware.deboinventariov20.Model.Articles
8 import com.focasoftware.deboinventariov20.R
9 import kotlinx.android.synthetic.main.item.view.*
10
11 class DescripcionListAdapter(private val productos: List<Articles>?) :
12 RecyclerView.Adapter<DescripcionListAdapter.ItemsViewHolder>() {
13 internal var items2: List<Articles>? = null
14
15 init {
16 this.items2 = productos
17 }
18
19 override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(
20 LayoutInflater.from(parent.context).inflate(R.layout.item_descripcion, parent, false)
21 )
22
23 override fun getItemCount() = productos!!.size
24
25 override fun onBindViewHolder(holder: ItemsViewHolder, position: Int) {
26 when (holder) {
27 is ItemsViewHolder -> {
28 holder.bind(items2!![position])
29 }
30 }
31 }
32
33
34 class ItemsViewHolder constructor(view: View) : RecyclerView.ViewHolder(view) {
35
36 val sector = view.tvSector
37 val codigo = view.tvCodigo
38 val descripcion = view.tvDescripcion
39 val codigoBarras = view.tvCodigoBarras
40
41 fun bind(pro: Articles) {
42 sector.text = pro.sector
43 codigo.text = pro.codigo
44 descripcion.text = pro.descripcion
45 codigoBarras.text = pro.codBar
46 }
47 }
48 }
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/DialogPersoComplexCantidadModificacion.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.inventario
2
3 import android.app.AlertDialog
4 import android.app.Dialog
5 import android.content.Context
6 import android.text.Editable
7 import android.text.TextWatcher
8 import android.view.View
9 import android.view.View.OnFocusChangeListener
10 import android.widget.Button
11 import android.widget.EditText
12 import android.widget.ImageView
13 import android.widget.TextView
14 import com.focasoftware.deboinventariov20.R
15
16 /**
17 * Dialogo que permite mostrar una UI para modificar la cantidad de un articulo
18 * en las BD
19 * @author GuillermoR
20 */
21 class DialogPersoComplexCantidadModificacion(context: Context?,
22 tipo_operacion: Int,
23 valor_inicial: Float,
24 listenerValidar: View.OnClickListener?,
25 listenerCancelar: View.OnClickListener?,
26 listenerReset: View.OnClickListener?) : Dialog(context!!), GestionarioTecladoVirtual {
27 /**
28 * TextView para mostrar el valor incical
29 */
30 private val textV_valor_inicial: TextView
31
32 /**
33 * Text view para mostrar el valor previsional luego de modificar su cantidad
34 */
35 private val textV_valor_previsional: TextView
36
37 /**
38 * EditText para almacenar el nuevo valor a ingresar
39 */
40 private val editT_nuevo_valor: EditText
41
42 /**
43 * Boton para resetear la cantidad
44 */
45 private val boton_reset: Button? = null
46
47 /**
48 * Variables accesorias
49 */
50 private var VALOR_INICIO = 0f
51 private var TIPO_OPERACION = -1
52
53 /**
54 * Devuleve el nuevo valor
55 *
56 * 1 Test para ver si el valor tiene formato a nombre, sino 0
57 *
58 * 2 Para provocar la excepcion si s no es del tipo Integer
59 *
60 * 3 En caso de error, devolvemos 0 si se trata de "sumar" o "restar".
61 * En el caso del "modificar", devolvemos "" para poder
62 * restablecer un "No Tomado", o valor inicial sino
63 *
64 * @return
65 */
66 fun get_nuevo_valor(): String {
67 //1 Test para ver si el valor tiene formato a nombre, sino 0:
68 val s = editT_nuevo_valor.text.toString()
69 return try {
70 //2 Para provocar la excepcion si s no es del tipo Integer
71 s.toFloat()
72 s
73 } catch (ex: Exception) {
74 VALOR_INICIO.toString()
75 }
76 }
77
78 fun valor_incorrecto(context: Context?) {
79 val show = AlertDialog.Builder(context).setTitle("Debo Inventario").setMessage("Valor ingresado incorrecto").show()
80 }
81
82 override fun showKeyboard(edit_text: EditText?) {
83 // TODO Auto-generated method stub
84 }
85
86 override fun hideKeyboard(edit_text: EditText?) {
87 // TODO Auto-generated method stub
88 }
89
90 /**
91 * Constructor completo, setea las UI y carga los handlers
92 *
93 * 1 Construccin del ttulo
94 *
95 * 2 Cargamos el layout y main layout
96 *
97 * 3 Actualizacin de los textos
98 *
99 * 4 Si estamos en el modo "MODIFICAR",
100 * se habilita la posibilidad de reestablecer el valor a No Tomado
101 *
102 * 5 EditTexts y handlers de los mismos
103 *
104 * 6 Botones y sus handlers
105 *
106 * @param context
107 * @param tipo_operacion
108 * @param valor_inicial
109 * @param listenerValidar
110 * @param listenerCancelar
111 * @param listenerReset
112 */
113 init {
114 super.setTitle("Nuevo valor")
115
116
117 // System.out.println("::: DialogComple modificacion antes del switch");
118 super.setContentView(R.layout.z_dialogpersocomplexcantidad_modificacion)
119
120 //3 Actualizacin de los textos:
121 textV_valor_inicial = super.findViewById<View>(R.id.Z_DIALOG_cantidad_actual) as TextView
122 textV_valor_inicial.text = valor_inicial.toString()
123 VALOR_INICIO = valor_inicial
124 TIPO_OPERACION = tipo_operacion
125 textV_valor_previsional = super.findViewById<View>(R.id.Z_DIALOG_cantidad_final) as TextView
126 textV_valor_previsional.text = valor_inicial.toString()
127
128
129 //5 EditTexts y handlers de los mismos
130 editT_nuevo_valor = super.findViewById<View>(R.id.Z_DIALOG_cantidad_nueva) as EditText
131 editT_nuevo_valor.onFocusChangeListener = OnFocusChangeListener { v, hasFocus -> showKeyboard(editT_nuevo_valor) }
132 editT_nuevo_valor.addTextChangedListener(object : TextWatcher {
133 override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
134 override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
135 override fun afterTextChanged(s: Editable) {
136 val new_val = 0f
137 var val_temp = 0f
138 val_temp = s.toString().toFloat()
139 textV_valor_previsional.text = val_temp.toString()
140 }
141 })
142 val textV_operacion = super.findViewById<View>(R.id.Z_DIALOG_tipo_operacion) as TextView
143 var miTexto = ""
144 miTexto = "NUEVO VALOR: "
145 textV_operacion.text = miTexto
146
147 //6 Botones y sus handlers:
148 val boton_validar = super.findViewById<View>(R.id.Z_DIALOG_validar) as ImageView
149 val boton_cancelar = super.findViewById<View>(R.id.Z_DIALOG_cancelar) as ImageView
150 boton_validar.setOnClickListener(listenerValidar)
151 boton_cancelar.setOnClickListener(listenerCancelar)
152 }
153 }
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/GestionarioTecladoVirtual.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.inventario
2
3 import android.widget.EditText
4
5 /**
6 * Interface que representa metodos para administrar (Mostrar u ocultar) el teclado
7 * virtual
8 * @author GuillermoR
9 */
10 interface GestionarioTecladoVirtual {
11 /**
12 * Funcion a implementar para mostrar el teclado virtual sobre el editText parametro
13 * @param edit_text
14 */
15 fun showKeyboard(edit_text: EditText?)
16
17 /**
18 * Funcion a implementar para ocultar el teclado virtual sobre el editText parametro
19 * @param edit_text
20 */
21 fun hideKeyboard(edit_text: EditText?)
22 }
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/InsertCant.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.inventario
2
3 import android.app.Dialog
4 import android.content.Context
5 import android.view.View
6 import android.widget.EditText
7 import com.focasoftware.deboinventariov20.R
8
9 class InsertCant(ctxt: Context) : Dialog(ctxt) {
10
11 private val editT: EditText
12 fun get_text(): String {
13 return editT.text.toString()
14 }
15 init {
16 super.setContentView(R.layout.ingresar_cantidad)
17 editT = super.findViewById<View>(R.id.etCantidad) as EditText
18 }
19 }
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/InventarioFragment.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.inventario
2
3 import android.content.Context
4 import android.content.SharedPreferences
5 import android.graphics.Canvas
6 import android.graphics.Color
7 import android.graphics.drawable.Drawable
8 import android.os.Bundle
9 import android.view.KeyEvent
10 import android.view.LayoutInflater
11 import android.view.View
12 import android.view.ViewGroup
13 import android.widget.*
14 import androidx.core.content.ContextCompat
15 import androidx.core.os.bundleOf
16 import androidx.fragment.app.Fragment
17 import androidx.lifecycle.lifecycleScope
18 import androidx.navigation.NavController
19 import androidx.navigation.Navigation
20 import androidx.recyclerview.widget.ItemTouchHelper
21 import androidx.recyclerview.widget.LinearLayoutManager
22 import androidx.recyclerview.widget.RecyclerView
23 import com.afollestad.materialdialogs.MaterialDialog
24 import com.afollestad.materialdialogs.input.input
25 import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
26 import com.focasoftware.deboinventariov20.Model.Articles
27 import com.focasoftware.deboinventariov20.Model.InvBody
28 import com.focasoftware.deboinventariov20.Model.InvHead
29 import com.focasoftware.deboinventariov20.R
30 import kotlinx.android.synthetic.main.fragment_inventario.*
31 import kotlinx.coroutines.*
32 import java.time.LocalDateTime
33 import java.time.format.DateTimeFormatter
34 import java.util.*
35
36
37 class InventarioFragment : Fragment() {
38
39 private lateinit var sharedPreferences: SharedPreferences
40 private var iArea: Int = 0
41 private lateinit var invHead: InvHead
42 private lateinit var rcInventarios: RecyclerView
43 lateinit var viewAdapter: RecyclerView.Adapter<*>
44 private lateinit var viewManager: RecyclerView.LayoutManager
45 private lateinit var sChangeUpper: String
46 private var listArticulos = ArrayList<ItemsRecycler>()
47 lateinit var navController: NavController
48 var InventarioNuevo: Int = 0
49 var fCant = 0F
50 private lateinit var deleteIcon: Drawable
51 // private var editTT: EditText? = null
52 // private var dialogoModificacion: DialogPersoComplexCantidadModificacion? = null
53
54 override fun onCreate(savedInstanceState: Bundle?) {
55 super.onCreate(savedInstanceState)
56
57 sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
58 if (sharedPreferences.contains("Inventario")) if (sharedPreferences.getString("Inventario", "").toString() != "-1") {
59 InventarioNuevo = sharedPreferences.getString("Inventario", "").toString().toInt()
60 val editor = sharedPreferences.edit()
61 editor?.putString("Inventario", "-1")
62 editor?.apply()
63 editor.commit()
64 }
65 }
66
67 override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
68 val v = inflater.inflate(R.layout.fragment_inventario, container, false)
69 sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
70 val tCodigoBarras = v.findViewById<EditText>(R.id.etCodigoBarras)
71 rcInventarios = v.findViewById(R.id.rcInventarios)
72 val tvTitulo = v.findViewById<TextView>(R.id.tvTitulo)
73 val toggleButton = v.findViewById<ToggleButton>(R.id.toggleButton)
74
75
76 if (InventarioNuevo == 0) {// TODO: SI INVETNARIO NUEVO
77 GlobalScope.launch(Dispatchers.Main) {
78 //TODO: BUSCO EL ULTIMO INVENTARIO EN LA BD PARA PODER CREAR EL PROXIMO
79 InventarioNuevo = AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.findLastInv() + 1
80 SerchArea()
81 val descripInv: String = if (iArea == 0) "Inventario Ventas" else "Inventario Deposito"
82 //TODO: CREAMOS EL INVENTARIO EN LA CABECERA DEL INVENTARIO
83 invHead = InvHead(InventarioNuevo, descripInv, 1, ObtenerFechaActual(), ObtenerFechaActual(), 0L, iArea, AjusteProductos(), ProdNoCont())
84 AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.insertInvHead(invHead)
85 tvTitulo.text = "Inventario Dinamico" + " N° $InventarioNuevo"
86 }
87 } else {// TODO: SI VENGO DE FRAGMENT DESCRIPCION
88 CargarDeBdInventario(InventarioNuevo)
89 tvTitulo.text = "Inventario Dinamico" + " N° $InventarioNuevo"
90 }
91
92 tCodigoBarras.setOnKeyListener { _, keyCode, keyEvent ->
93 if (keyCode == KeyEvent.KEYCODE_ENTER && keyEvent.action == KeyEvent.ACTION_UP) {
94 sChangeUpper = tCodigoBarras.text.toString()
95
96 var indiceDelArtEncontrado = 0
97
98 //TODO COMIENZA LA BUSQUEDA POR CODIGO DE BARRAS
99 if (toggleButton.isChecked) {
100 indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 0)//TODO Si encuentra el articulo en el RV devuelve el indice
101 //TODO Si no lo encuentra devuelve -1
102 if (indiceDelArtEncontrado != -1) {
103 if (swSumaUno!!.isChecked) {
104 fCant = 0F
105 fCant = listArticulos[indiceDelArtEncontrado].cantTomada
106 fCant += 1F
107 //TODO ACTUALIZO LA CANTIDAD EN LA BD
108 updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant)
109 //TODO ACTUALIZO LA CANTIDAD EN EL RV
110 listArticulos[indiceDelArtEncontrado].cantTomada = fCant
111 viewAdapter.notifyDataSetChanged()
112 } else {
113 // val mDialogView = LayoutInflater.from(context).inflate(R.layout.login_dialog, null)
114 // val mBuilder = AlertDialog.Builder(context).setView(mDialogView).setTitle("Login Form").setCancelable(false)
115 // val mAlertDialog = mBuilder.show()
116 // mDialogView.dialogLoginBtn.setOnClickListener {
117 // mAlertDialog.dismiss()
118 // //get text from EditTexts of custom layout
119 // val name = mDialogView.dialogNameEt.text.toString()
120 // val email = mDialogView.dialogEmailEt.text.toString()
121 // val password = mDialogView.dialogPasswEt.text.toString()
122 // fCant = 0F
123 // fCant = name.toFloat()
124 // }
125 // mDialogView.dialogCancelBtn.setOnClickListener {
126 // mAlertDialog.dismiss()
127 // }
128 fCant = listArticulos[indiceDelArtEncontrado].cantTomada
129 MaterialDialog(requireContext()).show {
130 title(R.string.sTituloNueva)
131 message(R.string.sCantidadNueva)
132 input { materialDialog, charSequence ->
133 fCant = 0F
134 fCant = charSequence.toString().toFloat()
135 }
136 positiveButton(R.string.btnOk) {
137 //TODO ACTUALIZO CANTIADAD EN BD
138 updateCantidad(listArticulos[indiceDelArtEncontrado].sector.toString(), listArticulos[indiceDelArtEncontrado].codigo.toString(), fCant)
139 //TODO ACTUALIZO CANTIDAD EN RV
140 listArticulos[indiceDelArtEncontrado].cantTomada = fCant
141 viewAdapter.notifyDataSetChanged()
142 dismiss()
143 }
144 }.cancelOnTouchOutside(false).cornerRadius(10F)
145 }
146
147 } else if (indiceDelArtEncontrado == -1) {// no lo encontro en el RV, lo va a buscar en al BD
148
149 GlobalScope.launch(Dispatchers.Main) {
150 //TODO BUSCO EN BASE DE DATOS
151 val artEncontrado = buscarCBEnBD(sChangeUpper.toUpperCase(Locale.ROOT))
152 ContinuarCargaCB(artEncontrado)
153 }
154 }
155
156 tCodigoBarras.focusable = View.FOCUSABLE
157 tCodigoBarras.setText("")
158 tCodigoBarras.selectAll()
159 return@setOnKeyListener true
160
161
162 } else {//TODO BUSQUEDA POR DESCRIPCION**************************************************************************
163
164 indiceDelArtEncontrado = buscoArtEnRv(sChangeUpper.toUpperCase(Locale.ROOT), 1) //TODO :Si encuentra el articulo en el RV devuelve el indice
165 //TODO Si no lo encuentra devuelve -1
166 if (indiceDelArtEncontrado != -1) {
167 // if (swSumaUno!!.isChecked) {
168 // fCant = 0F
169 // fCant = listArticulos[indiceDelArtEncontrado].cantTomada
170 // fCant += 1F
171 // listArticulos[indiceDelArtEncontrado].cantTomada = fCant
172 // viewAdapter.notifyDataSetChanged()
173 // } else {
174 fCant = listArticulos[indiceDelArtEncontrado].cantTomada
175 MaterialDialog(requireContext()).show {
176 title(R.string.sTituloNueva)
177 message(R.string.sCantidadNueva)
178 input { materialDialog, charSequence ->
179 fCant = 0F
180 fCant = charSequence.toString().toFloat()
181 }
182 positiveButton(R.string.btnOk) {
183 listArticulos[indiceDelArtEncontrado].cantTomada = fCant
184 viewAdapter.notifyDataSetChanged()
185 dismiss()
186 }
187 }.cancelOnTouchOutside(false).cornerRadius(10F)
188 // }
189
190 } else if (indiceDelArtEncontrado == -1) {// TODO: no lo encontro en el RV, lo va a buscar en al BD
191 GlobalScope.launch(Dispatchers.Main) {
192 val artEncontrado = buscarDescEnBD(sChangeUpper.toUpperCase(Locale.ROOT))
193 ContinuarCargaDesc(artEncontrado as ArrayList<Articles>)
194 }
195 }
196 tCodigoBarras.focusable = View.FOCUSABLE
197 tCodigoBarras.setText("")
198 tCodigoBarras.selectAll()
199 return@setOnKeyListener true
200 }
201 }
202 return@setOnKeyListener false
203 }
204 return v
205 }
206
207 override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
208 super.onViewCreated(view, savedInstanceState)
209 navController = Navigation.findNavController(view)
210 etCodigoBarras.requestFocus()
211
212 btnBorrarInv.setOnClickListener {
213 MaterialDialog(requireContext()).show {
214 title(R.string.sTituloBorrarInv)
215 message(R.string.sMensajeBorrarInv)
216 positiveButton(R.string.btnOk) {
217 BorrarInvActual()
218 Toast.makeText(requireContext(), "El inventario $InventarioNuevo fue Borrado", Toast.LENGTH_LONG).show()
219 navController.navigate(R.id.action_inventarioFragment_to_mainFragment2)
220 InventarioNuevo = 0
221 dismiss()
222 }
223 negativeButton {
224 dismiss()
225 }
226 }.cancelOnTouchOutside(false).cornerRadius(10F)
227 }
228
229 btnExportarInv.setOnClickListener {
230 MaterialDialog(requireContext()).show {
231 title(R.string.sTituloExportar)
232 message(R.string.sMensajeExportar)
233 positiveButton(R.string.btnOk) {
234 BorrarInvActual()
235 Toast.makeText(requireContext(), "El inventario $InventarioNuevo fue Exportado al Servidor", Toast.LENGTH_LONG).show()
236 navController.navigate(R.id.action_inventarioFragment_to_mainFragment2)
237 InventarioNuevo = 0
238 dismiss()
239 }
240 negativeButton {
241 dismiss()
242 }
243 }.cancelOnTouchOutside(false).cornerRadius(10F)
244 }
245 }
246
247 private fun BorrarInvActual() {
248 lifecycleScope.launch {
249 withContext(Dispatchers.IO) {
250 AppDb.getAppDb(requireActivity())!!.InvHeadDAO()!!.deleteinvHead(InventarioNuevo)
251 AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.deleteInvBody(InventarioNuevo)
252 }
253 }
254 }
255
256 private fun CargarDeBdInventario(ultimoInv: Int) {
257 GlobalScope.launch(Dispatchers.Main) {
258 val invbody = cargarInventario(ultimoInv)
259 for ((i, item) in invbody!!.withIndex()) {
260 val art = Articles(invbody[i].sector,
261 invbody[i].codigo,
262 invbody[i].descripcion,
263 invbody[i].codBar,
264 invbody[i].codOrigen,
265 invbody[i].precio,
266 invbody[i].costo,
267 invbody[i].balanza,
268 invbody[i].depSn,
269 invbody[i].costo)
270 cargarRecicler(art, invbody[i].cantTomada!!.toFloat())
271 }
272 }
273
274 }
275
276 private fun ContinuarCargaDesc(artAcargar: ArrayList<Articles>) {
277 //TODO DESPUES DE INGRESAR LA DESCRIPCION Y DE BUSCAR LOS CAINCIDENCIAS EN LA BASE SE VA A MOSTRAR LAS MISMAS
278 //TODO SI LA CANTIDAD ENCONTRADA ES UNO, LO CARGO DIRECTAMENTE EN EL RV
279
280 if (artAcargar.isNotEmpty() || !artAcargar.isNullOrEmpty()) {// TODO: Si lo encuentra en la BD
281 // if (swSumaUno!!.isChecked) {// TODO: SI ESTA +1, PONE CANTIDAD 1
282 if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV
283 fCant = 0F
284 fCant += 1F
285 // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV
286 val acargarPorDesc = Articles(artAcargar[0].sector,
287 artAcargar[0].codigo,
288 artAcargar[0].descripcion,
289 artAcargar[0].codBar,
290 artAcargar[0].codOrigen,
291 artAcargar[0].precio,
292 artAcargar[0].costo,
293 artAcargar[0].balanza,
294 artAcargar[0].depSn,
295 "")
296 // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD
297 cargarArtEnBd(acargarPorDesc, fCant)
298 cargarRecicler(acargarPorDesc, fCant)
299 } else {
300 var bundle = Bundle()
301 bundle = bundleOf("ArrayDesc" to artAcargar)
302 bundle.putInt("numeroInv", InventarioNuevo)
303 navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle)
304 }
305 // } else {//SI NO ESTA +1
306 // if (artAcargar.size == 1) { // TODO: SI EN EL ARRAY SOLO HAY UN ITEM LO METE DIRECTAMENTE AL RV
307 // fCant = listArticulos[0].cantTomada
308 // MaterialDialog(requireContext()).show {
309 // title(R.string.sTituloNueva)
310 // message(R.string.sCantidadNueva)
311 // input { materialDialog, charSequence ->
312 // fCant = 0F
313 // fCant = charSequence.toString().toFloat()
314 // }
315 // positiveButton(R.string.btnOk) {
316 // listArticulos[0].cantTomada = fCant
317 // viewAdapter.notifyDataSetChanged()
318 // dismiss()
319 // }
320 // }.cancelOnTouchOutside(false).cornerRadius(10F)
321 // // TODO PASO DEL ARRAY A UN ITEM PARA QUE LO CARGUE EN EL RV
322 // val acargarPorDesc = Articles(artAcargar[0].sector,
323 // artAcargar[0].codigo,
324 // artAcargar[0].descripcion,
325 // artAcargar[0].codBar,
326 // artAcargar[0].codOrigen,
327 // artAcargar[0].precio,
328 // artAcargar[0].costo,
329 // artAcargar[0].balanza,
330 // artAcargar[0].depSn,
331 // "")
332 // // TODO LO ENVIO A CARGAR EN EL RV Y EN LA BD
333 // cargarArtEnBd(acargarPorDesc, fCant)
334 // cargarRecicler(acargarPorDesc, fCant)
335 // } else {
336 // var bundle = Bundle()
337 // bundle = bundleOf("ArrayDesc" to artAcargar)
338 // bundle.putInt("numeroInv", InventarioNuevo)
339 // navController.navigate(R.id.action_inventarioFragment_to_descripcionFragment, bundle)
340 // }
341 // }
342 } else {//TODO si no lo encuentra en la BD
343 MaterialDialog(requireContext()).show {
344 title(R.string.sTitulo)
345 message(R.string.sMensaje)
346 positiveButton(R.string.btnOk) {
347 dismiss()
348 }
349 }.cancelOnTouchOutside(false).cornerRadius(10F)
350 }
351
352 }
353
354 private fun ContinuarCargaCB(artAcargar: Articles?) {
355
356 if (artAcargar != null) {//Si lo encuentra en la BD
357
358 if (swSumaUno!!.isChecked) {// SI ESTA +1, PONE CANTIDAD 1
359 fCant = 0F
360 fCant += 1F
361 cargarArtEnBd(artAcargar, fCant)
362 cargarRecicler(artAcargar, fCant)
363 } else {//SI NO ESTA +1 PREGUNTA CANTIDAD
364 MaterialDialog(requireContext()).show {
365 title(R.string.sTitulo)
366 message(R.string.sMensajeEncontrado)
367 input { materialDialog, charSequence ->
368 fCant = 0F
369 fCant = charSequence.toString().toFloat()
370 }
371 // .input("Cantidad",1,,1,0,InputType.TYPE_CLASS_NUMBER,0,waitForPositiveButton = true,false,positiveButton ())
372 positiveButton(R.string.btnOk) {
373 dismiss()
374 cargarArtEnBd(artAcargar, fCant)
375 cargarRecicler(artAcargar, fCant)
376
377 }
378 }.cancelOnTouchOutside(false).cornerRadius(10F)
379 }
380 } else {// TODO si no lo encuentra en la BD
381 MaterialDialog(requireContext()).show {
382 title(R.string.sTitulo)
383 message(R.string.sMensaje)
384 positiveButton(R.string.btnOk) {
385 // if (this.swSumaUno.isChecked) {
386 // swSumaUno.isChecked=false
387 // }
388 dismiss()
389 }
390 }.cancelOnTouchOutside(false).cornerRadius(10F)
391 }
392 }
393
394 suspend fun buscarCBEnBD(CodigoBarras: String): Articles? {
395 //TODO BUSQUEDA POR CODIGO DE BARRAS
396 var busqueda: Articles? = null
397 return GlobalScope.async(Dispatchers.IO) {
398 busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByCodBar(CodigoBarras, iArea)
399 return@async busqueda
400 }.await()
401 }
402
403 suspend fun buscarDescEnBD(descripcion: String): List<Articles>? {
404 //TODO BUSQUEDA POR DESCRIPCION
405 var busqueda: List<Articles>? = null
406 return GlobalScope.async(Dispatchers.IO) {
407 busqueda = AppDb.getAppDb(requireContext())!!.ArticulosDAO()!!.findArticuloByDesc(descripcion, iArea)
408 return@async busqueda
409 }.await()
410 }
411
412 private fun buscoArtEnRv(codigoBarras: String, sTipoBusqueda: Int): Int {
413 var indice = 0
414 var bEncontrado = false
415 if (sTipoBusqueda == 0) {//TODO BUSQUEDA POR CODIGO DE BARRAS
416 for (item in listArticulos) {
417 if (item.codigoBarras!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) {
418 bEncontrado = true
419 break
420 }
421 indice += 1
422 }
423 } else {//TODO BUSQUEDA POR DESCRIPCION
424 for (item in listArticulos) {
425 if (item.descripcion!!.toUpperCase(Locale.ROOT).contains(codigoBarras)) {
426 bEncontrado = true
427 break
428 }
429 indice += 1
430 }
431 }
432 return if (bEncontrado) indice
433 else -1
434 }
435
436 private fun cargarArtEnBd(articulos: Articles, cant: Float) {
437 val body = InvBody(InventarioNuevo,// TODO PREPARO PARA MANDAR A CARGAR EN LA BD
438 articulos.sector,
439 articulos.codigo,
440 articulos.descripcion,
441 cant.toString(),
442 articulos.codBar,
443 articulos.codOrigen,
444 articulos.precio,
445 articulos.precio,
446 articulos.balanza,
447 articulos.depSn,
448 ObtenerFechaActual(),
449 ObtenerFechaActual())
450 InsertarArtEnDB(body)// TODO MANDO A CARGAR A LA BASE DE DATOS
451 }
452
453 fun cargarRecicler(articulos: Articles, cant: Float) {
454
455 //TODO CARGO EN LE RV
456 val item = ItemsRecycler(articulos.sector, articulos.codigo, articulos.descripcion, cant, articulos.codBar)
457 listArticulos.add(item)
458
459 viewAdapter = ProductosListAdapter(listArticulos)
460 viewManager =LinearLayoutManager(requireContext())
461 deleteIcon = ContextCompat.getDrawable(requireContext(), R.drawable.borrar)!!
462 rcInventarios.apply {
463 adapter = viewAdapter
464 layoutManager = viewManager
465 }
466 val itemTouchHelperCallback = object : ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.RIGHT) {
467 override fun onMove(p0: RecyclerView, p1: RecyclerView.ViewHolder, target: RecyclerView.ViewHolder): Boolean {
468 return false
469 }
470
471 override fun onSwiped(viewHolder: RecyclerView.ViewHolder, direction: Int) {
472 (viewAdapter as ProductosListAdapter).removeItem(viewHolder)
473 viewAdapter.notifyDataSetChanged()
474 }
475
476 override fun onChildDraw(c: Canvas, recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder, dX: Float, dY: Float, actionState: Int, isCurrentlyActive: Boolean) {
477 val itemView = viewHolder.itemView
478 val iconMargin = (itemView.height - deleteIcon.intrinsicHeight) / 2
479 c.clipRect(0f, itemView.top.toFloat(), dX, itemView.bottom.toFloat())
480
481 if (dX > 0) {
482
483 if (dX < c.width / 2) c.drawColor(Color.GREEN)
484 else c.drawColor(Color.RED)
485 deleteIcon.setBounds(itemView.left + iconMargin, itemView.top + iconMargin, itemView.left + iconMargin + deleteIcon.intrinsicWidth, itemView.bottom-iconMargin)
486 } else {
487
488 }
489
490 super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive)
491 deleteIcon.draw(c)
492 }
493 }
494
495 val itemTouchHelper = ItemTouchHelper(itemTouchHelperCallback)
496 itemTouchHelper.attachToRecyclerView(rcInventarios)
497 }
498
499 private fun ProdNoCont(): Int? {
500 var mostrarStock = 0
501 if (sharedPreferences.contains("cbMostrarStock")) if (sharedPreferences.getString("cbMostrarStock", "").toString() == "1") mostrarStock = 1
502 return mostrarStock
503 }
504
505 private fun AjusteProductos(): Int? {
506 var prodInclu = 0
507 if (sharedPreferences.contains("rbProInclu")) if (sharedPreferences.getString("rbProInclu", "").toString() == "1") prodInclu = 1
508
509 if (sharedPreferences.contains("rbProNoInclu")) if (sharedPreferences.getString("rbProNoInclu", "").toString() == "0") prodInclu = 0
510 return prodInclu
511 }
512
513 private fun SerchArea() {
514
515 if (sharedPreferences.contains("rbVentas")) if (sharedPreferences.getString("rbVentas", "").toString() == "1") iArea = 0
516 if (sharedPreferences.contains("rbDeposito")) if (sharedPreferences.getString("rbDeposito", "").toString() == "1") iArea = 1
517 }
518
519 fun ObtenerFechaActual(): String? {
520 //TODO OBTENGO FECHA Y HORA ACTUAL PARA LA CABECERA DEL INVENTARIO Y PARA CADA ITEM QUE SE INSERTA EN LA BD
521 val current = LocalDateTime.now()
522 val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
523 val dFechaHora = current.format(formatter)
524 return dFechaHora.toString()
525 }
526
527 fun InsertarArtEnDB(cuarpoInventario: InvBody) {
528 lifecycleScope.launch {
529 withContext(Dispatchers.IO) {
530 AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.insertInvBody(cuarpoInventario)
531 }
532 }
533 }
534
535 fun updateCantidad(sector: String, codigo: String, cantidad: Float) {
536 lifecycleScope.launch {
537 withContext(Dispatchers.IO) {
538 AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.UpdateInvBody(cantidad, sector, codigo)
539 }
540 }
541 }
542
543 suspend fun cargarInventario(inventario: Int): List<InvBody>? {
544 // var inventarios: List<InvBody>? = null
545 return GlobalScope.async(Dispatchers.IO) {
546 return@async AppDb.getAppDb(requireActivity())!!.InvBodyDAO()!!.fetchAllInvBody(inventario)
547 }.await()
548 }
549 }
550
551
552
553
554
555
556
557
558
559
560
561
562
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/ItemDescripcion.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.inventario
2
3 data class ItemDescripcion(val sector: String?,val codigo: String?, val descripcion: String?, val codigoBarras: String?)
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/ItemsRecycler.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.inventario
2
3 data class ItemsRecycler(val sector: String?,val codigo: String?, val descripcion: String?, var cantTomada: Float, val codigoBarras: String?)
app/src/main/java/com/focasoftware/deboinventariov20/ui/inventario/ProductosListAdapter.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.inventario
2
3 import android.view.LayoutInflater
4 import android.view.View
5 import android.view.ViewGroup
6 import androidx.recyclerview.widget.RecyclerView
7 import com.focasoftware.deboinventariov20.R
8 import com.google.android.material.snackbar.Snackbar
9 import kotlinx.android.synthetic.main.item.view.*
10
11
12 class ProductosListAdapter(private val productos: ArrayList<ItemsRecycler>) : RecyclerView.Adapter<ProductosListAdapter.ItemsViewHolder>() {
13 private var removePosition: Int = 0
14 private var removedItem: ItemsRecycler? = null
15 internal var items2: ArrayList<ItemsRecycler>? = null
16
17 init {
18 this.items2 = productos
19 }
20
21 override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.item, parent, false))
22
23 override fun getItemCount() = productos.size
24
25 override fun onBindViewHolder(holder: ItemsViewHolder, position: Int) {
26 when (holder) {
27 is ItemsViewHolder -> {
28 holder.bind(items2!![position])
29 }
30 }
31 }
32
33
34 class ItemsViewHolder constructor(view: View) : RecyclerView.ViewHolder(view) {
35
36 val sector = view.tvSector
37 val codigo = view.tvCodigo
38 val descripcion = view.tvDescripcion
39 val cantCont = view.tvCantidad
40 val codigoBarras = view.tvCodigoBarras
41
42 fun bind(pro: ItemsRecycler) {
43 sector.text = pro.sector
44 codigo.text = pro.codigo
45 descripcion.text = pro.descripcion
46 cantCont.text = pro.cantTomada.toString()
47 codigoBarras.text = pro.codigoBarras
48 }
49 }
50
51 fun removeItem(viewHolder: RecyclerView.ViewHolder) {
52 removePosition = viewHolder.adapterPosition
53 removedItem = productos[viewHolder.adapterPosition]
54
55 productos.removeAt(viewHolder.adapterPosition)
56 notifyItemRemoved(viewHolder.adapterPosition)
57
58 Snackbar.make(viewHolder.itemView, "El articulo fue ${removedItem!!.descripcion} eliminado", Snackbar.LENGTH_LONG).setAction("Rehacer") {
59 productos.add(removePosition, removedItem!!)
60 notifyItemInserted(removePosition)
61 }.show()
62 }
63 // interface OnItemClickListener{
64 // fun OnImageClick(position: Int)
65 // }
66 }
app/src/main/java/com/focasoftware/deboinventariov20/ui/main/InventarioListAdapter.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.main
2
3 import android.view.LayoutInflater
4 import android.view.View
5 import android.view.ViewGroup
6 import androidx.recyclerview.widget.RecyclerView
7 import com.focasoftware.deboinventariov20.R
8 import com.google.android.material.snackbar.Snackbar
9 import kotlinx.android.synthetic.main.item.view.*
10 import kotlinx.android.synthetic.main.item_principal.view.*
11 import javax.sql.ConnectionEventListener
12
13
14 class InventarioListAdapter(private val productos: ArrayList<ItemInventario>, private val listener: OnItemClickListener) : RecyclerView.Adapter<InventarioListAdapter.ItemsViewHolder>() {
15
16 internal var items2: ArrayList<ItemInventario>? = null
17
18 init {
19 this.items2 = productos
20 }
21
22 override fun onCreateViewHolder(parent: ViewGroup, p1: Int) = ItemsViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.item_principal, parent, false))
23
24 override fun getItemCount() = productos.size
25
26 override fun onBindViewHolder(holder: ItemsViewHolder, position: Int) {
27 val currentItem=productos[position]
28 holder.inventario.text=currentItem.inventario
29 }
30
31 inner class ItemsViewHolder constructor(view: View) : RecyclerView.ViewHolder(view),View.OnClickListener {
32
33
34 val inventario = view.inventario
35 init {
36 itemView.setOnClickListener(this)
37 }
38 override fun onClick(p0: View?) {
39 val position=adapterPosition
40 if (position!=RecyclerView.NO_POSITION) {
41 listener.OnItemClick(position)
42 }
43 }
44 }
45
46 interface OnItemClickListener{
47 fun OnItemClick(position: Int)
48 }
49 }
50
51
app/src/main/java/com/focasoftware/deboinventariov20/ui/main/ItemPrincipal.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.main
2
3 data class ItemInventario(val inventario: String?)
app/src/main/java/com/focasoftware/deboinventariov20/ui/main/MainFragment.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.main
2
3 import android.content.Context
4 import android.content.SharedPreferences
5 import android.os.Bundle
6 import android.view.LayoutInflater
7 import android.view.View
8 import android.view.ViewGroup
9 import androidx.core.view.get
10 import androidx.fragment.app.Fragment
11 import androidx.navigation.NavController
12 import androidx.navigation.Navigation
13 import androidx.recyclerview.widget.LinearLayoutManager
14 import androidx.recyclerview.widget.RecyclerView
15 import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
16 import com.focasoftware.deboinventariov20.Model.InvHead
17 import com.focasoftware.deboinventariov20.R
18 import kotlinx.coroutines.Dispatchers
19 import kotlinx.coroutines.GlobalScope
20 import kotlinx.coroutines.async
21 import kotlinx.coroutines.launch
22 import java.util.*
23
24 class MainFragment : Fragment(), InventarioListAdapter.OnItemClickListener {
25 private lateinit var inventarios: List<InvHead>
26 private lateinit var rcInventario: RecyclerView
27 private lateinit var viewAdapter: RecyclerView.Adapter<*>
28 private lateinit var viewManager: RecyclerView.LayoutManager
29 private var listIvn = ArrayList<ItemInventario>()
30 private lateinit var navController: NavController
31 private lateinit var sharedPreferences: SharedPreferences
32
33 override fun onCreate(savedInstanceState: Bundle?) {
34 super.onCreate(savedInstanceState)
35 sharedPreferences = requireActivity().getSharedPreferences("SP_INFO", Context.MODE_PRIVATE)
36
37
38 }
39
40 override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
41 val v = inflater.inflate(R.layout.fragment_main, container, false)
42 GlobalScope.launch(Dispatchers.Main) {
43 inventarios = buscarEnBDInvHead()
44 for ((i, item) in inventarios.withIndex()) {
45 val inv = InvHead(inventarios[i].invNum,
46 inventarios[i].descripcion,
47 inventarios[i].estado,
48 inventarios[i].fechaInicio,
49 inventarios[i].fechaFinal,
50 inventarios[i].prodContados,
51 inventarios[i].lugar,
52 inventarios[i].stDesc,
53 inventarios[i].proNoCont)
54 cargarRecicler(inv)
55 }
56 }
57 rcInventario = v.findViewById(R.id.rcInventario)
58 return v
59 }
60
61 suspend fun buscarEnBDInvHead(): List<InvHead> {
62 //TODO BUSQUEDA POR DESCRIPCION
63 var busqueda: List<InvHead>
64 return GlobalScope.async(Dispatchers.IO) {
65 busqueda = AppDb.getAppDb(requireContext())!!.InvHeadDAO()!!.fetchAllInvHead()
66 return@async busqueda
67 }.await()
68 }
69
70 fun cargarRecicler(inv: InvHead) {
71 var numero=""
72 //TODO CARGO EN LE RV
73 if (inv.invNum.toLong()<10) numero="0${inv.invNum.toLong()}" else numero=inv.invNum.toString()
74 val item = ItemInventario("Inventeario: ${numero} ${inv.descripcion} Fecha:${inv.fechaFinal} ")
75 //(articulos.sector, articulos.codigo, articulos.descripcion, cant, articulos.codBar)
76 listIvn.add(item)
77
78 viewAdapter = InventarioListAdapter(listIvn, this)
79 viewManager = LinearLayoutManager(requireContext())
80
81 rcInventario.apply {
82 adapter = viewAdapter
83 layoutManager = viewManager
84 }
85 }
86
87 override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
88 super.onViewCreated(view, savedInstanceState)
89 navController = Navigation.findNavController(view)
90 }
91
92 override fun OnItemClick(position: Int) {
93 val editor = sharedPreferences.edit()
94 var invSel:String = listIvn[position].inventario.toString()
95 invSel=invSel.substring(13, 15)
96 editor?.putString("Inventario", invSel)
97 editor?.apply()
98 editor.commit()
99 navController.navigate(R.id.action_mainFragment2_to_inventarioFragment)
100
101 }
102 }
103
104
app/src/main/java/com/focasoftware/deboinventariov20/ui/servidores/AdapterServidores.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.servidores
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 kotlinx.android.synthetic.main.item_servidores.view.*
10
11 class AdapterServidores(
12 private val servidor: ArrayList<ItemsServidores>,
13 private var contexto: Context
14 ) :
15 RecyclerView.Adapter<AdapterServidores.ViewHolder>() {
16
17
18 class ViewHolder(var vista: View) : RecyclerView.ViewHolder(vista) {
19 fun bind(itemsServidores: ItemsServidores) {
20 vista.tvDescServidor.text = itemsServidores.descripcion
21 vista.tvDireccionServidor.text = itemsServidores.direccion
22
23 }
24 }
25
26 override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
27 return ViewHolder(
28 LayoutInflater.from(parent.context).inflate(R.layout.item_servidores, parent, false)
29 )
30 }
31
32 override fun getItemCount(): Int {
33 return servidor.size
34 }
35
36 override fun onBindViewHolder(holder: ViewHolder, position: Int) {
37 holder.bind(servidor[position])
38 }
39
40 }
app/src/main/java/com/focasoftware/deboinventariov20/ui/servidores/ItemsServidores.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.servidores
2
3 data class ItemsServidores (val descripcion: String?, var direccion: String?, var predeterminado: String?)
app/src/main/java/com/focasoftware/deboinventariov20/ui/servidores/ServidoresFragment.kt
File was created 1 package com.focasoftware.deboinventariov20.ui.servidores
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 android.widget.Button
9 import androidx.recyclerview.widget.DefaultItemAnimator
10 import androidx.recyclerview.widget.LinearLayoutManager
11 import androidx.recyclerview.widget.RecyclerView
12 import com.focasoftware.deboinventariov20.DB.DataBase.AppDb
13 import com.focasoftware.deboinventariov20.Model.ServeInv
14 import com.focasoftware.deboinventariov20.R
15 import kotlinx.android.synthetic.main.fragment_servidores.*
16 import kotlinx.coroutines.GlobalScope
17 import kotlinx.coroutines.launch
18
19 class ServidoresFragment : Fragment() {
20 val servidorNuevo = ArrayList<ItemsServidores>()
21 var index=0
22
23 override fun onCreateView(
24 inflater: LayoutInflater,
25 container: ViewGroup?,
26 savedInstanceState: Bundle?
27 ): View? {
28 val v = inflater.inflate(R.layout.fragment_servidores, container, false)
29
30 val btnGuardarServidores = v.findViewById<Button>(R.id.btnGuardarServidores)
31 val rvServidores = v.findViewById<RecyclerView>(R.id.rvServidores)
32
33 rvServidores.layoutManager = LinearLayoutManager(context)
34 rvServidores.itemAnimator = DefaultItemAnimator()
35
36 btnGuardarServidores.setOnClickListener {
37 rvServidores.adapter = AdapterServidores(ingregarDatos(), requireContext())
38 }
39 return v
40 }
41
42 fun ingregarDatos(): ArrayList<ItemsServidores> {
43
44 val item=ItemsServidores(etNombreServidor.text.toString(),etDireccionServidor.text.toString(),"0")
45
46 val servidor = ServeInv(
47 etNombreServidor.text.toString(),
48 etDireccionServidor.text.toString(),
49 "0")
50 index+=index
51 servidorNuevo.add(item)
52 val Job = GlobalScope.launch {
53 AppDb.getAppDb(requireActivity())!!.ServeInvDao()!!.insertServer(servidor)
54 }
55
56 return servidorNuevo
57 }
58 }
app/src/main/res/anim/slide_in_left.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <set xmlns:android="http://schemas.android.com/apk/res/android">
3
4 </set>
app/src/main/res/anim/slide_in_right.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <set xmlns:android="http://schemas.android.com/apk/res/android">
3
4 </set>
app/src/main/res/anim/slide_out_left.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <set xmlns:android="http://schemas.android.com/apk/res/android">
3
4 </set>
app/src/main/res/anim/slide_out_right.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <set xmlns:android="http://schemas.android.com/apk/res/android">
3
4 </set>
app/src/main/res/drawable-v24/camera.xml
File was created 1 <vector android:height="50dp" android:tint="?attr/colorControlNormal"
2 android:viewportHeight="24" android:viewportWidth="24"
3 android:width="50dp" xmlns:android="http://schemas.android.com/apk/res/android">
4 <path android:fillColor="@android:color/white" android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0"/>
5 <path android:fillColor="@android:color/white" android:pathData="M9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2L9,2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z"/>
6 </vector>
7
app/src/main/res/drawable-v24/configuracion.xml
File was created 1 <vector xmlns:android="http://schemas.android.com/apk/res/android"
2 android:width="24dp"
3 android:height="24dp"
4 android:viewportWidth="24"
5 android:viewportHeight="24"
6 android:tint="?attr/colorControlNormal">
7 <path
8 android:fillColor="@android:color/white"
9 android:pathData="M10.82,12.49c0.02,-0.16 0.04,-0.32 0.04,-0.49 0,-0.17 -0.02,-0.33 -0.04,-0.49l1.08,-0.82c0.1,-0.07 0.12,-0.21 0.06,-0.32l-1.03,-1.73c-0.06,-0.11 -0.2,-0.15 -0.31,-0.11l-1.28,0.5c-0.27,-0.2 -0.56,-0.36 -0.87,-0.49l-0.2,-1.33c0,-0.12 -0.11,-0.21 -0.24,-0.21H5.98c-0.13,0 -0.24,0.09 -0.26,0.21l-0.2,1.32c-0.31,0.12 -0.6,0.3 -0.87,0.49l-1.28,-0.5c-0.12,-0.05 -0.25,0 -0.31,0.11l-1.03,1.73c-0.06,0.12 -0.03,0.25 0.07,0.33l1.08,0.82c-0.02,0.16 -0.03,0.33 -0.03,0.49 0,0.17 0.02,0.33 0.04,0.49l-1.09,0.83c-0.1,0.07 -0.12,0.21 -0.06,0.32l1.03,1.73c0.06,0.11 0.2,0.15 0.31,0.11l1.28,-0.5c0.27,0.2 0.56,0.36 0.87,0.49l0.2,1.32c0.01,0.12 0.12,0.21 0.25,0.21h2.06c0.13,0 0.24,-0.09 0.25,-0.21l0.2,-1.32c0.31,-0.12 0.6,-0.3 0.87,-0.49l1.28,0.5c0.12,0.05 0.25,0 0.31,-0.11l1.03,-1.73c0.06,-0.11 0.04,-0.24 -0.06,-0.32l-1.1,-0.83zM7,13.75c-0.99,0 -1.8,-0.78 -1.8,-1.75s0.81,-1.75 1.8,-1.75 1.8,0.78 1.8,1.75S8,13.75 7,13.75zM18,1.01L8,1c-1.1,0 -2,0.9 -2,2v3h2V5h10v14H8v-1H6v3c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3c0,-1.1 -0.9,-1.99 -2,-1.99z"/>
10 </vector>
11
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
File was created 1 <vector xmlns:android="http://schemas.android.com/apk/res/android"
2 xmlns:aapt="http://schemas.android.com/aapt"
3 android:width="108dp"
4 android:height="108dp"
5 android:viewportWidth="108"
6 android:viewportHeight="108">
7 <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
8 <aapt:attr name="android:fillColor">
9 <gradient
10 android:endX="85.84757"
11 android:endY="92.4963"
12 android:startX="42.9492"
13 android:startY="49.59793"
14 android:type="linear">
15 <item
16 android:color="#44000000"
17 android:offset="0.0" />
18 <item
19 android:color="#00000000"
20 android:offset="1.0" />
21 </gradient>
22 </aapt:attr>
23 </path>
24 <path
25 android:fillColor="#FFFFFF"
26 android:fillType="nonZero"
27 android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
28 android:strokeWidth="1"
29 android:strokeColor="#00000000" />
30 </vector>
app/src/main/res/drawable-v24/inicio.xml
File was created 1 <vector xmlns:android="http://schemas.android.com/apk/res/android"
2 android:width="30dp"
3 android:height="30dp"
4 android:viewportWidth="30"
5 android:viewportHeight="30"
6 android:tint="?attr/colorControlNormal">
7 <path
8 android:fillColor="@android:color/white"
9 android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"/>
10 </vector>
11
app/src/main/res/drawable-v24/inventario.xml
File was created 1 <vector xmlns:android="http://schemas.android.com/apk/res/android"
2 android:width="24dp"
3 android:height="24dp"
4 android:viewportWidth="24"
5 android:viewportHeight="24"
6 android:tint="?attr/colorControlNormal">
7 <path
8 android:fillColor="@android:color/white"
9 android:pathData="M11,9h2L13,6h3L16,4h-3L13,1h-2v3L8,4v2h3v3zM7,18c-1.1,0 -1.99,0.9 -1.99,2S5.9,22 7,22s2,-0.9 2,-2 -0.9,-2 -2,-2zM17,18c-1.1,0 -1.99,0.9 -1.99,2s0.89,2 1.99,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM7.17,14.75l0.03,-0.12 0.9,-1.63h7.45c0.75,0 1.41,-0.41 1.75,-1.03l3.86,-7.01L19.42,4h-0.01l-1.1,2 -2.76,5L8.53,11l-0.13,-0.27L6.16,6l-0.95,-2 -0.94,-2L1,2v2h2l3.6,7.59 -1.35,2.45c-0.16,0.28 -0.25,0.61 -0.25,0.96 0,1.1 0.9,2 2,2h12v-2L7.42,15c-0.13,0 -0.25,-0.11 -0.25,-0.25z"/>
10 </vector>
11
app/src/main/res/drawable-v24/logo.png

10.5 KB

app/src/main/res/drawable-v24/maestros.xml
File was created 1 <vector xmlns:android="http://schemas.android.com/apk/res/android"
2 android:width="24dp"
3 android:height="24dp"
4 android:viewportWidth="24"
5 android:viewportHeight="24"
6 android:tint="?attr/colorControlNormal">
7 <path
8 android:fillColor="@android:color/white"
9 android:pathData="M17,1.01L7,1c-1.1,0 -2,0.9 -2,2v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2L19,3c0,-1.1 -0.9,-1.99 -2,-1.99zM17,19L7,19L7,5h10v14zM16,13h-3L13,8h-2v5L8,13l4,4 4,-4z"/>
10 </vector>
11
app/src/main/res/drawable-v24/more.xml
File was created 1 <vector android:height="30dp" android:tint="?attr/colorControlNormal"
2 android:viewportHeight="24" android:viewportWidth="24"
3 android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android">
4 <path android:fillColor="@android:color/white" android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
5 </vector>
6
app/src/main/res/drawable-v24/search.xml
File was created 1 <vector xmlns:android="http://schemas.android.com/apk/res/android"
2 android:width="24dp"
3 android:height="24dp"
4 android:viewportWidth="24"
5 android:viewportHeight="24"
6 android:tint="?attr/colorControlNormal">
7 <path
8 android:fillColor="@android:color/white"
9 android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
10 </vector>
11
app/src/main/res/drawable/borrar.xml
File was created 1 <vector android:height="40dp" android:tint="?attr/colorControlNormal"
2 android:viewportHeight="24" android:viewportWidth="24"
3 android:width="40dp" xmlns:android="http://schemas.android.com/apk/res/android">
4 <path android:fillColor="@android:color/white" android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
5 </vector>
6
app/src/main/res/drawable/ic_launcher_background.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <vector xmlns:android="http://schemas.android.com/apk/res/android"
3 android:width="108dp"
4 android:height="108dp"
5 android:viewportWidth="108"
6 android:viewportHeight="108">
7 <path
8 android:fillColor="#3DDC84"
9 android:pathData="M0,0h108v108h-108z" />
10 <path
11 android:fillColor="#00000000"
12 android:pathData="M9,0L9,108"
13 android:strokeWidth="0.8"
14 android:strokeColor="#33FFFFFF" />
15 <path
16 android:fillColor="#00000000"
17 android:pathData="M19,0L19,108"
18 android:strokeWidth="0.8"
19 android:strokeColor="#33FFFFFF" />
20 <path
21 android:fillColor="#00000000"
22 android:pathData="M29,0L29,108"
23 android:strokeWidth="0.8"
24 android:strokeColor="#33FFFFFF" />
25 <path
26 android:fillColor="#00000000"
27 android:pathData="M39,0L39,108"
28 android:strokeWidth="0.8"
29 android:strokeColor="#33FFFFFF" />
30 <path
31 android:fillColor="#00000000"
32 android:pathData="M49,0L49,108"
33 android:strokeWidth="0.8"
34 android:strokeColor="#33FFFFFF" />
35 <path
36 android:fillColor="#00000000"
37 android:pathData="M59,0L59,108"
38 android:strokeWidth="0.8"
39 android:strokeColor="#33FFFFFF" />
40 <path
41 android:fillColor="#00000000"
42 android:pathData="M69,0L69,108"
43 android:strokeWidth="0.8"
44 android:strokeColor="#33FFFFFF" />
45 <path
46 android:fillColor="#00000000"
47 android:pathData="M79,0L79,108"
48 android:strokeWidth="0.8"
49 android:strokeColor="#33FFFFFF" />
50 <path
51 android:fillColor="#00000000"
52 android:pathData="M89,0L89,108"
53 android:strokeWidth="0.8"
54 android:strokeColor="#33FFFFFF" />
55 <path
56 android:fillColor="#00000000"
57 android:pathData="M99,0L99,108"
58 android:strokeWidth="0.8"
59 android:strokeColor="#33FFFFFF" />
60 <path
61 android:fillColor="#00000000"
62 android:pathData="M0,9L108,9"
63 android:strokeWidth="0.8"
64 android:strokeColor="#33FFFFFF" />
65 <path
66 android:fillColor="#00000000"
67 android:pathData="M0,19L108,19"
68 android:strokeWidth="0.8"
69 android:strokeColor="#33FFFFFF" />
70 <path
71 android:fillColor="#00000000"
72 android:pathData="M0,29L108,29"
73 android:strokeWidth="0.8"
74 android:strokeColor="#33FFFFFF" />
75 <path
76 android:fillColor="#00000000"
77 android:pathData="M0,39L108,39"
78 android:strokeWidth="0.8"
79 android:strokeColor="#33FFFFFF" />
80 <path
81 android:fillColor="#00000000"
82 android:pathData="M0,49L108,49"
83 android:strokeWidth="0.8"
84 android:strokeColor="#33FFFFFF" />
85 <path
86 android:fillColor="#00000000"
87 android:pathData="M0,59L108,59"
88 android:strokeWidth="0.8"
89 android:strokeColor="#33FFFFFF" />
90 <path
91 android:fillColor="#00000000"
92 android:pathData="M0,69L108,69"
93 android:strokeWidth="0.8"
94 android:strokeColor="#33FFFFFF" />
95 <path
96 android:fillColor="#00000000"
97 android:pathData="M0,79L108,79"
98 android:strokeWidth="0.8"
99 android:strokeColor="#33FFFFFF" />
100 <path
101 android:fillColor="#00000000"
102 android:pathData="M0,89L108,89"
103 android:strokeWidth="0.8"
104 android:strokeColor="#33FFFFFF" />
105 <path
106 android:fillColor="#00000000"
107 android:pathData="M0,99L108,99"
108 android:strokeWidth="0.8"
109 android:strokeColor="#33FFFFFF" />
110 <path
111 android:fillColor="#00000000"
112 android:pathData="M19,29L89,29"
113 android:strokeWidth="0.8"
114 android:strokeColor="#33FFFFFF" />
115 <path
116 android:fillColor="#00000000"
117 android:pathData="M19,39L89,39"
118 android:strokeWidth="0.8"
119 android:strokeColor="#33FFFFFF" />
120 <path
121 android:fillColor="#00000000"
122 android:pathData="M19,49L89,49"
123 android:strokeWidth="0.8"
124 android:strokeColor="#33FFFFFF" />
125 <path
126 android:fillColor="#00000000"
127 android:pathData="M19,59L89,59"
128 android:strokeWidth="0.8"
129 android:strokeColor="#33FFFFFF" />
130 <path
131 android:fillColor="#00000000"
132 android:pathData="M19,69L89,69"
133 android:strokeWidth="0.8"
134 android:strokeColor="#33FFFFFF" />
135 <path
136 android:fillColor="#00000000"
137 android:pathData="M19,79L89,79"
138 android:strokeWidth="0.8"
139 android:strokeColor="#33FFFFFF" />
140 <path
141 android:fillColor="#00000000"
142 android:pathData="M29,19L29,89"
143 android:strokeWidth="0.8"
144 android:strokeColor="#33FFFFFF" />
145 <path
146 android:fillColor="#00000000"
147 android:pathData="M39,19L39,89"
148 android:strokeWidth="0.8"
149 android:strokeColor="#33FFFFFF" />
150 <path
151 android:fillColor="#00000000"
152 android:pathData="M49,19L49,89"
153 android:strokeWidth="0.8"
154 android:strokeColor="#33FFFFFF" />
155 <path
156 android:fillColor="#00000000"
157 android:pathData="M59,19L59,89"
158 android:strokeWidth="0.8"
159 android:strokeColor="#33FFFFFF" />
160 <path
161 android:fillColor="#00000000"
162 android:pathData="M69,19L69,89"
163 android:strokeWidth="0.8"
164 android:strokeColor="#33FFFFFF" />
165 <path
166 android:fillColor="#00000000"
167 android:pathData="M79,19L79,89"
168 android:strokeWidth="0.8"
169 android:strokeColor="#33FFFFFF" />
170 </vector>
171
app/src/main/res/drawable/ic_menu_camera.xml
File was created 1 <vector xmlns:android="http://schemas.android.com/apk/res/android"
2 android:width="24dp"
3 android:height="24dp"
4 android:viewportWidth="24.0"
5 android:viewportHeight="24.0">
6 <path
7 android:fillColor="#FF000000"
8 android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0" />
9 <path
10 android:fillColor="#FF000000"
11 android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z" />
12 </vector>
13
app/src/main/res/drawable/ic_menu_gallery.xml
File was created 1 <vector xmlns:android="http://schemas.android.com/apk/res/android"
2 android:width="24dp"
3 android:height="24dp"
4 android:viewportWidth="24.0"
5 android:viewportHeight="24.0">
6 <path
7 android:fillColor="#FF000000"
8 android:pathData="M22,16V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2zm-11,-4l2.03,2.71L16,11l4,5H8l3,-4zM2,6v14c0,1.1 0.9,2 2,2h14v-2H4V6H2z" />
9 </vector>
10
app/src/main/res/drawable/ic_menu_slideshow.xml
File was created 1 <vector xmlns:android="http://schemas.android.com/apk/res/android"
2 android:width="24dp"
3 android:height="24dp"
4 android:viewportWidth="24.0"
5 android:viewportHeight="24.0">
6 <path
7 android:fillColor="#FF000000"
8 android:pathData="M4,6H2v14c0,1.1 0.9,2 2,2h14v-2H4V6zm16,-4H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V4c0,-1.1 -0.9,-2 -2,-2zm-8,12.5v-9l6,4.5 -6,4.5z" />
9 </vector>
10
app/src/main/res/drawable/side_nav_bar.xml
File was created 1 <shape xmlns:android="http://schemas.android.com/apk/res/android"
2 android:shape="rectangle">
3 <gradient
4 android:angle="135"
5 android:centerColor="#009688"
6 android:endColor="#00695C"
7 android:startColor="#4DB6AC"
8 android:type="linear" />
9 </shape>
app/src/main/res/layout/activity_main.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <androidx.drawerlayout.widget.DrawerLayout 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:id="@+id/drawer_layout"
6 android:layout_width="match_parent"
7 android:layout_height="match_parent"
8 android:fitsSystemWindows="true"
9 tools:openDrawer="start">
10
11 <include
12 layout="@layout/app_bar_main"
13 android:layout_width="match_parent"
14 android:layout_height="match_parent" />
15
16 <com.google.android.material.navigation.NavigationView
17 android:id="@+id/nav_view"
18 android:layout_width="wrap_content"
19 android:layout_height="match_parent"
20 android:layout_gravity="start"
21 android:fitsSystemWindows="true"
22 app:headerLayout="@layout/nav_header_main"
23 app:menu="@menu/activity_main_drawer" />
24
25 </androidx.drawerlayout.widget.DrawerLayout>
app/src/main/res/layout/activity_mensaje.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.MensajeActivity">
8
9 </androidx.constraintlayout.widget.ConstraintLayout>
app/src/main/res/layout/app_bar_main.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <androidx.coordinatorlayout.widget.CoordinatorLayout 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=".MainActivity">
8
9 <com.google.android.material.appbar.AppBarLayout
10 android:layout_width="match_parent"
11 android:layout_height="wrap_content"
12 android:theme="@style/AppTheme.AppBarOverlay">
13
14 <androidx.appcompat.widget.Toolbar
15 android:id="@+id/toolbar"
16 android:layout_width="match_parent"
17 android:layout_height="?attr/actionBarSize"
18 android:background="?attr/colorPrimary"
19 app:popupTheme="@style/AppTheme.PopupOverlay" />
20
21 </com.google.android.material.appbar.AppBarLayout>
22
23 <include layout="@layout/content_main" />
24
25
26 </androidx.coordinatorlayout.widget.CoordinatorLayout>
app/src/main/res/layout/content_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 app:layout_behavior="@string/appbar_scrolling_view_behavior"
8 tools:showIn="@layout/app_bar_main">
9
10 <fragment
11 android:id="@+id/nav_host_fragment"
12 android:name="androidx.navigation.fragment.NavHostFragment"
13 android:layout_width="match_parent"
14 android:layout_height="match_parent"
15 app:defaultNavHost="true"
16 app:layout_constraintLeft_toLeftOf="parent"
17 app:layout_constraintRight_toRightOf="parent"
18 app:layout_constraintTop_toTopOf="parent"
19 app:navGraph="@navigation/mobile_navigation" />
20
21 <!-- <fragment-->
22 <!-- android:id="@+id/fragmentoSecundario"-->
23 <!-- android:name="androidx.navigation.fragment.NavHostFragment"-->
24 <!-- android:layout_width="289dp"-->
25 <!-- android:layout_height="335dp"-->
26 <!-- app:layout_constraintBottom_toBottomOf="parent"-->
27 <!-- app:layout_constraintHorizontal_bias="0.497"-->
28 <!-- app:layout_constraintLeft_toLeftOf="parent"-->
29 <!-- app:layout_constraintRight_toRightOf="parent"-->
30 <!-- app:layout_constraintTop_toTopOf="parent"-->
31 <!-- app:layout_constraintVertical_bias="0.597" />-->
32 </androidx.constraintlayout.widget.ConstraintLayout>
app/src/main/res/layout/dialog_signin.xml
File was created 1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2 android:orientation="vertical"
3 android:layout_width="wrap_content"
4 android:layout_height="wrap_content">
5
6 <EditText
7 android:id="@+id/username"
8 android:inputType="textEmailAddress"
9 android:layout_width="match_parent"
10 android:layout_height="wrap_content"
11 android:layout_marginTop="16dp"
12 android:layout_marginLeft="4dp"
13 android:layout_marginRight="4dp"
14 android:layout_marginBottom="4dp"
15 android:hint="" />
16 <EditText
17 android:id="@+id/password"
18 android:inputType="textPassword"
19 android:layout_width="match_parent"
20 android:layout_height="wrap_content"
21 android:layout_marginTop="4dp"
22 android:layout_marginLeft="4dp"
23 android:layout_marginRight="4dp"
24 android:layout_marginBottom="16dp"
25 android:fontFamily="sans-serif"
26 android:hint=""/>
27 </LinearLayout>
app/src/main/res/layout/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
10 <androidx.appcompat.widget.AppCompatTextView
11 android:id="@+id/tvActMaestros"
12 android:layout_width="match_parent"
13 android:layout_height="wrap_content"
14 android:layout_marginTop="@dimen/MarginTopTitulos"
15 android:gravity="center"
16
17 android:text="@string/tvActMaestros"
18 android:textColor="@color/colorAccent"
19 android:textSize="@dimen/Titulos"
20 app:fontFamily="sans-serif-condensed"
21 app:layout_constraintBottom_toTopOf="@+id/tvSeleccioneServidor"
22 app:layout_constraintEnd_toEndOf="parent"
23 app:layout_constraintStart_toStartOf="parent"
24 app:layout_constraintTop_toTopOf="parent" />
25
26 <TextView
27 android:id="@+id/tvSeleccioneServidor"
28 android:layout_width="0dp"
29 android:layout_height="wrap_content"
30 android:layout_margin="30dp"
31 android:gravity="center"
32 android:lines="2"
33 android:text="@string/tvMedio"
34 android:textColor="@android:color/black"
35 android:textSize="@dimen/SubTitulos"
36 app:fontFamily="sans-serif-condensed"
37 app:layout_constraintEnd_toEndOf="parent"
38 app:layout_constraintStart_toStartOf="parent"
39 app:layout_constraintTop_toBottomOf="@+id/tvActMaestros" />
40
41 <RadioGroup
42 android:id="@+id/rgTipoActualizacion"
43 android:layout_width="0dp"
44 android:layout_height="wrap_content"
45 android:layout_margin="25dp"
46 android:gravity="center"
47 android:orientation="horizontal"
48 app:layout_constraintEnd_toEndOf="parent"
49 app:layout_constraintStart_toStartOf="parent"
50 app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor">
51
52 <RadioButton
53 android:id="@+id/obPorWifi"
54 android:layout_width="wrap_content"
55 android:layout_height="wrap_content"
56 android:layout_margin="5dp"
57 android:checked="true"
58 android:padding="5dp"
59 android:text="@string/obPorWifi"
60 android:textSize="@dimen/NormalText" />
61
62 <RadioButton
63 android:id="@+id/obViaArchivo"
64 android:layout_width="wrap_content"
65 android:layout_height="wrap_content"
66 android:layout_margin="5dp"
67 android:checked="false"
68 android:padding="5dp"
69 android:text="@string/obViaArchivo"
70 android:textSize="@dimen/NormalText" />
71
72
73 </RadioGroup>
74
75
76 <TextView
77 android:id="@+id/countriesList"
78 android:layout_width="0dp"
79 android:layout_height="wrap_content"
80 android:layout_marginTop="@dimen/MarginTopTitulos"
81 android:gravity="center"
82 android:text=""
83 android:textColor="@android:color/black"
84 android:textSize="@dimen/SubTitulos"
85 android:visibility="visible"
86 app:fontFamily="sans-serif-condensed"
87 app:layout_constraintBottom_toTopOf="@+id/btnConfirmarAct"
88 app:layout_constraintEnd_toEndOf="parent"
89 app:layout_constraintHorizontal_bias="0.0"
90 app:layout_constraintStart_toStartOf="parent"
91 app:layout_constraintTop_toBottomOf="@+id/rgTipoActualizacion"
92 app:layout_constraintVertical_bias="0.0" />
93
94 <Button
95 android:id="@+id/btnConfirmarAct"
96 android:layout_width="0dp"
97 android:layout_height="wrap_content"
98 android:layout_margin="20dp"
99 android:text="@string/btnConfirmarAct"
100 android:textSize="@dimen/NormalText"
101 app:layout_constraintBottom_toBottomOf="parent"
102 app:layout_constraintEnd_toEndOf="parent"
103 app:layout_constraintStart_toStartOf="parent" />
104
105
106 <ProgressBar
107 android:id="@+id/loading_view"
108 android:layout_width="wrap_content"
109 android:layout_height="wrap_content"
110 android:layout_marginStart="8dp"
111 android:layout_marginLeft="8dp"
112 android:layout_marginTop="8dp"
113 android:layout_marginEnd="8dp"
114 android:layout_marginRight="8dp"
115 android:layout_marginBottom="8dp"
116 android:visibility="gone"
117 app:layout_constraintBottom_toBottomOf="parent"
118 app:layout_constraintEnd_toEndOf="parent"
119 app:layout_constraintStart_toStartOf="parent"
120 app:layout_constraintTop_toTopOf="parent" />
121 </androidx.constraintlayout.widget.ConstraintLayout>
122
app/src/main/res/layout/fragment_configuracion.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="wrap_content"
7 tools:context=".ui.configuracion.ConfiguracionFragment">
8
9
10 <androidx.appcompat.widget.AppCompatTextView
11 android:id="@+id/textView2"
12 android:layout_width="match_parent"
13 android:layout_height="wrap_content"
14
15 android:layout_marginTop="@dimen/MarginTopTitulos"
16 android:gravity="center"
17
18 android:lines="1"
19 android:text="@string/tvTituloConf"
20 android:textColor="@color/colorAccent"
21 android:textSize="@dimen/Titulos"
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
33 android:layout_marginStart="@dimen/MarginBotAgreSer"
34 android:layout_marginTop="@dimen/MarginTopSubTitulos"
35 android:gravity="start"
36 android:lines="1"
37 android:text="@string/tvSeleccioneServidor"
38 android:textColor="@android:color/black"
39 android:textSize="@dimen/SubTitulos"
40 app:fontFamily="sans-serif-condensed"
41 app:layout_constraintBottom_toTopOf="@+id/spServidor"
42 app:layout_constraintEnd_toEndOf="parent"
43 app:layout_constraintStart_toStartOf="parent"
44 app:layout_constraintTop_toBottomOf="@+id/textView2" />
45
46 <Spinner
47 android:id="@+id/spServidor"
48 android:layout_width="0dp"
49 android:layout_height="wrap_content"
50 android:backgroundTint="@color/LightGray"
51 android:elevation="5dp"
52 android:fadeScrollbars="true"
53 android:foregroundTint="@android:color/holo_orange_dark"
54 android:soundEffectsEnabled="true"
55 android:spinnerMode="dialog"
56 android:splitMotionEvents="false"
57 android:textAlignment="center"
58 android:textSize="@dimen/NormalText"
59 app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor"
60 app:layout_constraintEnd_toStartOf="@+id/btnValidarServidor"
61 app:layout_constraintHorizontal_chainStyle="packed"
62 app:layout_constraintStart_toStartOf="parent"
63 app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor"
64 android:entries="@array/spinnerServidor"
65 android:prompt="@string/leyendaSpinner"/>
66
67 <Button
68 android:id="@+id/btnValidarServidor"
69 android:layout_width="wrap_content"
70 android:layout_height="wrap_content"
71
72 android:text="@string/btnValidarServidor"
73 android:textSize="@dimen/NormalText"
74 app:layout_constraintBottom_toTopOf="@+id/btnAgregarServidor"
75 app:layout_constraintEnd_toEndOf="parent"
76 app:layout_constraintHorizontal_chainStyle="packed"
77 app:layout_constraintStart_toEndOf="@id/spServidor"
78 app:layout_constraintTop_toBottomOf="@+id/tvSeleccioneServidor" />
79
80 <Button
81 android:id="@+id/btnAgregarServidor"
82 android:layout_width="0dp"
83 android:layout_height="wrap_content"
84 android:layout_marginStart="@dimen/MarginBotAgreSer"
85 android:layout_marginEnd="@dimen/MarginBotAgreSer"
86 android:text="@string/btnAgregarServidor"
87 android:textSize="@dimen/NormalText"
88 app:layout_constraintBottom_toTopOf="@+id/tvUbicacionCarpetas"
89 app:layout_constraintEnd_toEndOf="parent"
90 app:layout_constraintStart_toStartOf="parent"
91 app:layout_constraintTop_toBottomOf="@+id/btnValidarServidor" />
92
93
94 <TextView
95 android:id="@+id/tvUbicacionCarpetas"
96 android:layout_width="0dp"
97 android:layout_height="wrap_content"
98
99 android:layout_marginStart="@dimen/MarginBotAgreSer"
100 android:layout_marginTop="@dimen/MarginTopSubTitulos"
101 android:gravity="start"
102 android:lines="1"
103 android:text="@string/tvUbicacionCarpetas"
104 android:textColor="@android:color/black"
105 android:textSize="@dimen/SubTitulos"
106 app:fontFamily="sans-serif-condensed"
107 app:layout_constraintBottom_toTopOf="@+id/ibSearch"
108 app:layout_constraintEnd_toEndOf="parent"
109 app:layout_constraintStart_toStartOf="parent"
110 app:layout_constraintTop_toBottomOf="@+id/btnAgregarServidor" />
111
112 <ImageButton
113 android:id="@+id/ibSearch"
114 android:layout_width="36dp"
115 android:layout_height="37dp"
116 android:layout_margin="10dp"
117 android:src="@drawable/search"
118 app:layout_constraintEnd_toStartOf="@+id/etRuta"
119 app:layout_constraintStart_toStartOf="parent"
120 app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" />
121
122 <EditText
123 android:id="@+id/etRuta"
124 android:layout_width="0dp"
125 android:layout_height="wrap_content"
126 android:layout_marginTop="10dp"
127 android:layout_marginEnd="10dp"
128 android:clickable="true"
129 android:ems="10"
130 android:focusable="true"
131 android:inputType="textPersonName"
132 android:lines="1"
133 android:text=""
134 android:textSize="@dimen/NormalText"
135 app:layout_constraintEnd_toEndOf="parent"
136 app:layout_constraintStart_toEndOf="@id/ibSearch"
137 app:layout_constraintTop_toBottomOf="@+id/tvUbicacionCarpetas" />
138
139 <TextView
140 android:id="@+id/tvActuFecha"
141 android:layout_width="0dp"
142 android:layout_height="wrap_content"
143 android:layout_marginStart="@dimen/MarginBotAgreSer"
144 android:layout_marginTop="@dimen/MarginTopSubTitulos"
145 android:gravity="start"
146 android:lines="1"
147 android:text="@string/tvTituloArea"
148 android:textColor="@android:color/black"
149 android:textSize="@dimen/SubTitulos"
150 app:fontFamily="sans-serif-condensed"
151 app:layout_constraintEnd_toEndOf="parent"
152 app:layout_constraintStart_toStartOf="parent"
153 app:layout_constraintTop_toBottomOf="@+id/etRuta" />
154
155 <RadioGroup
156 android:id="@+id/rgFechaHora"
157 android:layout_width="0dp"
158 android:layout_height="wrap_content"
159
160 android:gravity="center"
161 android:orientation="horizontal"
162 app:layout_constraintEnd_toEndOf="parent"
163 app:layout_constraintStart_toStartOf="parent"
164 app:layout_constraintTop_toBottomOf="@+id/tvActuFecha">
165
166 <RadioButton
167 android:id="@+id/rbVentas"
168 android:layout_width="wrap_content"
169 android:layout_height="wrap_content"
170 android:layout_margin="5dp"
171 android:checked="true"
172 android:padding="5dp"
173 android:text="@string/rbVentas"
174 android:textSize="@dimen/NormalText" />
175
176 <RadioButton
177 android:id="@+id/rbDeposito"
178 android:layout_width="wrap_content"
179 android:layout_height="wrap_content"
180 android:layout_margin="5dp"
181 android:checked="false"
182 android:padding="5dp"
183 android:text="@string/rbDeposito"
184 android:textSize="@dimen/NormalText" />
185
186 </RadioGroup>
187
188 <TextView
189 android:id="@+id/tvLosProductos"
190 android:layout_width="0dp"
191 android:layout_height="wrap_content"
192
193 android:layout_marginStart="@dimen/MarginBotAgreSer"
194 android:layout_marginEnd="@dimen/MarginTopSubTitulos"
195 android:gravity="start"
196 android:lines="1"
197 android:text="@string/tvLosProductos"
198 android:textColor="@android:color/black"
199 android:textSize="@dimen/SubTitulos"
200 app:fontFamily="sans-serif-condensed"
201 app:layout_constraintEnd_toEndOf="parent"
202 app:layout_constraintStart_toStartOf="parent"
203 app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" />
204
205 <RadioGroup
206 android:id="@+id/rgLosProductos"
207 android:layout_width="0dp"
208 android:layout_height="wrap_content"
209
210 android:gravity="center"
211 android:orientation="vertical"
212 app:layout_constraintEnd_toEndOf="parent"
213 app:layout_constraintStart_toStartOf="parent"
214 app:layout_constraintTop_toBottomOf="@+id/tvLosProductos">
215
216 <RadioButton
217 android:id="@+id/rbProInclu"
218 android:layout_width="match_parent"
219 android:layout_height="wrap_content"
220
221 android:layout_margin="@dimen/PadingCbyRb"
222 android:checked="true"
223 android:padding="@dimen/PadingCbyRb"
224 android:text="@string/rbProInclu"
225 android:textSize="@dimen/NormalText" />
226
227 <RadioButton
228 android:id="@+id/rbProNoInclu"
229 android:layout_width="match_parent"
230 android:layout_height="wrap_content"
231 android:layout_margin="@dimen/PadingCbyRb"
232 android:checked="false"
233 android:padding="@dimen/PadingCbyRb"
234 android:text="@string/rbProNoInclu"
235 android:textSize="@dimen/NormalText" />
236
237 </RadioGroup>
238
239 <CheckBox
240 android:id="@+id/cbHabiLectura"
241 android:layout_width="0dp"
242 android:layout_height="wrap_content"
243 android:layout_margin="@dimen/PadingCbyRb"
244 android:padding="@dimen/PadingCbyRb"
245 android:text="@string/cbHabiLectura"
246 android:textSize="@dimen/NormalText"
247 app:layout_constraintEnd_toEndOf="parent"
248 app:layout_constraintStart_toStartOf="parent"
249 app:layout_constraintTop_toBottomOf="@+id/rgLosProductos" />
250
251 <CheckBox
252 android:id="@+id/cbMostrarStock"
253 android:layout_width="0dp"
254 android:layout_height="wrap_content"
255 android:layout_margin="@dimen/PadingCbyRb"
256 android:padding="@dimen/PadingCbyRb"
257 android:text="@string/cbMostrarStock"
258 android:textSize="@dimen/NormalText"
259 app:layout_constraintEnd_toEndOf="parent"
260 app:layout_constraintStart_toStartOf="parent"
261 app:layout_constraintTop_toBottomOf="@+id/cbHabiLectura" />
262
263 <TextView
264 android:id="@+id/tvColumMostrar"
265 android:layout_width="0dp"
266 android:layout_height="wrap_content"
267
268 android:layout_marginStart="@dimen/MarginBotAgreSer"
269 android:layout_marginEnd="@dimen/MarginTopSubTitulos"
270 android:gravity="start"
271 android:lines="1"
272 android:text="@string/tvColumMostrar"
273 android:textColor="@android:color/black"
274 android:textSize="@dimen/SubTitulos"
275 app:fontFamily="sans-serif-condensed"
276 app:layout_constraintEnd_toEndOf="parent"
277 app:layout_constraintStart_toStartOf="parent"
278 app:layout_constraintTop_toBottomOf="@+id/cbMostrarStock" />
279
280 <RadioGroup
281 android:id="@+id/rgCodigosMostrar"
282 android:layout_width="0dp"
283 android:layout_height="wrap_content"
284
285 android:gravity="center"
286 android:orientation="horizontal"
287 app:layout_constraintEnd_toEndOf="parent"
288 app:layout_constraintStart_toStartOf="parent"
289 app:layout_constraintTop_toBottomOf="@+id/tvColumMostrar">
290
291 <RadioButton
292 android:id="@+id/rbCodigoDebo"
293 android:layout_width="wrap_content"
294 android:layout_height="wrap_content"
295 android:layout_margin="5dp"
296 android:checked="true"
297 android:padding="5dp"
298 android:text="@string/rbCodigoDebo"
299 android:textSize="@dimen/NormalText" />
300
301 <RadioButton
302 android:id="@+id/rbCodigoOrigen"
303 android:layout_width="wrap_content"
304 android:layout_height="wrap_content"
305 android:layout_margin="5dp"
306 android:checked="false"
307 android:padding="5dp"
308 android:text="@string/rbCodigoOrigen"
309 android:textSize="@dimen/NormalText" />
310
311 <RadioButton
312 android:id="@+id/rbCodigoBarras"
313 android:layout_width="wrap_content"
314 android:layout_height="wrap_content"
315 android:layout_margin="5dp"
316 android:padding="5dp"
317 android:text="@string/rbCodigoBarras"
318 android:textSize="@dimen/NormalText" />
319 </RadioGroup>
320
321 <CheckBox
322 android:id="@+id/cbMostrarExistencia"
323 android:layout_width="wrap_content"
324 android:layout_height="wrap_content"
325 android:layout_margin="@dimen/PadingCbyRb"
326 android:padding="@dimen/PadingCbyRb"
327 android:text="@string/cbMostrarExistencia"
328 android:textSize="@dimen/NormalText"
329 android:checked="false"
330 app:layout_constraintEnd_toStartOf="@+id/cbMostrarPrecio"
331 app:layout_constraintStart_toStartOf="parent"
332 app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" />
333
334 <CheckBox
335 android:id="@+id/cbMostrarPrecio"
336 android:layout_width="wrap_content"
337 android:layout_height="wrap_content"
338 android:layout_margin="@dimen/PadingCbyRb"
339 android:padding="@dimen/PadingCbyRb"
340 android:text="@string/cbMostrarPrecio"
341 android:textSize="@dimen/NormalText"
342 android:checked="false"
343 app:layout_constraintEnd_toEndOf="parent"
344 app:layout_constraintStart_toEndOf="@+id/cbMostrarExistencia"
345 app:layout_constraintTop_toBottomOf="@+id/rgCodigosMostrar" />
346
347 <Button
348 android:id="@+id/btnGuardar"
349 android:layout_width="wrap_content"
350 android:layout_height="wrap_content"
351 android:text="@string/btnGuardar"
352 android:textSize="@dimen/NormalText"
353 app:layout_constraintEnd_toEndOf="parent"
354
355 app:layout_constraintStart_toStartOf="parent"
356 app:layout_constraintTop_toBottomOf="@+id/cbMostrarPrecio" />
357 </androidx.constraintlayout.widget.ConstraintLayout>
358
359
app/src/main/res/layout/fragment_descripcion.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2
3
4 <androidx.constraintlayout.widget.ConstraintLayout
5 xmlns:android="http://schemas.android.com/apk/res/android"
6 xmlns:app="http://schemas.android.com/apk/res-auto"
7 xmlns:tools="http://schemas.android.com/tools"
8 android:layout_width="match_parent"
9 android:layout_height="match_parent"
10 tools:context=".ui.inventario.DescripcionFragment">
11
12
13 <androidx.recyclerview.widget.RecyclerView
14 android:id="@+id/rcDescripcion"
15 android:layout_width="match_parent"
16 android:layout_height="0dp"
17 android:background="@android:color/darker_gray"
18 android:scrollbars="vertical"
19 app:layout_constraintTop_toBottomOf="@id/guideline4"
20 app:layout_constraintBottom_toTopOf="@+id/guideline5"
21 app:layout_constraintEnd_toEndOf="parent"
22 app:layout_constraintStart_toStartOf="parent"
23 tools:listitem="@layout/item" />
24
25 <Button
26 android:id="@+id/btnSalir"
27 android:layout_width="0dp"
28 android:layout_height="wrap_content"
29 android:text="@string/btnCancelar"
30 app:layout_constraintBottom_toBottomOf="@+id/guideline6"
31 app:layout_constraintEnd_toEndOf="parent"
32 app:layout_constraintHorizontal_chainStyle="spread"
33 app:layout_constraintStart_toStartOf="parent"
34 app:layout_constraintTop_toBottomOf="@+id/rcInventarios" />
35
36 <androidx.constraintlayout.widget.Guideline
37 android:id="@+id/guideline4"
38 android:layout_width="wrap_content"
39 android:layout_height="wrap_content"
40 android:orientation="horizontal"
41 app:layout_constraintGuide_percent="0.06" />
42
43 <androidx.constraintlayout.widget.Guideline
44 android:id="@+id/guideline5"
45 android:layout_width="wrap_content"
46 android:layout_height="wrap_content"
47 android:orientation="horizontal"
48 app:layout_constraintGuide_percent="0.88" />
49
50 <androidx.constraintlayout.widget.Guideline
51 android:id="@+id/guideline6"
52 android:layout_width="wrap_content"
53 android:layout_height="wrap_content"
54 android:orientation="horizontal"
55 app:layout_constraintGuide_percent="0.97" />
56 </androidx.constraintlayout.widget.ConstraintLayout>
57
app/src/main/res/layout/fragment_inventario.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/tvTitulo"
14 android:layout_width="match_parent"
15 android:layout_height="90dp"
16 android:layout_marginStart="8dp"
17 android:layout_marginTop="15dp"
18 android:layout_marginEnd="8dp"
19 android:autoSizeMaxTextSize="100sp"
20 android:autoSizeMinTextSize="20sp"
21 android:autoSizeStepGranularity="5sp"
22 android:autoSizeTextType="uniform"
23 android:gravity="center"
24 android:lines="1"
25 android:text="@string/invTitulo"
26 android:textColor="@color/colorAccent"
27 app:fontFamily="sans-serif-condensed"
28 app:layout_constraintBottom_toTopOf="@id/guideline2"
29 app:layout_constraintEnd_toEndOf="parent"
30 app:layout_constraintStart_toStartOf="parent"
31 app:layout_constraintTop_toTopOf="@id/guideline" />
32
33
34 <androidx.appcompat.widget.AppCompatTextView
35 android:id="@+id/tvCodigoBarras"
36 android:layout_width="wrap_content"
37 android:layout_height="wrap_content"
38 android:layout_marginStart="5dp"
39 android:text="@string/invCodigoBarras"
40 android:textColor="@color/colorAccent"
41 android:textSize="@dimen/subTitulos"
42 app:fontFamily="sans-serif-condensed"
43 app:layout_constraintBottom_toTopOf="@+id/guideline3"
44 app:layout_constraintEnd_toStartOf="@+id/etCodigoBarras"
45 app:layout_constraintHorizontal_bias="0.0"
46 app:layout_constraintHorizontal_chainStyle="packed"
47 app:layout_constraintStart_toStartOf="parent"
48 app:layout_constraintTop_toTopOf="@id/guideline2" />
49
50 <EditText
51 android:id="@+id/etCodigoBarras"
52 android:layout_width="wrap_content"
53 android:layout_height="wrap_content"
54 android:clickable="true"
55 android:ems="10"
56 android:focusable="true"
57 android:textAllCaps="true"
58 android:inputType="textPersonName"
59 android:lines="1"
60 android:text=""
61 android:textSize="20sp"
62 app:layout_constraintBaseline_toBaselineOf="@+id/tvCodigoBarras"
63 app:layout_constraintEnd_toEndOf="parent"
64 app:layout_constraintHorizontal_chainStyle="packed"
65 app:layout_constraintStart_toEndOf="@id/tvCodigoBarras"
66 android:autofillHints="" />
67
68 <Switch
69 android:id="@+id/swSumaUno"
70 android:layout_width="wrap_content"
71 android:layout_height="wrap_content"
72 android:layout_marginStart="5dp"
73 android:text="@string/switch_1"
74 app:layout_constraintBottom_toTopOf="@+id/guideline3"
75 app:layout_constraintEnd_toEndOf="parent"
76 app:layout_constraintStart_toEndOf="@id/etCodigoBarras"
77 app:layout_constraintTop_toTopOf="@id/guideline2"
78 tools:ignore="UseSwitchCompatOrMaterialXml" />
79
80 <ImageButton
81 android:id="@+id/ivCamara"
82 android:layout_width="74dp"
83 android:layout_height="wrap_content"
84 android:layout_margin="10dp"
85 android:clickable="true"
86 android:contentDescription="TODO"
87 android:src="@drawable/camera"
88 app:layout_constraintBottom_toTopOf="@+id/guideline4"
89 app:layout_constraintStart_toStartOf="parent"
90 app:layout_constraintTop_toTopOf="@id/guideline3" />
91
92 <androidx.recyclerview.widget.RecyclerView
93 android:id="@+id/rcInventarios"
94 android:layout_width="match_parent"
95 android:layout_height="0dp"
96 android:background="@android:color/darker_gray"
97 app:layout_constraintBottom_toBottomOf="@+id/guideline5"
98 app:layout_constraintEnd_toEndOf="parent"
99 app:layout_constraintStart_toStartOf="parent"
100 tools:listitem="@layout/item"
101 app:layout_constraintTop_toBottomOf="@+id/guideline4" />
102
103
104 <Button
105 android:id="@+id/btnExportarInv"
106 android:layout_width="wrap_content"
107 android:layout_height="wrap_content"
108 android:text="@string/btnExportarInv"
109 app:layout_constraintBottom_toBottomOf="@+id/guideline6"
110 app:layout_constraintEnd_toEndOf="parent"
111 app:layout_constraintHorizontal_chainStyle="spread"
112 app:layout_constraintStart_toEndOf="@+id/btnBorrarInv"
113 app:layout_constraintTop_toBottomOf="@+id/guideline5" />
114
115 <Button
116 android:id="@+id/btnBorrarInv"
117 android:layout_width="wrap_content"
118 android:layout_height="wrap_content"
119 android:text="@string/btnBorrarInv"
120 app:layout_constraintBottom_toBottomOf="@+id/guideline6"
121 app:layout_constraintEnd_toStartOf="@id/btnExportarInv"
122 app:layout_constraintHorizontal_chainStyle="spread"
123 app:layout_constraintStart_toStartOf="parent"
124 app:layout_constraintTop_toBottomOf="@+id/guideline5" />
125
126 <androidx.constraintlayout.widget.Guideline
127 android:id="@+id/guideline"
128 android:layout_width="wrap_content"
129 android:layout_height="wrap_content"
130 android:orientation="horizontal"
131 app:layout_constraintGuide_percent="0.05" />
132
133 <androidx.constraintlayout.widget.Guideline
134 android:id="@+id/guideline2"
135 android:layout_width="wrap_content"
136 android:layout_height="wrap_content"
137 android:orientation="horizontal"
138 app:layout_constraintGuide_percent="0.15" />
139
140 <androidx.constraintlayout.widget.Guideline
141 android:id="@+id/guideline3"
142 android:layout_width="wrap_content"
143 android:layout_height="wrap_content"
144 android:orientation="horizontal"
145 app:layout_constraintGuide_percent="0.25" />
146
147 <androidx.constraintlayout.widget.Guideline
148 android:id="@+id/guideline4"
149 android:layout_width="wrap_content"
150 android:layout_height="wrap_content"
151 android:orientation="horizontal"
152 app:layout_constraintGuide_percent="0.35" />
153
154 <androidx.constraintlayout.widget.Guideline
155 android:id="@+id/guideline5"
156 android:layout_width="wrap_content"
157 android:layout_height="wrap_content"
158 android:orientation="horizontal"
159 app:layout_constraintGuide_percent="0.88" />
160
161 <androidx.constraintlayout.widget.Guideline
162 android:id="@+id/guideline6"
163 android:layout_width="wrap_content"
164 android:layout_height="wrap_content"
165 android:orientation="horizontal"
166 app:layout_constraintGuide_percent="0.97" />
167
168 <ToggleButton
169 android:id="@+id/toggleButton"
170 android:layout_width="wrap_content"
171 android:layout_height="wrap_content"
172 android:text="ToggleButton"
173 app:layout_constraintBottom_toTopOf="@+id/rcInventarios"
174 app:layout_constraintEnd_toEndOf="parent"
175 app:layout_constraintStart_toEndOf="@+id/ivCamara" />
176
177
178 </androidx.constraintlayout.widget.ConstraintLayout>
app/src/main/res/layout/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 tools:context=".ui.main.MainFragment">
8
9 <androidx.appcompat.widget.AppCompatTextView
10 android:id="@+id/txtVentas"
11 android:layout_width="match_parent"
12 android:layout_height="90dp"
13 android:autoSizeMaxTextSize="150sp"
14 android:autoSizeMinTextSize="25sp"
15 android:autoSizeStepGranularity="5sp"
16 android:autoSizeTextType="uniform"
17 android:gravity="center"
18 android:padding="10dp"
19 android:text="@string/invDinamicoVenta"
20 android:textColor="@color/colorAccent"
21 app:fontFamily="sans-serif"
22 app:layout_constraintBottom_toTopOf="@+id/guideline"
23 app:layout_constraintEnd_toEndOf="parent"
24 app:layout_constraintStart_toStartOf="parent"
25 app:layout_constraintTop_toTopOf="@+id/guideline0" />
26
27 <ScrollView
28 android:id="@+id/scrollView"
29 android:layout_width="match_parent"
30 android:layout_height="0dp"
31 android:layout_margin="10dp"
32 android:layout_marginTop="4dp"
33 android:background="@android:color/darker_gray"
34 android:elevation="10dp"
35 android:scrollbarStyle="insideOverlay"
36 app:layout_constraintBottom_toTopOf="@+id/guideline2"
37 app:layout_constraintCircleRadius="10dp"
38 app:layout_constraintEnd_toEndOf="parent"
39 app:layout_constraintStart_toStartOf="parent"
40 app:layout_constraintTop_toTopOf="@+id/guideline"
41 app:layout_constraintVertical_bias="0.512">
42
43 <GridLayout
44 android:id="@+id/tableLayout"
45 android:layout_width="match_parent"
46 android:layout_height="wrap_content"
47 android:alignmentMode="alignMargins"
48 android:columnCount="2"
49 android:padding="15dp"
50 android:rowCount="2">
51
52 <androidx.recyclerview.widget.RecyclerView
53 android:id="@+id/rcInventario"
54 android:layout_width="match_parent"
55 android:layout_height="wrap_content"
56 android:background="@android:color/darker_gray"
57 android:scrollbars="vertical"
58 app:layout_constraintTop_toBottomOf="@id/guideline4"
59 app:layout_constraintBottom_toTopOf="@+id/guideline5"
60 app:layout_constraintEnd_toEndOf="parent"
61 app:layout_constraintStart_toStartOf="parent"
62 tools:listitem="@layout/item_principal" />
63 </GridLayout>
64 </ScrollView>
65
66 <androidx.appcompat.widget.AppCompatTextView
67 android:id="@+id/txtDeposito"
68 android:layout_width="419dp"
69 android:layout_height="90dp"
70 android:autoSizeMaxTextSize="150sp"
71 android:autoSizeMinTextSize="25sp"
72 android:autoSizeStepGranularity="5sp"
73 android:autoSizeTextType="uniform"
74 android:gravity="center"
75 android:lines="1"
76 android:padding="10dp"
77 android:text="@string/invDinamicoCompra"
78 android:textColor="@color/colorAccent"
79
80 app:fontFamily="sans-serif-condensed"
81 app:layout_constraintBottom_toTopOf="@id/guideline3"
82 app:layout_constraintEnd_toEndOf="parent"
83 app:layout_constraintStart_toStartOf="parent"
84 app:layout_constraintTop_toTopOf="@+id/guideline2" />
85
86 <ScrollView
87 android:id="@+id/scrollView2"
88 android:layout_width="match_parent"
89 android:layout_height="0dp"
90 android:layout_margin="10dp"
91 android:background="@android:color/darker_gray"
92 android:elevation="10dp"
93 android:scrollbarStyle="insideOverlay"
94 app:layout_constraintBottom_toTopOf="@+id/guideline4"
95 app:layout_constraintCircleRadius="10dp"
96 app:layout_constraintEnd_toEndOf="parent"
97 app:layout_constraintStart_toStartOf="parent"
98 app:layout_constraintTop_toBottomOf="@+id/txtDeposito">
99
100 <GridLayout
101 android:id="@+id/tableLayout2"
102 android:layout_width="match_parent"
103 android:layout_height="match_parent"
104 android:alignmentMode="alignMargins"
105 android:columnCount="2"
106 android:padding="15dp"
107 android:rowCount="2">
108
109 <!-- FILA 1-->
110 <!-- COLUMNA 1-->
111 <androidx.cardview.widget.CardView
112 android:layout_width="0dp"
113 android:layout_height="match_parent"
114 android:layout_rowWeight="1"
115 android:layout_columnWeight="1"
116 android:layout_margin="15dp"
117 app:cardCornerRadius="8dp"
118 app:cardElevation="8dp">
119
120 <LinearLayout
121 android:layout_width="wrap_content"
122 android:layout_height="wrap_content"
123 android:layout_gravity="center_horizontal|center_vertical"
124 android:layout_margin="15dp"
125 android:orientation="vertical">
126
127 <androidx.appcompat.widget.AppCompatImageView
128 android:layout_width="wrap_content"
129 android:layout_height="wrap_content"
130 android:layout_gravity="center_horizontal"
131 android:src="@drawable/inventario" />
132
133 <androidx.appcompat.widget.AppCompatTextView
134 android:id="@+id/inventario5"
135 android:layout_width="wrap_content"
136 android:layout_height="100dp"
137
138 android:autoSizeMaxTextSize="150sp"
139 android:autoSizeMinTextSize="15sp"
140 android:autoSizeStepGranularity="5sp"
141 android:autoSizeTextType="uniform"
142 android:gravity="center"
143 android:inputType="textMultiLine"
144 android:text="Inventeario 1 Articulos 100 12/12/2020 12:00"
145 android:textColor="@android:color/black"
146 android:textStyle="bold" />
147 </LinearLayout>
148 </androidx.cardview.widget.CardView>
149 <!-- COLUMNA 2-->
150 <androidx.cardview.widget.CardView
151 android:layout_width="0dp"
152 android:layout_height="0dp"
153 android:layout_rowWeight="1"
154 android:layout_columnWeight="1"
155 android:layout_margin="15dp"
156 app:cardCornerRadius="8dp"
157 app:cardElevation="8dp">
158
159 <LinearLayout
160 android:layout_width="wrap_content"
161 android:layout_height="wrap_content"
162 android:layout_gravity="center_horizontal|center_vertical"
163 android:layout_margin="15dp"
164 android:orientation="vertical">
165
166 <androidx.appcompat.widget.AppCompatImageView
167 android:layout_width="wrap_content"
168 android:layout_height="wrap_content"
169 android:layout_gravity="center_horizontal"
170 android:src="@drawable/inventario" />
171
172 <androidx.appcompat.widget.AppCompatTextView
173 android:id="@+id/inventario6"
174 android:layout_width="wrap_content"
175 android:layout_height="100dp"
176
177 android:autoSizeMaxTextSize="150sp"
178 android:autoSizeMinTextSize="15sp"
179 android:autoSizeStepGranularity="5sp"
180 android:autoSizeTextType="uniform"
181 android:gravity="center"
182 android:text="Inventeario 2 Articulos 100 12/12/2020 12:00"
183 android:textColor="@android:color/black"
184 android:textStyle="bold" />
185 </LinearLayout>
186 </androidx.cardview.widget.CardView>
187
188 <!-- FILA 2-->
189 <!-- COLUMNA 1-->
190 <androidx.cardview.widget.CardView
191 android:layout_width="0dp"
192 android:layout_height="match_parent"
193 android:layout_rowWeight="1"
194 android:layout_columnWeight="1"
195 android:layout_margin="15dp"
196 app:cardCornerRadius="8dp"
197 app:cardElevation="8dp">
198
199 <LinearLayout
200 android:layout_width="wrap_content"
201 android:layout_height="wrap_content"
202 android:layout_gravity="center_horizontal|center_vertical"
203 android:layout_margin="15dp"
204 android:orientation="vertical">
205
206 <androidx.appcompat.widget.AppCompatImageView
207 android:layout_width="wrap_content"
208 android:layout_height="wrap_content"
209 android:layout_gravity="center_horizontal"
210 android:src="@drawable/inventario" />
211
212 <androidx.appcompat.widget.AppCompatTextView
213 android:id="@+id/inventario7"
214 android:layout_width="wrap_content"
215 android:layout_height="100dp"
216
217 android:autoSizeMaxTextSize="150sp"
218 android:autoSizeMinTextSize="15sp"
219 android:autoSizeStepGranularity="5sp"
220 android:autoSizeTextType="uniform"
221 android:gravity="center"
222 android:text="Inventeario 4 Cerrado. Articulos 100 12/12/2020 12:00"
223 android:textColor="@android:color/black"
224 android:textStyle="bold" />
225 </LinearLayout>
226 </androidx.cardview.widget.CardView>
227 <!-- COLUMNA 2-->
228 <androidx.cardview.widget.CardView
229 android:layout_width="0dp"
230 android:layout_height="0dp"
231 android:layout_rowWeight="1"
232 android:layout_columnWeight="1"
233 android:layout_margin="15dp"
234 app:cardCornerRadius="8dp"
235 app:cardElevation="8dp">
236
237 <LinearLayout
238 android:layout_width="wrap_content"
239 android:layout_height="wrap_content"
240 android:layout_gravity="center_horizontal|center_vertical"
241 android:layout_margin="15dp"
242 android:orientation="vertical">
243
244 <androidx.appcompat.widget.AppCompatImageView
245 android:layout_width="wrap_content"
246 android:layout_height="wrap_content"
247 android:layout_gravity="center_horizontal"
248 android:src="@drawable/inventario" />
249
250 <androidx.appcompat.widget.AppCompatTextView
251 android:id="@+id/inventario8"
252 android:layout_width="wrap_content"
253 android:layout_height="100dp"
254
255 android:autoSizeMaxTextSize="150sp"
256 android:autoSizeMinTextSize="15sp"
257 android:autoSizeStepGranularity="5sp"
258 android:autoSizeTextType="uniform"
259 android:gravity="center"
260 android:text="Inventeario 4 Cerrado. Articulos 100 12/12/2020 12:00"
261 android:textColor="@android:color/black"
262 android:textStyle="bold" />
263 </LinearLayout>
264 </androidx.cardview.widget.CardView>
265
266 </GridLayout>
267 </ScrollView>
268
269 <androidx.constraintlayout.widget.Guideline
270 android:id="@+id/guideline0"
271 android:layout_width="wrap_content"
272 android:layout_height="wrap_content"
273 android:orientation="horizontal"
274 app:layout_constraintGuide_percent="0.03" />
275
276 <androidx.constraintlayout.widget.Guideline
277 android:id="@+id/guideline"
278 android:layout_width="wrap_content"
279 android:layout_height="wrap_content"
280 android:orientation="horizontal"
281 app:layout_constraintGuide_percent="0.15"/>
282
283 <androidx.constraintlayout.widget.Guideline
284 android:id="@+id/guideline2"
285 android:layout_width="wrap_content"
286 android:layout_height="wrap_content"
287 android:orientation="horizontal"
288 app:layout_constraintGuide_percent="0.55" />
289
290 <androidx.constraintlayout.widget.Guideline
291 android:id="@+id/guideline3"
292 android:layout_width="wrap_content"
293 android:layout_height="wrap_content"
294 android:orientation="horizontal"
295 app:layout_constraintGuide_percent="0.62" />
296
297 <androidx.constraintlayout.widget.Guideline
298 android:id="@+id/guideline4"
299 android:layout_width="wrap_content"
300 android:layout_height="wrap_content"
301 android:orientation="horizontal"
302 app:layout_constraintGuide_percent="0.95" />
303 </androidx.constraintlayout.widget.ConstraintLayout>
app/src/main/res/layout/fragment_servidores.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.servidores.ServidoresFragment">
8
9
10 <androidx.appcompat.widget.AppCompatTextView
11 android:id="@+id/tvTitutloServer"
12 android:layout_width="match_parent"
13 android:layout_height="90dp"
14 android:layout_marginStart="8dp"
15 android:layout_marginTop="15dp"
16 android:layout_marginEnd="8dp"
17 android:autoSizeMaxTextSize="100sp"
18 android:autoSizeMinTextSize="20sp"
19 android:autoSizeStepGranularity="5sp"
20 android:autoSizeTextType="uniform"
21 android:gravity="center"
22 android:lines="1"
23 android:text="@string/tvTitutloServer"
24 android:textColor="@color/colorAccent"
25 app:fontFamily="sans-serif-condensed"
26 app:layout_constraintBottom_toTopOf="@id/guideline2"
27 app:layout_constraintEnd_toEndOf="parent"
28 app:layout_constraintStart_toStartOf="parent"
29 app:layout_constraintTop_toTopOf="parent" />
30
31 <TextView
32 android:id="@+id/tvDirServer"
33 android:layout_width="match_parent"
34 android:layout_height="wrap_content"
35 android:layout_marginStart="8dp"
36 android:layout_marginEnd="8dp"
37 android:gravity="center"
38 android:lines="1"
39 android:text="@string/tvDirServer"
40 android:textColor="@android:color/black"
41 android:textSize="@dimen/TitulosMedios"
42 android:textStyle="bold|italic"
43 app:fontFamily="sans-serif-condensed"
44 app:layout_constraintBottom_toTopOf="@+id/etDireccionServidor"
45 app:layout_constraintEnd_toEndOf="parent"
46 app:layout_constraintStart_toStartOf="parent"
47 app:layout_constraintTop_toBottomOf="@id/guideline3"
48 app:layout_constraintVertical_bias="0.451" />
49
50 <TextView
51 android:id="@+id/tvNomServer"
52 android:layout_width="match_parent"
53 android:layout_height="wrap_content"
54 android:layout_marginStart="8dp"
55 android:layout_marginEnd="8dp"
56 android:layout_marginTop="15dp"
57 android:gravity="center"
58 android:lines="2"
59 android:text="@string/tvNomServer"
60 android:textColor="@android:color/black"
61 android:textSize="@dimen/TitulosMedios"
62 android:textStyle="bold|italic"
63 app:fontFamily="sans-serif-condensed"
64 app:layout_constraintBottom_toTopOf="@+id/etNombreServidor"
65 app:layout_constraintEnd_toEndOf="parent"
66 app:layout_constraintStart_toStartOf="parent"
67 app:layout_constraintTop_toBottomOf="@id/guideline2" />
68
69 <EditText
70 android:id="@+id/etNombreServidor"
71 android:layout_width="match_parent"
72 android:layout_height="wrap_content"
73 android:autofillHints=""
74 android:clickable="true"
75 android:ems="10"
76 android:focusable="true"
77 android:inputType="text"
78 android:lines="1"
79 android:text=""
80 android:textSize="15sp"
81 app:layout_constraintBottom_toTopOf="@id/guideline3"
82 app:layout_constraintEnd_toEndOf="parent"
83 app:layout_constraintHorizontal_bias="0.0"
84 app:layout_constraintStart_toStartOf="parent"
85 app:layout_constraintTop_toBottomOf="@+id/tvNomServer" />
86
87 <EditText
88 android:id="@+id/etDireccionServidor"
89 android:layout_width="0dp"
90 android:layout_height="wrap_content"
91 android:layout_marginStart="8dp"
92 android:layout_marginEnd="8dp"
93 android:clickable="true"
94 android:ems="10"
95 android:focusable="true"
96 android:inputType="text"
97 android:lines="1"
98 android:text=""
99 android:textSize="15sp"
100 app:layout_constraintBottom_toTopOf="@id/guideline4"
101 app:layout_constraintEnd_toEndOf="parent"
102 app:layout_constraintStart_toStartOf="parent"
103 app:layout_constraintTop_toTopOf="@+id/tvDirServer" />
104
105 <androidx.recyclerview.widget.RecyclerView
106 android:id="@+id/rvServidores"
107 android:layout_width="match_parent"
108 android:layout_height="0dp"
109 android:background="@android:color/darker_gray"
110 app:layout_constraintBottom_toBottomOf="@+id/guideline5"
111 app:layout_constraintEnd_toEndOf="parent"
112 app:layout_constraintStart_toStartOf="parent"
113 app:layout_constraintTop_toBottomOf="@+id/guideline4"
114 tools:listitem="@layout/item_servidores" />
115
116 <Button
117 android:id="@+id/btnGuardarServidores"
118 android:layout_width="0dp"
119 android:layout_height="wrap_content"
120 android:text="@string/btnGuardarServidores"
121 app:layout_constraintBottom_toBottomOf="@+id/guideline6"
122 app:layout_constraintEnd_toEndOf="parent"
123 app:layout_constraintStart_toStartOf="parent" />
124
125
126 <androidx.constraintlayout.widget.Guideline
127 android:id="@+id/guideline2"
128 android:layout_width="wrap_content"
129 android:layout_height="wrap_content"
130 android:orientation="horizontal"
131 app:layout_constraintGuide_percent="0.15" />
132
133 <androidx.constraintlayout.widget.Guideline
134 android:id="@+id/guideline3"
135 android:layout_width="wrap_content"
136 android:layout_height="wrap_content"
137 android:orientation="horizontal"
138 app:layout_constraintGuide_percent="0.25" />
139
140 <androidx.constraintlayout.widget.Guideline
141 android:id="@+id/guideline4"
142 android:layout_width="wrap_content"
143 android:layout_height="wrap_content"
144 android:orientation="horizontal"
145 app:layout_constraintGuide_percent="0.5" />
146
147 <androidx.constraintlayout.widget.Guideline
148 android:id="@+id/guideline5"
149 android:layout_width="wrap_content"
150 android:layout_height="wrap_content"
151 android:orientation="horizontal"
152 app:layout_constraintGuide_percent="0.80" />
153
154 <androidx.constraintlayout.widget.Guideline
155 android:id="@+id/guideline6"
156 android:layout_width="wrap_content"
157 android:layout_height="wrap_content"
158 android:orientation="horizontal"
159 app:layout_constraintGuide_percent="0.88" />
160 </androidx.constraintlayout.widget.ConstraintLayout>
161
app/src/main/res/layout/ingresar_cantidad.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <androidx.cardview.widget.CardView
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:layout_width="match_parent"
7 android:layout_height="wrap_content"
8 app:cardCornerRadius="10dp"
9 app:cardElevation="5dp"
10 android:background="@drawable/md_transparent"
11 tools:context=".ui.inventario.InsertCant"
12 tools:ignore="PrivateResource">
13
14
15 <androidx.constraintlayout.widget.ConstraintLayout
16 android:layout_width="match_parent"
17 android:layout_height="match_parent">
18
19 <LinearLayout
20 android:id="@+id/barraSuperior"
21 android:layout_width="0dp"
22 android:layout_height="wrap_content"
23 android:background="@color/colorPrimaryDark"
24 android:orientation="horizontal"
25 app:layout_constraintLeft_toLeftOf="parent"
26 app:layout_constraintRight_toRightOf="parent"
27 app:layout_constraintTop_toTopOf="parent"
28 app:layout_constraintTop_toBottomOf="@+id/lySegundo">
29
30 <androidx.appcompat.widget.AppCompatTextView
31 android:layout_width="0dp"
32 android:layout_height="wrap_content"
33 android:layout_margin="10dp"
34 android:layout_marginStart="5dp"
35 android:layout_marginTop="10dp"
36 android:layout_weight="1"
37 android:text="@string/adv"
38 android:textAlignment="center"
39 android:textColor="@android:color/white"
40 android:textSize="25sp"
41 android:textStyle="bold" />
42 </LinearLayout>
43
44
45 <LinearLayout
46 android:id="@+id/lySegundo"
47 android:layout_width="match_parent"
48 android:layout_height="wrap_content"
49 android:orientation="vertical"
50 android:padding="12dp"
51 app:layout_constraintLeft_toLeftOf="parent"
52 app:layout_constraintRight_toRightOf="parent"
53 app:layout_constraintTop_toBottomOf="@id/barraSuperior">
54
55
56
57 <EditText
58 android:id="@+id/etCantidad"
59 android:layout_width="match_parent"
60 android:layout_height="wrap_content"
61 android:ems="10"
62 android:gravity="center"
63 android:textSize="20sp"
64 android:focusable="true"
65 android:clickable="true"
66 android:inputType="numberDecimal"
67 android:text="" />
68
69
70 <androidx.appcompat.widget.AppCompatButton
71 android:id="@+id/btnAceptar"
72 android:layout_width="match_parent"
73 android:layout_height="wrap_content"
74 android:layout_margin="10dp"
75 android:layout_marginBottom="20dp"
76 android:clickable="true"
77 android:focusable="true"
78 android:text="@string/btnConfirmar"
79 android:textAlignment="center"
80 android:textColor="@android:color/black"
81 android:textSize="20sp"
82 android:textStyle="bold"
83 app:cardBackgroundColor="@android:color/darker_gray"
84 app:cardUseCompatPadding="true" />
85
86
87 </LinearLayout>
88
89
90 </androidx.constraintlayout.widget.ConstraintLayout>
91 </androidx.cardview.widget.CardView>
app/src/main/res/layout/item.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="2dp"
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/textView2"
19 android:layout_width="wrap_content"
20 android:layout_height="wrap_content"
21 android:layout_marginStart="5dp"
22 android:text="Código:"
23 android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
24 android:textSize="14sp"
25 app:layout_constraintEnd_toStartOf="@+id/tvSector"
26 app:layout_constraintHorizontal_bias="0.01"
27 app:layout_constraintHorizontal_chainStyle="packed"
28 app:layout_constraintStart_toStartOf="parent"
29 app:layout_constraintTop_toTopOf="parent" />
30
31
32 <TextView
33 android:id="@+id/tvSector"
34 android:layout_width="wrap_content"
35 android:layout_height="match_parent"
36 android:layout_marginStart="8dp"
37 android:text="9999"
38 android:textAppearance="@style/TextAppearance.AppCompat.Large"
39 android:textColorHint="@android:color/black"
40 android:textSize="14sp"
41 android:textStyle="bold"
42 app:layout_constraintHorizontal_chainStyle="packed"
43 app:layout_constraintBaseline_toBaselineOf="@+id/textView2"
44 app:layout_constraintEnd_toStartOf="@+id/tvCodigo"
45 app:layout_constraintStart_toEndOf="@+id/textView2" />
46 <TextView
47 android:id="@+id/tvCodigo"
48 android:layout_width="wrap_content"
49 android:layout_height="match_parent"
50 android:layout_marginStart="8dp"
51 android:text="99999999"
52 app:layout_constraintHorizontal_chainStyle="packed"
53 android:textAppearance="@style/TextAppearance.AppCompat.Large"
54 android:textColorHint="@android:color/black"
55 android:textSize="14sp"
56 android:textStyle="bold"
57 app:layout_constraintBaseline_toBaselineOf="@+id/tvSector"
58 app:layout_constraintEnd_toStartOf="@+id/textView5"
59 app:layout_constraintStart_toEndOf="@+id/tvSector" />
60
61 <TextView
62 android:id="@+id/textView5"
63 android:layout_width="wrap_content"
64 android:layout_height="wrap_content"
65 android:layout_marginStart="8dp"
66 android:text="Cantidad:"
67 android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
68 android:textSize="14sp"
69 app:layout_constraintTop_toTopOf="parent"
70 app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras"
71 app:layout_constraintStart_toEndOf="@+id/tvCodigo" />
72
73 <TextView
74 android:id="@+id/tvCantidad"
75 android:layout_width="wrap_content"
76 android:layout_height="match_parent"
77 android:layout_margin="5dp"
78 android:text="12345.12"
79 android:textAppearance="@style/TextAppearance.AppCompat.Large"
80 android:textSize="14sp"
81 android:textStyle="bold"
82 app:layout_constraintBaseline_toBaselineOf="@+id/textView5"
83 app:layout_constraintEnd_toEndOf="parent"
84 app:layout_constraintHorizontal_bias="0.0"
85 app:layout_constraintStart_toEndOf="@id/textView5"
86 app:layout_constraintTop_toTopOf="parent" />
87
88 <ImageView
89 android:id="@+id/ivHolder"
90 android:layout_width="30dp"
91 android:layout_height="30dp"
92 android:visibility="visible"
93 android:src="@drawable/more"
94 app:layout_constraintBottom_toTopOf="@+id/tvDescripcion"
95 app:layout_constraintEnd_toEndOf="parent"
96 app:layout_constraintHorizontal_bias="0.968"
97 app:layout_constraintStart_toEndOf="@+id/tvCodigoBarras"
98 app:layout_constraintTop_toTopOf="parent"
99 app:layout_constraintVertical_bias="0.0" />
100
101 <TextView
102 android:id="@+id/textView85"
103 android:layout_width="wrap_content"
104 android:layout_height="wrap_content"
105 android:layout_marginStart="5dp"
106 android:layout_marginTop="8dp"
107 android:text="Desc:"
108 android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
109 android:textSize="14sp"
110 app:layout_constraintEnd_toStartOf="@+id/tvDescripcion"
111 app:layout_constraintHorizontal_bias="0.0"
112 app:layout_constraintHorizontal_chainStyle="packed"
113 app:layout_constraintStart_toStartOf="parent"
114 app:layout_constraintTop_toBottomOf="@id/tvCodigo" />
115
116 <TextView
117 android:id="@+id/tvDescripcion"
118 android:layout_width="0dp"
119 android:layout_height="wrap_content"
120 android:layout_marginStart="3dp"
121 android:layout_marginTop="8dp"
122 android:maxLines="2"
123 android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz"
124 android:textAppearance="@style/TextAppearance.AppCompat.Large"
125 android:textSize="14sp"
126 android:textStyle="bold"
127 app:layout_constraintBaseline_toBaselineOf="@+id/textView85"
128 app:layout_constraintEnd_toEndOf="parent"
129 app:layout_constraintStart_toEndOf="@+id/textView85"
130 app:layout_constraintTop_toBottomOf="@+id/tvCodigo" />
131
132 <TextView
133 android:id="@+id/tvCodigoBarras"
134 android:layout_width="match_parent"
135 android:layout_height="wrap_content"
136 android:layout_marginStart="3dp"
137 android:layout_marginTop="8dp"
138 android:maxLines="2"
139 android:text=""
140 android:textAppearance="@style/TextAppearance.AppCompat.Large"
141 android:textSize="14sp"
142 android:visibility="gone"
143 android:textStyle="bold"
144 app:layout_constraintBaseline_toBaselineOf="@+id/textView85"
145 app:layout_constraintEnd_toEndOf="parent"
146 app:layout_constraintStart_toEndOf="@+id/textView85"
147 app:layout_constraintTop_toBottomOf="@+id/tvCodigo" />
148
149 </androidx.constraintlayout.widget.ConstraintLayout>
150
151 </androidx.cardview.widget.CardView>
app/src/main/res/layout/item_descripcion.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 android:layout_width="match_parent"
5 android:layout_height="wrap_content"
6 android:layout_margin="5dp"
7 app:cardCornerRadius="2dp"
8 app:cardElevation="10dp"
9 app:contentPadding="5dp"
10 app:cardPreventCornerOverlap="false">
11
12 <androidx.constraintlayout.widget.ConstraintLayout
13 android:layout_width="match_parent"
14 android:layout_height="wrap_content">
15
16 <TextView
17 android:id="@+id/textView2"
18 android:layout_width="wrap_content"
19 android:layout_height="wrap_content"
20 android:layout_marginStart="5dp"
21 android:text="Código:"
22 android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
23 android:textSize="14sp"
24 app:layout_constraintEnd_toStartOf="@+id/tvSector"
25 app:layout_constraintHorizontal_bias="0.01"
26 app:layout_constraintHorizontal_chainStyle="packed"
27 app:layout_constraintStart_toStartOf="parent"
28 app:layout_constraintTop_toTopOf="parent" />
29
30
31 <TextView
32 android:id="@+id/tvSector"
33 android:layout_width="wrap_content"
34 android:layout_height="match_parent"
35 android:layout_marginStart="8dp"
36 android:text="9999"
37 android:textAppearance="@style/TextAppearance.AppCompat.Large"
38 android:textColorHint="@android:color/black"
39 android:textSize="14sp"
40 android:textStyle="bold"
41 app:layout_constraintHorizontal_chainStyle="packed"
42 app:layout_constraintBaseline_toBaselineOf="@+id/textView2"
43 app:layout_constraintEnd_toStartOf="@+id/tvCodigo"
44 app:layout_constraintStart_toEndOf="@+id/textView2" />
45 <TextView
46 android:id="@+id/tvCodigo"
47 android:layout_width="wrap_content"
48 android:layout_height="match_parent"
49 android:layout_marginStart="8dp"
50 android:text="99999999"
51 app:layout_constraintHorizontal_chainStyle="packed"
52 android:textAppearance="@style/TextAppearance.AppCompat.Large"
53 android:textColorHint="@android:color/black"
54 android:textSize="14sp"
55 android:textStyle="bold"
56 app:layout_constraintBaseline_toBaselineOf="@+id/tvSector"
57 app:layout_constraintEnd_toStartOf="@+id/textView5"
58 app:layout_constraintStart_toEndOf="@+id/tvSector" />
59
60 <TextView
61 android:id="@+id/textView5"
62 android:layout_width="wrap_content"
63 android:layout_height="wrap_content"
64 android:layout_marginStart="8dp"
65 android:text="Cantidad:"
66 android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
67 android:textSize="14sp"
68 android:visibility="gone"
69 app:layout_constraintTop_toTopOf="parent"
70 app:layout_constraintEnd_toStartOf="@+id/tvCodigoBarras"
71 app:layout_constraintStart_toEndOf="@+id/tvCodigo" />
72
73 <TextView
74 android:id="@+id/tvCantidad"
75 android:layout_width="wrap_content"
76 android:layout_height="match_parent"
77 android:layout_marginStart="8dp"
78 android:text="Otros Códigos:"
79 android:textAppearance="@style/TextAppearance.AppCompat.Large"
80 android:textSize="14sp"
81 android:textStyle="bold"
82 android:visibility="visible"
83 app:layout_constraintEnd_toStartOf="@id/tvCodigoBarras"
84 app:layout_constraintStart_toEndOf="@id/textView5"
85 app:layout_constraintTop_toTopOf="parent" />
86
87 <TextView
88 android:id="@+id/tvCodigoBarras"
89 android:layout_width="0dp"
90 android:layout_height="wrap_content"
91 android:layout_marginStart="3dp"
92 android:maxLines="2"
93 android:text=""
94 android:textAppearance="@style/TextAppearance.AppCompat.Large"
95 android:textSize="14sp"
96 android:visibility="visible"
97 android:textStyle="bold"
98 app:layout_constraintEnd_toEndOf="parent"
99 app:layout_constraintStart_toEndOf="@+id/tvCantidad"
100 app:layout_constraintTop_toTopOf="parent"/>
101
102 <ImageView
103 android:id="@+id/ivHolder"
104 android:layout_width="30dp"
105 android:layout_height="30dp"
106 android:visibility="gone"
107 android:src="@drawable/more"
108 app:layout_constraintBottom_toTopOf="@+id/tvDescripcion"
109 app:layout_constraintEnd_toEndOf="parent"
110 app:layout_constraintHorizontal_bias="0.968"
111 app:layout_constraintStart_toEndOf="@+id/tvCodigoBarras"
112 app:layout_constraintTop_toTopOf="parent"
113 app:layout_constraintVertical_bias="0.0" />
114
115 <TextView
116 android:id="@+id/textView85"
117 android:layout_width="wrap_content"
118 android:layout_height="wrap_content"
119 android:layout_marginStart="5dp"
120 android:layout_marginTop="8dp"
121 android:text="Desc:"
122 android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
123 android:textSize="14sp"
124 app:layout_constraintEnd_toStartOf="@+id/tvDescripcion"
125 app:layout_constraintHorizontal_bias="0.0"
126 app:layout_constraintHorizontal_chainStyle="packed"
127 app:layout_constraintStart_toStartOf="parent"
128 app:layout_constraintTop_toBottomOf="@id/tvCodigo" />
129
130 <TextView
131 android:id="@+id/tvDescripcion"
132 android:layout_width="0dp"
133 android:layout_height="wrap_content"
134 android:layout_marginStart="3dp"
135 android:layout_marginTop="8dp"
136 android:maxLines="2"
137 android:text="abcdefghijklmnñopqrstuvwxyz0123456789abcdefghijklmnñopqrstuvwxyz"
138 android:textAppearance="@style/TextAppearance.AppCompat.Large"
139 android:textSize="14sp"
140 android:textStyle="bold"
141 app:layout_constraintBaseline_toBaselineOf="@+id/textView85"
142 app:layout_constraintEnd_toEndOf="parent"
143 app:layout_constraintStart_toEndOf="@+id/textView85"
144 app:layout_constraintTop_toBottomOf="@+id/tvCodigo" />
145
146
147 </androidx.constraintlayout.widget.ConstraintLayout>
148
149 </androidx.cardview.widget.CardView>
app/src/main/res/layout/item_principal.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <androidx.cardview.widget.CardView
3 xmlns:android="http://schemas.android.com/apk/res/android"
4 xmlns:app="http://schemas.android.com/apk/res-auto"
5 android:id="@+id/cvInventario"
6 android:layout_width="match_parent"
7 android:layout_height="wrap_content"
8 android:layout_rowWeight="1"
9 android:layout_columnWeight="1"
10 android:layout_margin="15dp"
11 app:cardCornerRadius="8dp"
12 app:cardElevation="8dp"
13 app:layout_constraintBottom_toBottomOf="parent"
14 app:layout_constraintEnd_toEndOf="parent"
15 app:layout_constraintStart_toStartOf="parent"
16 app:layout_constraintTop_toTopOf="parent">
17
18 <LinearLayout
19 android:layout_width="wrap_content"
20 android:layout_height="wrap_content"
21 android:layout_gravity="center_horizontal|center_vertical"
22 android:layout_margin="15dp"
23 android:orientation="vertical">
24
25 <androidx.appcompat.widget.AppCompatImageView
26 android:layout_width="wrap_content"
27 android:layout_height="wrap_content"
28 android:layout_gravity="center_horizontal"
29 android:src="@drawable/inventario" />
30
31 <androidx.appcompat.widget.AppCompatTextView
32 android:id="@+id/inventario"
33 android:layout_width="wrap_content"
34 android:layout_height="60dp"
35 android:autoSizeMaxTextSize="50sp"
36 android:autoSizeMinTextSize="15sp"
37 android:clickable="true"
38 android:autoSizeStepGranularity="5sp"
39 android:autoSizeTextType="uniform"
40 android:gravity="center"
41 android:inputType="textMultiLine"
42 android:text="Inventeario 1 Abierto. Articulos 100 12/12/2020 12:00"
43 android:textColor="@android:color/black"
44 android:textStyle="bold" />
45 </LinearLayout>
46 </androidx.cardview.widget.CardView>
47
app/src/main/res/layout/item_servidores.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="2dp"
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/textView2"
19 android:layout_width="wrap_content"
20 android:layout_height="wrap_content"
21 android:layout_marginStart="5dp"
22 android:text="Descripción:"
23 android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
24 android:textSize="14sp"
25 app:layout_constraintEnd_toStartOf="@+id/tvCodigo"
26 app:layout_constraintHorizontal_bias="0.01"
27 app:layout_constraintHorizontal_chainStyle="packed"
28 app:layout_constraintStart_toStartOf="parent"
29 app:layout_constraintTop_toTopOf="parent" />
30
31
32 <TextView
33 android:id="@+id/tvDescServidor"
34 android:layout_width="0dp"
35 android:layout_height="match_parent"
36 android:layout_marginStart="8dp"
37 android:text="Laboratorio Foca 1"
38 android:textAppearance="@style/TextAppearance.AppCompat.Large"
39 android:textColorHint="@android:color/black"
40 android:textSize="14sp"
41 android:textStyle="bold"
42 app:layout_constraintBaseline_toBaselineOf="@+id/textView2"
43 app:layout_constraintEnd_toEndOf="parent"
44 app:layout_constraintStart_toEndOf="@+id/textView2" />
45
46 <TextView
47 android:id="@+id/textView85"
48 android:layout_width="wrap_content"
49 android:layout_height="wrap_content"
50 android:layout_marginStart="5dp"
51 android:layout_marginTop="8dp"
52 android:text="Dirección:"
53 android:textAppearance="@style/TextAppearance.AppCompat.Widget.PopupMenu.Large"
54 android:textSize="14sp"
55 app:layout_constraintHorizontal_chainStyle="packed"
56 app:layout_constraintStart_toStartOf="parent"
57 app:layout_constraintEnd_toStartOf="@id/tvDireccionServidor"
58 app:layout_constraintTop_toBottomOf="@id/tvDescServidor" />
59
60 <TextView
61 android:id="@+id/tvDireccionServidor"
62 android:layout_width="0dp"
63 android:layout_height="match_parent"
64 android:layout_marginStart="8dp"
65 android:text="http://192.168.0.205:3008"
66 android:textAppearance="@style/TextAppearance.AppCompat.Large"
67 android:textColorHint="@android:color/black"
68 android:textSize="14sp"
69 android:textStyle="bold"
70 app:layout_constraintBaseline_toBaselineOf="@+id/textView85"
71 app:layout_constraintEnd_toEndOf="parent"
72 app:layout_constraintStart_toEndOf="@+id/textView85" />
73
74 </androidx.constraintlayout.widget.ConstraintLayout>
75
76 </androidx.cardview.widget.CardView>
app/src/main/res/layout/login_dialog.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:orientation="vertical"
7 android:padding="10dp">
8
9 <TextView
10 android:id="@+id/dialogNameEt"
11 android:layout_width="wrap_content"
12 android:layout_height="wrap_content"
13 android:layout_margin="5dp"
14 android:text="La cantidad actual es:"
15 android:textSize="20sp"
16 app:layout_constraintEnd_toStartOf="@id/tvCantInicial"
17 app:layout_constraintHorizontal_bias="0.0"
18 app:layout_constraintHorizontal_chainStyle="packed"
19 app:layout_constraintStart_toStartOf="parent"
20 app:layout_constraintTop_toTopOf="parent" />
21
22 <TextView
23 android:id="@+id/tvCantInicial"
24 android:layout_width="wrap_content"
25 android:layout_height="wrap_content"
26 android:layout_margin="5dp"
27 android:text="20"
28 android:textSize="20sp"
29 app:layout_constraintBaseline_toBaselineOf="@+id/dialogNameEt"
30 app:layout_constraintEnd_toEndOf="parent"
31 app:layout_constraintHorizontal_chainStyle="packed"
32 app:layout_constraintStart_toEndOf="@id/dialogNameEt" />
33
34 <TextView
35 android:id="@+id/tvgenerico"
36 android:layout_width="wrap_content"
37 android:layout_height="wrap_content"
38 android:layout_margin="5dp"
39 android:text="Ingrese la nueva cantidad:"
40 android:textSize="20sp"
41 app:layout_constraintStart_toStartOf="parent"
42 app:layout_constraintTop_toBottomOf="@+id/tvCantInicial" />
43
44 <EditText
45 android:id="@+id/tvNuevaCantidad"
46 android:layout_width="0dp"
47 android:layout_height="wrap_content"
48 android:hint="Nueva Cacntidad"
49 android:inputType="numberDecimal"
50 app:layout_constraintBaseline_toBaselineOf="@+id/tvgenerico"
51 app:layout_constraintEnd_toEndOf="parent"
52 app:layout_constraintStart_toEndOf="@id/tvgenerico" />
53
54 <TextView
55 android:id="@+id/tvgenerico2"
56 android:layout_width="wrap_content"
57 android:layout_height="wrap_content"
58 android:layout_margin="5dp"
59 android:gravity="center"
60 android:text="@string/tvSeleccion"
61 android:textSize="20sp"
62 app:layout_constraintStart_toStartOf="parent"
63 app:layout_constraintTop_toBottomOf="@+id/tvgenerico" />
64
65 <RadioGroup
66 android:id="@+id/rgFechaHora"
67 android:layout_width="wrap_content"
68 android:layout_height="wrap_content"
69 android:layout_margin="5dp"
70 android:gravity="start"
71 android:orientation="vertical"
72 app:layout_constraintEnd_toEndOf="parent"
73 app:layout_constraintHorizontal_bias="0.0"
74 app:layout_constraintStart_toStartOf="parent"
75 app:layout_constraintTop_toBottomOf="@+id/tvgenerico2">
76
77
78 <RadioButton
79 android:id="@+id/rbMdodificar"
80 android:layout_width="wrap_content"
81 android:layout_height="wrap_content"
82 android:layout_margin="5dp"
83 android:checked="false"
84 android:padding="5dp"
85 android:text="@string/rbModificar"
86 android:textSize="@dimen/text_size2" />
87
88 <RadioButton
89 android:id="@+id/rbSumar"
90 android:layout_width="wrap_content"
91 android:layout_height="wrap_content"
92 android:layout_margin="5dp"
93 android:checked="false"
94 android:padding="5dp"
95 android:text="@string/rbSumar"
96 android:textSize="@dimen/text_size2" />
97
98 <RadioButton
99 android:id="@+id/rbRestar"
100 android:layout_width="wrap_content"
101 android:layout_height="wrap_content"
102 android:layout_margin="5dp"
103 android:checked="false"
104 android:padding="5dp"
105 android:text="@string/rbRestar"
106 android:textSize="@dimen/text_size2" />
107 </RadioGroup>
108
109 <TextView
110 android:id="@+id/tvgenerico3"
111 android:layout_width="wrap_content"
112 android:layout_height="wrap_content"
113 android:layout_margin="5dp"
114 android:gravity="center"
115 android:text="@string/tvResultado"
116 android:textSize="20sp"
117 app:layout_constraintEnd_toEndOf="parent"
118 app:layout_constraintHorizontal_bias="0.0"
119 app:layout_constraintStart_toStartOf="parent"
120 app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" />
121
122 <TextView
123 android:id="@+id/tvgenerico4"
124 android:layout_width="wrap_content"
125 android:layout_height="wrap_content"
126 android:layout_margin="5dp"
127 android:gravity="center"
128 android:text="50"
129 android:textSize="20sp"
130 app:layout_constraintEnd_toEndOf="parent"
131 app:layout_constraintHorizontal_bias="0.0"
132 app:layout_constraintStart_toEndOf="@+id/tvgenerico3"
133 app:layout_constraintTop_toBottomOf="@+id/rgFechaHora" />
134
135 <LinearLayout
136 android:layout_width="match_parent"
137 android:layout_height="wrap_content"
138 android:orientation="horizontal"
139 android:gravity="center"
140 app:layout_constraintStart_toStartOf="parent"
141 app:layout_constraintEnd_toEndOf="parent"
142 app:layout_constraintTop_toBottomOf="@+id/tvgenerico4">
143
144 <Button
145 android:id="@+id/dialogLoginBtn"
146 style="@style/Base.Widget.AppCompat.Button.Colored"
147 android:layout_width="wrap_content"
148 android:padding="20dp"
149 android:layout_margin="5dp"
150 android:layout_height="wrap_content"
151 android:text="@string/btnOk" />
152
153 <Button
154 android:id="@+id/dialogCancelBtn"
155 style="@style/Base.Widget.AppCompat.Button.Colored"
156 android:padding="20dp"
157 android:layout_margin="5dp"
158 android:layout_width="wrap_content"
159 android:layout_height="wrap_content"
160 android:text="@string/btnCancelar" />
161 </LinearLayout>
162
163 </androidx.constraintlayout.widget.ConstraintLayout>
app/src/main/res/layout/nav_header_main.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout 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="@dimen/nav_header_height"
6 android:background="@drawable/side_nav_bar"
7 android:gravity="bottom"
8 android:orientation="vertical"
9 android:paddingLeft="@dimen/activity_horizontal_margin"
10 android:paddingTop="@dimen/activity_vertical_margin"
11 android:paddingRight="@dimen/activity_horizontal_margin"
12 android:paddingBottom="@dimen/activity_vertical_margin"
13 android:theme="@style/ThemeOverlay.AppCompat.Dark">
14
15 <ImageView
16 android:id="@+id/imageView"
17 android:layout_width="141dp"
18 android:layout_height="wrap_content"
19 android:contentDescription=" "
20 android:paddingTop="@dimen/nav_header_vertical_spacing"
21 app:srcCompat="@drawable/logo" />
22
23 <TextView
24 android:layout_width="match_parent"
25 android:layout_height="wrap_content"
26 android:paddingTop="@dimen/nav_header_vertical_spacing"
27 android:textSize="@dimen/md_message_textsize"
28 android:text="Debo Inventario"
29 android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
30
31 <TextView
32 android:id="@+id/textView"
33 android:layout_width="wrap_content"
34 android:layout_height="wrap_content"
35 android:text="FocaSoftware SA" />
36 </LinearLayout>
app/src/main/res/layout/z_dialogpersocomplexcantidad_modificacion.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="match_parent"
4 android:layout_height="match_parent"
5 android:gravity="center_horizontal"
6 android:orientation="vertical">
7
8 <TableLayout
9 android:layout_width="wrap_content"
10 android:layout_height="wrap_content">
11
12 <TableRow
13 android:layout_width="wrap_content"
14 android:layout_height="wrap_content"
15 android:gravity="center_vertical">
16
17 <TextView
18 android:layout_width="200dp"
19 android:layout_height="wrap_content"
20 android:gravity="end"
21 android:text="Cantidad actual: "
22 android:textSize="20sp" />
23
24 <TextView
25 android:id="@+id/Z_DIALOG_cantidad_actual"
26 android:layout_width="50dp"
27 android:layout_height="wrap_content"
28 android:gravity="center"
29 android:text="13"
30 android:textSize="20sp" />
31 </TableRow>
32
33 <TableRow
34 android:layout_width="wrap_content"
35 android:layout_height="wrap_content"
36 android:gravity="center_vertical">
37
38 <TextView
39 android:layout_width="wrap_content"
40 android:layout_height="wrap_content"
41 android:gravity="end"
42 android:text="Cantidad previsional: "
43 android:textSize="20sp" />
44
45 <TextView
46 android:id="@+id/Z_DIALOG_cantidad_final"
47 android:layout_width="wrap_content"
48 android:layout_height="wrap_content"
49 android:gravity="center"
50 android:text="24"
51 android:textSize="20sp" />
52 </TableRow>
53 </TableLayout>
54
55 <LinearLayout
56 android:layout_width="wrap_content"
57 android:layout_height="wrap_content"
58 android:layout_marginTop="10dp"
59 android:gravity="center_vertical"
60 android:orientation="horizontal">
61
62 <TextView
63 android:id="@+id/Z_DIALOG_tipo_operacion"
64 android:layout_width="wrap_content"
65 android:layout_height="wrap_content"
66 android:gravity="end"
67 android:text="SUMAR: "
68 android:textSize="20sp" />
69
70 <EditText
71 android:id="@+id/Z_DIALOG_cantidad_nueva"
72 android:layout_width="120dp"
73 android:layout_height="50dp"
74 android:clickable="true"
75 android:focusable="true"
76 android:gravity="center"
77 android:hint="Cantidad"
78 android:inputType="numberDecimal"
79 android:maxLength="6"
80 android:textColor="@android:color/black"
81 android:textSize="20sp" />
82
83 <Button
84 android:id="@+id/Z_DIALOG_boton_reset"
85 android:layout_width="80dp"
86 android:layout_height="wrap_content"
87 android:gravity="center"
88 android:text="No tomado"
89 android:visibility="gone" />
90 </LinearLayout>
91
92 <LinearLayout
93 android:layout_width="wrap_content"
94 android:layout_height="wrap_content"
95 android:layout_gravity="center_horizontal"
96 android:layout_marginTop="10dp"
97 android:orientation="horizontal">
98
99 <ImageView
100 android:id="@+id/Z_DIALOG_validar"
101 android:layout_width="50dp"
102 android:layout_height="50dp"
103 android:layout_marginEnd="60dp"
104 android:contentDescription=" "
105 android:scaleType="fitXY"
106 android:src="@drawable/md_transparent" />
107
108 <ImageView
109 android:id="@+id/Z_DIALOG_cancelar"
110 android:layout_width="50dp"
111 android:layout_height="50dp"
112 android:contentDescription=" "
113 android:scaleType="fitXY"
114 android:src="@drawable/md_btn_selected_dark" />
115
116
117 </LinearLayout>
118
119 </LinearLayout>
app/src/main/res/menu/activity_main_drawer.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <menu xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:tools="http://schemas.android.com/tools"
4 tools:showIn="navigation_view">
5
6 <group android:checkableBehavior="single">
7 <item
8 android:id="@+id/mainFragment2"
9 android:checkable="true"
10 android:checked="true"
11 android:icon="@drawable/inicio"
12 android:title="@string/menuInicio" />
13 <item
14 android:id="@+id/mnuInicio2"
15 android:checkable="false"
16 android:checked="false"
17
18 android:title="" />
19 <item
20 android:id="@+id/inventarioFragment"
21 android:icon="@drawable/inventario"
22 android:title="@string/menuNueInv" />
23 <item
24 android:id="@+id/mnuInicio3"
25 android:checkable="false"
26 android:checked="false"
27 android:title="" />
28 <item
29 android:id="@+id/actuaMaestrosFragment"
30 android:icon="@drawable/maestros"
31 android:title="@string/menuActMae" />
32 <item
33 android:id="@+id/mnuInicio4"
34 android:checkable="false"
35 android:checked="false"
36 android:title="" />
37 <item
38 android:id="@+id/configuracionFragment"
39 android:icon="@drawable/configuracion"
40 android:title="@string/menuConf" />
41 </group>
42 </menu>
app/src/main/res/menu/main.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <menu xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto">
4 <item
5 android:id="@+id/action_settings"
6 android:orderInCategory="100"
7 android:title="@string/action_settings"
8 app:showAsAction="never" />
9 </menu>
app/src/main/res/menu/prueba.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <menu xmlns:android="http://schemas.android.com/apk/res/android">
3 <group android:checkableBehavior="single">
4 <item
5 android:id="@+id/mainFragment2"
6 android:checkable="true"
7 android:checked="true"
8 android:icon="@drawable/inicio"
9 android:title="@string/menuInicio" />
10 <item
11 android:id="@+id/configuracionFragment"
12 android:icon="@drawable/configuracion"
13 android:title="@string/menuConf" />
14 </group>
15 </menu>
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3 <background android:drawable="@drawable/ic_launcher_background" />
4 <foreground android:drawable="@drawable/ic_launcher_foreground" />
5 </adaptive-icon>
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3 <background android:drawable="@drawable/ic_launcher_background" />
4 <foreground android:drawable="@drawable/ic_launcher_foreground" />
5 </adaptive-icon>
app/src/main/res/mipmap-hdpi/ic_launcher.png

3.51 KB

app/src/main/res/mipmap-hdpi/ic_launcher_round.png

5.21 KB

app/src/main/res/mipmap-mdpi/ic_launcher.png

2.57 KB

app/src/main/res/mipmap-mdpi/ic_launcher_round.png

3.31 KB

app/src/main/res/mipmap-xhdpi/ic_launcher.png

4.81 KB

app/src/main/res/mipmap-xhdpi/ic_launcher_round.png

7.3 KB

app/src/main/res/mipmap-xxhdpi/ic_launcher.png

7.72 KB

app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png

11.6 KB

app/src/main/res/mipmap-xxxhdpi/ic_launcher.png

10.4 KB

app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png

16.2 KB

app/src/main/res/navigation/mobile_navigation.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <navigation 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:id="@+id/mobile_navigation"
6 app:startDestination="@id/mainFragment2">
7
8 <activity
9 android:id="@+id/mainActivity"
10 android:name="com.focasoftware.deboinventariov20.MainActivity"
11 android:label="app_bar_main"
12 tools:layout="@layout/app_bar_main" />
13 <fragment
14 android:id="@+id/mainFragment2"
15 android:name="com.focasoftware.deboinventariov20.ui.main.MainFragment"
16 android:label="Principal"
17 tools:layout="@layout/fragment_main" >
18 <action
19 android:id="@+id/action_mainFragment2_to_configuracionFragment"
20 app:destination="@id/configuracionFragment"
21 app:popEnterAnim="@anim/slide_in_left"
22 app:popExitAnim="@anim/slide_out_right"
23 app:enterAnim="@anim/slide_in_right"
24 app:exitAnim="@anim/slide_out_left" />
25 <action
26 android:id="@+id/action_mainFragment2_to_actuaMaestrosFragment"
27 app:destination="@id/actuaMaestrosFragment"
28 app:popEnterAnim="@anim/slide_in_left"
29 app:popExitAnim="@anim/slide_out_right"
30 app:enterAnim="@anim/slide_in_right"
31 app:exitAnim="@anim/slide_out_left" />
32 <action
33 android:id="@+id/action_mainFragment2_to_inventarioFragment"
34 app:destination="@id/inventarioFragment"
35 app:popEnterAnim="@anim/slide_in_left"
36 app:popExitAnim="@anim/slide_out_right"
37 app:enterAnim="@anim/slide_in_right"
38 app:exitAnim="@anim/slide_out_left" />
39 </fragment>
40 <fragment
41 android:id="@+id/actuaMaestrosFragment"
42 android:name="com.focasoftware.deboinventariov20.ui.actualizacionMaestros.ActuaMaestrosFragment"
43 android:label="Actualización de Maestros"
44 tools:layout="@layout/fragment_actua_maestros" />
45 <fragment
46 android:id="@+id/servidoresFragment"
47 android:name="com.focasoftware.deboinventariov20.ui.servidores.ServidoresFragment"
48 android:label="Alta Servidores"
49 tools:layout="@layout/fragment_servidores">
50 <action
51 android:id="@+id/action_servidoresFragment_to_configuracionFragment"
52 app:destination="@id/configuracionFragment"
53 app:enterAnim="@anim/slide_in_right"
54 app:exitAnim="@anim/slide_out_left"
55 app:popEnterAnim="@anim/slide_in_left"
56 app:popExitAnim="@anim/slide_out_right" />
57 </fragment>
58 <fragment
59 android:id="@+id/inventarioFragment"
60 android:name="com.focasoftware.deboinventariov20.ui.inventario.InventarioFragment"
61 android:label="Inventario Dinamico"
62 tools:layout="@layout/fragment_inventario" >
63 <action
64 android:id="@+id/action_inventarioFragment_to_descripcionFragment"
65 app:destination="@id/descripcionFragment"
66 app:popEnterAnim="@anim/slide_in_left"
67 app:popExitAnim="@anim/slide_out_right"
68 app:enterAnim="@anim/slide_in_right"
69 app:exitAnim="@anim/slide_out_left" />
70 <action
71 android:id="@+id/action_inventarioFragment_to_mainFragment2"
72 app:destination="@id/mainFragment2"
73 app:popEnterAnim="@anim/slide_in_left"
74 app:popExitAnim="@anim/slide_out_right"
75 app:enterAnim="@anim/slide_in_right"
76 app:exitAnim="@anim/slide_out_left"/>
77
78 </fragment>
79 <fragment
80 android:id="@+id/configuracionFragment"
81 android:name="com.focasoftware.deboinventariov20.ui.configuracion.ConfiguracionFragment"
82 android:label="Configuraciones"
83 tools:layout="@layout/fragment_configuracion" >
84 <action
85 android:id="@+id/action_configuracionFragment_to_servidoresFragment"
86 app:destination="@id/servidoresFragment"
87 app:popEnterAnim="@anim/slide_in_left"
88 app:popExitAnim="@anim/slide_out_right"
89 app:enterAnim="@anim/slide_in_right"
90 app:exitAnim="@anim/slide_out_left" />
91 </fragment>
92 <fragment
93 android:id="@+id/descripcionFragment"
94 android:name="com.focasoftware.deboinventariov20.ui.inventario.DescripcionFragment"
95 android:label="Productos Encontrados">
96
97 <action
98 android:id="@+id/action_descripcionFragment_to_inventarioFragment"
99 app:destination="@id/inventarioFragment"
100 app:popEnterAnim="@anim/slide_in_left"
101 app:popExitAnim="@anim/slide_out_right"
102 app:enterAnim="@anim/slide_in_right"
103 app:exitAnim="@anim/slide_out_left"
104 app:popUpTo="@+id/descripcionFragment"
105 app:popUpToInclusive="true"/>
106 </fragment>
107 </navigation>
app/src/main/res/values/arrays.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <resources>
3 <string-array name="sort_array">
4 <item>Suma</item>
5 <item>Resta</item>
6 <item>Modifica</item>
7 </string-array>
8 </resources>
app/src/main/res/values/colors.xml
File was created 1 <?xml version="1.0" encoding="utf-8"?>
2 <resources>
3 <color name="colorPrimaryDark">#3700B3</color>
4 <color name="colorAccent">#03DAC5</color>
5 <color name="colorPrimary">#085394</color>
6 <color name="backMenu">#dddddd</color>
7 <color name="LightGray">#E0E0E0</color>
8 </resources>
app/src/main/res/values/dimens.xml
File was created 1 <resources>
2 <!-- Default screen margins, per the Android Design guidelines. -->
3 <dimen name="activity_horizontal_margin">16dp</dimen>
4 <dimen name="activity_vertical_margin">16dp</dimen>
5 <dimen name="nav_header_vertical_spacing">8dp</dimen>
6 <dimen name="nav_header_height">176dp</dimen>
7 <dimen name="fab_margin">16dp</dimen>
8
9 <!-- // Tamaño de los iconos-->
10 <dimen name="icon_dim">80dp</dimen>
11 <dimen name="icon_top">20dp</dimen>
12 <dimen name="text_size">12sp</dimen>
13
14 <!-- //fragment inventario-->
15 <dimen name="subTitulos">20sp</dimen>
16
17 <!-- //Normal Size-->
18 <dimen name="Titulos">40sp</dimen>
19 <dimen name="TitulosMedios">25sp</dimen>
20 <dimen name="SubTitulos">15sp</dimen>
21
22 <dimen name="MarginTopSubTitulos">5dp</dimen>
23 <dimen name="MarginTopTitulos">30dp</dimen>
24
25 <dimen name="MarginBotAgreSer">10dp</dimen>
26 <dimen name="NormalText">10sp</dimen>
27
28 <dimen name="PadingCbyRb">5dp</dimen>
29
30 <!-- //fragemnt Actualizacion de Maestros-->
31 <dimen name="TitulosActMa">20sp</dimen>
32
33
34 <dimen name="md_message_textsize">20sp</dimen>
35 <dimen name="text_size2">16sp</dimen>
36 <dimen name="list_item_spacing">16dp</dimen>
37 <dimen name="list_item_spacing_half">8dp</dimen>
38 </resources>
app/src/main/res/values/strings.xml
File was created 1 <resources>
2
3 <string name="nav_header_title">Android Studio</string>
4 <string name="nav_header_subtitle">android.studio@android.com</string>
5 <string name="nav_header_desc">Navigation header</string>
6 <string name="action_settings">Settings</string>
7
8 <string name="menu_home">Home</string>
9 <string name="menu_gallery">Gallery</string>
10 <string name="menu_slideshow">Slideshow</string>
11
12 <string name="app_name">Inventario Dinamicos</string>
13
14 <!-- menu-->
15 <string name="menuInicio">Inicio</string>
16 <string name="menuNueInv">Nuevo Inventario</string>
17 <string name="menuActMae">Actualizar Maestros</string>
18 <string name="menuConf">Configuraciones</string>
19 <string name="menuSal">Salir</string>
20
21 <!-- Menu header-->
22 <string name="menuLeyenda">Debo Inventario</string>
23
24 <string name="navigation_drawer_open">Open navigation drawer</string>
25 <string name="navigation_drawer_close">Close navigation drawer</string>
26
27 <!-- Pantalla de inicio-->
28 <string name="bien">Bienvenido</string>
29 <string name="debo">DEBO®</string>
30 <string name="inventario">Inventario</string>
31 <string name="todo">TODO</string>
32 <string name="hello_blank_fragment">Hello blank fragment</string>
33
34 <!-- inventarios dinamicos-->
35 <string name="invDinamicoVenta">Inventarios Dinamicos</string>
36 <string name="invDinamicoCompra">Inventarios Sectorizados</string>
37
38 <!-- ventana emergente-->
39 <string name="adv">Ingrese la cantidad contada</string>
40 <string name="invVentas">Inventarios Dinamicos de Ventas</string>
41 <string name="btnConfirmar">Confirmar</string>
42 <string name="btnCancela">Cancelar</string>
43
44
45 <!-- Fragment Inventario-->
46 <string name="invTitulo">Inventarios Dinamicos</string>
47 <string name="invTituloV">Inventarios de Ventas</string>
48 <string name="invTituloD">Inventarios de Depositos</string>
49 <string name="invCodigoBarras">Código Barras:</string>
50 <string name="btnExportarInv">Exportar Inventario</string>
51 <string name="btnBorrarInv">Borrar Inventario</string>
52 <string name="switch_1">+ 1</string>
53
54 <!-- Fragmento Configuraciones-->
55 <string name="tvTituloConf">Configuraciones</string>
56 <string name="tvSeleccioneServidor">Seleccione un Servidor</string>
57 <string name="btnValidarServidor">Validar</string>
58 <string name="btnAgregarServidor">Agregar un nuevo servidor</string>
59 <string name="tvUbicacionCarpetas">Ubicación de las carpetas de uso interno</string>
60 <string name="tvTituloArea">Area de Invetnario</string>
61 <string name="rbVentas">Inventarios de Ventas</string>
62 <string name="rbDeposito">Inventarios de Depositos</string>
63 <string name="tvLosProductos">Los productos no contabilizados en Inventarios</string>
64 <string name="tvColumnas">Columnas a Visualizar</string>
65
66 <string name="rbProInclu">Solo se ajustan los productos incluidos en el conteo.</string>
67 <string name="rbProNoInclu">Ajusta productos no incluidos en el conteo con stock en cero.</string>
68
69 <string name="cbMostrarStock">Mostror stock en el sistema al momento de la descarga del maestro.</string>
70 <string name="cbHabiLectura">Habilitar Lectura de codigo de barras en balanza.</string>
71
72 <string name="tvColumMostrar">Columnas a mostrar en inventario</string>
73
74 <string name="rbCodigoDebo">Código DEBO</string>
75 <string name="rbCodigoOrigen">Código Origen</string>
76 <string name="rbCodigoBarras">Código de Barras</string>
77
78
79 <!-- Spinner servidor-->
80 <string-array name="spinnerServidor">
81 <item>Servidor Laboratorio 1</item>
82 <item>Servidor Laboratorio 2</item>
83 <item>Servidor Laboratorio 3</item>
84 </string-array>
85 <string name="leyendaSpinner">Seleccione Servidor Predeterminado</string>
86
87 <string name="cbMostrarExistencia">Existencia</string>
88 <string name="cbMostrarPrecio">Precio</string>
89
90 <string name="btnGuardar">Guardar Cambios</string>
91
92 <!-- fragment Actualizacion de Maestros-->
93 <string name="tvActMaestros">Actualización de Maestros</string>
94 <string name="tvMedio">Seleccione el medio por el cual desea realizar la importación de maestros</string>
95 <string name="obPorWifi">Via Wifi</string>
96 <string name="obViaArchivo">Via Archivos MaeTable</string>
97
98 <string name="btnConfirmarAct">Confirmar Actualización</string>
99
100 <!-- Fragment Save-->
101 <string name="tvConfServi">Configuración de Servidores</string>
102 <string name="server">Ingrese la direccion del servidor</string>
103 <string name="etNomServer">Ingrese una descripción para la conexión</string>
104 <string name="btnGuardarConfServ">Guardar Conexión</string>
105
106 <!-- Dialog-->
107 <string name="sTitulo">Producto Buscado</string>
108 <string name="btnOk">Aceptar</string>
109 <string name="btnCancelar">Cancelar</string>
110 <string name="sMensaje">¡No se encontro el producto ingresado!</string>
111 <string name="sMensajeEncontrado">¡Ingrese la cantidad contada!</string>
112 <string name="sTituloNueva">Producto ingresado esta cargado</string>
113 <string name="sCantidadNueva">¡Por favor ingrese la nueva Cantidad!</string>
114 <string name="sMensajeBorrarInv">¡Seguro que desea Borrar el inventario!</string>
115 <string name="sTituloBorrarInv">Borrar Inventario</string>
116
117 <string name="sMensajeExportar">¡Confirma que exporta el Inventario!</string>
118 <string name="sTituloExportar">Exportación de Inventarios</string>
119
120 <!-- FRAGMENT SERVIDOR-->
121 <string name="tvTitutloServer">Alta de Servidores</string>
122 <string name="tvNomServer">Ingrese un nombre para identificar al servidor</string>
123 <string name="tvDirServer">Ingrese la dirección del servidor</string>
124 <string name="btnGuardarServidores">Guardar Servidor</string>
125
126 <string name="tvSeleccion">Toque sobre la operación que desea realizar</string>
127 <string name="rbSumar">Sumar</string>
128 <string name="rbRestar">Restar</string>
129 <string name="rbModificar">Reemplazar</string>
130 <string name="tvTotal">Cantidad Final</string>tvTotal
131 <string name="tvResultado">La cantidad final es:</string>tvTotal
132
133 <string name="large_text">
134 "Material is the metaphor.\n\n"
135
136 "A material metaphor is the unifying theory of a rationalized space and a system of motion."
137 "The material is grounded in tactile reality, inspired by the study of paper and ink, yet "
138 "technologically advanced and open to imagination and magic.\n"
139 "Surfaces and edges of the material provide visual cues that are grounded in reality. The "
140 "use of familiar tactile attributes helps users quickly understand affordances. Yet the "
141 "flexibility of the material creates new affordances that supercede those in the physical "
142 "world, without breaking the rules of physics.\n"
143 "The fundamentals of light, surface, and movement are key to conveying how objects move, "
144 "interact, and exist in space and in relation to each other. Realistic lighting shows "
145 "seams, divides space, and indicates moving parts.\n\n"
146
147 "Bold, graphic, intentional.\n\n"
148
149 "The foundational elements of print based design typography, grids, space, scale, color, "
150 "and use of imagery guide visual treatments. These elements do far more than please the "
151 "eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge "
152 "imagery, large scale typography, and intentional white space create a bold and graphic "
153 "interface that immerse the user in the experience.\n"
154 "An emphasis on user actions makes core functionality immediately apparent and provides "
155 "waypoints for the user.\n\n"
156
157 "Motion provides meaning.\n\n"
158
159 "Motion respects and reinforces the user as the prime mover. Primary user actions are "
160 "inflection points that initiate motion, transforming the whole design.\n"
161 "All action takes place in a single environment. Objects are presented to the user without "
162 "breaking the continuity of experience even as they transform and reorganize.\n"
163 "Motion is meaningful and appropriate, serving to focus attention and maintain continuity. "
164 "Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n"
165
166 "3D world.\n\n"
167
168 "The material environment is a 3D space, which means all objects have x, y, and z "
169 "dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the "
170 "positive z-axis extending towards the viewer. Every sheet of material occupies a single "
171 "position along the z-axis and has a standard 1dp thickness.\n"
172 "On the web, the z-axis is used for layering and not for perspective. The 3D world is "
173 "emulated by manipulating the y-axis.\n\n"
174
175 "Light and shadow.\n\n"
176
177 "Within the material environment, virtual lights illuminate the scene. Key lights create "
178 "directional shadows, while ambient light creates soft shadows from all angles.\n"
179 "Shadows in the material environment are cast by these two light sources. In Android "
180 "development, shadows occur when light sources are blocked by sheets of material at "
181 "various positions along the z-axis. On the web, shadows are depicted by manipulating the "
182 "y-axis only. The following example shows the card with a height of 6dp.\n\n"
183
184 "Resting elevation.\n\n"
185
186 "All material objects, regardless of size, have a resting elevation, or default elevation "
187 "that does not change. If an object changes elevation, it should return to its resting "
188 "elevation as soon as possible.\n\n"
189
190 "Component elevations.\n\n"
191
192 "The resting elevation for a component type is consistent across apps (e.g., FAB elevation "
193 "does not vary from 6dp in one app to 16dp in another app).\n"
194 "Components may have different resting elevations across platforms, depending on the depth "
195 "of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n"
196
197 "Responsive elevation and dynamic elevation offsets.\n\n"
198
199 "Some component types have responsive elevation, meaning they change elevation in response "
200 "to user input (e.g., normal, focused, and pressed) or system events. These elevation "
201 "changes are consistently implemented using dynamic elevation offsets.\n"
202 "Dynamic elevation offsets are the goal elevation that a component moves towards, relative "
203 "to the component’s resting state. They ensure that elevation changes are consistent "
204 "across actions and component types. For example, all components that lift on press have "
205 "the same elevation change relative to their resting elevation.\n"
206 "Once the input event is completed or cancelled, the component will return to its resting "
207 "elevation.\n\n"
208
209 "Avoiding elevation interference.\n\n"
210
211 "Components with responsive elevations may encounter other components as they move between "
212 "their resting elevations and dynamic elevation offsets. Because material cannot pass "
213 "through other material, components avoid interfering with one another any number of ways, "
214 "whether on a per component basis or using the entire app layout.\n"
215 "On a component level, components can move or be removed before they cause interference. "
216 "For example, a floating action button (FAB) can disappear or move off screen before a "
217 "user picks up a card, or it can move if a snackbar appears.\n"
218 "On the layout level, design your app layout to minimize opportunities for interference. "
219 "For example, position the FAB to one side of stream of a cards so the FAB won’t interfere "
220 "when a user tries to pick up one of cards.\n\n"
221 </string>
222 </resources>