first commit

This commit is contained in:
Enrique Blasco 2020-05-04 13:15:24 +02:00
commit cb005b3837
105 changed files with 3106 additions and 0 deletions

14
.gitignore vendored Normal file
View File

@ -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

1
.idea/.name Normal file
View File

@ -0,0 +1 @@
Gestor Almacén

View File

@ -0,0 +1,122 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>

View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

20
.idea/gradle.xml Normal file
View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="PLATFORM" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

9
.idea/misc.xml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>

1
app/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

75
app/build.gradle Normal file
View File

@ -0,0 +1,75 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "es.verdnatura"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "5.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
debugImplementation fileTree(dir: 'libs/debug', include: ['*.jar'])
releaseImplementation fileTree(dir: 'libs/release', include: ['*.jar'])
// Kotlin and Android
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'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation "com.airbnb.android:lottie:$lottieVersion"
// Architecture components
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle"
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
// Koin for DI
implementation "org.koin:koin-core:$koin"
implementation "org.koin:koin-android:$koin"
implementation "org.koin:koin-androidx-scope:$koin"
implementation "org.koin:koin-androidx-viewmodel:$koin"
// Image libraries
implementation "io.coil-kt:coil:$coil"
implementation "com.github.bumptech.glide:glide:$glide"
implementation "com.github.bumptech.glide:okhttp3-integration:$glide"
kapt "com.github.bumptech.glide:compiler:$glide"
}

21
app/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@ -0,0 +1,22 @@
package es.verdnatura
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
/**
* 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("es.verdnatura", appContext.packageName)
}
}

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="es.verdnatura">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MobileApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<activity android:name=".presentation.view.feature.main.activity.MainActivity"></activity>
<activity android:name=".presentation.view.feature.login.activity.LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@ -0,0 +1,20 @@
package es.verdnatura
import android.app.Application
import es.verdnatura.di.viewModelModule
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.loadKoinModules
import org.koin.core.context.startKoin
class MobileApplication: Application() {
override fun onCreate() {
super.onCreate()
startKoin { androidContext(this@MobileApplication)
val moduleList = listOf(viewModelModule)
loadKoinModules(moduleList)
}
}
}

View File

@ -0,0 +1,24 @@
package es.verdnatura.di
import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesViewModel
import es.verdnatura.presentation.view.feature.login.fragment.LoginViewModel
import es.verdnatura.presentation.view.feature.pasillero.fragment.PasilleroViewModel
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.dsl.module
val viewModelModule = module{
// Login
viewModel {
LoginViewModel()
}
// Pasilleros
viewModel {
PasilleroViewModel()
}
// Ajustes
viewModel {
AjustesViewModel()
}
}

View File

@ -0,0 +1,16 @@
package es.verdnatura.domain
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
class ApiSalixUtils {
companion object {
//const val BASE_URL:String = "http://192.168.1.108:8000/"
const val BASE_URL:String = "https://salix.verdnatura.es/api/"
fun getApiService():SalixService{
val salixRetrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(
GsonConverterFactory.create()).build()
return salixRetrofit.create(SalixService::class.java)
}
}
}

View File

@ -0,0 +1,16 @@
package es.verdnatura.domain
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
class ApiUtils {
companion object {
const val BASE_URL:String = "http://192.168.1.108:8000/"
//const val BASE_URL:String = "https://app.verdnatura.es/"
fun getApiService():VerdnaturaService{
val retrofit = Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(
GsonConverterFactory.create()).build()
return retrofit.create(VerdnaturaService::class.java)
}
}
}

View File

@ -0,0 +1,12 @@
package es.verdnatura.domain
import android.content.Context
import android.widget.Toast
fun Any.toast(context: Context, duration: Int = Toast.LENGTH_SHORT): Toast {
return Toast.makeText(context, this.toString(), duration).apply { show() }
}
fun <T : Any> T?.notNull(f: (it: T) -> Unit) {
if (this != null) f(this)
}

View File

@ -0,0 +1,13 @@
package es.verdnatura.domain
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
import retrofit2.Call
class GetAjustesUserCase : RestClient() {
fun getSectors(usuario:String,password:String) : Call<List<SectorItemVO>> {
return restClient!!.getSectors("json","1",usuario,password,"application/json")!!
}
}

View File

@ -0,0 +1,26 @@
package es.verdnatura.domain
import es.verdnatura.presentation.view.feature.login.model.LoginSalixVO
import retrofit2.Call
class GetLoginUserCase() : RestClient() {
fun login(usuario:String,password:String) : Call<String>{
val params:ArrayList<String> = ArrayList();
params.add(usuario)
params.add(password)
return restClient!!.login("json","1",usuario,password,"application/json",params)!!
}
fun salixLogin(usuario:String,password:String) : Call<LoginSalixVO>{
return salixClient!!.login("application/json", LoginSalixVO(usuario,password))!!
}
fun checkVersion(usuario:String,password:String,version:String) : Call<Boolean> {
val params:ArrayList<String> = ArrayList();
params.add(version)
return restClient!!.version("json","1",usuario,password,"application/json",params)!!
}
}

View File

@ -0,0 +1,13 @@
package es.verdnatura.domain
open class RestClient {
var restClient:VerdnaturaService? = null
var salixClient:SalixService? = null
init {
restClient = ApiUtils.getApiService()
salixClient = ApiSalixUtils.getApiService()
}
}

View File

@ -0,0 +1,15 @@
package es.verdnatura.domain
import es.verdnatura.presentation.view.feature.login.model.LoginSalixVO
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.Header
import retrofit2.http.POST
interface SalixService {
@POST("Accounts/login")
fun login(@Header("Content-Type") content_type: String,
@Body params: LoginSalixVO):
Call<LoginSalixVO>
}

View File

@ -0,0 +1,38 @@
package es.verdnatura.domain
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.Header
import retrofit2.http.POST
interface VerdnaturaService {
@POST("security/login")
fun login(@Header("aplicacion") aplicacion: String,
@Header("version") version: String,
@Header("user") user: String,
@Header("pass") pass: String,
@Header("Content-Type") content_type: String,
@Body params: List<String>):
Call<String>
@POST("almacenv2/version")
fun version(@Header("aplicacion") aplicacion: String,
@Header("version") version: String,
@Header("user") user: String,
@Header("pass") pass: String,
@Header("Content-Type") content_type: String,
@Body params: List<String>):
Call<Boolean>
@POST("almacenv2/sector_get")
fun getSectors(@Header("aplicacion") aplicacion: String,
@Header("version") version: String,
@Header("user") user: String,
@Header("pass") pass: String,
@Header("Content-Type") content_type: String):
Call<List<SectorItemVO>>
}

View File

@ -0,0 +1,27 @@
package es.verdnatura.presentation.base
object BR {
const val _all = 0
const val focused = 1
const val rating = 2
const val resumePosition = 3
const val favorite = 4
const val selected = 5
const val toolBarItem = 6
const val item = 7
const val loadingInfo = 8
const val color = 9
const val icon = 10
const val episode = 11
const val title = 12
const val content = 13
const val onOptionsItemSelected = 14
const val vpsActionListener = 15
const val numberEpisodes = 16
const val seasonColor = 17
const val viewModel = 18
const val action = 19
const val liveProgram = 20
const val loadingEpisodes = 21
const val ratio = 22
}

View File

@ -0,0 +1,33 @@
package es.verdnatura.presentation.base
import android.os.Bundle
import androidx.annotation.LayoutRes
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
abstract class BaseActivity<T : ViewDataBinding> : AppCompatActivity() {
protected lateinit var binding: T
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(getLayoutId())
initDataBinding()
init()
}
@LayoutRes
abstract fun getLayoutId(): Int
open fun addBindingVariables() {}
abstract fun init()
private fun initDataBinding() {
binding = DataBindingUtil.setContentView(this, getLayoutId())
binding.lifecycleOwner = this
addBindingVariables()
}
}

View File

@ -0,0 +1,61 @@
package es.verdnatura.presentation.base
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.LayoutRes
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import androidx.fragment.app.Fragment
import org.koin.androidx.viewmodel.ext.android.viewModel
import kotlin.reflect.KClass
abstract class BaseFragment<T : ViewDataBinding, V : BaseViewModel>(viewModelClass: KClass<V>) :
Fragment() {
protected val PREFS_USER = "es.verdnatura.user.prefs"
protected val USERFK = "userFk"
protected val USER = "user"
protected val PASSWORD = "password"
protected val TOKEN = "token"
protected val SECTORDESCRIP = "sectordescrip"
protected val SECTORFK = "sectorFk"
protected val WAREHOUSEFK = "warehouseFk"
protected val viewModel: V by viewModel(viewModelClass)
protected lateinit var binding: T
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? = inflater.inflate(getLayoutId(), container, false)
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
initDataBinding()
getBundleArguments()
observeViewModel()
init()
}
@LayoutRes
abstract fun getLayoutId(): Int
open fun init() {}
open fun observeViewModel() {}
open fun getBundleArguments() {}
open fun addBindingVariables() {}
private fun initDataBinding() {
binding = DataBindingUtil.bind<T>(view!!)!!
binding.lifecycleOwner = viewLifecycleOwner
binding.setVariable(BR.viewModel, this@BaseFragment.viewModel)
lifecycle.addObserver(this@BaseFragment.viewModel)
addBindingVariables()
}
}

View File

@ -0,0 +1,6 @@
package es.verdnatura.presentation.base
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.ViewModel
abstract class BaseViewModel : ViewModel(), LifecycleObserver

View File

@ -0,0 +1,24 @@
package es.verdnatura.presentation.common
open class Event<out T>(private val content: T) {
var hasBeenHandled = false
private set // Allow external read but not write
/**
* Returns the content and prevents its use again.
*/
fun getContentIfNotHandled(): T? {
return if (hasBeenHandled) {
null
} else {
hasBeenHandled = true
content
}
}
/**
* Returns the content, even if it's already been handled.
*/
fun peekContent(): T = content
}

