diff --git a/app/build.gradle b/app/build.gradle index 75106ba..5c6b306 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,7 +8,7 @@ android { defaultConfig { applicationId "fr.sanchezm.attestationsCovid19" - minSdkVersion 21 + minSdkVersion 23 targetSdkVersion 29 versionCode 1 versionName "1.0" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7e5a220..3ff6c1a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,13 +2,16 @@ + + + + android:theme="@style/AppTheme.Light"> diff --git a/app/src/main/ic_launcher-playstore.png b/app/src/main/ic_launcher-playstore.png new file mode 100644 index 0000000..b02c9af Binary files /dev/null and b/app/src/main/ic_launcher-playstore.png differ diff --git a/app/src/main/java/fr/sanchezm/attestationsCovid19/MainActivity.kt b/app/src/main/java/fr/sanchezm/attestationsCovid19/MainActivity.kt index 2a9a3d6..1a0ff59 100644 --- a/app/src/main/java/fr/sanchezm/attestationsCovid19/MainActivity.kt +++ b/app/src/main/java/fr/sanchezm/attestationsCovid19/MainActivity.kt @@ -3,8 +3,6 @@ package fr.sanchezm.attestationsCovid19 import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.navigation.findNavController -import androidx.navigation.ui.AppBarConfiguration -import androidx.navigation.ui.setupActionBarWithNavController import androidx.navigation.ui.setupWithNavController import com.google.android.material.bottomnavigation.BottomNavigationView @@ -16,14 +14,8 @@ class MainActivity : AppCompatActivity() { val navView: BottomNavigationView = findViewById(R.id.nav_view) val navController = findNavController(R.id.nav_host_fragment) - // Passing each menu ID as a set of Ids because each - // menu should be considered as top level destinations. - val appBarConfiguration = AppBarConfiguration( - setOf( - R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications - ) - ) - setupActionBarWithNavController(navController, appBarConfiguration) + navView.setupWithNavController(navController) + navView.setBackgroundColor(resources.getColor(R.color.itemBackground, theme)) } -} +} \ No newline at end of file diff --git a/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/home/HomeFragment.kt b/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/add/AddFragment.kt similarity index 70% rename from app/src/main/java/fr/sanchezm/attestationsCovid19/ui/home/HomeFragment.kt rename to app/src/main/java/fr/sanchezm/attestationsCovid19/ui/add/AddFragment.kt index 8f1f0d2..7e7387c 100644 --- a/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/home/HomeFragment.kt +++ b/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/add/AddFragment.kt @@ -1,4 +1,4 @@ -package fr.sanchezm.attestationsCovid19.ui.home +package fr.sanchezm.attestationsCovid19.ui.add import android.os.Bundle import android.view.LayoutInflater @@ -10,9 +10,9 @@ import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProviders import fr.sanchezm.attestationsCovid19.R -class HomeFragment : Fragment() { +class AddFragment : Fragment() { - private lateinit var homeViewModel: HomeViewModel + private lateinit var homeViewModel: AddViewModel override fun onCreateView( inflater: LayoutInflater, @@ -20,8 +20,8 @@ class HomeFragment : Fragment() { savedInstanceState: Bundle? ): View? { homeViewModel = - ViewModelProviders.of(this).get(HomeViewModel::class.java) - val root = inflater.inflate(R.layout.fragment_home, container, false) + ViewModelProviders.of(this).get(AddViewModel::class.java) + val root = inflater.inflate(R.layout.fragment_add_attestation, container, false) val textView: TextView = root.findViewById(R.id.text_home) homeViewModel.text.observe(viewLifecycleOwner, Observer { textView.text = it diff --git a/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/home/HomeViewModel.kt b/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/add/AddViewModel.kt similarity index 62% rename from app/src/main/java/fr/sanchezm/attestationsCovid19/ui/home/HomeViewModel.kt rename to app/src/main/java/fr/sanchezm/attestationsCovid19/ui/add/AddViewModel.kt index 939149f..9f111d2 100644 --- a/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/home/HomeViewModel.kt +++ b/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/add/AddViewModel.kt @@ -1,13 +1,13 @@ -package fr.sanchezm.attestationsCovid19.ui.home +package fr.sanchezm.attestationsCovid19.ui.add import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -class HomeViewModel : ViewModel() { +class AddViewModel : ViewModel() { private val _text = MutableLiveData().apply { - value = "This is home Fragment" + value = "Fragment ajouter une attestation" } val text: LiveData = _text } \ No newline at end of file diff --git a/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/dashboard/DashboardFragment.kt b/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/attestations/AttestationsFragment.kt similarity index 67% rename from app/src/main/java/fr/sanchezm/attestationsCovid19/ui/dashboard/DashboardFragment.kt rename to app/src/main/java/fr/sanchezm/attestationsCovid19/ui/attestations/AttestationsFragment.kt index 50fda21..1aef0f2 100644 --- a/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/dashboard/DashboardFragment.kt +++ b/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/attestations/AttestationsFragment.kt @@ -1,4 +1,4 @@ -package fr.sanchezm.attestationsCovid19.ui.dashboard +package fr.sanchezm.attestationsCovid19.ui.attestations import android.os.Bundle import android.view.LayoutInflater @@ -10,9 +10,9 @@ import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProviders import fr.sanchezm.attestationsCovid19.R -class DashboardFragment : Fragment() { +class AttestationsFragment : Fragment() { - private lateinit var dashboardViewModel: DashboardViewModel + private lateinit var dashboardViewModel: AttestationsViewModel override fun onCreateView( inflater: LayoutInflater, @@ -20,8 +20,8 @@ class DashboardFragment : Fragment() { savedInstanceState: Bundle? ): View? { dashboardViewModel = - ViewModelProviders.of(this).get(DashboardViewModel::class.java) - val root = inflater.inflate(R.layout.fragment_dashboard, container, false) + ViewModelProviders.of(this).get(AttestationsViewModel::class.java) + val root = inflater.inflate(R.layout.fragment_attestations, container, false) val textView: TextView = root.findViewById(R.id.text_dashboard) dashboardViewModel.text.observe(viewLifecycleOwner, Observer { textView.text = it diff --git a/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/dashboard/DashboardViewModel.kt b/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/attestations/AttestationsViewModel.kt similarity index 72% rename from app/src/main/java/fr/sanchezm/attestationsCovid19/ui/dashboard/DashboardViewModel.kt rename to app/src/main/java/fr/sanchezm/attestationsCovid19/ui/attestations/AttestationsViewModel.kt index 220208c..f802a7f 100644 --- a/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/dashboard/DashboardViewModel.kt +++ b/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/attestations/AttestationsViewModel.kt @@ -1,10 +1,10 @@ -package fr.sanchezm.attestationsCovid19.ui.dashboard +package fr.sanchezm.attestationsCovid19.ui.attestations import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -class DashboardViewModel : ViewModel() { +class AttestationsViewModel : ViewModel() { private val _text = MutableLiveData().apply { value = "This is dashboard Fragment" diff --git a/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/notifications/NotificationsFragment.kt b/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/notifications/NotificationsFragment.kt deleted file mode 100644 index c9c01d4..0000000 --- a/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/notifications/NotificationsFragment.kt +++ /dev/null @@ -1,31 +0,0 @@ -package fr.sanchezm.attestationsCovid19.ui.notifications - -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import android.widget.TextView -import androidx.fragment.app.Fragment -import androidx.lifecycle.Observer -import androidx.lifecycle.ViewModelProviders -import fr.sanchezm.attestationsCovid19.R - -class NotificationsFragment : Fragment() { - - private lateinit var notificationsViewModel: NotificationsViewModel - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View? { - notificationsViewModel = - ViewModelProviders.of(this).get(NotificationsViewModel::class.java) - val root = inflater.inflate(R.layout.fragment_notifications, container, false) - val textView: TextView = root.findViewById(R.id.text_notifications) - notificationsViewModel.text.observe(viewLifecycleOwner, Observer { - textView.text = it - }) - return root - } -} diff --git a/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/notifications/NotificationsViewModel.kt b/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/notifications/NotificationsViewModel.kt deleted file mode 100644 index 6b46e6c..0000000 --- a/app/src/main/java/fr/sanchezm/attestationsCovid19/ui/notifications/NotificationsViewModel.kt +++ /dev/null @@ -1,13 +0,0 @@ -package fr.sanchezm.attestationsCovid19.ui.notifications - -import androidx.lifecycle.LiveData -import androidx.lifecycle.MutableLiveData -import androidx.lifecycle.ViewModel - -class NotificationsViewModel : ViewModel() { - - private val _text = MutableLiveData().apply { - value = "This is notifications Fragment" - } - val text: LiveData = _text -} \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_dashboard_black_24dp.xml b/app/src/main/res/drawable/ic_attestations_24dp.xml similarity index 63% rename from app/src/main/res/drawable/ic_dashboard_black_24dp.xml rename to app/src/main/res/drawable/ic_attestations_24dp.xml index 46fc8de..a0243c2 100644 --- a/app/src/main/res/drawable/ic_dashboard_black_24dp.xml +++ b/app/src/main/res/drawable/ic_attestations_24dp.xml @@ -5,5 +5,5 @@ android:viewportHeight="24.0"> + android:pathData="M10,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V8c0,-1.1 -0.9,-2 -2,-2h-8l-2,-2z" /> diff --git a/app/src/main/res/drawable/ic_home_black_24dp.xml b/app/src/main/res/drawable/ic_create_24dp.xml similarity index 55% rename from app/src/main/res/drawable/ic_home_black_24dp.xml rename to app/src/main/res/drawable/ic_create_24dp.xml index f8bb0b5..5505cc7 100644 --- a/app/src/main/res/drawable/ic_home_black_24dp.xml +++ b/app/src/main/res/drawable/ic_create_24dp.xml @@ -5,5 +5,5 @@ android:viewportHeight="24.0"> + android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z" /> diff --git a/app/src/main/res/drawable/ic_notifications_black_24dp.xml b/app/src/main/res/drawable/ic_notifications_black_24dp.xml deleted file mode 100644 index 78b75c3..0000000 --- a/app/src/main/res/drawable/ic_notifications_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 38c0aa8..6dc94d0 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -12,7 +12,7 @@ android:layout_height="wrap_content" android:layout_marginStart="0dp" android:layout_marginEnd="0dp" - android:background="?android:attr/windowBackground" + android:background="@color/colorPrimaryBackground" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_add_attestation.xml similarity index 90% rename from app/src/main/res/layout/fragment_home.xml rename to app/src/main/res/layout/fragment_add_attestation.xml index f3d9b08..2e7706c 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_add_attestation.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".ui.home.HomeFragment"> + tools:context=".ui.add.AddFragment"> + tools:context=".ui.attestations.AttestationsFragment"> - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/bottom_nav_menu.xml b/app/src/main/res/menu/bottom_nav_menu.xml index f4de4f8..5236ab6 100644 --- a/app/src/main/res/menu/bottom_nav_menu.xml +++ b/app/src/main/res/menu/bottom_nav_menu.xml @@ -1,19 +1,17 @@ - + + android:id="@+id/navigation_add" + android:icon="@drawable/ic_create_24dp" + android:title="@string/title_add" + app:itemBackground="?attr/itemBackground" /> - - + android:id="@+id/navigation_attestations" + android:icon="@drawable/ic_attestations_24dp" + android:title="@string/title_attestations" + app:itemBackground="?attr/itemBackground" /> diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index eca70cf..c9ad5f9 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index eca70cf..c9ad5f9 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png index a571e60..9418759 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png index 61da551..d1db237 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png index c41dd28..9a77947 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png index db5080a..4896373 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 6dba46d..95690c6 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..c9716cc Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png index da31a87..5834841 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 15ac681..75bcc32 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png index b216f2d..2c20f06 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index f25a419..8221df5 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..fd1684c Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png index e96783c..fb44143 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/navigation/mobile_navigation.xml b/app/src/main/res/navigation/mobile_navigation.xml index 3a1cb0b..2edb615 100644 --- a/app/src/main/res/navigation/mobile_navigation.xml +++ b/app/src/main/res/navigation/mobile_navigation.xml @@ -3,23 +3,18 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/mobile_navigation" - app:startDestination="@+id/navigation_home"> + app:startDestination="@+id/navigation_add"> + android:id="@+id/navigation_add" + android:name="fr.sanchezm.attestationsCovid19.ui.add.AddFragment" + android:label="@string/title_add" + tools:layout="@layout/fragment_add_attestation" /> + android:id="@+id/navigation_attestations" + android:name="fr.sanchezm.attestationsCovid19.ui.attestations.AttestationsFragment" + android:label="@string/title_attestations" + tools:layout="@layout/fragment_attestations" /> - diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 030098f..fa82310 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,6 +1,9 @@ - #6200EE - #3700B3 - #03DAC5 + #303841 + #262d34 + #585E66 + + #E3E3E3 + #FFF diff --git a/app/src/main/res/values/ic_launcher_background.xml b/app/src/main/res/values/ic_launcher_background.xml new file mode 100644 index 0000000..6ad2fa3 --- /dev/null +++ b/app/src/main/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #F3F3F3 + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5c70033..61108ff 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,5 @@ - My Application - Home - Dashboard - Notifications + Attestation de déplacement dérogatoire + Nouvelle Attestation + Mes Attestations diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 5885930..da40ce4 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,11 +1,18 @@ -