Pārlūkot izejas kodu

Discover page en Android. Esta roto

Andres Ramos 4 gadus atpakaļ
vecāks
revīzija
36651c1725
52 mainītis faili ar 1202 papildinājumiem un 0 dzēšanām
  1. 15
    0
      Floradex20/.gitignore
  2. 3
    0
      Floradex20/.idea/.gitignore
  3. 1
    0
      Floradex20/.idea/.name
  4. 6
    0
      Floradex20/.idea/compiler.xml
  5. 7
    0
      Floradex20/.idea/dictionaries/andres.xml
  6. 22
    0
      Floradex20/.idea/gradle.xml
  7. 25
    0
      Floradex20/.idea/jarRepositories.xml
  8. 9
    0
      Floradex20/.idea/misc.xml
  9. 1
    0
      Floradex20/app/.gitignore
  10. 68
    0
      Floradex20/app/build.gradle
  11. 21
    0
      Floradex20/app/proguard-rules.pro
  12. 24
    0
      Floradex20/app/src/androidTest/java/com/example/floradex20/ExampleInstrumentedTest.kt
  13. 24
    0
      Floradex20/app/src/main/AndroidManifest.xml
  14. 20
    0
      Floradex20/app/src/main/java/com/example/floradex20/Data.kt
  15. 41
    0
      Floradex20/app/src/main/java/com/example/floradex20/FlowerAdapter.kt
  16. 7
    0
      Floradex20/app/src/main/java/com/example/floradex20/Links.kt
  17. 8
    0
      Floradex20/app/src/main/java/com/example/floradex20/LinksX.kt
  18. 90
    0
      Floradex20/app/src/main/java/com/example/floradex20/MainActivity.kt
  19. 5
    0
      Floradex20/app/src/main/java/com/example/floradex20/Meta.kt
  20. 7
    0
      Floradex20/app/src/main/java/com/example/floradex20/PlantListss.kt
  21. 11
    0
      Floradex20/app/src/main/java/com/example/floradex20/ToyFlower.kt
  22. 20
    0
      Floradex20/app/src/main/java/com/example/floradex20/TrefleService.kt
  23. Binārs
      Floradex20/app/src/main/res/drawable-v24/flor_de_maga.jpeg
  24. 30
    0
      Floradex20/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
  25. 170
    0
      Floradex20/app/src/main/res/drawable/ic_launcher_background.xml
  26. 123
    0
      Floradex20/app/src/main/res/layout/activity_main.xml
  27. 40
    0
      Floradex20/app/src/main/res/layout/layout.xml
  28. 5
    0
      Floradex20/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  29. 5
    0
      Floradex20/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  30. Binārs
      Floradex20/app/src/main/res/mipmap-hdpi/ic_launcher.png
  31. Binārs
      Floradex20/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  32. Binārs
      Floradex20/app/src/main/res/mipmap-mdpi/ic_launcher.png
  33. Binārs
      Floradex20/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  34. Binārs
      Floradex20/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  35. Binārs
      Floradex20/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  36. Binārs
      Floradex20/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  37. Binārs
      Floradex20/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  38. Binārs
      Floradex20/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  39. Binārs
      Floradex20/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  40. 16
    0
      Floradex20/app/src/main/res/values-night/themes.xml
  41. 10
    0
      Floradex20/app/src/main/res/values/Styles.xml
  42. 10
    0
      Floradex20/app/src/main/res/values/colors.xml
  43. 14
    0
      Floradex20/app/src/main/res/values/strings.xml
  44. 16
    0
      Floradex20/app/src/main/res/values/themes.xml
  45. 17
    0
      Floradex20/app/src/test/java/com/example/floradex20/ExampleUnitTest.kt
  46. 26
    0
      Floradex20/build.gradle
  47. 21
    0
      Floradex20/gradle.properties
  48. Binārs
      Floradex20/gradle/wrapper/gradle-wrapper.jar
  49. 6
    0
      Floradex20/gradle/wrapper/gradle-wrapper.properties
  50. 172
    0
      Floradex20/gradlew
  51. 84
    0
      Floradex20/gradlew.bat
  52. 2
    0
      Floradex20/settings.gradle

+ 15
- 0
Floradex20/.gitignore Parādīt failu

@@ -0,0 +1,15 @@
1
+*.iml
2
+.gradle
3
+/local.properties
4
+/.idea/caches
5
+/.idea/libraries
6
+/.idea/modules.xml
7
+/.idea/workspace.xml
8
+/.idea/navEditor.xml
9
+/.idea/assetWizardSettings.xml
10
+.DS_Store
11
+/build
12
+/captures
13
+.externalNativeBuild
14
+.cxx
15
+local.properties

+ 3
- 0
Floradex20/.idea/.gitignore Parādīt failu

@@ -0,0 +1,3 @@
1
+# Default ignored files
2
+/shelf/
3
+/workspace.xml

+ 1
- 0
Floradex20/.idea/.name Parādīt failu

@@ -0,0 +1 @@
1
+Floradex2.0

+ 6
- 0
Floradex20/.idea/compiler.xml Parādīt failu

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="CompilerConfiguration">
4
+    <bytecodeTargetLevel target="1.8" />
5
+  </component>
6
+</project>

+ 7
- 0
Floradex20/.idea/dictionaries/andres.xml Parādīt failu

@@ -0,0 +1,7 @@
1
+<component name="ProjectDictionaryState">
2
+  <dictionary name="andres">
3
+    <words>
4
+      <w>floradex</w>
5
+    </words>
6
+  </dictionary>
7
+</component>

+ 22
- 0
Floradex20/.idea/gradle.xml Parādīt failu

@@ -0,0 +1,22 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="GradleMigrationSettings" migrationVersion="1" />
4
+  <component name="GradleSettings">
5
+    <option name="linkedExternalProjectsSettings">
6
+      <GradleProjectSettings>
7
+        <option name="testRunner" value="PLATFORM" />
8
+        <option name="distributionType" value="DEFAULT_WRAPPED" />
9
+        <option name="externalProjectPath" value="$PROJECT_DIR$" />
10
+        <option name="gradleJvm" value="1.8" />
11
+        <option name="modules">
12
+          <set>
13
+            <option value="$PROJECT_DIR$" />
14
+            <option value="$PROJECT_DIR$/app" />
15
+          </set>
16
+        </option>
17
+        <option name="resolveModulePerSourceSet" value="false" />
18
+        <option name="useQualifiedModuleNames" value="true" />
19
+      </GradleProjectSettings>
20
+    </option>
21
+  </component>
22
+</project>

+ 25
- 0
Floradex20/.idea/jarRepositories.xml Parādīt failu