View File

@ -0,0 +1,12 @@
package es.verdnatura.presentation.common
import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
interface OnPasillerosItemClickListener {
fun onPasillerosItemClickListener(item: PasillerosItemVO)
}
interface OnAjustesItemClickListener {
fun onAjustesItemClickListener(item: AjustesItemVO)
}

View File

@ -0,0 +1,80 @@
package es.verdnatura.presentation.common
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction
import com.bumptech.glide.Glide
inline fun FragmentManager.inTransaction(func: FragmentTransaction.() -> FragmentTransaction) =
beginTransaction().func().commit()
fun <T> Context.openActivity(it: Class<T>, extras: Bundle.() -> Unit = {}) {
val intent = Intent(this, it)
intent.putExtras(Bundle().apply(extras))
startActivity(intent)
}
fun FragmentActivity.replaceFragment(
fragment: Fragment,
frameId: Int,
tag: String,
addToBackStack: Boolean = false
) {
supportFragmentManager.inTransaction {
replace(frameId, fragment, tag)
if (addToBackStack) addToBackStack(tag)
setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)
}
}
fun FragmentActivity.addFragment(
fragment: Fragment,
frameId: Int,
tag: String = "",
addToBackStack: Boolean = false
) {
supportFragmentManager.inTransaction {
add(frameId, fragment, tag)
if (addToBackStack) addToBackStack(tag)
setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)
}
}
fun View.setDimensions(width: Int, height: Int) {
val layoutParams = this.layoutParams
layoutParams?.width = width
layoutParams?.height = height
this.layoutParams = layoutParams
}
fun View.setMargins(left: Int, top: Int, right: Int, bottom: Int) {
val mlp = this.layoutParams as ViewGroup.MarginLayoutParams
mlp.setMargins(left, top, right, bottom)
}
fun ImageView.loadUrl(url: String) {
// load(url)
Glide.with(context).load(url).into(this)
// Glide.with(context)
// .asBitmap()
// .load(url)
// .into(object : CustomTarget<Bitmap>() {
//
// override fun onLoadCleared(placeholder: Drawable?) {}
//
// override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>?) {
// setImageBitmap(resource)
// }
// })
}
inline val <reified T> T.TAG: String
get() = T::class.java.canonicalName ?: T::class.simpleName ?: T::class.java.simpleName

View File

@ -0,0 +1,42 @@
package es.verdnatura.presentation.view.component
import android.app.Dialog
import android.content.Context
import android.view.View
import es.verdnatura.R
import kotlinx.android.synthetic.main.component_custom_dialog.*
class CustomDialog(context: Context) : Dialog(context, R.style.DialogTheme) {
init {
setContentView(R.layout.component_custom_dialog)
}
fun setTitle(title: String): CustomDialog {
custom_dialog_title.visibility = View.VISIBLE
custom_dialog_title.text = title
return this
}
fun setDescription(description: String): CustomDialog {
custom_dialog_description.visibility = View.VISIBLE
custom_dialog_description.text = description
return this
}
fun setOkButton(text: String, onButtonClicked: () -> Unit): CustomDialog {
custom_dialog_button_ok.visibility = View.VISIBLE
custom_dialog_button_ok.text = text
custom_dialog_button_ok.setOnClickListener { onButtonClicked() }
return this
}
fun setKoButton(text: String, onButtonClicked: () -> Unit): CustomDialog {
custom_dialog_button_ko.visibility = View.VISIBLE
custom_dialog_button_ko.text = text
custom_dialog_button_ko.setOnClickListener { onButtonClicked() }
return this
}
}

View File

@ -0,0 +1,41 @@
package es.verdnatura.presentation.view.feature.ajustes.adapter
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.databinding.ItemAjustesRowBinding
import es.verdnatura.presentation.common.OnAjustesItemClickListener
import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
class AjustesAdapter (
private val items: List<AjustesItemVO>,
private val onAjustesItemClickListener: OnAjustesItemClickListener
): RecyclerView.Adapter<AjustesAdapter.AjustesItemHolder> () {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AjustesItemHolder {
return AjustesItemHolder(
ItemAjustesRowBinding.inflate(LayoutInflater.from(parent.context),parent,false)
)
}
override fun getItemCount() =items.size
override fun onBindViewHolder(holder: AjustesItemHolder, position: Int) {
holder.bind(items[position])
holder.binding.root.setOnClickListener {
onAjustesItemClickListener.onAjustesItemClickListener(items[position])
}
}
class AjustesItemHolder(
val binding: ItemAjustesRowBinding
) : RecyclerView.ViewHolder(binding.root){
fun bind(item: AjustesItemVO) {
binding.apply {
this.item = item
}
}
}
}

View File

@ -0,0 +1,127 @@
package es.verdnatura.presentation.view.feature.ajustes.fragment
import android.app.AlertDialog
import android.content.DialogInterface
import android.content.SharedPreferences
import android.view.View
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentAjustesBinding
import es.verdnatura.domain.notNull
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnAjustesItemClickListener
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.feature.ajustes.adapter.AjustesAdapter
import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
import es.verdnatura.presentation.view.feature.ajustes.model.SectorListVO
import kotlinx.android.synthetic.main.fragment_ajustes.*
class AjustesFragment : BaseFragment<FragmentAjustesBinding,AjustesViewModel>(AjustesViewModel::class) {
private var user:String? = ""
private var password:String? = ""
private lateinit var customDialog: CustomDialog
private var sectorListVO:List<SectorItemVO> = listOf()
private var prefs: SharedPreferences? = null
private var ajustesAdapter: AjustesAdapter? = null
companion object {
fun newInstance() = AjustesFragment()
}
override fun getLayoutId(): Int = R.layout.fragment_ajustes
override fun init() {
prefs = activity!!.getSharedPreferences(PREFS_USER,0)
customDialog = CustomDialog(requireContext())
viewModel.inititializeDefaultAjusts(prefs!!.getString(SECTORDESCRIP,"Sin sector").toString(),prefs!!.getInt(SECTORFK,0),prefs!!.getInt(WAREHOUSEFK,0))
user_text.setText(prefs!!.getString(USERFK,""))
val versionName = activity!!.packageManager.getPackageInfo(activity!!.packageName,0).versionName
item_version.setText(versionName)
user = prefs!!.getString(USER,"")
password = prefs!!.getString(PASSWORD,"")
super.init()
}
override fun observeViewModel() {
with(viewModel){
ajustesAdapter = AjustesAdapter(ajustesitem,object: OnAjustesItemClickListener{
override fun onAjustesItemClickListener(item: AjustesItemVO) {
if (item.id == 0){
splash_progress.visibility = View.VISIBLE
viewModel.getSectors(user!!,password!!)
} else if (item.id == 1){
activity!!.onBackPressed()
}
}
})
ajustess_items.adapter = ajustesAdapter
ajustess_items.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
loadSectorList.observe(viewLifecycleOwner, Observer { event ->
event.getContentIfNotHandled().notNull {
splash_progress.visibility = View.INVISIBLE
if (it.list != null && it.list.size > 0 && it.list.get(0).isError){
customDialog.setTitle("Error").setDescription(it.list.get(0).errorMessage).setOkButton("Cerrar"){
customDialog.hide()
}.show()
}else{
if (it.list != null && it.list.size > 0){
val listSectores : ArrayList<String> = ArrayList()
it.list.forEach {
listSectores.add(it.description)
}
val array = arrayOfNulls<String>(listSectores.size)
sectorListVO = it.list
showDialogSector(listSectores.toArray(array))
}else{
customDialog.setTitle("Sectores").setDescription("No existes sectores.").setOkButton("Cerrar"){
customDialog.hide()
}.show()
}
}
}
})
}
super.observeViewModel()
}
private fun showDialogSector(array:Array<String>){
val builder = AlertDialog.Builder(this.context)
builder.setTitle("Selecciona un sector")
builder.setItems(array) { _, which ->
val selected = array[which]
sectorListVO.forEach {
if (it.description.equals(selected)){
val editor = prefs!!.edit()
editor.putString(SECTORDESCRIP,it.description)
editor.putInt(SECTORFK,it.id)
it.warehouseFk?.let { it1 -> editor.putInt(WAREHOUSEFK, it1) }
editor.apply()
viewModel.ajustesitem.get(0).sectorFk = it.id
viewModel.ajustesitem.get(0).warehouse = it.warehouseFk
viewModel.ajustesitem.get(0).selected = it.description
ajustesAdapter!!.notifyDataSetChanged()
return@forEach
}
}
}
val dialog = builder.create()
dialog.show()
}
}

View File

@ -0,0 +1,81 @@
package es.verdnatura.presentation.view.feature.ajustes.fragment
import android.content.SharedPreferences
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import es.verdnatura.domain.GetAjustesUserCase
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.common.Event
import es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO
import es.verdnatura.presentation.view.feature.ajustes.model.SectorItemVO
import es.verdnatura.presentation.view.feature.ajustes.model.SectorListVO
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
class AjustesViewModel : BaseViewModel() {
private val getAjustesUserCase:GetAjustesUserCase = GetAjustesUserCase()
val version : String = "5.0.0";
private val _ajustesitem by lazy { ArrayList<AjustesItemVO>() }
val ajustesitem: List<AjustesItemVO>
get() = _ajustesitem
private val _sectorList by lazy { MutableLiveData<SectorListVO>() }
val sectorList: LiveData<SectorListVO>
get() = _sectorList
val loadSectorList = Transformations.map(_sectorList) {Event(it)}
fun inititializeDefaultAjusts(sectorDescrip: String,sectorFk : Int, warehouseFk : Int) {
_ajustesitem.add(
AjustesItemVO(0,
"Sector",
sectorDescrip,
sectorFk,
warehouseFk)
)
_ajustesitem.add(
AjustesItemVO(1,
"Cerrar Sesión",
"",
0,
0)
)
}
fun getSectors(user:String,password:String){
getAjustesUserCase.getSectors(user,password).enqueue(object : Callback<List<SectorItemVO>>{
override fun onFailure(call: Call<List<SectorItemVO>>, t: Throwable) {
val listError:ArrayList<SectorItemVO> = ArrayList()
listError.add(SectorItemVO(0,"",0,true,t.message!!))
_sectorList.value = SectorListVO(listError)
}
override fun onResponse(
call: Call<List<SectorItemVO>>,
response: Response<List<SectorItemVO>>
) {
if (response.body() != null){
_sectorList.value = response.body()?.let { SectorListVO(it) }
}else{
val listError:ArrayList<SectorItemVO> = ArrayList()
listError.add(SectorItemVO(0,"",0,true,"Error en la llamada sector_get"))
_sectorList.value = SectorListVO(listError)
}
}
})
}
}

View File

@ -0,0 +1,21 @@
package es.verdnatura.presentation.view.feature.ajustes.model
class AjustesItemVO (
var id: Int,
var title: String = "",
var selected: String = "",
var sectorFk : Int?,
var warehouse: Int?
)
class SectorItemVO (
var id: Int,
var description:String = "",
val warehouseFk:Int?,
val isError : Boolean = false,
var errorMessage : String = ""
)
class SectorListVO (
var list: List<SectorItemVO> = listOf()
)

View File

@ -0,0 +1,19 @@
package es.verdnatura.presentation.view.feature.login.activity
import es.verdnatura.R
import es.verdnatura.databinding.ActivityLoginBinding
import es.verdnatura.presentation.base.BaseActivity
import es.verdnatura.presentation.common.TAG
import es.verdnatura.presentation.common.addFragment
import es.verdnatura.presentation.view.feature.login.fragment.LoginFragment
class LoginActivity : BaseActivity<ActivityLoginBinding>() {
override fun getLayoutId(): Int = R.layout.activity_login
override fun init() {
addFragment(LoginFragment.newInstance(),R.id.main_frame_layout,LoginFragment.TAG)
}
}

View File

@ -0,0 +1,130 @@
package es.verdnatura.presentation.view.feature.login.fragment
import android.content.Intent
import android.content.SharedPreferences
import android.net.Uri
import android.view.View
import androidx.lifecycle.Observer
import es.verdnatura.R
import es.verdnatura.databinding.FragmentLoginBinding
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.feature.login.model.LoginItemVO
import es.verdnatura.presentation.view.feature.main.activity.MainActivity
import kotlinx.android.synthetic.main.fragment_login.*
class LoginFragment : BaseFragment<FragmentLoginBinding,LoginViewModel> (LoginViewModel::class) {
private lateinit var customDialog: CustomDialog
companion object {
fun newInstance() = LoginFragment()
}
override fun getLayoutId(): Int = R.layout.fragment_login
override fun init() {
customDialog = CustomDialog(requireContext())
checkUser()
button_login.setOnClickListener(View.OnClickListener {
splash_progress.visibility = View.VISIBLE
viewModel.login(edittext_username.text.toString(),edittext_password.text.toString())
})
}
private fun checkUser(){
val prefs: SharedPreferences = activity!!.getSharedPreferences(PREFS_USER,0)
edittext_username.setText(prefs.getString(USER,""))
edittext_password.setText(prefs.getString(PASSWORD,""))
if (edittext_password.text.toString().isNotEmpty()){
switch_remember.isChecked = true
}
}
override fun observeViewModel() {
with(viewModel){
loginitem.observe(viewLifecycleOwner, Observer {
splash_progress.visibility = View.INVISIBLE
if (it.isError){
customDialog.setTitle("Error").setDescription(it.errorMessage).setOkButton("Cerrar"){
customDialog.hide()
}.show()
}else{
splash_progress.visibility = View.VISIBLE
saveUserFkPref(it)
if (switch_remember.isChecked) {
saveUserAccesPref(edittext_username.text.toString(),edittext_password.text.toString())
}else{
saveUserAccesPref("","")
}
loginSalix(user = edittext_username.text.toString(),password = edittext_password.text.toString())
}
})
loginsalixitem.observe(viewLifecycleOwner, Observer {
splash_progress.visibility = View.INVISIBLE
if (it.isError){
saveTokenPref("")
customDialog.setTitle("Error").setDescription(it.errorMessage+". Puedes continuar pero algunas funcionalidades no estarán disponibles.").setOkButton("Entendido"){
customDialog.hide()
getVersion()
}.show()
}else{
saveTokenPref(it.token)
getVersion()
}
})
version.observe(viewLifecycleOwner, Observer {
splash_progress.visibility = View.INVISIBLE
if (it){
goToMain()
}else{
customDialog.setTitle("Error").setDescription("Existe una versión nueva, es recomendable actualizar.").setOkButton("Actualizar"){
val openURL = Intent(Intent.ACTION_VIEW)
openURL.data = Uri.parse("https://app.verdnatura.es/bin/vn-pickingV2.apk")
startActivity(openURL)
}.setKoButton("Omitir"){
customDialog.hide()
goToMain()
}.show()
}
})
}
super.observeViewModel()
}
private fun saveTokenPref(token:String){
val prefs: SharedPreferences = activity!!.getSharedPreferences(PREFS_USER,0)
val editor = prefs.edit()
editor.putString(TOKEN,token)
editor.apply()
}
private fun saveUserFkPref(loginitem : LoginItemVO){
val prefs: SharedPreferences = activity!!.getSharedPreferences(PREFS_USER,0)
val editor = prefs.edit()
editor.putString(USERFK,loginitem.id)
editor.apply()
}
private fun saveUserAccesPref(user:String,password:String){
val prefs: SharedPreferences = activity!!.getSharedPreferences(PREFS_USER,0)
val editor = prefs.edit()
editor.putString(USER,user)
editor.putString(PASSWORD,password)
editor.apply()
}
private fun goToMain(){
val intent = Intent(activity,MainActivity::class.java)
startActivity(intent)
}
private fun getVersion(){
val versionName = activity!!.packageManager.getPackageInfo(activity!!.packageName,0).versionName
splash_progress.visibility = View.VISIBLE
viewModel.checkVersion(user = edittext_username.text.toString(),password = edittext_password.text.toString(),version = versionName)
}
}

