Merge pull request #2 from Aviortheking/first_view

first view
This commit is contained in:
Florian Bouillon 2021-02-19 17:09:43 +01:00 committed by GitHub
commit 8003095e5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 442 additions and 72 deletions

View File

@ -1,6 +1,8 @@
plugins { plugins {
id 'com.android.application' id 'com.android.application'
id 'kotlin-android' id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
} }
android { android {
@ -14,6 +16,14 @@ android {
versionName "1.0" versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments =
["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
} }
buildTypes { buildTypes {
@ -36,10 +46,13 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2' implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1' implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.2' // implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.2.2' // implementation 'com.google.android.material:material:1.3.0'
// implementation 'androidx.preference:preference:1.1.1'
// implementation 'androidx.navigation:navigation-fragment-ktx:2.2.2'
// implementation 'androidx.navigation:navigation-ui-ktx:2.2.2'
testImplementation 'junit:junit:4.+' testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
@ -57,6 +70,12 @@ dependencies {
implementation 'com.squareup.picasso:picasso:2.71828' implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.squareup.okhttp:okhttp:2.2.0' implementation 'com.squareup.okhttp:okhttp:2.2.0'
implementation 'com.squareup.okhttp:okhttp-urlconnection:2.2.0' implementation 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
// Database
implementation 'androidx.room:room-runtime:2.2.6'
implementation 'androidx.room:room-runtime:2.2.6'
kapt 'androidx.room:room-compiler:2.2.6'
} }
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'

View File

@ -0,0 +1,64 @@
{
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "8bdf84f071ba217eb3653e01500bac94",
"entities": [
{
"tableName": "country",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`countryId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `country` TEXT, `capitalCity` TEXT, `continent` TEXT, `code` TEXT, `date` INTEGER)",
"fields": [
{
"fieldPath": "countryId",
"columnName": "countryId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "country",
"columnName": "country",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "capitalCity",
"columnName": "capitalCity",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "continent",
"columnName": "continent",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "code",
"columnName": "code",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "date",
"columnName": "date",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"countryId"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"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, '8bdf84f071ba217eb3653e01500bac94')"
]
}
}

View File

@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.ca_contest"> package="com.example.ca_contest">
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application <application
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
@ -11,9 +12,7 @@
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
android:theme="@style/Theme.CA_Contest"> android:theme="@style/Theme.CA_Contest">
<activity <activity
android:name=".CountrySelectorActivity" android:name=".CountrySelectorActivity"></activity>
android:label="@string/title_activity_country_selector"
android:theme="@style/Theme.CA_Contest.NoActionBar"></activity>
<activity android:name=".MainActivity"> <activity android:name=".MainActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

View File

@ -5,11 +5,13 @@ import android.app.ProgressDialog
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.KeyEvent import android.view.KeyEvent
import android.view.MenuItem
import android.view.View import android.view.View
import android.widget.Button import android.widget.Button
import android.widget.EditText import android.widget.EditText
import android.widget.TextView import android.widget.TextView
import android.widget.Toast import android.widget.Toast
import androidx.appcompat.app.ActionBar
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
@ -70,5 +72,4 @@ class CountrySelectorActivity : AppCompatActivity() {
recycler.adapter?.notifyDataSetChanged() recycler.adapter?.notifyDataSetChanged()
} }
} }
} }

View File

@ -1,19 +1,43 @@
package com.example.ca_contest package com.example.ca_contest
import android.content.Intent import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle import android.os.Bundle
import android.widget.Button import android.view.View
import androidx.appcompat.app.ActionBar
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.example.ca_contest.adapters.HomepageCountryAdapter
import com.example.ca_contest.dao.AppDatabaseHelper
import java.util.*
class MainActivity : AppCompatActivity() { class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { private lateinit var countryAdapter: HomepageCountryAdapter
// private lateinit var imageView: ImageView
override fun onCreate(savedInstanceState: Bundle?)
{
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main) setContentView(R.layout.activity_main)
var btn = findViewById<Button>(R.id.btnStartAnotherActivity)
btn.setOnClickListener { val recycler = findViewById<RecyclerView>(R.id.list_country)
val intent = Intent(this, CountrySelectorActivity::class.java) recycler.setHasFixedSize(true)
// start your next activity
startActivity(intent) val layoutManager = LinearLayoutManager(this)
} recycler.layoutManager = layoutManager
val adapter = HomepageCountryAdapter(
AppDatabaseHelper
.getDatabase(this)
.countryDAO()
.getListCountry()
)
recycler.adapter = adapter
} }
}
fun addCountry(view: View) {
val intent = Intent(this, CountrySelectorActivity::class.java)
startActivity(intent)
}
}

View File

@ -0,0 +1,65 @@
package com.example.ca_contest.adapters
import com.example.ca_contest.R
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import android.widget.Toast
import androidx.recyclerview.widget.RecyclerView
import com.example.ca_contest.dao.Country
import com.squareup.picasso.Picasso
class HomepageCountryAdapter(list: List<Country>) : RecyclerView.Adapter<HomepageCountryAdapter.CountryViewHolder>() {
private var list: List<Country> = ArrayList()
init {
this.list = list
}
// Create the view Holder
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CountryViewHolder {
val viewMemo: View =
LayoutInflater.from(parent.context).inflate(R.layout.item_list, parent, false)
return CountryViewHolder(viewMemo)
}
// Bind each items
override fun onBindViewHolder(holder: CountryViewHolder, position: Int) {
holder.name?.text = list[position].country
holder.capital?.text = "Capital : " + list[position].capitalCity
holder.date?.text = list[position].date.toString()
holder.region?.text = "Continent : " + list[position].continent
Picasso.get()
.load("http://www.geognos.com/api/en/countries/flag/" + list[position].code + ".png")
.into(holder.image!!)
}
// Update the list
fun update(list: ArrayList<Country>) {
this.list = list
}
override fun getItemCount(): Int {
return list.size
}
inner class CountryViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
var name: TextView? = null
var capital: TextView? = null
var region: TextView? = null
var date: TextView? = null
var image: ImageView? = null
init {
name = itemView.findViewById(R.id.country)
date = itemView.findViewById(R.id.date)
capital = itemView.findViewById(R.id.capital)
region = itemView.findViewById(R.id.continent)
image = itemView.findViewById(R.id.image)
}
}
}

View File

@ -0,0 +1,13 @@
package com.example.ca_contest.dao
import com.example.ca_contest.libs.Converters
import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
@Database(entities = [Country::class], version = 1)
@TypeConverters(Converters::class)
abstract class AppDatabase : RoomDatabase()
{
abstract fun countryDAO(): CountryDAO
}

View File

@ -0,0 +1,28 @@
package com.example.ca_contest.dao
import android.content.Context
import androidx.room.Room
class AppDatabaseHelper(context: Context)
{
// Bloc de code "static" :
companion object
{
// Helper :
private lateinit var databaseHelper: AppDatabaseHelper
// Getter instance :
fun getDatabase(context: Context): AppDatabase
{
if (!::databaseHelper.isInitialized)
{
databaseHelper = AppDatabaseHelper(context)
}
return databaseHelper.database
}
}
// Base de données :
val database: AppDatabase = Room
.databaseBuilder(context.applicationContext, AppDatabase::class.java, "courses.db")
.allowMainThreadQueries()
.build()
}

View File

@ -0,0 +1,16 @@
package com.example.ca_contest.dao
import androidx.room.Entity
import androidx.room.PrimaryKey
import java.util.Date
@Entity(tableName = "country")
class Country(
@PrimaryKey(autoGenerate = true)
val countryId: Long = 0,
val country: String? = null,
val capitalCity: String? = null,
val continent: String? = null,
val code: String? = null,
val date: Date? = null
)

View File

@ -0,0 +1,15 @@
package com.example.ca_contest.dao
import androidx.room.*
@Dao
abstract class CountryDAO {
@Query("SELECT * FROM country")
abstract fun getListCountry(): List<Country>
@Insert
abstract fun insert(vararg country: Country)
@Update
abstract fun update(vararg country: Country)
@Delete
abstract fun delete(vararg country: Country)
}

View File

@ -0,0 +1,16 @@
package com.example.ca_contest.libs
import androidx.room.TypeConverter
import java.util.*
class Converters {
@TypeConverter
fun fromTimestamp(value: Long?): Date? {
return value?.let { Date(it) }
}
@TypeConverter
fun dateToTimestamp(date: Date?): Long? {
return date?.time?.toLong()
}
}

View File

@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#E5446E"
android:alpha="0.8">
<path
android:fillColor="@android:color/white"
android:pathData="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<stroke
android:width="1dp"
android:color="@color/black" />
<solid android:color="@color/white" />
</shape>
</item>
<item android:bottom="1dp">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="@color/white" />
</shape>
</item>
</layer-list>

View File

@ -8,33 +8,39 @@
<EditText <EditText
android:id="@+id/text" android:id="@+id/text"
android:layout_width="325dp" android:layout_width="0dp"
android:layout_height="40dp" android:layout_height="70dp"
android:background="#eee" android:background="#eee"
android:hint="Nom du pays" android:hint="Nom du pays"
android:paddingLeft="16px"
android:inputType="textCapSentences" android:inputType="textCapSentences"
android:maxLines="1" android:maxLines="1"
android:textColor="@android:color/black" android:textColor="@android:color/black"
app:layout_constraintEnd_toStartOf="@+id/validate"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<Button <Button
android:id="@+id/validate" android:id="@+id/validate"
android:layout_width="0dp" android:layout_width="70dp"
android:layout_height="40dp" android:layout_height="0dp"
android:background="#eee" android:background="#eee"
android:text="OK" android:text="OK"
android:textColor="@android:color/white" android:textColor="@android:color/white"
app:backgroundTint="@color/button"
app:layout_constraintBottom_toTopOf="@+id/list"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/text"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/list" android:id="@+id/list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text" app:layout_constraintEnd_toEndOf="parent"
tools:layout_editor_absoluteX="16dp" /> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/text" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -6,24 +6,28 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity"> tools:context=".MainActivity">
<TextView <androidx.recyclerview.widget.RecyclerView
android:layout_width="wrap_content" android:id="@+id/list_country"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:text="Hello World!" android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent" android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toTopOf="@+id/bouton_retour"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<Button <Button
android:id="@+id/btnStartAnotherActivity" android:id="@+id/bouton_retour"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="50dp"
android:layout_marginTop="48dp" android:background="#eee"
android:background="#397bb2" android:onClick="addCountry"
android:padding="20sp" android:text="AJOUTER UN PAYS"
android:text="Start Another Activity" android:textColor="@android:color/white"
android:textColor="#FFF" app:backgroundTint="@color/button"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent"
tools:layout_editor_absoluteX="86dp" /> app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -3,22 +3,30 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:background="@drawable/border_bottom">
<ImageView <ImageView
android:id="@+id/image" android:id="@+id/image"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="72dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_weight="1" android:layout_weight="1"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<TextView <TextView
android:id="@+id/name" android:id="@+id/name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:fontFamily="sans-serif-medium"
android:textColor="@android:color/black" android:textColor="@android:color/black"
android:textSize="24sp"
app:layout_constraintStart_toEndOf="@+id/image" app:layout_constraintStart_toEndOf="@+id/image"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:text="Nom Pays" /> tools:text="Nom Pays" />
@ -27,6 +35,7 @@
android:id="@+id/capital" android:id="@+id/capital"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:textColor="@android:color/black" android:textColor="@android:color/black"
app:layout_constraintStart_toEndOf="@+id/image" app:layout_constraintStart_toEndOf="@+id/image"
app:layout_constraintTop_toBottomOf="@+id/name" app:layout_constraintTop_toBottomOf="@+id/name"
@ -36,8 +45,10 @@
android:id="@+id/region" android:id="@+id/region"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="1dp" android:layout_marginStart="8dp"
android:layout_marginBottom="8dp"
android:textColor="@android:color/black" android:textColor="@android:color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/image" app:layout_constraintStart_toEndOf="@+id/image"
app:layout_constraintTop_toBottomOf="@+id/capital" app:layout_constraintTop_toBottomOf="@+id/capital"
tools:text="Continent: Continent" /> tools:text="Continent: Continent" />

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/border_bottom">
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="64dp"
android:layout_weight="1"
tools:srcCompat="@tools:sample/avatars" />
<TextView
android:id="@+id/date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="sans-serif-medium"
android:textAlignment="center"
android:textColor="@color/black"
tools:text="12 sep. 2018" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/linearLayout"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/country"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:textColor="@color/black"
android:textSize="24sp"
tools:text="France" />
<TextView
android:id="@+id/capital"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Capital: Paris" />
<TextView
android:id="@+id/continent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Continent: Europe" />
</LinearLayout>
<ImageButton
android:id="@+id/delete"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="@color/white"
android:onClick="deleteCountry"
android:src="@drawable/ic_trash"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_graph"
app:startDestination="@id/FirstFragment">
<fragment
android:id="@+id/FirstFragment"
android:name="com.example.ca_contest.FirstFragment"
android:label="@string/first_fragment_label"
tools:layout="@layout/fragment_first">
<action
android:id="@+id/action_FirstFragment_to_SecondFragment"
app:destination="@id/SecondFragment" />
</fragment>
<fragment
android:id="@+id/SecondFragment"
android:name="com.example.ca_contest.SecondFragment"
android:label="@string/second_fragment_label"
tools:layout="@layout/fragment_second">
<action
android:id="@+id/action_SecondFragment_to_FirstFragment"
app:destination="@id/FirstFragment" />
</fragment>
</navigation>

View File

@ -7,4 +7,7 @@
<color name="teal_700">#FF018786</color> <color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color> <color name="white">#FFFFFFFF</color>
<color name="button">#CD4E61</color>
<color name="validation">#2ECB60</color>
</resources> </resources>