@@ -0,0 +1,25 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="RemoteRepositoriesConfiguration">
4
+    <remote-repository>
5
+      <option name="id" value="central" />
6
+      <option name="name" value="Maven Central repository" />
7
+      <option name="url" value="https://repo1.maven.org/maven2" />
8
+    </remote-repository>
9
+    <remote-repository>
10
+      <option name="id" value="jboss.community" />
11
+      <option name="name" value="JBoss Community repository" />
12
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
13
+    </remote-repository>
14
+    <remote-repository>
15
+      <option name="id" value="BintrayJCenter" />
16
+      <option name="name" value="BintrayJCenter" />
17
+      <option name="url" value="https://jcenter.bintray.com/" />
18
+    </remote-repository>
19
+    <remote-repository>
20
+      <option name="id" value="Google" />
21
+      <option name="name" value="Google" />
22
+      <option name="url" value="https://dl.google.com/dl/android/maven2/" />
23
+    </remote-repository>
24
+  </component>
25
+</project>

+ 9
- 0
Floradex20/.idea/misc.xml Parādīt failu

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

+ 1
- 0
Floradex20/app/.gitignore Parādīt failu

@@ -0,0 +1 @@
1
+/build

+ 68
- 0
Floradex20/app/build.gradle Parādīt failu

@@ -0,0 +1,68 @@
1
+plugins {
2
+    id 'com.android.application'
3
+    id 'kotlin-android'
4
+}
5
+
6
+android {
7
+    compileSdkVersion 30
8
+    buildToolsVersion "30.0.2"
9
+
10
+    defaultConfig {
11
+        applicationId "com.example.floradex20"
12
+        minSdkVersion 22
13
+        targetSdkVersion 30
14
+        versionCode 1
15
+        versionName "1.0"
16
+
17
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18
+    }
19
+
20
+    buildTypes {
21
+        release {
22
+            minifyEnabled false
23
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24
+        }
25
+    }
26
+    compileOptions {
27
+        sourceCompatibility JavaVersion.VERSION_1_8
28
+        targetCompatibility JavaVersion.VERSION_1_8
29
+    }
30
+    kotlinOptions {
31
+        jvmTarget = '1.8'
32
+    }
33
+}
34
+
35
+dependencies {
36
+
37
+    //noinspection GradleCompatible
38
+    implementation 'com.android.support:recyclerview-v7:28.0.0'
39
+    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
40
+    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
41
+    implementation 'com.squareup.okhttp3:okhttp:4.9.0'
42
+    implementation 'com.google.code.gson:gson:2.8.5'
43
+    implementation 'androidx.cardview:cardview:1.0.0'
44
+    implementation 'androidx.recyclerview:recyclerview:1.1.0'
45
+    implementation 'com.github.bumptech.glide:glide:4.10.0'
46
+    implementation 'androidx.appcompat:appcompat:1.2.0'//Glide
47
+    annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
48
+    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
49
+//    implementation 'androidx.core:core-ktx:1.3.2'
50
+    implementation 'androidx.appcompat:appcompat:1.2.0'
51
+    implementation 'com.google.android.material:material:1.2.1'
52
+//    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
53
+//    implementation 'androidx.fragment:fragment-ktx:1.2.4'
54
+//    implementation 'androidx.recyclerview:recyclerview:1.1.0'
55
+//    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
56
+//    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
57
+//    implementation fileTree(dir: "libs", include: ["*.jar"])
58
+//    testImplementation 'junit:junit:4.13.1'
59
+//    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
60
+//    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
61
+//    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
62
+//    implementation "com.squareup.picasso:picasso:2.71828"
63
+//    implementation "org.jetbrains.anko:anko-common:0.9"
64
+//    implementation 'com.squareup.okhttp3:okhttp:4.9.0'
65
+//    implementation 'com.android.support:recyclerview-v7:28.0.0'
66
+
67
+
68
+}

+ 21
- 0
Floradex20/app/proguard-rules.pro Parādīt failu

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

+ 24
- 0
Floradex20/app/src/androidTest/java/com/example/floradex20/ExampleInstrumentedTest.kt Parādīt failu

@@ -0,0 +1,24 @@
1
+package com.example.floradex20
2
+
3
+import androidx.test.platform.app.InstrumentationRegistry
4
+import androidx.test.ext.junit.runners.AndroidJUnit4
5
+
6
+import org.junit.Test
7
+import org.junit.runner.RunWith
8
+
9
+import org.junit.Assert.*
10
+
11
+/**
12
+ * Instrumented test, which will execute on an Android device.
13
+ *
14
+ * See [testing documentation](http://d.android.com/tools/testing).
15
+ */
16
+@RunWith(AndroidJUnit4::class)
17
+class ExampleInstrumentedTest {
18
+    @Test
19
+    fun useAppContext() {
20
+        // Context of the app under test.
21
+        val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22
+        assertEquals("com.example.floradex20", appContext.packageName)
23
+    }
24
+}

+ 24
- 0
Floradex20/app/src/main/AndroidManifest.xml Parādīt failu

@@ -0,0 +1,24 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+    package="com.example.floradex20">
4
+
5
+    <uses-permission android:name="android.permission.INTERNET"/>
6
+
7
+    <application
8
+        android:allowBackup="true"
9
+        android:icon="@drawable/ic_launcher_background"
10
+        android:label="@string/app_name"
11
+        android:roundIcon="@drawable/ic_launcher_foreground"
12
+        android:supportsRtl="true"
13
+        android:theme="@style/AppTheme">
14
+
15
+        <activity android:name=".MainActivity">
16
+            <intent-filter>
17
+                <action android:name="android.intent.action.MAIN" />
18
+
19
+                <category android:name="android.intent.category.LAUNCHER" />
20
+            </intent-filter>
21
+        </activity>
22
+    </application>
23
+
24
+</manifest>

+ 20
- 0
Floradex20/app/src/main/java/com/example/floradex20/Data.kt Parādīt failu

@@ -0,0 +1,20 @@
1
+package com.example.floradex20
2
+
3
+data class Data(
4
+    val author: String,
5
+    val bibliography: String,
6
+    val common_name: String,
7
+    val family: String,
8
+    val family_common_name: String,
9
+    val genus: String,
10
+    val genus_id: Int,
11
+    val id: Int,
12
+    val image_url: String,
13
+    val links: Links,
14
+    val rank: String,
15
+    val scientific_name: String,
16
+    val slug: String,
17
+    val status: String,
18
+    val synonyms: List<String>,
19
+    val year: Int
20
+)

+ 41
- 0
Floradex20/app/src/main/java/com/example/floradex20/FlowerAdapter.kt Parādīt failu

@@ -0,0 +1,41 @@
1
+package com.example.floradex20
2
+
3
+import android.view.LayoutInflater
4
+import android.view.View
5
+import android.view.ViewGroup
6
+import android.widget.ImageView
7
+import android.widget.TextView
8
+import androidx.recyclerview.widget.RecyclerView
9
+
10
+class FlowerAdapter(val flowers: List<Data>): RecyclerView.Adapter<PlantViewHolder>() {
11
+    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PlantViewHolder {
12
+        val view = LayoutInflater.from(parent.context).inflate(R.layout.layout, parent, false)
13
+        return PlantViewHolder(view)
14
+    }
15
+
16
+    override fun getItemCount(): Int {
17
+        return flowers.size
18
+    }
19
+
20
+    override fun onBindViewHolder(holder: PlantViewHolder, position: Int) {
21
+        return holder.bind(flowers[position])
22
+    }
23
+}
24
+
25
+class PlantViewHolder(itemView : View): RecyclerView.ViewHolder(itemView){
26
+    private val photo:ImageView = itemView.findViewById(R.id.flower_photo)
27
+    private val title:TextView = itemView.findViewById(R.id.flower_name)
28
+//    private val overview:TextView = itemView.findViewById(R.id.movie_overview)
29
+//    private val rating:TextView = itemView.findViewById(R.id.movie_rating)
30
+
31
+    fun bind(plant: Data) {
32
+        //Pomer pa que salga foto de la planta
33
+//        photo.setImageResource(R.drawable.Flor_de_maga.jpeg)
34
+        title.text = "Name: "+plant.common_name
35
+//        overview.text = plant.overview
36
+//        rating.text = "Rating : "+plant.vote_average.toString()
37
+    }
38
+
39
+}
40
+
41
+

+ 7
- 0
Floradex20/app/src/main/java/com/example/floradex20/Links.kt Parādīt failu

@@ -0,0 +1,7 @@
1
+package com.example.floradex20
2
+
3
+data class Links(
4
+    val genus: String,
5
+    val plant: String,
6
+    val self: String
7
+)

+ 8
- 0
Floradex20/app/src/main/java/com/example/floradex20/LinksX.kt Parādīt failu

@@ -0,0 +1,8 @@
1
+package com.example.floradex20
2
+
3
+data class LinksX(
4
+    val first: String,
5
+    val last: String,
6
+    val next: String,
7
+    val self: String
8
+)

+ 90
- 0
Floradex20/app/src/main/java/com/example/floradex20/MainActivity.kt Parādīt failu

@@ -0,0 +1,90 @@
1
+package com.example.floradex20
2
+
3
+import android.app.Activity
4
+import android.os.Bundle
5
+import android.util.Log
6
+import android.widget.ArrayAdapter
7
+import android.widget.ImageView
8
+import android.widget.TextView
9
+import android.widget.Toast
10
+import androidx.appcompat.app.AppCompatActivity
11
+//import com.example.floradex20.R
12
+//import com.example.floradex20.Plant
13
+import com.example.floradex20.R
14
+//import com.squareup.picasso.Picasso
15
+import okhttp3.OkHttpClient
16
+import retrofit2.Call
17
+import retrofit2.Callback
18
+import retrofit2.Response
19
+import retrofit2.Retrofit
20
+import retrofit2.converter.gson.GsonConverterFactory
21
+//import android.support.v4.app.FragmentActivity
22
+import android.view.LayoutInflater
23
+import android.view.View
24
+import android.view.ViewGroup
25
+import androidx.fragment.app.FragmentActivity
26
+import androidx.recyclerview.widget.LinearLayoutManager
27
+import androidx.recyclerview.widget.RecyclerView
28
+import com.google.gson.Gson
29
+
30
+
31
+//Cosas para que lleguen las flores
32
+//private const val TOKEN: String = "cMyugCJvk-U_xoi31FVBgoEqZiuRnDYpP8fv8Vfiejg"
33
+private const val  BASE_URL = "https://trefle.io/"
34
+//var slug: String = "prunella-vulgaris"
35
+
36
+//Creo que mas cosas para que lleguen las flores
37
+object ServiceBuilder {
38
+
39
+    val client = OkHttpClient.Builder().build()
40
+
41
+    var retrofit: Retrofit = Retrofit.Builder()
42
+        .baseUrl(BASE_URL)
43
+        .addConverterFactory(GsonConverterFactory.create())
44
+        .client(client)
45
+        .build()
46
+
47
+    fun <T> buildService(service: Class<T>): T {
48
+        return retrofit.create(service)
49
+    }
50
+}
51
+
52
+
53
+//Main Activity
54
+class MainActivity : AppCompatActivity() {
55
+    private lateinit var recyclerView: RecyclerView
56
+//    private lateinit var viewAdapter: RecyclerView.Adapter<PlantList>
57
+//    private lateinit var viewManager: RecyclerView.LayoutManager
58
+
59
+
60
+    override fun onCreate(savedInstanceState: Bundle?) {
61
+        super.onCreate(savedInstanceState)
62
+        setContentView(R.layout.activity_main)
63
+
64
+        val request = ServiceBuilder.buildService(TrefleService::class.java)
65
+        val call : Call<PlantListss> = request.getPlants(getString(R.string.TOKEN))
66
+////        Log.i("Call Plant List", call.toString())
67
+        call.enqueue(object : Callback<PlantListss>{
68
+            override fun onResponse(call: Call<PlantListss>, response: Response<PlantListss>) {
69
+//                Log.i("response", response.body().toString())
70
+                if (response.isSuccessful){
71
+//                    Log.i("Status", "Respones fue succesful")
72
+                    recyclerView = findViewById<RecyclerView>(R.id.recyclerView)
73
+////                        progress_bar.visibility = View.GONE
74
+                    recyclerView.apply {
75
+//                        Log.i("velllllllllllllllllllll", response.body().toString())
76
+                        setHasFixedSize(true)
77
+//                        layoutManager = LinearLayoutManager(this@MainActivity)
78
+//                        adapter = FlowerAdapter(response.body()!!.data)
79
+//                        recyclerView.setAdapter(adapter)
80
+//                        recyclerView.setLayoutManager(layoutManager)
81
+                    }
82
+                }
83
+            }
84
+            override fun onFailure(call: Call<PlantListss>, t: Throwable) {
85
+                Toast.makeText(this@MainActivity, "${t.message}", Toast.LENGTH_SHORT).show()
86
+            }
87
+        })
88
+        }
89
+    }
90
+

+ 5
- 0
Floradex20/app/src/main/java/com/example/floradex20/Meta.kt Parādīt failu

@@ -0,0 +1,5 @@
1
+package com.example.floradex20
2
+
3
+data class Meta(
4
+    val total: Int
5
+)

+ 7
- 0
Floradex20/app/src/main/java/com/example/floradex20/PlantListss.kt Parādīt failu

@@ -0,0 +1,7 @@
1
+package com.example.floradex20
2
+
3
+data class PlantListss(
4
+    val `data`: List<Data>,
5
+    val links: LinksX,
6
+    val meta: Meta
7
+)

+ 11
- 0
Floradex20/app/src/main/java/com/example/floradex20/ToyFlower.kt Parādīt failu

@@ -0,0 +1,11 @@
1
+package com.example.floradex20
2
+
3
+
4
+data class ToyFlowerList(
5
+    val flo_list: List<ToyFlower>
6
+)
7
+
8
+data class ToyFlower(
9
+    val scientific_name : String,
10
+    val color: String
11
+)

+ 20
- 0
Floradex20/app/src/main/java/com/example/floradex20/TrefleService.kt Parādīt failu

@@ -0,0 +1,20 @@
1
+package com.example.floradex20
2
+
3
+import com.example.floradex20.PlantListss
4
+import retrofit2.Call
5
+import retrofit2.http.GET
6
+import retrofit2.http.Path
7
+import retrofit2.http.Query
8
+
9
+interface TrefleService {
10
+    @GET("/api/v1/plants/")
11
+    //Quite el id de la planta para recibir mas cosas
12
+    //Posiblemente se puede overload la funcion para q funcione sin id y con id
13
+    fun getPlants(@Query("token") token: String): Call<PlantListss>
14
+
15
+}
16
+
17
+
18
+
19
+
20
+//@Query("filter[id]") id: Int

Binārs
Floradex20/app/src/main/res/drawable-v24/flor_de_maga.jpeg Parādīt failu


+ 30
- 0
Floradex20/app/src/main/res/drawable-v24/ic_launcher_foreground.xml Parādīt failu

@@ -0,0 +1,30 @@
1
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
2
+    xmlns:aapt="http://schemas.android.com/aapt"
3
+    android:width="108dp"
4
+    android:height="108dp"
5
+    android:viewportWidth="108"
6
+    android:viewportHeight="108">
7
+    <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
8
+        <aapt:attr name="android:fillColor">
9
+            <gradient
10
+                android:endX="85.84757"
11
+                android:endY="92.4963"
12
+                android:startX="42.9492"
13
+                android:startY="49.59793"
14
+                android:type="linear">
15
+                <item
16
+                    android:color="#44000000"
17
+                    android:offset="0.0" />
18
+                <item
19
+                    android:color="#00000000"
20
+                    android:offset="1.0" />
21
+            </gradient>
22
+        </aapt:attr>
23
+    </path>
24
+    <path
25
+        android:fillColor="#FFFFFF"
26
+        android:fillType="nonZero"
27
+        android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
28
+        android:strokeWidth="1"
29
+        android:strokeColor="#00000000" />
30
+</vector>

+ 170
- 0
Floradex20/app/src/main/res/drawable/ic_launcher_background.xml Parādīt failu