View File

@ -0,0 +1,92 @@
package es.verdnatura.presentation.view.feature.login.fragment
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import es.verdnatura.domain.GetLoginUserCase
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.view.feature.login.model.LoginItemVO
import es.verdnatura.presentation.view.feature.login.model.LoginSalixVO
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
class LoginViewModel() : BaseViewModel() {
private val getLoginUserCase: GetLoginUserCase = GetLoginUserCase()
private val _loginitem by lazy { MutableLiveData<LoginItemVO> ()}
val loginitem : LiveData<LoginItemVO>
get() = _loginitem
private val _loginsalixitem by lazy { MutableLiveData<LoginSalixVO> ()}
val loginsalixitem : LiveData<LoginSalixVO>
get() = _loginsalixitem
private val _version by lazy { MutableLiveData<Boolean> ()}
val version : LiveData<Boolean>
get() = _version
fun login(user:String,password:String){
getLoginUserCase.login(user,password).enqueue(object : Callback<String>{
override fun onResponse(call: Call<String>, response: Response<String>) {
var loginItemVO:LoginItemVO?
if (response.raw().code() == 555){
loginItemVO = LoginItemVO(id = "0",isError = true, errorMessage = "Usuario o contraseña incorrectos")
}else if (!response.body().isNullOrEmpty()){
loginItemVO = response.body()?.let { LoginItemVO(id = it) }
}else{
loginItemVO = LoginItemVO(id = "0",isError = true,errorMessage = "Error desconocido")
}
_loginitem.value = loginItemVO!!
}
override fun onFailure(call: Call<String>, t: Throwable) {
val loginItemVO : LoginItemVO? = LoginItemVO(id = "0",isError = true, errorMessage = t.message!!)
_loginitem.value = loginItemVO
}
})
}
fun loginSalix(user:String,password:String){
getLoginUserCase.salixLogin(user,password).enqueue(object : Callback<LoginSalixVO>{
override fun onResponse(call: Call<LoginSalixVO>, response: Response<LoginSalixVO>) {
var loginSalixVO:LoginSalixVO?
if(response.body() != null){
loginSalixVO = response.body()?.token?.let { LoginSalixVO(user,password, it,isError = false,errorMessage = "") }
}else{
loginSalixVO = LoginSalixVO(user,password,isError = true,errorMessage = "Error al conectar con salix")
}
_loginsalixitem.value = loginSalixVO
}
override fun onFailure(call: Call<LoginSalixVO>, t: Throwable) {
val loginSalixVO = LoginSalixVO(user,password, "",isError = true,errorMessage = t.message!!)
_loginsalixitem.value = loginSalixVO
}
})
}
fun checkVersion(user:String,password:String,version:String){
getLoginUserCase.checkVersion(user,password,version).enqueue(object : Callback<Boolean>{
override fun onResponse(call: Call<Boolean>, response: Response<Boolean>) {
if (response.body() != null){
_version.value = response.body()
}else{
_version.value = true
}
}
override fun onFailure(call: Call<Boolean>, t: Throwable) {
_version.value = true
}
})
}
}

View File

@ -0,0 +1,15 @@
package es.verdnatura.presentation.view.feature.login.model
class LoginItemVO (
val id:String = "",
var isError:Boolean = false,
var errorMessage:String = ""
)
class LoginSalixVO (
val user:String = "",
val password:String = "",
val token:String = "",
var isError:Boolean = false,
var errorMessage:String = ""
)

View File

@ -0,0 +1,132 @@
package es.verdnatura.presentation.view.feature.main.activity
import android.util.Log
import android.view.Menu
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import es.verdnatura.R
import es.verdnatura.databinding.ActivityMainBinding
import es.verdnatura.domain.toast
import es.verdnatura.presentation.base.BaseActivity
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.common.TAG
import es.verdnatura.presentation.common.addFragment
import es.verdnatura.presentation.view.component.CustomDialog
import es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesFragment
import es.verdnatura.presentation.view.feature.main.model.ItemMenuVO
import es.verdnatura.presentation.view.feature.pasillero.fragment.PasilleroFragment
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
class MainActivity : BaseActivity<ActivityMainBinding>() , OnPasillerosItemClickListener {
private var lastBottomMenuItemSelected: ItemMenuVO? = null
private lateinit var customDialog: CustomDialog
override fun getLayoutId(): Int = R.layout.activity_main
override fun init() {
customDialog = CustomDialog(this)
setBottomMenu()
addFragment(PasilleroFragment.newInstance(),R.id.main_frame_layout, PasilleroFragment.TAG)
}
private fun openFragment(fragment: Fragment) {
val transaction = supportFragmentManager.beginTransaction()
transaction.replace(R.id.main_frame_layout, fragment)
transaction.addToBackStack(null)
transaction.commit()
}
private fun setBottomMenu(){
val bottomMenu = main_bottom_navigation
bottomMenu.itemIconTintList = null
GlobalScope.launch(Dispatchers.Main){
val bottomMenuItems : ArrayList<ItemMenuVO> = ArrayList()
bottomMenuItems.add(ItemMenuVO(0,title = "Pasilleros",defaultImage = ContextCompat.getDrawable(
applicationContext,R.drawable.ic_device_hub_black_24dp),selectedImage = ContextCompat.getDrawable(
applicationContext,R.drawable.ic_device_hub_black_24dp_selected)))
bottomMenuItems.add(ItemMenuVO(1,title = "Sacadores",defaultImage = ContextCompat.getDrawable(
applicationContext,R.drawable.ic_local_florist_black_24dp),selectedImage = ContextCompat.getDrawable(
applicationContext,R.drawable.ic_local_florist_black_24dp_selected)))
bottomMenuItems.add(ItemMenuVO(2,title = "Controladores",defaultImage = ContextCompat.getDrawable(
applicationContext,R.drawable.ic_verified_user_black_24dp),selectedImage = ContextCompat.getDrawable(
applicationContext,R.drawable.ic_verified_user_black_24dp_selected)))
bottomMenuItems.add(ItemMenuVO(3,title = "Ajustes",defaultImage = ContextCompat.getDrawable(
applicationContext,R.drawable.ic_build_black_24dp),selectedImage = ContextCompat.getDrawable(
applicationContext,R.drawable.ic_build_black_24dp_selected)))
// Add al items to menu view
bottomMenuItems.forEach {
bottomMenu.menu.add(Menu.NONE, it.id, Menu.NONE, it.title).icon = it.defaultImage
}
// Select first item by default
val firstItem = bottomMenuItems.first()
bottomMenu.selectedItemId = firstItem.id
bottomMenu.menu.findItem(firstItem.id).icon = firstItem.selectedImage
lastBottomMenuItemSelected = firstItem
bottomMenu.setOnNavigationItemSelectedListener { menuItem ->
// Get selected item from itemList and apply ui changes to menu view
val selectedItemMenu = bottomMenuItems.find { menuItem.itemId == it.id }
menuItem.icon = selectedItemMenu?.selectedImage
// Get last selected item and disable it
bottomMenu.menu.findItem(lastBottomMenuItemSelected?.id!!).icon =
lastBottomMenuItemSelected?.defaultImage
lastBottomMenuItemSelected = selectedItemMenu
when (selectedItemMenu?.title) {
"Pasilleros" -> {
addFragment(PasilleroFragment.newInstance(),R.id.main_frame_layout, PasilleroFragment.TAG)
true
}
"Sacadores" -> {
selectedItemMenu.title.toast(this@MainActivity)
true
}
"Controladores" -> {
selectedItemMenu.title.toast(this@MainActivity)
true
}
"Ajustes" -> {
addFragment(AjustesFragment.newInstance(),R.id.main_frame_layout, AjustesFragment.TAG)
true
}
else -> false
}
true
}
bottomMenu.setOnNavigationItemReselectedListener {
}
}
}
override fun onPasillerosItemClickListener(item: PasillerosItemVO) {
Log.i("Item: ",item.title)
}
override fun onBackPressed() {
customDialog.setTitle("Error").setDescription("¿Estás seguro de cerrar la sesión?").setOkButton("Salir"){
customDialog.hide()
finish()
}.setKoButton("Cancelar") {
customDialog.hide()
}.show()
}
}

