From 7e22898af0093c5f2dbf7bbfeed6e1feff0c6702 Mon Sep 17 00:00:00 2001 From: Miguel Do Carmo Date: Tue, 31 Mar 2020 12:48:36 -0400 Subject: [PATCH] proyecto miguel --- .gitignore | 14 ++++++++++++++ .idea/.name | 1 + .idea/codeStyles/Project.xml | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 +++++ .idea/gradle.xml | 20 ++++++++++++++++++++ .idea/misc.xml | 9 +++++++++ .idea/runConfigurations.xml | 12 ++++++++++++ app/.gitignore | 1 + app/build.gradle | 39 +++++++++++++++++++++++++++++++++++++++ app/proguard-rules.pro | 21 +++++++++++++++++++++ app/src/androidTest/java/py/com/roshka/fragment_v001a/ExampleInstrumentedTest.kt | 24 ++++++++++++++++++++++++ app/src/main/AndroidManifest.xml | 30 ++++++++++++++++++++++++++++++ app/src/main/java/py/com/roshka/fragment_v001a/AdapterViewPager.kt | 21 +++++++++++++++++++++ app/src/main/java/py/com/roshka/fragment_v001a/LoginActivity.kt | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/java/py/com/roshka/fragment_v001a/MainActivity.kt | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/java/py/com/roshka/fragment_v001a/SplashActivity.kt | 30 ++++++++++++++++++++++++++++++ app/src/main/java/py/com/roshka/fragment_v001a/fragments/FragmentPagina.kt | 27 +++++++++++++++++++++++++++ app/src/main/java/py/com/roshka/fragment_v001a/modelo/ModeloNoticia.kt | 7 +++++++ app/src/main/res/drawable-v24/ic_launcher_foreground.xml | 30 ++++++++++++++++++++++++++++++ app/src/main/res/drawable/bbva_novedades01.png | Bin 0 -> 46581 bytes app/src/main/res/drawable/bbva_novedades02.png | Bin 0 -> 41246 bytes app/src/main/res/drawable/ic_academy_logo.xml | 5 +++++ app/src/main/res/drawable/ic_android_green.xml | 5 +++++ app/src/main/res/drawable/ic_expand_more_black_24dp.xml | 5 +++++ app/src/main/res/drawable/ic_expandible.xml | 5 +++++ app/src/main/res/drawable/ic_imagen_prueba.xml | 5 +++++ app/src/main/res/drawable/ic_launcher_background.xml | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/res/drawable/ic_lector.xml | 5 +++++ app/src/main/res/drawable/ic_menu_expand_more_gray.png | Bin 0 -> 327 bytes app/src/main/res/drawable/ic_pantalla_activa.xml | 5 +++++ app/src/main/res/drawable/ic_pantalla_inactiva.xml | 6 ++++++ app/src/main/res/drawable/ic_password_invisible.xml | 9 +++++++++ app/src/main/res/drawable/ic_password_visible.xml | 5 +++++ app/src/main/res/drawable/ic_tecladinho.xml | 5 +++++ app/src/main/res/drawable/icon_keyboard.png | Bin 0 -> 3318 bytes app/src/main/res/drawable/logo_login.png | Bin 0 -> 1778 bytes app/src/main/res/font/bentonbook.otf | Bin 0 -> 24936 bytes app/src/main/res/layout/activity_login.xml | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/res/layout/activity_main.xml | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/res/layout/activity_splash.xml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/res/layout/modelo_pagina_con_imagenes.xml | 34 ++++++++++++++++++++++++++++++++++ app/src/main/res/layout/modelo_spinner_items.xml | 27 +++++++++++++++++++++++++++ app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml | 5 +++++ app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml | 5 +++++ app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3593 bytes app/src/main/res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5339 bytes app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2636 bytes app/src/main/res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 3388 bytes app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4926 bytes app/src/main/res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7472 bytes app/src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7909 bytes app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 11873 bytes app/src/main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 10652 bytes app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 16570 bytes app/src/main/res/values/colors.xml | 11 +++++++++++ app/src/main/res/values/dimens.xml | 9 +++++++++ app/src/main/res/values/strings.xml | 4 ++++ app/src/main/res/values/styles.xml | 17 +++++++++++++++++ app/src/test/java/py/com/roshka/fragment_v001a/ExampleUnitTest.kt | 17 +++++++++++++++++ build.gradle | 29 +++++++++++++++++++++++++++++ gradle.properties | 21 +++++++++++++++++++++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 54329 bytes gradle/wrapper/gradle-wrapper.properties | 6 ++++++ gradlew | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ gradlew.bat | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ settings.gradle | 2 ++ 66 files changed, 1564 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.name create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/gradle.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/runConfigurations.xml create mode 100644 app/.gitignore create mode 100644 app/build.gradle create mode 100644 app/proguard-rules.pro create mode 100644 app/src/androidTest/java/py/com/roshka/fragment_v001a/ExampleInstrumentedTest.kt create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/java/py/com/roshka/fragment_v001a/AdapterViewPager.kt create mode 100644 app/src/main/java/py/com/roshka/fragment_v001a/LoginActivity.kt create mode 100644 app/src/main/java/py/com/roshka/fragment_v001a/MainActivity.kt create mode 100644 app/src/main/java/py/com/roshka/fragment_v001a/SplashActivity.kt create mode 100644 app/src/main/java/py/com/roshka/fragment_v001a/fragments/FragmentPagina.kt create mode 100644 app/src/main/java/py/com/roshka/fragment_v001a/modelo/ModeloNoticia.kt create mode 100644 app/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 app/src/main/res/drawable/bbva_novedades01.png create mode 100644 app/src/main/res/drawable/bbva_novedades02.png create mode 100644 app/src/main/res/drawable/ic_academy_logo.xml create mode 100644 app/src/main/res/drawable/ic_android_green.xml create mode 100644 app/src/main/res/drawable/ic_expand_more_black_24dp.xml create mode 100644 app/src/main/res/drawable/ic_expandible.xml create mode 100644 app/src/main/res/drawable/ic_imagen_prueba.xml create mode 100644 app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 app/src/main/res/drawable/ic_lector.xml create mode 100644 app/src/main/res/drawable/ic_menu_expand_more_gray.png create mode 100644 app/src/main/res/drawable/ic_pantalla_activa.xml create mode 100644 app/src/main/res/drawable/ic_pantalla_inactiva.xml create mode 100644 app/src/main/res/drawable/ic_password_invisible.xml create mode 100644 app/src/main/res/drawable/ic_password_visible.xml create mode 100644 app/src/main/res/drawable/ic_tecladinho.xml create mode 100644 app/src/main/res/drawable/icon_keyboard.png create mode 100644 app/src/main/res/drawable/logo_login.png create mode 100644 app/src/main/res/font/bentonbook.otf create mode 100644 app/src/main/res/layout/activity_login.xml create mode 100644 app/src/main/res/layout/activity_main.xml create mode 100644 app/src/main/res/layout/activity_splash.xml create mode 100644 app/src/main/res/layout/modelo_pagina_con_imagenes.xml create mode 100644 app/src/main/res/layout/modelo_spinner_items.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/values/colors.xml create mode 100644 app/src/main/res/values/dimens.xml create mode 100644 app/src/main/res/values/strings.xml create mode 100644 app/src/main/res/values/styles.xml create mode 100644 app/src/test/java/py/com/roshka/fragment_v001a/ExampleUnitTest.kt create mode 100644 build.gradle create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..603b140 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..8f84e8a --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +Fragment-v0.0.1a \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..88ea3aa --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,122 @@ + + + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+ + +
+
\ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..5cd135a --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..37a7509 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..1cfcce4 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,39 @@ +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply plugin: 'kotlin-android-extensions' + +android { + compileSdkVersion 29 + buildToolsVersion "29.0.3" + + defaultConfig { + applicationId "py.com.roshka.fragment_v001a" + minSdkVersion 16 + targetSdkVersion 29 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.core:core-ktx:1.2.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + testImplementation 'junit:junit:4.13' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' + implementation 'androidx.recyclerview:recyclerview:1.1.0' + implementation 'androidx.viewpager2:viewpager2:1.0.0' +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/app/src/androidTest/java/py/com/roshka/fragment_v001a/ExampleInstrumentedTest.kt b/app/src/androidTest/java/py/com/roshka/fragment_v001a/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..73ecb51 --- /dev/null +++ b/app/src/androidTest/java/py/com/roshka/fragment_v001a/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package py.com.roshka.fragment_v001a + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("py.com.roshka.fragment_v001a", appContext.packageName) + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..183086c --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/py/com/roshka/fragment_v001a/AdapterViewPager.kt b/app/src/main/java/py/com/roshka/fragment_v001a/AdapterViewPager.kt new file mode 100644 index 0000000..a858e95 --- /dev/null +++ b/app/src/main/java/py/com/roshka/fragment_v001a/AdapterViewPager.kt @@ -0,0 +1,21 @@ + + +package py.com.roshka.fragment_v001a + +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentManager +import androidx.fragment.app.FragmentPagerAdapter + +class AdapterViewPager(manager : FragmentManager) : FragmentPagerAdapter(manager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT){ + + val list : MutableList = ArrayList() + + override fun getItem(position: Int): Fragment { + return list[position] + } + + override fun getCount(): Int { + return list.size + } + +} \ No newline at end of file diff --git a/app/src/main/java/py/com/roshka/fragment_v001a/LoginActivity.kt b/app/src/main/java/py/com/roshka/fragment_v001a/LoginActivity.kt new file mode 100644 index 0000000..5e61f15 --- /dev/null +++ b/app/src/main/java/py/com/roshka/fragment_v001a/LoginActivity.kt @@ -0,0 +1,106 @@ +package py.com.roshka.fragment_v001a + +import android.content.Context +import android.graphics.Paint +import android.os.Bundle +import android.text.InputType +import android.text.method.HideReturnsTransformationMethod +import android.text.method.PasswordTransformationMethod +import android.view.View +import android.widget.AdapterView +import android.widget.ArrayAdapter +import android.widget.Spinner +import android.widget.Toast +import androidx.appcompat.app.AppCompatActivity +import kotlinx.android.synthetic.main.activity_login.* + + +class LoginActivity : AppCompatActivity() { +/*****************************************************/ + +/*****************************************************/ + private var ver = true + + + + private val array = arrayListOf( + "Numero de Documento", + "Numero de Cuenta o Tarjeta" + ) + private val SAVED = "DocumentSaved" + private lateinit var document : String + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_login) + val preference =getSharedPreferences(SAVED , Context.MODE_PRIVATE) + val editor = preference.edit() + document = preference.getString(SAVED, "EMPTY").toString() + + + if( document != "EMPTY"){ + entradaDocumento.setText(document) + } + + seOlvido.paintFlags = Paint.UNDERLINE_TEXT_FLAG + seOlvido.setOnClickListener { + Toast.makeText(this, "todavia no hay manera de recuperar contrasenha mi rey", Toast.LENGTH_LONG).show() + } + + botonIngresar.setOnClickListener { + + //recordarNumero.setOnCheckedChangeListener { _, isChecked -> + if (recordarNumero.isChecked) { + editor.putString("DocumentSaved", entradaDocumento.text.toString()) + Toast.makeText(this, "SE GUARDO EL documento", Toast.LENGTH_SHORT).show() + editor.commit() + }else{ + Toast.makeText(this, "No se guardo ni mierda", Toast.LENGTH_SHORT).show() + } + + //} + } + val spinner = findViewById(R.id.spinnerOpciones) + if (spinner != null) { + val adapter = ArrayAdapter(this, + R.layout.modelo_spinner_items, + R.id.itemSpinnerTexto, array) + spinner.adapter = adapter + + + selectorDeTeclado.setOnClickListener { + when(entradaDocumento.inputType){ + InputType.TYPE_CLASS_NUMBER-> entradaDocumento.inputType = InputType.TYPE_CLASS_TEXT + InputType.TYPE_CLASS_TEXT-> entradaDocumento.inputType = InputType.TYPE_CLASS_NUMBER + } + } + + passwordVisible.setOnClickListener { + + if(ver){ + entradaPassword.transformationMethod = HideReturnsTransformationMethod.getInstance() + passwordVisible.setImageResource(R.drawable.ic_password_visible) + ver = false + } else{ + entradaPassword.transformationMethod = PasswordTransformationMethod.getInstance() + passwordVisible.setImageResource(R.drawable.ic_password_invisible) + ver = true + } + } + spinner.onItemSelectedListener = object : + AdapterView.OnItemSelectedListener { + + override fun onItemSelected(parent: AdapterView<*>, + view: View, position: Int, id: Long) { + + + } + + override fun onNothingSelected(parent: AdapterView<*>) { + // write code to perform some action + } + } + } + } + + +} diff --git a/app/src/main/java/py/com/roshka/fragment_v001a/MainActivity.kt b/app/src/main/java/py/com/roshka/fragment_v001a/MainActivity.kt new file mode 100644 index 0000000..1a4e9b6 --- /dev/null +++ b/app/src/main/java/py/com/roshka/fragment_v001a/MainActivity.kt @@ -0,0 +1,78 @@ +package py.com.roshka.fragment_v001a + +import android.content.Context +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import androidx.viewpager.widget.ViewPager +import kotlinx.android.synthetic.main.activity_main.* +import py.com.roshka.fragment_v001a.fragments.FragmentPagina +import py.com.roshka.fragment_v001a.modelo.ModeloNoticia + +class MainActivity : AppCompatActivity() { + + private val fragment1 = FragmentPagina() + private val fragment2 = FragmentPagina() + private lateinit var adaptadorPagina : AdapterViewPager + private val SKIP = "PREFERENCE_NAME" + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + val sharedPreference = getSharedPreferences(SKIP,Context.MODE_PRIVATE) + var editor = sharedPreference.edit() + + if (sharedPreference.getBoolean(SKIP, false)){ + goToLogin(this) + } + + fragment1.noticia = ModeloNoticia("Roshka Bootcamp Nro.6", + "se realiza varias actividades tanto academicas como de entretenimiento.", + R.drawable.bbva_novedades01) + fragment2.noticia = ModeloNoticia("Programacion Android con Kotlin", + "The best way para el futuro, bastante flexible y potente", + R.drawable.bbva_novedades02) + + adaptadorPagina =AdapterViewPager(supportFragmentManager) + adaptadorPagina.list.add(fragment1) + adaptadorPagina.list.add(fragment2) + + vistaPaginas.adapter = adaptadorPagina + + accederLogin.setOnClickListener { + + editor.putBoolean(SKIP, true) + editor.commit() + + goToLogin(this) + } + + vistaPaginas.addOnPageChangeListener(object : ViewPager.OnPageChangeListener{ + override fun onPageScrollStateChanged(state: Int) { + } + + override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) { + } + + override fun onPageSelected(position: Int) { + + when(vistaPaginas.currentItem){ + 0->{ + indicator1.setImageResource(R.drawable.ic_pantalla_activa) + indicator2.setImageResource(R.drawable.ic_pantalla_inactiva) + } + 1->{ + indicator1.setImageResource(R.drawable.ic_pantalla_inactiva) + indicator2.setImageResource(R.drawable.ic_pantalla_activa) + } + } + + } + + }) + } + + private fun goToLogin(context : Context){ + val intentoLogin = Intent(context, LoginActivity::class.java) + startActivity(intentoLogin) + } +} diff --git a/app/src/main/java/py/com/roshka/fragment_v001a/SplashActivity.kt b/app/src/main/java/py/com/roshka/fragment_v001a/SplashActivity.kt new file mode 100644 index 0000000..4ed3828 --- /dev/null +++ b/app/src/main/java/py/com/roshka/fragment_v001a/SplashActivity.kt @@ -0,0 +1,30 @@ +package py.com.roshka.fragment_v001a + +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.os.Handler + +class SplashActivity : AppCompatActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_splash) + + + Handler().postDelayed({ + // This method will be executed once the timer is over + // Start your app main activity + + startActivity(Intent(this,MainActivity::class.java)) + + // close this activity + finish() + }, TIME_OUT) + } + + companion object { + // This is the loading time of the splash screen + private const val TIME_OUT:Long = 1500 // 0.5 sec + } +} diff --git a/app/src/main/java/py/com/roshka/fragment_v001a/fragments/FragmentPagina.kt b/app/src/main/java/py/com/roshka/fragment_v001a/fragments/FragmentPagina.kt new file mode 100644 index 0000000..eb5ff84 --- /dev/null +++ b/app/src/main/java/py/com/roshka/fragment_v001a/fragments/FragmentPagina.kt @@ -0,0 +1,27 @@ +package py.com.roshka.fragment_v001a.fragments + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.fragment.app.Fragment +import kotlinx.android.synthetic.main.modelo_pagina_con_imagenes.* +import py.com.roshka.fragment_v001a.R +import py.com.roshka.fragment_v001a.modelo.ModeloNoticia + +class FragmentPagina : Fragment() { + + lateinit var noticia : ModeloNoticia + + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle?): View? { + return inflater.inflate(R.layout.modelo_pagina_con_imagenes, container, false) + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + textoTitulo.text = noticia.tituloNoticia + textoCuerpo.text = noticia.cuerpoNoticia + imagenPagina.setImageResource(noticia.imagenNoticia) + } + +} \ No newline at end of file diff --git a/app/src/main/java/py/com/roshka/fragment_v001a/modelo/ModeloNoticia.kt b/app/src/main/java/py/com/roshka/fragment_v001a/modelo/ModeloNoticia.kt new file mode 100644 index 0000000..78ae2f4 --- /dev/null +++ b/app/src/main/java/py/com/roshka/fragment_v001a/modelo/ModeloNoticia.kt @@ -0,0 +1,7 @@ +package py.com.roshka.fragment_v001a.modelo + +data class ModeloNoticia( + val tituloNoticia: String, + val cuerpoNoticia: String, + val imagenNoticia: Int +) \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bbva_novedades01.png b/app/src/main/res/drawable/bbva_novedades01.png new file mode 100644 index 0000000..94e4b6c Binary files /dev/null and b/app/src/main/res/drawable/bbva_novedades01.png differ diff --git a/app/src/main/res/drawable/bbva_novedades02.png b/app/src/main/res/drawable/bbva_novedades02.png new file mode 100644 index 0000000..a386f92 Binary files /dev/null and b/app/src/main/res/drawable/bbva_novedades02.png differ diff --git a/app/src/main/res/drawable/ic_academy_logo.xml b/app/src/main/res/drawable/ic_academy_logo.xml new file mode 100644 index 0000000..df409f1 --- /dev/null +++ b/app/src/main/res/drawable/ic_academy_logo.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_android_green.xml b/app/src/main/res/drawable/ic_android_green.xml new file mode 100644 index 0000000..fb66e74 --- /dev/null +++ b/app/src/main/res/drawable/ic_android_green.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_expand_more_black_24dp.xml b/app/src/main/res/drawable/ic_expand_more_black_24dp.xml new file mode 100644 index 0000000..2a4e343 --- /dev/null +++ b/app/src/main/res/drawable/ic_expand_more_black_24dp.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_expandible.xml b/app/src/main/res/drawable/ic_expandible.xml new file mode 100644 index 0000000..7769990 --- /dev/null +++ b/app/src/main/res/drawable/ic_expandible.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_imagen_prueba.xml b/app/src/main/res/drawable/ic_imagen_prueba.xml new file mode 100644 index 0000000..2db0de8 --- /dev/null +++ b/app/src/main/res/drawable/ic_imagen_prueba.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_lector.xml b/app/src/main/res/drawable/ic_lector.xml new file mode 100644 index 0000000..6a3a239 --- /dev/null +++ b/app/src/main/res/drawable/ic_lector.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_menu_expand_more_gray.png b/app/src/main/res/drawable/ic_menu_expand_more_gray.png new file mode 100644 index 0000000..abce18d Binary files /dev/null and b/app/src/main/res/drawable/ic_menu_expand_more_gray.png differ diff --git a/app/src/main/res/drawable/ic_pantalla_activa.xml b/app/src/main/res/drawable/ic_pantalla_activa.xml new file mode 100644 index 0000000..0d67b4e --- /dev/null +++ b/app/src/main/res/drawable/ic_pantalla_activa.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_pantalla_inactiva.xml b/app/src/main/res/drawable/ic_pantalla_inactiva.xml new file mode 100644 index 0000000..9601178 --- /dev/null +++ b/app/src/main/res/drawable/ic_pantalla_inactiva.xml @@ -0,0 +1,6 @@ + + + diff --git a/app/src/main/res/drawable/ic_password_invisible.xml b/app/src/main/res/drawable/ic_password_invisible.xml new file mode 100644 index 0000000..056254c --- /dev/null +++ b/app/src/main/res/drawable/ic_password_invisible.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_password_visible.xml b/app/src/main/res/drawable/ic_password_visible.xml new file mode 100644 index 0000000..789a0f2 --- /dev/null +++ b/app/src/main/res/drawable/ic_password_visible.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_tecladinho.xml b/app/src/main/res/drawable/ic_tecladinho.xml new file mode 100644 index 0000000..91845de --- /dev/null +++ b/app/src/main/res/drawable/ic_tecladinho.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/icon_keyboard.png b/app/src/main/res/drawable/icon_keyboard.png new file mode 100644 index 0000000..167ab2f Binary files /dev/null and b/app/src/main/res/drawable/icon_keyboard.png differ diff --git a/app/src/main/res/drawable/logo_login.png b/app/src/main/res/drawable/logo_login.png new file mode 100644 index 0000000..d0f94f5 Binary files /dev/null and b/app/src/main/res/drawable/logo_login.png differ diff --git a/app/src/main/res/font/bentonbook.otf b/app/src/main/res/font/bentonbook.otf new file mode 100644 index 0000000..a24ba5a Binary files /dev/null and b/app/src/main/res/font/bentonbook.otf differ diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml new file mode 100644 index 0000000..69b68d6 --- /dev/null +++ b/app/src/main/res/layout/activity_login.xml @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + +