From 1623ce2c7157863ddf86e0ffd5ccfd4b3a26bd64 Mon Sep 17 00:00:00 2001 From: Yannine Alvarez Date: Wed, 13 May 2020 19:53:42 -0400 Subject: [PATCH] Iniciando repositorio de ayudapy --- .gitignore | 14 ++++++++++++++ .idea/codeStyles/Project.xml | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 +++++ .idea/gradle.xml | 20 ++++++++++++++++++++ .idea/misc.xml | 9 +++++++++ .idea/runConfigurations.xml | 12 ++++++++++++ app/.gitignore | 1 + app/build.gradle | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/proguard-rules.pro | 21 +++++++++++++++++++++ app/schemas/com.example.ayudapy.PedidoDataBase/1.json | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/androidTest/java/com/example/ayudapy/ExampleInstrumentedTest.kt | 24 ++++++++++++++++++++++++ app/src/debug/res/values/google_maps_api.xml | 24 ++++++++++++++++++++++++ app/src/main/AndroidManifest.xml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/java/com/example/ayudapy/ApiPedidos.kt | 31 +++++++++++++++++++++++++++++++ app/src/main/java/com/example/ayudapy/ApiService.kt | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/java/com/example/ayudapy/CentroAyuda.kt | 26 ++++++++++++++++++++++++++ app/src/main/java/com/example/ayudapy/Dao.kt | 21 +++++++++++++++++++++ app/src/main/java/com/example/ayudapy/DataBaseRoom.kt | 30 ++++++++++++++++++++++++++++++ app/src/main/java/com/example/ayudapy/Entity.kt | 21 +++++++++++++++++++++ app/src/main/java/com/example/ayudapy/InfoActivity.kt | 44 ++++++++++++++++++++++++++++++++++++++++++++ app/src/main/java/com/example/ayudapy/MapsActivity.kt | 396 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/java/com/example/ayudapy/Pedido.kt | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/java/com/example/ayudapy/PedidoDetalle.kt | 33 +++++++++++++++++++++++++++++++++ app/src/main/java/com/example/ayudapy/PedidosAyuda.kt | 34 ++++++++++++++++++++++++++++++++++ app/src/main/res/drawable-v24/ic_launcher_foreground.xml | 30 ++++++++++++++++++++++++++++++ app/src/main/res/drawable-xhdpi/centro_donacion.png | Bin 0 -> 3209 bytes app/src/main/res/drawable-xxhdpi/ayuda.png | Bin 0 -> 12130 bytes app/src/main/res/drawable-xxhdpi/icon_listo_unchecked.png | Bin 0 -> 6262 bytes app/src/main/res/drawable-xxhdpi/icon_pendientes_unchecked.png | Bin 0 -> 5206 bytes app/src/main/res/drawable-xxhdpi/infobutton.png | Bin 0 -> 19848 bytes app/src/main/res/drawable-xxhdpi/logoheader.png | Bin 0 -> 20304 bytes app/src/main/res/drawable-xxhdpi/pedido.png | Bin 0 -> 4949 bytes app/src/main/res/drawable-xxhdpi/pendientesbutton.png | Bin 0 -> 23674 bytes app/src/main/res/drawable-xxhdpi/pin_favorito.png | Bin 0 -> 5225 bytes app/src/main/res/drawable/background_gradient.xml | 9 +++++++++ app/src/main/res/drawable/background_round.xml | 6 ++++++ app/src/main/res/drawable/ic_launcher_background.xml | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/res/layout/activity_maps.xml | 36 ++++++++++++++++++++++++++++++++++++ app/src/main/res/layout/alert_dialog.xml | 6 ++++++ app/src/main/res/layout/alert_dialog_contacto.xml | 40 ++++++++++++++++++++++++++++++++++++++++ app/src/main/res/layout/fragment_pedido.xml | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/res/layout/info.xml | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/res/layout/menu_buttons.xml | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml | 5 +++++ app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml | 5 +++++ app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3593 bytes app/src/main/res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5339 bytes app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2636 bytes app/src/main/res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 3388 bytes app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4926 bytes app/src/main/res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7472 bytes app/src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7909 bytes app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 11873 bytes app/src/main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 10652 bytes app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 16570 bytes app/src/main/res/values/colors.xml | 8 ++++++++ app/src/main/res/values/dimens.xml | 5 +++++ app/src/main/res/values/strings.xml | 7 +++++++ app/src/main/res/values/styles.xml | 17 +++++++++++++++++ app/src/release/res/values/google_maps_api.xml | 20 ++++++++++++++++++++ app/src/test/java/com/example/ayudapy/ExampleUnitTest.kt | 17 +++++++++++++++++ build.gradle | 29 +++++++++++++++++++++++++++++ gradle.properties | 21 +++++++++++++++++++++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 54329 bytes gradle/wrapper/gradle-wrapper.properties | 6 ++++++ gradlew | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ gradlew.bat | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ settings.gradle | 2 ++ 68 files changed, 2240 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/gradle.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/runConfigurations.xml create mode 100644 app/.gitignore create mode 100644 app/build.gradle create mode 100644 app/proguard-rules.pro create mode 100644 app/schemas/com.example.ayudapy.PedidoDataBase/1.json create mode 100644 app/src/androidTest/java/com/example/ayudapy/ExampleInstrumentedTest.kt create mode 100644 app/src/debug/res/values/google_maps_api.xml create mode 100644 app/src/main/AndroidManifest.xml create mode 100644 app/src/main/java/com/example/ayudapy/ApiPedidos.kt create mode 100644 app/src/main/java/com/example/ayudapy/ApiService.kt create mode 100644 app/src/main/java/com/example/ayudapy/CentroAyuda.kt create mode 100644 app/src/main/java/com/example/ayudapy/Dao.kt create mode 100644 app/src/main/java/com/example/ayudapy/DataBaseRoom.kt create mode 100644 app/src/main/java/com/example/ayudapy/Entity.kt create mode 100644 app/src/main/java/com/example/ayudapy/InfoActivity.kt create mode 100644 app/src/main/java/com/example/ayudapy/MapsActivity.kt create mode 100644 app/src/main/java/com/example/ayudapy/Pedido.kt create mode 100644 app/src/main/java/com/example/ayudapy/PedidoDetalle.kt create mode 100644 app/src/main/java/com/example/ayudapy/PedidosAyuda.kt create mode 100644 app/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 app/src/main/res/drawable-xhdpi/centro_donacion.png create mode 100644 app/src/main/res/drawable-xxhdpi/ayuda.png create mode 100644 app/src/main/res/drawable-xxhdpi/icon_listo_unchecked.png create mode 100644 app/src/main/res/drawable-xxhdpi/icon_pendientes_unchecked.png create mode 100644 app/src/main/res/drawable-xxhdpi/infobutton.png create mode 100644 app/src/main/res/drawable-xxhdpi/logoheader.png create mode 100644 app/src/main/res/drawable-xxhdpi/pedido.png create mode 100644 app/src/main/res/drawable-xxhdpi/pendientesbutton.png create mode 100644 app/src/main/res/drawable-xxhdpi/pin_favorito.png create mode 100644 app/src/main/res/drawable/background_gradient.xml create mode 100644 app/src/main/res/drawable/background_round.xml create mode 100644 app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 app/src/main/res/layout/activity_maps.xml create mode 100644 app/src/main/res/layout/alert_dialog.xml create mode 100644 app/src/main/res/layout/alert_dialog_contacto.xml create mode 100644 app/src/main/res/layout/fragment_pedido.xml create mode 100644 app/src/main/res/layout/info.xml create mode 100644 app/src/main/res/layout/menu_buttons.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 app/src/main/res/values/colors.xml create mode 100644 app/src/main/res/values/dimens.xml create mode 100644 app/src/main/res/values/strings.xml create mode 100644 app/src/main/res/values/styles.xml create mode 100644 app/src/release/res/values/google_maps_api.xml create mode 100644 app/src/test/java/com/example/ayudapy/ExampleUnitTest.kt create mode 100644 build.gradle create mode 100644 gradle.properties create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..603b140 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..88ea3aa --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,122 @@ + + + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+ + +
+
\ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..5cd135a --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..18962c8 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..2e78b11 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,80 @@ +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 "com.example.ayudapy" + minSdkVersion 19 + targetSdkVersion 29 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + javaCompileOptions { + annotationProcessorOptions { + arguments = ["room.schemaLocation": "$projectDir/schemas".toString()] + } + } + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + +} + +allprojects { + repositories { + jcenter() + maven { + url "https://maven.google.com" + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation 'androidx.appcompat:appcompat:1.1.0' + implementation 'androidx.core:core-ktx:1.2.0' + implementation 'com.google.android.gms:play-services-maps:17.0.0' + implementation 'com.google.android.gms:play-services-location:17.0.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'androidx.recyclerview:recyclerview:1.1.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.2.0-alpha06' + + implementation 'com.squareup.retrofit2:retrofit:2.3.0' + + implementation 'com.squareup.retrofit2:converter-gson:2.3.0' +// implementation 'com.squareup.okhttp3:okhttp:3.4.0' +// implementation 'com.squareup.okhttp3:logging-interceptor:3.4.0' + //implementation 'com.squareup.okio:okio:2.4.3' + + //noinspection GradleCompatible + implementation 'com.android.support:recyclerview-v7:28.0.0' + implementation 'com.squareup.picasso:picasso:2.71828' + implementation 'androidx.cardview:cardview:1.0.0' + implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0' + implementation 'com.google.okhttp:okhttp:20120626' + implementation 'com.squareup.okio:okio:2.6.0' + implementation 'androidx.constraintlayout:constraintlayout:1.1.3' + implementation 'android.arch.persistence.room:runtime:1.1.1' + kapt 'android.arch.persistence.room:compiler:1.1.1' + + //implementation "android.arch.lifecycle:extensions:1.1.1" + //implementation "android.arch.persistence.room:runtime:1.0.0-rc1" + //kapt "android.arch.persistence.room:compiler:1.0.0-rc1" + +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/app/schemas/com.example.ayudapy.PedidoDataBase/1.json b/app/schemas/com.example.ayudapy.PedidoDataBase/1.json new file mode 100644 index 0000000..ba1e454 --- /dev/null +++ b/app/schemas/com.example.ayudapy.PedidoDataBase/1.json @@ -0,0 +1,69 @@ +{ + "formatVersion": 1, + "database": { + "version": 1, + "identityHash": "f617a1d61ee384e32e6ed730c8c23f64", + "entities": [ + { + "tableName": "pedido_save", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `title` TEXT NOT NULL, `message` TEXT NOT NULL, `name` TEXT NOT NULL, `phone` TEXT NOT NULL, `address` TEXT NOT NULL, `added` TEXT NOT NULL, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "title", + "columnName": "title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "message", + "columnName": "message", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "phone", + "columnName": "phone", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "address", + "columnName": "address", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "added", + "columnName": "added", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + } + ], + "setupQueries": [ + "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"f617a1d61ee384e32e6ed730c8c23f64\")" + ] + } +} \ No newline at end of file diff --git a/app/src/androidTest/java/com/example/ayudapy/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/example/ayudapy/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..5e022a1 --- /dev/null +++ b/app/src/androidTest/java/com/example/ayudapy/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.example.ayudapy + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.ayudapy", appContext.packageName) + } +} diff --git a/app/src/debug/res/values/google_maps_api.xml b/app/src/debug/res/values/google_maps_api.xml new file mode 100644 index 0000000..d8cd09a --- /dev/null +++ b/app/src/debug/res/values/google_maps_api.xml @@ -0,0 +1,24 @@ + + + AIzaSyCDCQFseYL7K7okR_YL7lmh2SCRct9YiiM + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..be98e72 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/example/ayudapy/ApiPedidos.kt b/app/src/main/java/com/example/ayudapy/ApiPedidos.kt new file mode 100644 index 0000000..222b978 --- /dev/null +++ b/app/src/main/java/com/example/ayudapy/ApiPedidos.kt @@ -0,0 +1,31 @@ +package com.example.ayudapy + +import okhttp3.OkHttpClient +import okhttp3.logging.HttpLoggingInterceptor +import retrofit2.Call +import retrofit2.Retrofit +import retrofit2.converter.gson.GsonConverterFactory +import retrofit2.http.GET +import retrofit2.http.Query + +interface ApiPedidos { + + + companion object{ + val instance:ApiService by lazy{ + + val builder_pedido = Retrofit.Builder() + .baseUrl("https://ayudapy.org/api/v1/helprequestsgeo/") + .addConverterFactory(GsonConverterFactory.create()) + + val client = OkHttpClient.Builder() + + client.addInterceptor(HttpLoggingInterceptor().apply { + level = HttpLoggingInterceptor.Level.BODY + }) + + builder_pedido.client(client.build()) + builder_pedido.build().create(ApiService::class.java) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/ayudapy/ApiService.kt b/app/src/main/java/com/example/ayudapy/ApiService.kt new file mode 100644 index 0000000..3091bd6 --- /dev/null +++ b/app/src/main/java/com/example/ayudapy/ApiService.kt @@ -0,0 +1,69 @@ +package com.example.ayudapy + +import okhttp3.OkHttpClient +import okhttp3.logging.HttpLoggingInterceptor +import retrofit2.Call +import retrofit2.Retrofit +import retrofit2.converter.gson.GsonConverterFactory +import retrofit2.http.GET +import retrofit2.http.Path +import retrofit2.http.Query +import java.util.concurrent.TimeUnit + + +interface ApiService { + + @GET("?in_bbox") + fun getListaCentro( + @Query("limit") limit : Int, + @Query("offset") offset : Int + ): Call + + + /* @GET("helprequestsgeo/") + fun getHelpRequests(@Query("in_bbox") boundaryBox: String): Call*/ + + @GET("?in_bbox") + fun getListaPedidos( + @Query("limit") limit : Int, + @Query("offset") offset : Int + ): Call + + @GET("{id}") + fun getPedidoDetalle( + @Path("id") id : Int + ): Call + + + companion object { + // init Retrofit base server instance + val redditClient by lazy { ApiService.invoke("https://ayudapy.org/api/v1/donationcenters/") } + val stackClient by lazy { ApiService.invoke("https://ayudapy.org/api/v1/helprequestsgeo/") } + val pedidoDetalle by lazy { ApiService.invoke("https://ayudapy.org/api/v1/helprequests/") } + + private val loggingInterceptor = HttpLoggingInterceptor().apply { + this.level = HttpLoggingInterceptor.Level.BODY + } + + operator fun invoke(baseUrl: String): ApiService { + val client = OkHttpClient.Builder().apply { + /**addNetworkInterceptor(StethoInterceptor()) */ + addNetworkInterceptor(loggingInterceptor) + connectTimeout(10, TimeUnit.MINUTES) + readTimeout(10, TimeUnit.MINUTES) + writeTimeout(10, TimeUnit.MINUTES) + }.build() + + return Retrofit.Builder() + .client(client) + .baseUrl(baseUrl) +// .addCallAdapterFactory(CoroutineCallAdapterFactory()) + .addConverterFactory(GsonConverterFactory.create()) + .build() + .create(ApiService::class.java) + } + } + + + +} \ No newline at end of file diff --git a/app/src/main/java/com/example/ayudapy/CentroAyuda.kt b/app/src/main/java/com/example/ayudapy/CentroAyuda.kt new file mode 100644 index 0000000..9c48d6b --- /dev/null +++ b/app/src/main/java/com/example/ayudapy/CentroAyuda.kt @@ -0,0 +1,26 @@ +package com.example.ayudapy + + +data class CentroAyuda ( + val count: Long, + val next: Any? = null, + val previous: Any? = null, + val results: List +) + +data class Result ( + val id: Long, + val name: String, + val phone: String, + val location: Location, + val address: String, + val city: String, + val cityCode: String, + val active: Boolean, + val added: String +) + +data class Location ( + val type: String, + val coordinates: List +) diff --git a/app/src/main/java/com/example/ayudapy/Dao.kt b/app/src/main/java/com/example/ayudapy/Dao.kt new file mode 100644 index 0000000..ec0020b --- /dev/null +++ b/app/src/main/java/com/example/ayudapy/Dao.kt @@ -0,0 +1,21 @@ +package com.example.ayudapy + +import androidx.lifecycle.LiveData +import androidx.room.* +import androidx.room.OnConflictStrategy.REPLACE + +@Dao +interface DaoPedido { + @Query("SELECT * from pedido_save") + fun getAll(): List + + @Insert(onConflict = REPLACE) + fun insert(pedido: PedidoSave) + + @Delete + fun delete(pedido: PedidoSave) +} + + /* @Query("UPDATE pedido_save SET name =:studentName, nim =:studentNim, gender =:studentGen WHERE id =:studentId") + fun update(studentId: Long, studentName:String, studentNim:String, studentGen:String)*/ + diff --git a/app/src/main/java/com/example/ayudapy/DataBaseRoom.kt b/app/src/main/java/com/example/ayudapy/DataBaseRoom.kt new file mode 100644 index 0000000..1f58781 --- /dev/null +++ b/app/src/main/java/com/example/ayudapy/DataBaseRoom.kt @@ -0,0 +1,30 @@ +package com.example.ayudapy + +import android.content.Context +import androidx.room.Database +import androidx.room.Room +import androidx.room.RoomDatabase + +@Database(entities = arrayOf(PedidoSave::class), version = 1) +abstract class PedidoDataBase : RoomDatabase() { + + abstract fun daoPedido(): DaoPedido + companion object { + private var INSTANCE: PedidoDataBase? = null + + fun getInstance(context: Context): PedidoDataBase? { + if (INSTANCE == null) { + synchronized(PedidoDataBase::class) { + INSTANCE = Room.databaseBuilder(context.getApplicationContext(), + PedidoDataBase::class.java, "pedidodata.db") + .build() + } + } + return INSTANCE + } + + fun destroyInstance() { + INSTANCE = null + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/ayudapy/Entity.kt b/app/src/main/java/com/example/ayudapy/Entity.kt new file mode 100644 index 0000000..0c3ebce --- /dev/null +++ b/app/src/main/java/com/example/ayudapy/Entity.kt @@ -0,0 +1,21 @@ +package com.example.ayudapy + +import androidx.room.ColumnInfo +import androidx.room.Entity +import androidx.room.PrimaryKey +import org.jetbrains.annotations.NotNull + +@Entity(tableName = "pedido_save") +data class PedidoSave( + @PrimaryKey var id: Long, + @ColumnInfo(name = "title") var title: String, + @ColumnInfo(name = "message") var message: String, + @ColumnInfo(name = "name") var name: String, + @ColumnInfo(name = "phone") var phone: String, + @ColumnInfo(name = "address") var address: String, +// @ColumnInfo(name = "location") var location: String, +// @ColumnInfo(name = "active") var active: String, + @ColumnInfo(name = "added") var added: String +) + + diff --git a/app/src/main/java/com/example/ayudapy/InfoActivity.kt b/app/src/main/java/com/example/ayudapy/InfoActivity.kt new file mode 100644 index 0000000..6e3c9e3 --- /dev/null +++ b/app/src/main/java/com/example/ayudapy/InfoActivity.kt @@ -0,0 +1,44 @@ +package com.example.ayudapy + +import android.content.Intent +import android.net.Uri +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import kotlinx.android.synthetic.main.info.* + + +class InfoActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.info) + val intento : Intent =intent + + terminos_de_uso.setOnClickListener { + val url = "https://ayudapy.org/legal" + val i = Intent(Intent.ACTION_VIEW) + i.data = Uri.parse(url) + startActivity(i) + + } + preguntas_freq.setOnClickListener { + val url = "https://ayudapy.org/preguntas_frecuentes" + val i = Intent(Intent.ACTION_VIEW) + i.data = Uri.parse(url) + startActivity(i) + + } + visitar_ayudapy.setOnClickListener { + val url = "https://ayudapy.org" + val i = Intent(Intent.ACTION_VIEW) + i.data = Uri.parse(url) + startActivity(i) + + } + + } + + +} + + + diff --git a/app/src/main/java/com/example/ayudapy/MapsActivity.kt b/app/src/main/java/com/example/ayudapy/MapsActivity.kt new file mode 100644 index 0000000..b4d3efb --- /dev/null +++ b/app/src/main/java/com/example/ayudapy/MapsActivity.kt @@ -0,0 +1,396 @@ +package com.example.ayudapy + +import android.Manifest +import android.content.Intent +import android.content.pm.PackageManager +import android.database.Observable +import android.location.Location +import android.net.Uri +import android.os.Build +import android.os.Bundle +import android.provider.ContactsContract +import android.util.Log +import android.view.View +import android.widget.Button +import android.widget.Toast +import androidx.annotation.RequiresApi +import androidx.appcompat.app.AlertDialog +import androidx.appcompat.app.AppCompatActivity +import androidx.core.app.ActivityCompat +import androidx.core.content.ContextCompat +import com.google.android.gms.location.FusedLocationProviderClient +import com.google.android.gms.location.LocationServices +import com.google.android.gms.maps.CameraUpdateFactory +import com.google.android.gms.maps.GoogleMap +import com.google.android.gms.maps.OnMapReadyCallback +import com.google.android.gms.maps.SupportMapFragment +import com.google.android.gms.maps.model.BitmapDescriptorFactory +import com.google.android.gms.maps.model.LatLng +import com.google.android.gms.maps.model.Marker +import com.google.android.gms.maps.model.MarkerOptions +import com.google.android.material.bottomsheet.BottomSheetDialog +import kotlinx.android.synthetic.main.alert_dialog_contacto.view.* +import kotlinx.android.synthetic.main.fragment_pedido.view.* +import retrofit2.Call +import retrofit2.Callback +import retrofit2.Response +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class MapsActivity : AppCompatActivity(), OnMapReadyCallback, GoogleMap.OnMarkerClickListener { + + private lateinit var mMap: GoogleMap + private lateinit var lastLocation: Location + private lateinit var fusedLocationClient: FusedLocationProviderClient + internal lateinit var infoButton: Button + private var selectedMarker:Marker?=null + + companion object{ + private const val LOCATION_PERMISSION_REQUEST_CODE=1 + } + + + val PERMISSIONS_REQUEST_READ_CONTACTS = 100 + + private val PROJECTION = arrayOf( + ContactsContract.CommonDataKinds.Phone.CONTACT_ID, + ContactsContract.Contacts.DISPLAY_NAME, + ContactsContract.CommonDataKinds.Phone.NUMBER + ) + + private val markerClickListener = object: GoogleMap.OnMarkerClickListener{ + override fun onMarkerClick(marker: Marker?):Boolean{ + if(marker == selectedMarker){ + selectedMarker=null + return true + } + selectedMarker =marker + return false + } + } + private var pedidoDatabase:PedidoDataBase? = null + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_maps) + + // Obtain the SupportMapFragment and get notified when the map is ready to be used. + val mapFragment = supportFragmentManager + .findFragmentById(R.id.map) as SupportMapFragment + mapFragment.getMapAsync(this) + + fusedLocationClient = LocationServices.getFusedLocationProviderClient(this) + + //intent para mandar a la siguiente pantalla el boton + val myLayout: View = findViewById(R.id.menu_layout) // root View id from that link + + val myView: View = myLayout.findViewById(R.id.info_button) + val ayudenme_button: View = myLayout.findViewById(R.id.help_button) + + + myView.setOnClickListener { + Toast.makeText(this@MapsActivity, "Boton de info probar", Toast.LENGTH_SHORT).show() + val i = Intent(this, InfoActivity::class.java) + startActivity(i) + + + } + + ayudenme_button.setOnClickListener { + Toast.makeText(this@MapsActivity, "Boton de info probar ayudenme", Toast.LENGTH_SHORT).show() + val url = "https://ayudapy.org/recibir" + val i = Intent(Intent.ACTION_VIEW) + i.data = Uri.parse(url) + startActivity(i) + + } + + //agregar permiso para llamar + val permissionCheck: Int = ContextCompat.checkSelfPermission( + this, Manifest.permission.CALL_PHONE + ) + if (permissionCheck != PackageManager.PERMISSION_GRANTED) { + Log.i("Mensaje", "No se tiene permiso para realizar llamadas telefónicas.") + ActivityCompat.requestPermissions( + this, + arrayOf(Manifest.permission.CALL_PHONE), + 225 + ) + } else { + Log.i("Mensaje", "Se tiene permiso!") + } + + pedidoDatabase = PedidoDataBase.getInstance(this) + } + + + /** + * Manipulates the map once available. + * This callback is triggered when the map is ready to be used. + * This is where we can add markers or lines, add listeners or move the camera. In this case, + * we just add a marker near Sydney, Australia. + * If Google Play services is not installed on the device, the user will be prompted to install + * it inside the SupportMapFragment. This method will only be triggered once the user has + * installed Google Play services and returned to the app. + */ + override fun onMapReady(googleMap: GoogleMap) { + mMap = googleMap + + // Add a marker in Sydney and move the camera + /* val sydney = LatLng(-34.0, 151.0) + mMap.addMarker(MarkerOptions().position(sydney).title("Marker in Sydney")) + mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 15f))*/ + + mMap.setOnMarkerClickListener(this) + mMap.uiSettings.isZoomControlsEnabled = true + + setup() + + + ApiService.redditClient.getListaCentro(15, 0).enqueue( + object: Callback { + override fun onFailure(call: Call, t: Throwable) { + t.printStackTrace() + } + + override fun onResponse(call: Call, response: Response) { + if (response.isSuccessful) { + val listaCentro = response.body() + val CentroDeAyudas = listaCentro!!.results + + + var item = Int + for( item in CentroDeAyudas.indices ){ + var name=listaCentro.results[item].name + var lat =listaCentro.results[item].location.coordinates + println("Este es el nombre $name") + println("Este son coordenadas $lat") + mMap.addMarker( + MarkerOptions() + .position(LatLng(lat[1],lat[0])) + .title(name) + .icon(BitmapDescriptorFactory.fromResource(R.drawable.centro_donacion)) + ) + } + + //print("Este es el centro ${CentroDeAyudas.size}") + //Log.d("centro","$CentroDeAyudas") + + + }else{ + + Toast.makeText(this@MapsActivity, "NO HUBO RESPUESTA EXITOSA", Toast.LENGTH_SHORT).show() + } + } + } + ) + + ApiService.stackClient.getListaPedidos(15, 0).enqueue( + object: Callback { + override fun onFailure(call: Call, t: Throwable) { + t.printStackTrace() + } + + @RequiresApi(Build.VERSION_CODES.O) + override fun onResponse(call: Call, response: Response) { + if (response.isSuccessful) { + val listaPedidos = response.body() + val PedidosDeAyudas = listaPedidos!!.features + + var fec_actual = LocalDateTime.now() + var fec_actual_formato = DateTimeFormatter.ofPattern("yyyy-MM-dd") + var fec_actual_formateado = fec_actual.format(fec_actual_formato) + //print("La fecha es: $fec_actual_formateado") + for( item in PedidosDeAyudas.indices ){ + + var name=listaPedidos.features[item].properties.name + var id=listaPedidos.features[item].properties.pk.toInt() + var lat =listaPedidos.features[item].geometry.coordinates + //println("Este es el nombre $name") + //println("Este son coordenadas $lat") + // val bounds = LatLngBounds.Builder()//Prueba Bounds + mMap.addMarker( + MarkerOptions() + .position(LatLng(lat[1],lat[0])) + .title(name) + .snippet(id.toString()) + .icon(BitmapDescriptorFactory.fromResource(R.drawable.pedido) + ) + ) + + //bounds.include(LatLng(lat[1],lat[0])) + // moveCamera(CameraUpdateFactory.newLatLngBounds(bounds.build(), 50)) + // println("Este es el id sin hacer clic $id") + mMap.setOnMarkerClickListener {marker -> + var marcador = marker.snippet + // var filtrarMarcador = marcador.replace("m","") + // var idMarcador = filtrarMarcador.toInt() + //println("Este es el marcador filtrado ${marcador.replace("m","")}") + //println("Este es el id Marcador $idMarcador") + Toast.makeText(this@MapsActivity, "Este es el marker $marcador", Toast.LENGTH_SHORT).show() + callApiDetalle(marcador.toInt()) + true + } + + }//termina el for + + }else{ + + Toast.makeText(this@MapsActivity, "NO HUBO RESPUESTA EXITOSA", Toast.LENGTH_SHORT).show() + } + } + } + ) + + + } + + + //llamar con la función a la siguiente api para los detalles de acuerdo al parametro ingresado, es decir de acuerdo a la url pk + fun callApiDetalle(id: Int){ + ApiService.pedidoDetalle.getPedidoDetalle(id).enqueue( + object: Callback { + override fun onFailure(call: Call, t: Throwable) { + t.printStackTrace() + } + + @RequiresApi(Build.VERSION_CODES.O) + override fun onResponse(call: Call, response: Response) { + if (response.isSuccessful) { + val pedidoDetalle = response.body() + + println("Probar pedido de Detalle $pedidoDetalle") + + //fecha_publicado = findViewById(R.id.fecha_publicado) + // Publicado el 12 de abril de 2020 a las 00:04 + + val dialog = BottomSheetDialog(this@MapsActivity) + val view = layoutInflater.inflate(R.layout.fragment_pedido,null) + dialog.setContentView(view) + if (pedidoDetalle != null) { + view.fecha_publicado.setText("Publicado el ${pedidoDetalle.added}") + view.direccion_id.setText(pedidoDetalle.address) + view.contacto_id.setText(pedidoDetalle.name) + view.contacto_numero.setText(pedidoDetalle.phone) + view.pedido_id.setText(pedidoDetalle.title) + view.mensaje_id.setText(pedidoDetalle.message) + } + dialog.show() + view.llegar_id.setOnClickListener{ + Toast.makeText(this@MapsActivity, "Boton de como llegar", Toast.LENGTH_SHORT).show() + } + view.contacto_numero.setOnClickListener{ + val dialogo = layoutInflater.inflate(R.layout.alert_dialog_contacto,null) + val mBuilder =AlertDialog.Builder(this@MapsActivity) + .setView(dialogo) + .setTitle("¿Desea llamar o enviar mensaje?") + val mAlertDialog = mBuilder.show() + + dialogo.llamar_contacto.setOnClickListener{ + Toast.makeText(this@MapsActivity, "boton alerta llamar contacto", Toast.LENGTH_SHORT).show() + val i = Intent(Intent.ACTION_CALL) + i.data = Uri.parse("tel:${pedidoDetalle?.phone}") + if (ActivityCompat.checkSelfPermission( + this@MapsActivity, + Manifest.permission.CALL_PHONE + ) != PackageManager.PERMISSION_GRANTED + ) { + // TODO: Consider calling + // ActivityCompat#requestPermissions + // here to request the missing permissions, and then overriding + // public void onRequestPermissionsResult(int requestCode, String[] permissions, + // int[] grantResults) + // to handle the case where the user grants the permission. See the documentation + // for ActivityCompat#requestPermissions for more details. + return@setOnClickListener + } + startActivity(i) + // mAlertDialog.dismiss() + } + + dialogo.msm_whatsapp.setOnClickListener { + Toast.makeText(this@MapsActivity, "boton alerta enviar mensaje whatsapp", Toast.LENGTH_SHORT).show() + //marcar que no existe el numero en mis contactos + val msj = "Mi mensaje es abcdef 1234567890" + val numeroTel = pedidoDetalle?.phone + val intent = Intent(Intent.ACTION_VIEW) + val uri = + "whatsapp://send?phone=$numeroTel&text=$msj" + intent.data = Uri.parse(uri) + startActivity(intent) + } + + Toast.makeText(this@MapsActivity, "Numero de contacto ${pedidoDetalle?.phone}", Toast.LENGTH_SHORT).show() + + } + //Guardar los datos de la lista pendiente, usando la librería Room + view.pendiente_button.setOnClickListener{ + Toast.makeText(this@MapsActivity, "Boton de pendiente ", Toast.LENGTH_SHORT).show() + //InsertTask(this, chapterObj).execute() + /* insertToDb(PedidoSave(pedidoDetalle!!.id, + pedidoDetalle.title,pedidoDetalle.message,pedidoDetalle.name,pedidoDetalle.phone, + pedidoDetalle.address,pedidoDetalle.added))*/ + + } + + view.listo_button.setOnClickListener{ + Toast.makeText(this@MapsActivity, "boton de listo", Toast.LENGTH_SHORT).show() + } + + + Toast.makeText(this@MapsActivity, "Probar clic nuevo ${id}", Toast.LENGTH_SHORT).show() + + + }else{ + + Toast.makeText(this@MapsActivity, "El id es : $id", Toast.LENGTH_SHORT).show() + } + } + } + ) + } + + /* fun insertToDb(pedido:PedidoSave){ + + }*/ + + //permiso para acceder a la ubicacion del dispositvo + private fun setup(){ + if(ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED){ + ActivityCompat.requestPermissions(this, + arrayOf(android.Manifest.permission.ACCESS_FINE_LOCATION),LOCATION_PERMISSION_REQUEST_CODE) + return + } + + mMap.isMyLocationEnabled= true + + fusedLocationClient.lastLocation.addOnSuccessListener(this){ location -> + + if(location != null){ + + + + lastLocation = location + val currentLatLong = LatLng(location.latitude, location.longitude) + mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(currentLatLong, 18f)) + } + + } + } + + override fun onMarkerClick(p0: Marker?): Boolean = false + + /* + * CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngBounds(builder.build(), padding); +try { + map.moveCamera(cameraUpdate); +} catch (Exception e) { + int width = getResources().getDisplayMetrics().widthPixels; + int height = getResources().getDisplayMetrics().heightPixels; + cameraUpdate = CameraUpdateFactory.newLatLngBounds(builder.build(), width, height, padding); + map.moveCamera(cameraUpdate); +}*/ + + + +} \ No newline at end of file diff --git a/app/src/main/java/com/example/ayudapy/Pedido.kt b/app/src/main/java/com/example/ayudapy/Pedido.kt new file mode 100644 index 0000000..acfe878 --- /dev/null +++ b/app/src/main/java/com/example/ayudapy/Pedido.kt @@ -0,0 +1,67 @@ +package com.example.ayudapy + +import android.content.Context +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import com.google.android.material.bottomsheet.BottomSheetDialogFragment + +// TODO: Rename parameter arguments, choose names that match +// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER +private const val ARG_PARAM1 = "param1" +private const val ARG_PARAM2 = "param2" + +/** + * A simple [Fragment] subclass. + * Use the [Pedido.newInstance] factory method to + * create an instance of this fragment. + */ +class Pedido : Fragment() { + // TODO: Rename and change types of parameters + private var param1: String? = null + private var param2: String? = null + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + arguments?.let { + param1 = it.getString(ARG_PARAM1) + param2 = it.getString(ARG_PARAM2) + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_pedido, container, false) + } + + companion object { + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment Pedido. + */ + // TODO: Rename and change types and number of parameters + @JvmStatic + fun newInstance(param1: String, param2: String) = + Pedido().apply { + arguments = Bundle().apply { + putString(ARG_PARAM1, param1) + putString(ARG_PARAM2, param2) + } + } + } +} + + + + + + diff --git a/app/src/main/java/com/example/ayudapy/PedidoDetalle.kt b/app/src/main/java/com/example/ayudapy/PedidoDetalle.kt new file mode 100644 index 0000000..54e1591 --- /dev/null +++ b/app/src/main/java/com/example/ayudapy/PedidoDetalle.kt @@ -0,0 +1,33 @@ +package com.example.ayudapy + +data class PedidoDetalle ( + val count: Long, + val next: String, + val previous: Any? = null, + val results: List +) + +data class Resultado ( + val id: Long, + val title: String, + val message: String, + val name: String, + val phone: String, + val address: String, + val city: String, + val location: locacion, + val picture: String? = null, + val active: Boolean, + val added: String +) + +data class locacion ( + val type: Type, + val coordinates: List +) + +enum class Type { + Point +} + + diff --git a/app/src/main/java/com/example/ayudapy/PedidosAyuda.kt b/app/src/main/java/com/example/ayudapy/PedidosAyuda.kt new file mode 100644 index 0000000..06ccc80 --- /dev/null +++ b/app/src/main/java/com/example/ayudapy/PedidosAyuda.kt @@ -0,0 +1,34 @@ +package com.example.ayudapy + +data class PedidosAyuda ( + val type: String, + val features: List +) + +data class Feature ( + val type: FeatureType, + val geometry: Geometry, + val properties: Properties +) + +data class Geometry ( + val type: GeometryType, + val coordinates: List +) + +enum class GeometryType { + Point +} + +data class Properties ( + val pk: Long, + val title: String, + val name: String, + val added: String +) + +enum class FeatureType { + Feature +} + + diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-xhdpi/centro_donacion.png b/app/src/main/res/drawable-xhdpi/centro_donacion.png new file mode 100644 index 0000000..996553c Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/centro_donacion.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ayuda.png b/app/src/main/res/drawable-xxhdpi/ayuda.png new file mode 100644 index 0000000..dcaeded Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ayuda.png differ diff --git a/app/src/main/res/drawable-xxhdpi/icon_listo_unchecked.png b/app/src/main/res/drawable-xxhdpi/icon_listo_unchecked.png new file mode 100644 index 0000000..09d389a Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/icon_listo_unchecked.png differ diff --git a/app/src/main/res/drawable-xxhdpi/icon_pendientes_unchecked.png b/app/src/main/res/drawable-xxhdpi/icon_pendientes_unchecked.png new file mode 100644 index 0000000..27c894f Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/icon_pendientes_unchecked.png differ diff --git a/app/src/main/res/drawable-xxhdpi/infobutton.png b/app/src/main/res/drawable-xxhdpi/infobutton.png new file mode 100644 index 0000000..8372979 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/infobutton.png differ diff --git a/app/src/main/res/drawable-xxhdpi/logoheader.png b/app/src/main/res/drawable-xxhdpi/logoheader.png new file mode 100644 index 0000000..f038d9e Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/logoheader.png differ diff --git a/app/src/main/res/drawable-xxhdpi/pedido.png b/app/src/main/res/drawable-xxhdpi/pedido.png new file mode 100644 index 0000000..c9b2ba8 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/pedido.png differ diff --git a/app/src/main/res/drawable-xxhdpi/pendientesbutton.png b/app/src/main/res/drawable-xxhdpi/pendientesbutton.png new file mode 100644 index 0000000..c2e3274 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/pendientesbutton.png differ diff --git a/app/src/main/res/drawable-xxhdpi/pin_favorito.png b/app/src/main/res/drawable-xxhdpi/pin_favorito.png new file mode 100644 index 0000000..be457c4 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/pin_favorito.png differ diff --git a/app/src/main/res/drawable/background_gradient.xml b/app/src/main/res/drawable/background_gradient.xml new file mode 100644 index 0000000..faf49ea --- /dev/null +++ b/app/src/main/res/drawable/background_gradient.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/background_round.xml b/app/src/main/res/drawable/background_round.xml new file mode 100644 index 0000000..96759ee --- /dev/null +++ b/app/src/main/res/drawable/background_round.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_maps.xml b/app/src/main/res/layout/activity_maps.xml new file mode 100644 index 0000000..8d009ff --- /dev/null +++ b/app/src/main/res/layout/activity_maps.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/alert_dialog.xml b/app/src/main/res/layout/alert_dialog.xml new file mode 100644 index 0000000..61a4490 --- /dev/null +++ b/app/src/main/res/layout/alert_dialog.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/alert_dialog_contacto.xml b/app/src/main/res/layout/alert_dialog_contacto.xml new file mode 100644 index 0000000..3051787 --- /dev/null +++ b/app/src/main/res/layout/alert_dialog_contacto.xml @@ -0,0 +1,40 @@ + + + + + + +