View File

@ -0,0 +1,10 @@
package es.verdnatura.presentation.view.feature.main.model
import android.graphics.drawable.Drawable
data class ItemMenuVO(
val id: Int,
val title: String,
val defaultImage: Drawable?,
val selectedImage: Drawable?
)

View File

@ -0,0 +1,43 @@
package es.verdnatura.presentation.view.feature.pasillero.adapter
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import es.verdnatura.databinding.ItemPasillerosMainMenuBinding
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
class PasillerosAdapter (
private val items: List<PasillerosItemVO>,
private val onPasillerosItemClickListener: OnPasillerosItemClickListener
): RecyclerView.Adapter<PasillerosAdapter.PasillerosItemHolder> () {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PasillerosItemHolder {
return PasillerosItemHolder(
ItemPasillerosMainMenuBinding.inflate(LayoutInflater.from(parent.context),parent,false)
)
}
override fun getItemCount() =items.size
override fun onBindViewHolder(holder: PasillerosItemHolder, position: Int) {
holder.bind(items[position])
holder.binding.root.setOnClickListener {
onPasillerosItemClickListener.onPasillerosItemClickListener(items[position])
}
}
class PasillerosItemHolder(
val binding: ItemPasillerosMainMenuBinding
) : RecyclerView.ViewHolder(binding.root){
fun bind(item: PasillerosItemVO) {
binding.apply {
this.item = item
itemImage.setImageResource(item.iconResource)
}
}
}
}

View File

@ -0,0 +1,42 @@
package es.verdnatura.presentation.view.feature.pasillero.fragment
import android.content.Context
import androidx.recyclerview.widget.LinearLayoutManager
import es.verdnatura.R
import es.verdnatura.databinding.FragmentPasilleroBinding
import es.verdnatura.presentation.base.BaseFragment
import es.verdnatura.presentation.common.OnPasillerosItemClickListener
import es.verdnatura.presentation.view.feature.pasillero.adapter.PasillerosAdapter
import kotlinx.android.synthetic.main.fragment_pasillero.*
class PasilleroFragment : BaseFragment<FragmentPasilleroBinding,PasilleroViewModel>(PasilleroViewModel::class){
private var pasillerosItemClickListener: OnPasillerosItemClickListener? = null
companion object {
fun newInstance() = PasilleroFragment()
}
override fun onAttach(context: Context) {
super.onAttach(context)
if (context is OnPasillerosItemClickListener) pasillerosItemClickListener = context
}
override fun getLayoutId(): Int = R.layout.fragment_pasillero
override fun init() {
viewModel.inititializeDefaultData()
super.init()
}
override fun observeViewModel() {
with(viewModel){
pasilleros_items.adapter = PasillerosAdapter(pasillerositem,pasillerosItemClickListener!!)
pasilleros_items.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
}
super.observeViewModel()
}
}

View File

@ -0,0 +1,47 @@
package es.verdnatura.presentation.view.feature.pasillero.fragment
import es.verdnatura.R
import es.verdnatura.presentation.base.BaseViewModel
import es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO
class PasilleroViewModel : BaseViewModel() {
private val _pasillerositem by lazy { ArrayList<PasillerosItemVO>() }
val pasillerositem: List<PasillerosItemVO>
get() = _pasillerositem
fun inititializeDefaultData() {
_pasillerositem.add(
PasillerosItemVO(0,
R.drawable.ic_loyalty_black_24dp,
"Consultar artículo")
)
_pasillerositem.add(
PasillerosItemVO(1,
R.drawable.ic_dashboard_black_24dp,
"Ubicador")
)
_pasillerositem.add(
PasillerosItemVO(2,
R.drawable.ic_visibility_black_24dp,
"Buscar item")
)
_pasillerositem.add(
PasillerosItemVO(3,
R.drawable.ic_spa_black_24dp,
"Inventario")
)
_pasillerositem.add(
PasillerosItemVO(4,
R.drawable.ic_move_to_inbox_black_24dp,
"Faltas")
)
}
}

View File

@ -0,0 +1,7 @@
package es.verdnatura.presentation.view.feature.pasillero.model
class PasillerosItemVO (
var id: Int,
var iconResource: Int,
val title: String = ""
)

View File

@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<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">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
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"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/verdnatura_white" android:state_checked="true"/>
<item android:color="@color/verdnatura_brown_grey" android:state_checked="false"/>
</selector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:dither="true"
android:shape="rectangle"
android:useLevel="false"
android:innerRadius="2dp"
android:visible="true">
<solid android:color="@color/verdnatura_pumpkin_orange"/>
<corners android:radius="20dp" />
<size
android:width="40dp"
android:height="20dp" />
</shape>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:dither="true"
android:shape="rectangle"
android:useLevel="false"
android:visible="true">
<solid android:color="@color/verdnatura_brown_grey"/>
<corners android:radius="20dp" />
<size
android:width="40dp"
android:height="20dp" />
</shape>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<stroke android:width="3dp" />
<corners android:radius="@dimen/parental_border_radius" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false" android:drawable="@drawable/background_oval_unchecked" />
<item android:state_checked="true" android:drawable="@drawable/background_oval_checked" />
</selector>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/verdnatura_pumpkin_orange" />
<corners
android:bottomLeftRadius="@dimen/btn_radius"
android:bottomRightRadius="@dimen/btn_radius"
android:topLeftRadius="@dimen/btn_radius"
android:topRightRadius="@dimen/btn_radius" />
</shape>

View File

@ -0,0 +1,12 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@android:color/transparent"/>
<stroke
android:width="1dp"
android:color="@android:color/white" />
<corners
android:bottomLeftRadius="@dimen/btn_radius"
android:bottomRightRadius="@dimen/btn_radius"
android:topLeftRadius="@dimen/btn_radius"
android:topRightRadius="@dimen/btn_radius" />
</shape>

View File

@ -0,0 +1,19 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<size android:height="2dp"/>
<corners android:radius="@dimen/progress_bar_radius" />
<solid android:color="@color/verdnatura_white"/>
</shape>
</item>
<item android:id="@android:id/secondaryProgress">
<clip>
<shape>
<size android:height="2dp"/>
<corners android:radius="@dimen/progress_bar_radius" />
<solid android:color="@color/verdnatura_pumpkin_orange"/>
</shape>
</clip>
</item>
</layer-list>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:dither="true" android:shape="oval" android:useLevel="false" android:visible="true">
<solid android:color="#FFFFFF" />
<size android:width="25dp" android:height="25dp" />
</shape>
</item>
</selector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M7,10l5,5 5,-5z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M22.7,19l-9.1,-9.1c0.9,-2.3 0.4,-5 -1.5,-6.9 -2,-2 -5,-2.4 -7.4,-1.3L9,6 6,9 1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1c1.9,1.9 4.6,2.4 6.9,1.5l9.1,9.1c0.4,0.4 1,0.4 1.4,0l2.3,-2.3c0.5,-0.4 0.5,-1.1 0.1,-1.4z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#F7931E"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#F7931E" android:pathData="M22.7,19l-9.1,-9.1c0.9,-2.3 0.4,-5 -1.5,-6.9 -2,-2 -5,-2.4 -7.4,-1.3L9,6 6,9 1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1c1.9,1.9 4.6,2.4 6.9,1.5l9.1,9.1c0.4,0.4 1,0.4 1.4,0l2.3,-2.3c0.5,-0.4 0.5,-1.1 0.1,-1.4z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#F7931E"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#F7931E" android:pathData="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M17,16l-4,-4V8.82C14.16,8.4 15,7.3 15,6c0,-1.66 -1.34,-3 -3,-3S9,4.34 9,6c0,1.3 0.84,2.4 2,2.82V12l-4,4H3v5h5v-3.05l4,-4.2 4,4.2V21h5v-5h-4z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#F7931E"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#F7931E" android:pathData="M17,16l-4,-4V8.82C14.16,8.4 15,7.3 15,6c0,-1.66 -1.34,-3 -3,-3S9,4.34 9,6c0,1.3 0.84,2.4 2,2.82V12l-4,4H3v5h5v-3.05l4,-4.2 4,4.2V21h5v-5h-4z"/>
</vector>