@@ -0,0 +1,170 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:width="108dp"
4
+    android:height="108dp"
5
+    android:viewportWidth="108"
6
+    android:viewportHeight="108">
7
+    <path
8
+        android:fillColor="#3DDC84"
9
+        android:pathData="M0,0h108v108h-108z" />
10
+    <path
11
+        android:fillColor="#00000000"
12
+        android:pathData="M9,0L9,108"
13
+        android:strokeWidth="0.8"
14
+        android:strokeColor="#33FFFFFF" />
15
+    <path
16
+        android:fillColor="#00000000"
17
+        android:pathData="M19,0L19,108"
18
+        android:strokeWidth="0.8"
19
+        android:strokeColor="#33FFFFFF" />
20
+    <path
21
+        android:fillColor="#00000000"
22
+        android:pathData="M29,0L29,108"
23
+        android:strokeWidth="0.8"
24
+        android:strokeColor="#33FFFFFF" />
25
+    <path
26
+        android:fillColor="#00000000"
27
+        android:pathData="M39,0L39,108"
28
+        android:strokeWidth="0.8"
29
+        android:strokeColor="#33FFFFFF" />
30
+    <path
31
+        android:fillColor="#00000000"
32
+        android:pathData="M49,0L49,108"
33
+        android:strokeWidth="0.8"
34
+        android:strokeColor="#33FFFFFF" />
35
+    <path
36
+        android:fillColor="#00000000"
37
+        android:pathData="M59,0L59,108"
38
+        android:strokeWidth="0.8"
39
+        android:strokeColor="#33FFFFFF" />
40
+    <path
41
+        android:fillColor="#00000000"
42
+        android:pathData="M69,0L69,108"
43
+        android:strokeWidth="0.8"
44
+        android:strokeColor="#33FFFFFF" />
45
+    <path
46
+        android:fillColor="#00000000"
47
+        android:pathData="M79,0L79,108"
48
+        android:strokeWidth="0.8"
49
+        android:strokeColor="#33FFFFFF" />
50
+    <path
51
+        android:fillColor="#00000000"
52
+        android:pathData="M89,0L89,108"
53
+        android:strokeWidth="0.8"
54
+        android:strokeColor="#33FFFFFF" />
55
+    <path
56
+        android:fillColor="#00000000"
57
+        android:pathData="M99,0L99,108"
58
+        android:strokeWidth="0.8"
59
+        android:strokeColor="#33FFFFFF" />
60
+    <path
61
+        android:fillColor="#00000000"
62
+        android:pathData="M0,9L108,9"
63
+        android:strokeWidth="0.8"
64
+        android:strokeColor="#33FFFFFF" />
65
+    <path
66
+        android:fillColor="#00000000"
67
+        android:pathData="M0,19L108,19"
68
+        android:strokeWidth="0.8"
69
+        android:strokeColor="#33FFFFFF" />
70
+    <path
71
+        android:fillColor="#00000000"
72
+        android:pathData="M0,29L108,29"
73
+        android:strokeWidth="0.8"
74
+        android:strokeColor="#33FFFFFF" />
75
+    <path
76
+        android:fillColor="#00000000"
77
+        android:pathData="M0,39L108,39"
78
+        android:strokeWidth="0.8"
79
+        android:strokeColor="#33FFFFFF" />
80
+    <path
81
+        android:fillColor="#00000000"
82
+        android:pathData="M0,49L108,49"
83
+        android:strokeWidth="0.8"
84
+        android:strokeColor="#33FFFFFF" />
85
+    <path
86
+        android:fillColor="#00000000"
87
+        android:pathData="M0,59L108,59"
88
+        android:strokeWidth="0.8"
89
+        android:strokeColor="#33FFFFFF" />
90
+    <path
91
+        android:fillColor="#00000000"
92
+        android:pathData="M0,69L108,69"
93
+        android:strokeWidth="0.8"
94
+        android:strokeColor="#33FFFFFF" />
95
+    <path
96
+        android:fillColor="#00000000"
97
+        android:pathData="M0,79L108,79"
98
+        android:strokeWidth="0.8"
99
+        android:strokeColor="#33FFFFFF" />
100
+    <path
101
+        android:fillColor="#00000000"
102
+        android:pathData="M0,89L108,89"
103
+        android:strokeWidth="0.8"
104
+        android:strokeColor="#33FFFFFF" />
105
+    <path
106
+        android:fillColor="#00000000"
107
+        android:pathData="M0,99L108,99"
108
+        android:strokeWidth="0.8"
109
+        android:strokeColor="#33FFFFFF" />
110
+    <path
111
+        android:fillColor="#00000000"
112
+        android:pathData="M19,29L89,29"
113
+        android:strokeWidth="0.8"
114
+        android:strokeColor="#33FFFFFF" />
115
+    <path
116
+        android:fillColor="#00000000"
117
+        android:pathData="M19,39L89,39"
118
+        android:strokeWidth="0.8"
119
+        android:strokeColor="#33FFFFFF" />
120
+    <path
121
+        android:fillColor="#00000000"
122
+        android:pathData="M19,49L89,49"
123
+        android:strokeWidth="0.8"
124
+        android:strokeColor="#33FFFFFF" />
125
+    <path
126
+        android:fillColor="#00000000"
127
+        android:pathData="M19,59L89,59"
128
+        android:strokeWidth="0.8"
129
+        android:strokeColor="#33FFFFFF" />
130
+    <path
131
+        android:fillColor="#00000000"
132
+        android:pathData="M19,69L89,69"
133
+        android:strokeWidth="0.8"
134
+        android:strokeColor="#33FFFFFF" />
135
+    <path
136
+        android:fillColor="#00000000"
137
+        android:pathData="M19,79L89,79"
138
+        android:strokeWidth="0.8"
139
+        android:strokeColor="#33FFFFFF" />
140
+    <path
141
+        android:fillColor="#00000000"
142
+        android:pathData="M29,19L29,89"
143
+        android:strokeWidth="0.8"
144
+        android:strokeColor="#33FFFFFF" />
145
+    <path
146
+        android:fillColor="#00000000"
147
+        android:pathData="M39,19L39,89"
148
+        android:strokeWidth="0.8"
149
+        android:strokeColor="#33FFFFFF" />
150
+    <path
151
+        android:fillColor="#00000000"
152
+        android:pathData="M49,19L49,89"
153
+        android:strokeWidth="0.8"
154
+        android:strokeColor="#33FFFFFF" />
155
+    <path
156
+        android:fillColor="#00000000"
157
+        android:pathData="M59,19L59,89"
158
+        android:strokeWidth="0.8"
159
+        android:strokeColor="#33FFFFFF" />
160
+    <path
161
+        android:fillColor="#00000000"
162
+        android:pathData="M69,19L69,89"
163
+        android:strokeWidth="0.8"
164
+        android:strokeColor="#33FFFFFF" />
165
+    <path
166
+        android:fillColor="#00000000"
167
+        android:pathData="M79,19L79,89"
168
+        android:strokeWidth="0.8"
169
+        android:strokeColor="#33FFFFFF" />
170
+</vector>

+ 123
- 0
Floradex20/app/src/main/res/layout/activity_main.xml Parādīt failu