View File

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M12,22c4.97,0 9,-4.03 9,-9 -4.97,0 -9,4.03 -9,9zM5.6,10.25c0,1.38 1.12,2.5 2.5,2.5 0.53,0 1.01,-0.16 1.42,-0.44l-0.02,0.19c0,1.38 1.12,2.5 2.5,2.5s2.5,-1.12 2.5,-2.5l-0.02,-0.19c0.4,0.28 0.89,0.44 1.42,0.44 1.38,0 2.5,-1.12 2.5,-2.5 0,-1 -0.59,-1.85 -1.43,-2.25 0.84,-0.4 1.43,-1.25 1.43,-2.25 0,-1.38 -1.12,-2.5 -2.5,-2.5 -0.53,0 -1.01,0.16 -1.42,0.44l0.02,-0.19C14.5,2.12 13.38,1 12,1S9.5,2.12 9.5,3.5l0.02,0.19c-0.4,-0.28 -0.89,-0.44 -1.42,-0.44 -1.38,0 -2.5,1.12 -2.5,2.5 0,1 0.59,1.85 1.43,2.25 -0.84,0.4 -1.43,1.25 -1.43,2.25zM12,5.5c1.38,0 2.5,1.12 2.5,2.5s-1.12,2.5 -2.5,2.5S9.5,9.38 9.5,8s1.12,-2.5 2.5,-2.5zM3,13c0,4.97 4.03,9 9,9 0,-4.97 -4.03,-9 -9,-9z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#F7931E"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#F7931E" android:pathData="M12,22c4.97,0 9,-4.03 9,-9 -4.97,0 -9,4.03 -9,9zM5.6,10.25c0,1.38 1.12,2.5 2.5,2.5 0.53,0 1.01,-0.16 1.42,-0.44l-0.02,0.19c0,1.38 1.12,2.5 2.5,2.5s2.5,-1.12 2.5,-2.5l-0.02,-0.19c0.4,0.28 0.89,0.44 1.42,0.44 1.38,0 2.5,-1.12 2.5,-2.5 0,-1 -0.59,-1.85 -1.43,-2.25 0.84,-0.4 1.43,-1.25 1.43,-2.25 0,-1.38 -1.12,-2.5 -2.5,-2.5 -0.53,0 -1.01,0.16 -1.42,0.44l0.02,-0.19C14.5,2.12 13.38,1 12,1S9.5,2.12 9.5,3.5l0.02,0.19c-0.4,-0.28 -0.89,-0.44 -1.42,-0.44 -1.38,0 -2.5,1.12 -2.5,2.5 0,1 0.59,1.85 1.43,2.25 -0.84,0.4 -1.43,1.25 -1.43,2.25zM12,5.5c1.38,0 2.5,1.12 2.5,2.5s-1.12,2.5 -2.5,2.5S9.5,9.38 9.5,8s1.12,-2.5 2.5,-2.5zM3,13c0,4.97 4.03,9 9,9 0,-4.97 -4.03,-9 -9,-9z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#F7931E"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#F7931E" android:pathData="M21.41,11.58l-9,-9C12.05,2.22 11.55,2 11,2L4,2c-1.1,0 -2,0.9 -2,2v7c0,0.55 0.22,1.05 0.59,1.42l9,9c0.36,0.36 0.86,0.58 1.41,0.58 0.55,0 1.05,-0.22 1.41,-0.59l7,-7c0.37,-0.36 0.59,-0.86 0.59,-1.41 0,-0.55 -0.23,-1.06 -0.59,-1.42zM5.5,7C4.67,7 4,6.33 4,5.5S4.67,4 5.5,4 7,4.67 7,5.5 6.33,7 5.5,7zM17.27,15.27L13,19.54l-4.27,-4.27C8.28,14.81 8,14.19 8,13.5c0,-1.38 1.12,-2.5 2.5,-2.5 0.69,0 1.32,0.28 1.77,0.74l0.73,0.72 0.73,-0.73c0.45,-0.45 1.08,-0.73 1.77,-0.73 1.38,0 2.5,1.12 2.5,2.5 0,0.69 -0.28,1.32 -0.73,1.77z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#F7931E"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#F7931E" android:pathData="M19,3L4.99,3c-1.11,0 -1.98,0.9 -1.98,2L3,19c0,1.1 0.88,2 1.99,2L19,21c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM19,15h-4c0,1.66 -1.35,3 -3,3s-3,-1.34 -3,-3L4.99,15L4.99,5L19,5v10zM16,10h-2L14,7h-4v3L8,10l4,4 4,-4z"/>
</vector>

View File

@ -0,0 +1,6 @@
<vector android:height="24dp" android:tint="#F7931E"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#F7931E" android:pathData="M8.55,12c-1.07,-0.71 -2.25,-1.27 -3.53,-1.61 1.28,0.34 2.46,0.9 3.53,1.61zM18.98,10.39c-1.29,0.34 -2.49,0.91 -3.57,1.64 1.08,-0.73 2.28,-1.3 3.57,-1.64z"/>
<path android:fillColor="#F7931E" android:pathData="M15.49,9.63c-0.18,-2.79 -1.31,-5.51 -3.43,-7.63 -2.14,2.14 -3.32,4.86 -3.55,7.63 1.28,0.68 2.46,1.56 3.49,2.63 1.03,-1.06 2.21,-1.94 3.49,-2.63zM8.99,12.28c-0.14,-0.1 -0.3,-0.19 -0.45,-0.29 0.15,0.11 0.31,0.19 0.45,0.29zM15.41,12.03c-0.13,0.09 -0.27,0.16 -0.4,0.26 0.13,-0.1 0.27,-0.17 0.4,-0.26zM12,15.45C9.85,12.17 6.18,10 2,10c0,5.32 3.36,9.82 8.03,11.49 0.63,0.23 1.29,0.4 1.97,0.51 0.68,-0.12 1.33,-0.29 1.97,-0.51C18.64,19.82 22,15.32 22,10c-4.18,0 -7.85,2.17 -10,5.45z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M12,1L3,5v6c0,5.55 3.84,10.74 9,12 5.16,-1.26 9,-6.45 9,-12L21,5l-9,-4zM10,17l-4,-4 1.41,-1.41L10,14.17l6.59,-6.59L18,9l-8,8z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#F7931E"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#F7931E" android:pathData="M12,1L3,5v6c0,5.55 3.84,10.74 9,12 5.16,-1.26 9,-6.45 9,-12L21,5l-9,-4zM10,17l-4,-4 1.41,-1.41L10,14.17l6.59,-6.59L18,9l-8,8z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#F7931E"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#F7931E" android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
</vector>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".presentation.view.feature.login.activity.LoginActivity">
<FrameLayout
android:id="@+id/main_frame_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".presentation.view.feature.main.activity.MainActivity">
<FrameLayout
android:id="@+id/main_frame_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/main_bottom_navigation"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/main_bottom_navigation"
android:layout_width="match_parent"
android:layout_height="@dimen/bottom_navigation_height"
app:itemBackground="@color/verdnatura_black_3"
app:itemTextColor="@drawable/selector_bottombar_text"
app:labelVisibilityMode="labeled"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
style="@style/DialogTheme"
android:layout_height="wrap_content"
android:layout_margin="@dimen/layout_margin_1"
app:cardBackgroundColor="@color/verdnatura_black_8"
app:cardCornerRadius="@dimen/dialog_radius">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/default_layout_margin">
<TextView
android:id="@+id/custom_dialog_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/layout_margin_3"
android:layout_marginBottom="@dimen/default_layout_margin"
android:textAlignment="center"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/h6"
android:textStyle="bold"
android:visibility="gone"
tools:text="¿Estás seguro de que deseas eliminar el dispositivo de celia?"
tools:visibility="visible" />
<TextView
android:id="@+id/custom_dialog_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body1"
android:visibility="gone"
tools:text="Este cambio no podrá deshacerse a no ser que vuelvas a vincular el dispositivo"
tools:visibility="visible" />
<Button
android:id="@+id/custom_dialog_button_ok"
style="@style/DefaultButton.NormalButton"
android:layout_width="match_parent"
android:layout_marginTop="@dimen/default_layout_margin"
android:visibility="gone"
tools:text="Eliminar"
tools:visibility="visible" />
<Button
android:id="@+id/custom_dialog_button_ko"
style="@style/DefaultButton.TransparentButton"
android:layout_width="match_parent"
android:layout_marginTop="@dimen/default_layout_margin"
android:layout_marginBottom="@dimen/default_layout_margin"
android:visibility="gone"
tools:text="Cancelar"
tools:visibility="visible" />
</LinearLayout>
</androidx.cardview.widget.CardView>

View File

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tool="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="es.verdnatura.presentation.view.feature.ajustes.fragment.AjustesViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/verdnatura_black">
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:padding="@dimen/navigation_row_limit_padding">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Versión:"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body1"
android:textStyle="bold"
android:layout_marginRight="@dimen/default_layout_margin"/>
<TextView
android:id="@+id/item_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body1"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Usuario:"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/body1"
android:textStyle="bold"
android:layout_marginRight="@dimen/default_layout_margin"/>
<TextView
android:id="@+id/user_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="@color/verdnatura_brown_grey"
android:textSize="@dimen/body1"/>
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/ajustess_items"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.6"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout" />
<LinearLayout
android:id="@+id/splash_progress"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/verdnatura_black_8_alpha_6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tool="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="es.verdnatura.presentation.view.feature.login.fragment.LoginViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background_login">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/constrainlayout_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textview_welcome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/default_layout_margin"
android:layout_marginTop="16dp"
android:text="Bienvenido"
android:textColor="@android:color/white"
android:textSize="@dimen/h3"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textinputlayout_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textColorHint="@android:color/darker_gray"
app:layout_constraintStart_toStartOf="@id/textview_welcome"
app:layout_constraintTop_toBottomOf="@id/textview_welcome">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edittext_username"
style="@style/InputLineText"
android:layout_width="match_parent"
android:layout_margin="@dimen/default_layout_margin"
android:backgroundTint="@android:color/white"
android:hint="Usuario (Nombre trabajador)"
android:inputType="text"
android:lines="1"
android:maxLines="1"
android:textColor="@color/verdnatura_white"
android:textColorHint="@android:color/darker_gray" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textinputlayout_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColorHint="@android:color/darker_gray"
app:errorEnabled="true"
app:layout_constraintStart_toStartOf="@id/textinputlayout_username"
app:layout_constraintTop_toBottomOf="@id/textinputlayout_username"
app:passwordToggleEnabled="true"
app:passwordToggleTint="@android:color/white">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edittext_password"
style="@style/InputLineText"
android:layout_width="match_parent"
android:layout_margin="@dimen/default_layout_margin"
android:backgroundTint="@android:color/white"
android:gravity="center_vertical"
android:hint="Contraseña"
android:inputType="textPassword"
android:lines="1"
android:maxLines="1"
android:textColor="@color/verdnatura_white"
android:textColorHint="@android:color/darker_gray" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/textview_remember_user"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_layout_margin"
android:text="Recordar usuario y contraseña"
android:textColor="@android:color/white"
android:textSize="@dimen/body2"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/switch_remember"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textinputlayout_password" />
<Switch
android:id="@+id/switch_remember"
style="@style/DefaultButton"
android:layout_width="70dp"
android:layout_marginEnd="@dimen/default_layout_margin"
android:background="@android:color/transparent"
android:checked="false"
android:thumb="@drawable/drawable_white_circle"
android:track="@drawable/btn_ios_like"
app:layout_constraintBottom_toBottomOf="@+id/textview_remember_user"
app:layout_constraintEnd_toEndOf="@id/textinputlayout_password"
app:layout_constraintTop_toTopOf="@id/textview_remember_user" />
<Button
android:id="@+id/button_login"
style="@style/DefaultButton"
android:layout_width="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="@drawable/btn_orange"
android:text="Entrar"
android:textColor="@color/verdnatura_white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textview_remember_user" />
<Button
android:id="@+id/textview_remember_password"
style="@style/TextButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/default_layout_margin"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:paddingStart="@dimen/layout_margin_3"
android:paddingEnd="@dimen/layout_margin_3"
android:text="¿No recuerdas tu contraseña? Contacta con informática"
android:textAllCaps="false"
android:textColor="@color/verdnatura_white"
android:textStyle="normal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/button_login" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/splash_progress"
android:visibility="invisible"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/verdnatura_black_8_alpha_6"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center">
<com.airbnb.lottie.LottieAnimationView
android:layout_width="wrap_content"
android:layout_height="@dimen/verdnatura_logo_large_height"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_rawRes="@raw/orange_loading"
app:lottie_speed="2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tool="http://schemas.android.com/tools">
<data>
<variable
name="viewModel"
type="es.verdnatura.presentation.view.feature.pasillero.fragment.PasilleroViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/pasilleros_items"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.6"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tool="http://schemas.android.com/tools">
<data>
<variable
name="item"
type="es.verdnatura.presentation.view.feature.ajustes.model.AjustesItemVO" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/verdnatura_black_5"
android:padding="@dimen/pasilleros_margin_main_menu">
<TextView
android:id="@+id/item_title"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@{item.title}"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/h7"
android:gravity="center_vertical"
android:layout_marginLeft="@dimen/pasilleros_margin_main_menu"
android:textStyle="bold"/>
<TextView
android:id="@+id/item_selected"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@{item.selected}"
android:textColor="@color/verdnatura_pumpkin_orange"
android:textSize="@dimen/h7"
android:gravity="center_vertical"
android:layout_marginLeft="@dimen/pasilleros_margin_main_menu"/>
<ImageView
android:layout_marginLeft="@dimen/default_layout_margin"
android:id="@+id/item_image"
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="centerCrop"
android:src="@drawable/ic_chevron_right_black_24dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/verdnatura_black_9"/>
</LinearLayout>
</layout>