@@ -0,0 +1,123 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<RelativeLayout
3
+    xmlns:android="http://schemas.android.com/apk/res/android"
4
+    xmlns:app="http://schemas.android.com/apk/res-auto"
5
+    xmlns:tools="http://schemas.android.com/tools"
6
+    android:layout_width="match_parent"
7
+    android:layout_height="match_parent"
8
+    tools:context=".MainActivity">
9
+    <TextView
10
+        android:layout_centerHorizontal="true"
11
+        android:layout_width="wrap_content"
12
+        android:layout_height="wrap_content"
13
+        android:text="Floradex"
14
+        android:layout_margin="20dp"
15
+        android:id="@+id/title"
16
+        android:textSize="20sp"/>
17
+
18
+    <androidx.recyclerview.widget.RecyclerView
19
+        android:id="@+id/recyclerView"
20
+        android:layout_width="match_parent"
21
+        android:layout_height="wrap_content"
22
+        android:layout_margin="10dp"
23
+        android:layout_below="@+id/title" />
24
+
25
+    <ProgressBar
26
+        android:id="@+id/progress_bar"
27
+        style="@style/Widget.AppCompat.ProgressBar.Horizontal"
28
+        android:layout_width="match_parent"
29
+        android:layout_height="5dp"
30
+        android:scaleY="4"
31
+        android:indeterminateTint="@color/purple_200"
32
+        android:indeterminateBehavior="repeat"
33
+        android:indeterminate="true" />
34
+</RelativeLayout>
35
+
36
+    <!--<?xml version="1.0" encoding="utf-8"?>-->
37
+<!--<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"-->
38
+<!--    android:layout_width="match_parent"-->
39
+<!--    android:layout_height="match_parent"-->
40
+<!--    android:orientation="vertical" >-->
41
+<!--    <TextView android:id="@+id/text"-->
42
+<!--        android:layout_width="wrap_content"-->
43
+<!--        android:layout_height="wrap_content"-->
44
+<!--        android:text="Hello, I am a TextView" />-->
45
+<!--    <Button android:id="@+id/button"-->
46
+<!--        android:layout_width="wrap_content"-->
47
+<!--        android:layout_height="wrap_content"-->
48
+<!--        android:text="Hello, I am a Button" />-->
49
+<!--</LinearLayout>-->
50
+
51
+<!--<android.support.v7.widget.RecyclerView android:id="@+id/my_recycler_view"-->
52
+<!--    android:scrollbars="vertical"-->
53
+<!--    android:layout_width="match_parent"-->
54
+<!--    android:layout_height="match_parent"-->
55
+<!--    layout_height="8"-->
56
+<!--    xmlns:android="http://schemas.android.com/apk/res/android" />-->
57
+
58
+
59
+
60
+<!--    <TextView-->
61
+<!--        android:id="@+id/author"-->
62
+<!--        android:layout_width="wrap_content"-->
63
+<!--        android:layout_height="wrap_content"-->
64
+<!--        android:text="@string/author"-->
65
+<!--        android:textAppearance="@style/TextAppearance.AppCompat.Large"-->
66
+<!--        app:layout_constraintBottom_toBottomOf="parent"-->
67
+<!--        app:layout_constraintEnd_toEndOf="parent"-->
68
+<!--        app:layout_constraintHorizontal_bias="0.506"-->
69
+<!--        app:layout_constraintStart_toStartOf="parent"-->
70
+<!--        app:layout_constraintTop_toBottomOf="@+id/year"-->
71
+<!--        app:layout_constraintVertical_bias="0.239" />-->
72
+
73
+<!--    <TextView-->
74
+<!--        android:id="@+id/sci_name"-->
75
+<!--        android:layout_width="wrap_content"-->
76
+<!--        android:layout_height="wrap_content"-->
77
+<!--        android:text="@string/scientific_name"-->
78
+<!--        android:textAppearance="@style/TextAppearance.AppCompat.Large"-->
79
+<!--        app:layout_constraintBottom_toBottomOf="parent"-->
80
+<!--        app:layout_constraintEnd_toEndOf="parent"-->
81
+<!--        app:layout_constraintHorizontal_bias="0.507"-->
82
+<!--        app:layout_constraintStart_toStartOf="parent"-->
83
+<!--        app:layout_constraintTop_toBottomOf="@+id/plant_name"-->
84
+<!--        app:layout_constraintVertical_bias="0.155" />-->
85
+
86
+<!--    <TextView-->
87
+<!--        android:id="@+id/plant_name"-->
88
+<!--        android:layout_width="wrap_content"-->
89
+<!--        android:layout_height="wrap_content"-->
90
+<!--        android:text="@string/plant_name"-->
91
+<!--        android:textAppearance="@style/TextAppearance.AppCompat.Large"-->
92
+<!--        app:layout_constraintBottom_toBottomOf="parent"-->
93
+<!--        app:layout_constraintEnd_toEndOf="parent"-->
94
+<!--        app:layout_constraintHorizontal_bias="0.511"-->
95
+<!--        app:layout_constraintStart_toStartOf="parent"-->
96
+<!--        app:layout_constraintTop_toTopOf="parent"-->
97
+<!--        app:layout_constraintVertical_bias="0.57" />-->
98
+
99
+<!--    <TextView-->
100
+<!--        android:id="@+id/year"-->
101
+<!--        android:layout_width="wrap_content"-->
102
+<!--        android:layout_height="wrap_content"-->
103
+<!--        android:text="@string/year"-->
104
+<!--        android:textAppearance="@style/TextAppearance.AppCompat.Large"-->
105
+<!--        app:layout_constraintBottom_toBottomOf="parent"-->
106
+<!--        app:layout_constraintEnd_toEndOf="parent"-->
107
+<!--        app:layout_constraintHorizontal_bias="0.506"-->
108
+<!--        app:layout_constraintStart_toStartOf="parent"-->
109
+<!--        app:layout_constraintTop_toBottomOf="@+id/sci_name"-->
110
+<!--        app:layout_constraintVertical_bias="0.186" />-->
111
+
112
+<!--    <ImageView-->
113
+<!--        android:id="@+id/plantview"-->
114
+<!--        android:layout_width="wrap_content"-->
115
+<!--        android:layout_height="wrap_content"-->
116
+<!--        android:contentDescription="@string/plant_display"-->
117
+<!--        app:layout_constraintBottom_toTopOf="@+id/plant_name"-->
118
+<!--        app:layout_constraintEnd_toEndOf="parent"-->
119
+<!--        app:layout_constraintHorizontal_bias="0.498"-->
120
+<!--        app:layout_constraintStart_toStartOf="parent"-->
121
+<!--        app:layout_constraintTop_toTopOf="parent"-->
122
+<!--        app:srcCompat="@drawable/ic_launcher_foreground" />-->
123
+<!--</androidx.constraintlayout.widget.ConstraintLayout>-->

+ 40
- 0
Floradex20/app/src/main/res/layout/layout.xml Parādīt failu

@@ -0,0 +1,40 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+
4
+    android:orientation="vertical"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="wrap_content">
7
+
8
+    <androidx.cardview.widget.CardView
9
+
10
+        android:id="@+id/card_view"
11
+        android:layout_width="match_parent"
12
+        android:layout_height="wrap_content"
13
+        android:layout_margin="10dp">
14
+
15
+        <RelativeLayout
16
+            android:layout_width="match_parent"
17
+            android:layout_height="wrap_content">
18
+
19
+            <ImageView
20
+                android:layout_width="match_parent"
21
+                android:layout_height="200dp"
22
+                android:layout_centerHorizontal="true"
23
+                android:id="@+id/flower_photo"
24
+                android:src="@drawable/flor_de_maga"
25
+                android:contentDescription="Flower Image" />
26
+
27
+            <TextView
28
+                android:layout_below="@+id/flower_photo"
29
+                android:layout_width="wrap_content"
30
+                android:layout_height="wrap_content"
31
+                android:id="@+id/flower_name"
32
+                android:layout_margin="5dp"
33
+                android:textSize="15sp"
34
+                android:text="Flower Name "/>
35
+
36
+        </RelativeLayout>
37
+
38
+    </androidx.cardview.widget.CardView>
39
+
40
+</RelativeLayout>

+ 5
- 0
Floradex20/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml Parādīt failu

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

+ 5
- 0
Floradex20/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml Parādīt failu

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

Binārs
Floradex20/app/src/main/res/mipmap-hdpi/ic_launcher.png Parādīt failu


Binārs
Floradex20/app/src/main/res/mipmap-hdpi/ic_launcher_round.png Parādīt failu


Binārs
Floradex20/app/src/main/res/mipmap-mdpi/ic_launcher.png Parādīt failu


Binārs
Floradex20/app/src/main/res/mipmap-mdpi/ic_launcher_round.png Parādīt failu


Binārs
Floradex20/app/src/main/res/mipmap-xhdpi/ic_launcher.png Parādīt failu


Binārs
Floradex20/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png Parādīt failu


Binārs
Floradex20/app/src/main/res/mipmap-xxhdpi/ic_launcher.png Parādīt failu


Binārs
Floradex20/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png Parādīt failu


Binārs
Floradex20/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png Parādīt failu


Binārs
Floradex20/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png Parādīt failu


+ 16
- 0
Floradex20/app/src/main/res/values-night/themes.xml Parādīt failu

@@ -0,0 +1,16 @@
1
+<resources xmlns:tools="http://schemas.android.com/tools">
2
+    <!-- Base application theme. -->
3
+    <style name="Theme.Floradex20" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
4
+        <!-- Primary brand color. -->
5
+        <item name="colorPrimary">@color/purple_200</item>
6
+        <item name="colorPrimaryVariant">@color/purple_700</item>
7
+        <item name="colorOnPrimary">@color/black</item>
8
+        <!-- Secondary brand color. -->
9
+        <item name="colorSecondary">@color/teal_200</item>
10
+        <item name="colorSecondaryVariant">@color/teal_200</item>
11
+        <item name="colorOnSecondary">@color/black</item>
12
+        <!-- Status bar color. -->
13
+        <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
14
+        <!-- Customize your theme here. -->
15
+    </style>
16
+</resources>

+ 10
- 0
Floradex20/app/src/main/res/values/Styles.xml Parādīt failu

@@ -0,0 +1,10 @@
1
+<resources>
2
+    <!-- Base application theme. -->
3
+    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
4
+        <!-- Customize your theme here. -->
5
+<!--        <item name="colorPrimary">@color/colorPrimary</item>-->
6
+<!--        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>-->
7
+<!--        <item name="colorAccent">@color/colorAccent</item>-->
8
+    </style>
9
+
10
+</resources>

+ 10
- 0
Floradex20/app/src/main/res/values/colors.xml Parādīt failu

@@ -0,0 +1,10 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<resources>
3
+    <color name="purple_200">#FFBB86FC</color>
4
+    <color name="purple_500">#FF6200EE</color>
5
+    <color name="purple_700">#FF3700B3</color>
6
+    <color name="teal_200">#FF03DAC5</color>
7
+    <color name="teal_700">#FF018786</color>
8
+    <color name="black">#FF000000</color>
9
+    <color name="white">#FFFFFFFF</color>
10
+</resources>

+ 14
- 0
Floradex20/app/src/main/res/values/strings.xml Parādīt failu

@@ -0,0 +1,14 @@
1
+<resources>
2
+    <string name="app_name">Floradex20</string>
3
+    <string name="TOKEN">-wNgf1Lzwh__BwM_7iGot107arhbUbkFtFsCWtZI8lY</string>
4
+
5
+    <string name="BASE_URL">"https://trefle.io/"</string>
6
+
7
+    <string name="plant_name">Plant Name</string>
8
+    <string name="testuri">TestUri</string>
9
+    <string name="scientific_name">Scientific Name</string>
10
+    <string name="year">Year</string>
11
+    <string name="author">Author</string>
12
+    <string name="plant_display">Plant Display</string>
13
+
14
+</resources>

+ 16
- 0
Floradex20/app/src/main/res/values/themes.xml Parādīt failu

@@ -0,0 +1,16 @@
1
+<resources xmlns:tools="http://schemas.android.com/tools">
2
+    <!-- Base application theme. -->
3
+    <style name="Theme.Floradex20" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
4
+        <!-- Primary brand color. -->
5
+        <item name="colorPrimary">@color/purple_500</item>
6
+        <item name="colorPrimaryVariant">@color/purple_700</item>
7
+        <item name="colorOnPrimary">@color/white</item>
8
+        <!-- Secondary brand color. -->
9
+        <item name="colorSecondary">@color/teal_200</item>
10
+        <item name="colorSecondaryVariant">@color/teal_700</item>
11
+        <item name="colorOnSecondary">@color/black</item>
12
+        <!-- Status bar color. -->
13
+        <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
14
+        <!-- Customize your theme here. -->
15
+    </style>
16
+</resources>

+ 17
- 0
Floradex20/app/src/test/java/com/example/floradex20/ExampleUnitTest.kt Parādīt failu

@@ -0,0 +1,17 @@
1
+package com.example.floradex20
2
+
3
+import org.junit.Test
4
+
5
+import org.junit.Assert.*
6
+
7
+/**
8
+ * Example local unit test, which will execute on the development machine (host).
9
+ *
10
+ * See [testing documentation](http://d.android.com/tools/testing).
11
+ */
12
+class ExampleUnitTest {
13
+    @Test
14
+    fun addition_isCorrect() {
15
+        assertEquals(4, 2 + 2)
16
+    }
17
+}

+ 26
- 0
Floradex20/build.gradle Parādīt failu

@@ -0,0 +1,26 @@
1
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
2
+buildscript {
3
+    ext.kotlin_version = "1.4.10"
4
+    repositories {
5
+        google()
6
+        jcenter()
7
+    }
8
+    dependencies {
9
+        classpath 'com.android.tools.build:gradle:4.1.1'
10
+        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11
+
12
+        // NOTE: Do not place your application dependencies here; they belong
13
+        // in the individual module build.gradle files
14
+    }
15
+}
16
+
17
+allprojects {
18
+    repositories {
19
+        google()
20
+        jcenter()
21
+    }
22
+}
23
+
24
+task clean(type: Delete) {
25
+    delete rootProject.buildDir
26
+}

+ 21
- 0
Floradex20/gradle.properties Parādīt failu

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

Binārs
Floradex20/gradle/wrapper/gradle-wrapper.jar Parādīt failu


+ 6
- 0
Floradex20/gradle/wrapper/gradle-wrapper.properties Parādīt failu

@@ -0,0 +1,6 @@
1
+#Sat Nov 07 15:58:49 EST 2020
2
+distributionBase=GRADLE_USER_HOME
3
+distributionPath=wrapper/dists
4
+zipStoreBase=GRADLE_USER_HOME
5
+zipStorePath=wrapper/dists
6
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

+ 172
- 0
Floradex20/gradlew Parādīt failu