View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tool="http://schemas.android.com/tools">
<data>
<variable
name="item"
type="es.verdnatura.presentation.view.feature.pasillero.model.PasillerosItemVO" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/verdnatura_black_5"
android:padding="@dimen/pasilleros_margin_main_menu">
<ImageView
android:id="@+id/item_image"
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="centerCrop"/>
<TextView
android:id="@+id/item_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@{item.title}"
android:textColor="@color/verdnatura_white"
android:textSize="@dimen/h7"
android:gravity="center_vertical"
android:layout_marginLeft="@dimen/pasilleros_margin_main_menu"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/verdnatura_black_9"/>
</LinearLayout>
</layout>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1 @@
{"v":"5.6.3","fr":25,"ip":0,"op":50,"w":700,"h":500,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":2,"ty":4,"nm":"Capa de formas 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[350,250,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":2,"s":{"a":0,"k":[516.43,334.277],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":50,"ix":4},"nm":"Trazado de rectángulo 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.502],"y":[1.001]},"o":{"x":[0.14],"y":[0.34]},"t":0,"s":[14]},{"i":{"x":[0.697],"y":[0.505]},"o":{"x":[0.503],"y":[0.001]},"t":25,"s":[42.483]},{"t":49,"s":[14]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.638],"y":[1.001]},"o":{"x":[0.305],"y":[0.408]},"t":0,"s":[80]},{"i":{"x":[0.562],"y":[0.406]},"o":{"x":[0.223],"y":[0.001]},"t":25,"s":[100]},{"t":49,"s":[80]}],"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.644],"y":[0.515]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[78]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.295],"y":[0.143]},"t":25,"s":[176.327]},{"t":49,"s":[438]}],"ix":3},"m":1,"ix":2,"nm":"Recortar trazados 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[1,0.474509805441,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":40,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-11.785,-5.861],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[94.536,108.177],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Rectángulo 1","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":50,"st":0,"bm":0}],"markers":[]}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#f7931e</color>
<color name="colorPrimaryDark">#8b4200</color>
<color name="verdnatura_black">#000000</color>
<color name="verdnatura_black_1">#1d1d1d</color>
<color name="verdnatura_black_2">#171717</color>
<color name="verdnatura_black_3">#292929</color>
<color name="verdnatura_black_4">#242424</color>
<color name="verdnatura_black_5">#323232</color>
<color name="verdnatura_black_6">#333333</color>
<color name="verdnatura_black_7">#282828</color>
<color name="verdnatura_black_8">#1a1a1a</color>
<color name="verdnatura_black_9">#464446</color>
<color name="verdnatura_warm_grey">#707070</color>
<color name="verdnatura_brown_grey">#8f8f8f</color>
<color name="verdnatura_warm_brown">#8b4200</color>
<color name="verdnatura_pumpkin_orange">#f7931e</color>
<color name="verdnatura_sunflower_yellow">#ffd400</color>
<color name="verdnatura_dark_sky_blue">#4ab4e6</color>
<color name="verdnatura_dark_mint">#50be87</color>
<color name="verdnatura_light_teal">#b8ecd6</color>
<color name="verdnatura_white">#ffffff</color>
<color name="verdnatura_black_8_alpha_6">#991A1A1A</color>
</resources>

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--Vertical margin-->
<dimen name="layout_margin_min">4dp</dimen>
<dimen name="layout_margin_1">8dp</dimen>
<dimen name="default_layout_margin">16dp</dimen>
<dimen name="layout_margin_3">32dp</dimen>
<dimen name="layout_margin_4">40dp</dimen>
<dimen name="layout_margin_5">48dp</dimen>
<dimen name="layout_margin_6">56dp</dimen>
<dimen name="layout_margin_7">64dp</dimen>
<dimen name="layout_margin_8">72dp</dimen>
<dimen name="layout_margin_12">104dp</dimen>
<!--Bottom navigation-->
<dimen name="bottom_navigation_height">56dp</dimen>
<!--Toolbar-->
<dimen name="toolbar_height">56dp</dimen>
<dimen name="toolbar_icon_height">30dp</dimen>
<dimen name="toolbar_image_width">120dp</dimen>
<!--List separation-->
<dimen name="item_list_separation">4dp</dimen>
<!--Text sizes-->
<dimen name="h1">96sp</dimen>
<dimen name="h2">60sp</dimen>
<dimen name="h3">48sp</dimen>
<dimen name="h4">34sp</dimen>
<dimen name="h5">24sp</dimen>
<dimen name="h6">20sp</dimen>
<dimen name="h7">18sp</dimen>
<dimen name="subtitle1">16sp</dimen>
<dimen name="subtitle2">14sp</dimen>
<dimen name="body1">16sp</dimen>
<dimen name="body2">14sp</dimen>
<dimen name="button">14sp</dimen>
<dimen name="caption">12sp</dimen>
<dimen name="over_line">10sp</dimen>
<!--Button-->
<dimen name="btn_radius">5dp</dimen>
<!--Progress Bar-->
<dimen name="progress_bar_radius">5dp</dimen>
<!--Logo-->
<dimen name="verdnatura_logo_large_height">56dp</dimen>
<!--Card-->
<dimen name="card_radius">5dp</dimen>
<dimen name="card_elevation">4dp</dimen>
<!--Dialog-->
<dimen name="dialog_elevation">24dp</dimen>
<dimen name="dialog_radius">16dp</dimen>
<!--Navigation items-->
<dimen name="navigation_item_height">135dp</dimen>
<dimen name="navigation_item_width">200dp</dimen>
<dimen name="navigation_item_title_height">24dp</dimen>
<dimen name="navigation_row_limit_padding">12dp</dimen>
<dimen name="navigation_item_height_plus">149dp</dimen>
<dimen name="parental_border_radius">3dp</dimen>
<!--Pasilleros-->
<dimen name="pasilleros_margin_main_menu">15dp</dimen>
</resources>

View File

@ -0,0 +1,3 @@
<resources>
<string name="app_name">Gestor Almacén</string>
</resources>

View File

@ -0,0 +1,121 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/verdnatura_black</item>
<item name="colorAccent">@color/verdnatura_pumpkin_orange</item>
<item name="android:windowBackground">@color/verdnatura_black</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="colorControlHighlight">@color/verdnatura_white</item>
</style>
<!--Buttons-->
<style name="DefaultButton" parent="android:Widget.Button">
<item name="android:minWidth">64dp</item>
<item name="android:layout_height">36dp</item>
<item name="android:paddingStart">16dp</item>
<item name="android:paddingEnd">16dp</item>
<item name="android:textAllCaps">true</item>
<item name="android:textSize">14sp</item>
<item name="android:textStyle">bold</item>
<item name="android:gravity">center</item>
<item name="android:focusable">true</item>
<item name="android:lines">1</item>
<item name="android:ellipsize">end</item>
<item name="android:clickable">true</item>
<item name="android:drawablePadding">8dp</item>
</style>
<style name="DefaultButton.NormalButton" parent="DefaultButton">
<item name="android:background">@drawable/btn_orange</item>
<item name="android:textColor">@color/verdnatura_white</item>
</style>
<style name="DefaultButton.TransparentButton" parent="DefaultButton">
<item name="android:background">@drawable/btn_white_transparent</item>
<item name="android:textColor">@color/verdnatura_white</item>
</style>
<style name="TextButton" parent="android:Widget.TextView">
<item name="android:minWidth">64dp</item>
<item name="android:layout_height">36dp</item>
<item name="android:paddingStart">8dp</item>
<item name="android:paddingEnd">8dp</item>
<item name="android:gravity">center</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">14sp</item>
<item name="android:textAllCaps">true</item>
<item name="android:focusable">true</item>
<item name="android:clickable">true</item>
<item name="android:background">?android:attr/selectableItemBackground</item>
</style>
<style name="ImageButton" parent="android:Widget.ImageButton">
<item name="android:layout_height">48dp</item>
<item name="android:layout_width">48dp</item>
<item name="android:padding">12dp</item>
<item name="android:scaleType">centerCrop</item>
<item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
<item name="android:clickable">true</item>
<item name="android:focusable">true</item>
</style>
<!--Input Text-->
<style name="InputLineText" parent="android:Widget.EditText">
<item name="android:minWidth">280dp</item>
<item name="android:layout_height">56dp</item>
<item name="android:paddingStart">12dp</item>
<item name="android:paddingEnd">12dp</item>
<item name="android:textSize">16sp</item>
</style>
<!-- Full Screen Alert Dialog -->
<style name="DialogTheme">
<item name="android:layout_width">280dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="cardCornerRadius">@dimen/dialog_radius</item>
<!-- No backgrounds, titles or window float -->
<item name="android:windowFullscreen">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
</style>
<!--Ripple effect for layouts-->
<style name="LayoutClickable">
<item name="android:focusable">true</item>
<item name="android:clickable">true</item>
<item name="android:foreground">?android:attr/selectableItemBackground</item>
</style>
<!--Progress Bar-->
<style name="HorizontalProgressBar" parent="Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:layout_height">5dp</item>
<item name="android:progressDrawable">@drawable/component_progress</item>
</style>
<style name="ParentalLabel">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:minWidth">25dp</item>
<item name="android:background">@drawable/border_parental</item>
<item name="android:gravity">center</item>
<item name="android:padding">1dp</item>
<item name="android:textAlignment">center</item>
<item name="android:textSize">14sp</item>
<item name="android:textStyle">bold</item>
</style>
<style name="ParentalLabelSmall" parent="ParentalLabel">
<item name="android:layout_width">15dp</item>
<item name="android:layout_height">15dp</item>
<item name="android:minWidth">100dp</item>
<item name="android:padding">0dp</item>
<item name="android:textSize">10sp</item>
<item name="android:textStyle">normal</item>
</style>
</resources>

View File

@ -0,0 +1,17 @@
package es.verdnatura
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}

41
build.gradle Normal file
View File

@ -0,0 +1,41 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.72'
ext {
// UI components
lottieVersion = '3.4.0'
lifecycle = '2.2.0'
koin = '2.0.1'
// Images
glide = '4.11.0'
piccasso = '2.71828'
coil = '0.9.5'
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

21
gradle.properties Normal file
View File

@ -0,0 +1,21 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official

Some files were not shown because too many files have changed in this diff Show More