@@ -0,0 +1,172 @@
1
+#!/usr/bin/env sh
2
+
3
+##############################################################################
4
+##
5
+##  Gradle start up script for UN*X
6
+##
7
+##############################################################################
8
+
9
+# Attempt to set APP_HOME
10
+# Resolve links: $0 may be a link
11
+PRG="$0"
12
+# Need this for relative symlinks.
13
+while [ -h "$PRG" ] ; do
14
+    ls=`ls -ld "$PRG"`
15
+    link=`expr "$ls" : '.*-> \(.*\)$'`
16
+    if expr "$link" : '/.*' > /dev/null; then
17
+        PRG="$link"
18
+    else
19
+        PRG=`dirname "$PRG"`"/$link"
20
+    fi
21
+done
22
+SAVED="`pwd`"
23
+cd "`dirname \"$PRG\"`/" >/dev/null
24
+APP_HOME="`pwd -P`"
25
+cd "$SAVED" >/dev/null
26
+
27
+APP_NAME="Gradle"
28
+APP_BASE_NAME=`basename "$0"`
29
+
30
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31
+DEFAULT_JVM_OPTS=""
32
+
33
+# Use the maximum available, or set MAX_FD != -1 to use that value.
34
+MAX_FD="maximum"
35
+
36
+warn () {
37
+    echo "$*"
38
+}
39
+
40
+die () {
41
+    echo
42
+    echo "$*"
43
+    echo
44
+    exit 1
45
+}
46
+
47
+# OS specific support (must be 'true' or 'false').
48
+cygwin=false
49
+msys=false
50
+darwin=false
51
+nonstop=false
52
+case "`uname`" in
53
+  CYGWIN* )
54
+    cygwin=true
55
+    ;;
56
+  Darwin* )
57
+    darwin=true
58
+    ;;
59
+  MINGW* )
60
+    msys=true
61
+    ;;
62
+  NONSTOP* )
63
+    nonstop=true
64
+    ;;
65
+esac
66
+
67
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68
+
69
+# Determine the Java command to use to start the JVM.
70
+if [ -n "$JAVA_HOME" ] ; then
71
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72
+        # IBM's JDK on AIX uses strange locations for the executables
73
+        JAVACMD="$JAVA_HOME/jre/sh/java"
74
+    else
75
+        JAVACMD="$JAVA_HOME/bin/java"
76
+    fi
77
+    if [ ! -x "$JAVACMD" ] ; then
78
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79
+
80
+Please set the JAVA_HOME variable in your environment to match the
81
+location of your Java installation."
82
+    fi
83
+else
84
+    JAVACMD="java"
85
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86
+
87
+Please set the JAVA_HOME variable in your environment to match the
88
+location of your Java installation."
89
+fi
90
+
91
+# Increase the maximum file descriptors if we can.
92
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93
+    MAX_FD_LIMIT=`ulimit -H -n`
94
+    if [ $? -eq 0 ] ; then
95
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96
+            MAX_FD="$MAX_FD_LIMIT"
97
+        fi
98
+        ulimit -n $MAX_FD
99
+        if [ $? -ne 0 ] ; then
100
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
101
+        fi
102
+    else
103
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104
+    fi
105
+fi
106
+
107
+# For Darwin, add options to specify how the application appears in the dock
108
+if $darwin; then
109
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110
+fi
111
+
112
+# For Cygwin, switch paths to Windows format before running java
113
+if $cygwin ; then
114
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116
+    JAVACMD=`cygpath --unix "$JAVACMD"`
117
+
118
+    # We build the pattern for arguments to be converted via cygpath
119
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120
+    SEP=""
121
+    for dir in $ROOTDIRSRAW ; do
122
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
123
+        SEP="|"
124
+    done
125
+    OURCYGPATTERN="(^($ROOTDIRS))"
126
+    # Add a user-defined pattern to the cygpath arguments
127
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129
+    fi
130
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
131
+    i=0
132
+    for arg in "$@" ; do
133
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
135
+
136
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
137
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138
+        else
139
+            eval `echo args$i`="\"$arg\""
140
+        fi
141
+        i=$((i+1))
142
+    done
143
+    case $i in
144
+        (0) set -- ;;
145
+        (1) set -- "$args0" ;;
146
+        (2) set -- "$args0" "$args1" ;;
147
+        (3) set -- "$args0" "$args1" "$args2" ;;
148
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154
+    esac
155
+fi
156
+
157
+# Escape application args
158
+save () {
159
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160
+    echo " "
161
+}
162
+APP_ARGS=$(save "$@")
163
+
164
+# Collect all arguments for the java command, following the shell quoting and substitution rules
165
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166
+
167
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169
+  cd "$(dirname "$0")"
170
+fi
171
+
172
+exec "$JAVACMD" "$@"

+ 84
- 0
Floradex20/gradlew.bat Parādīt failu

@@ -0,0 +1,84 @@
1
+@if "%DEBUG%" == "" @echo off
2
+@rem ##########################################################################
3
+@rem
4
+@rem  Gradle startup script for Windows
5
+@rem
6
+@rem ##########################################################################
7
+
8
+@rem Set local scope for the variables with windows NT shell
9
+if "%OS%"=="Windows_NT" setlocal
10
+
11
+set DIRNAME=%~dp0
12
+if "%DIRNAME%" == "" set DIRNAME=.
13
+set APP_BASE_NAME=%~n0
14
+set APP_HOME=%DIRNAME%
15
+
16
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17
+set DEFAULT_JVM_OPTS=
18
+
19
+@rem Find java.exe
20
+if defined JAVA_HOME goto findJavaFromJavaHome
21
+
22
+set JAVA_EXE=java.exe
23
+%JAVA_EXE% -version >NUL 2>&1
24
+if "%ERRORLEVEL%" == "0" goto init
25
+
26
+echo.
27
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28
+echo.
29
+echo Please set the JAVA_HOME variable in your environment to match the
30
+echo location of your Java installation.
31
+
32
+goto fail
33
+
34
+:findJavaFromJavaHome
35
+set JAVA_HOME=%JAVA_HOME:"=%
36
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37
+
38
+if exist "%JAVA_EXE%" goto init
39
+
40
+echo.
41
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42
+echo.
43
+echo Please set the JAVA_HOME variable in your environment to match the
44
+echo location of your Java installation.
45
+
46
+goto fail
47
+
48
+:init
49
+@rem Get command-line arguments, handling Windows variants
50
+
51
+if not "%OS%" == "Windows_NT" goto win9xME_args
52
+
53
+:win9xME_args
54
+@rem Slurp the command line arguments.
55
+set CMD_LINE_ARGS=
56
+set _SKIP=2
57
+
58
+:win9xME_args_slurp
59
+if "x%~1" == "x" goto execute
60
+
61
+set CMD_LINE_ARGS=%*
62
+
63
+:execute
64
+@rem Setup the command line
65
+
66
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67
+
68
+@rem Execute Gradle
69
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70
+
71
+:end
72
+@rem End local scope for the variables with windows NT shell
73
+if "%ERRORLEVEL%"=="0" goto mainEnd
74
+
75
+:fail
76
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77
+rem the _cmd.exe /c_ return code!
78
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79
+exit /b 1
80
+
81
+:mainEnd
82
+if "%OS%"=="Windows_NT" endlocal
83
+
84
+:omega

+ 2
- 0
Floradex20/settings.gradle Parādīt failu

@@ -0,0 +1,2 @@
1
+include ':app'
2
+rootProject.name = "Floradex2.0"