mirror of
https://github.com/dzeiocom/OpenHealth.git
synced 2025-04-23 03:12:14 +00:00
feat: Add bottom navbar
This commit is contained in:
parent
939dcd24d3
commit
cd6337a1b6
@ -51,6 +51,15 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
||||
|
||||
setupActionBarWithNavController(navController, appBarConfiguration)
|
||||
|
||||
// binding.bottomNav.setOnItemSelectedListener {
|
||||
// val currentFragment = supportFragmentManager.fragments.last()
|
||||
// // currentFragment.javaClass.canonicalName
|
||||
//
|
||||
// navController.
|
||||
//
|
||||
// false
|
||||
// }
|
||||
|
||||
createNotificationChannel()
|
||||
|
||||
// Services
|
||||
|
@ -105,7 +105,12 @@ abstract class Extension {
|
||||
*
|
||||
* But it will only be launched if grantResults[0] == PackageManager.PERMISSION_GRANTED
|
||||
*/
|
||||
open fun onRequestPermissionResult(requestCode: Int, permission: Array<String>, grantResult: IntArray) {}
|
||||
open fun onRequestPermissionResult(
|
||||
requestCode: Int,
|
||||
permission: Array<String>,
|
||||
grantResult: IntArray
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as Activity/Fragment onActivityResult
|
||||
|
@ -16,7 +16,9 @@ import com.google.android.gms.fitness.FitnessOptions
|
||||
import com.google.android.gms.fitness.data.DataType
|
||||
import com.google.android.gms.fitness.request.DataReadRequest
|
||||
import java.text.DateFormat
|
||||
import java.util.*
|
||||
import java.util.Calendar
|
||||
import java.util.Date
|
||||
import java.util.TimeZone
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class GoogleFit() : Extension() {
|
||||
@ -126,7 +128,7 @@ class GoogleFit() : Extension() {
|
||||
// Set year to 2013 to be sure to get data from when Google Fit Started to today
|
||||
calendar.set(Calendar.YEAR, 2013)
|
||||
val startTime = calendar.timeInMillis
|
||||
arrayOf(startTime, endTime)
|
||||
return@lazy arrayOf(startTime, endTime)
|
||||
}
|
||||
|
||||
private fun startImport(data: Data) {
|
||||
|
@ -0,0 +1,27 @@
|
||||
package com.dzeio.openhealth.ui.activity
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.dzeio.openhealth.core.BaseFragment
|
||||
import com.dzeio.openhealth.databinding.FragmentActivityBinding
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@AndroidEntryPoint
|
||||
class ActivityFragment :
|
||||
BaseFragment<ActivityViewModel, FragmentActivityBinding>(ActivityViewModel::class.java) {
|
||||
|
||||
override val bindingInflater: (LayoutInflater, ViewGroup?, Boolean) -> FragmentActivityBinding
|
||||
get() = FragmentActivityBinding::inflate
|
||||
|
||||
private val settings: SharedPreferences by lazy {
|
||||
PreferenceManager.getDefaultSharedPreferences(requireContext())
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.dzeio.openhealth.ui.activity
|
||||
|
||||
import com.dzeio.openhealth.core.BaseViewModel
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
class ActivityViewModel @Inject internal constructor() : BaseViewModel()
|
@ -0,0 +1,27 @@
|
||||
package com.dzeio.openhealth.ui.browse
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.dzeio.openhealth.core.BaseFragment
|
||||
import com.dzeio.openhealth.databinding.FragmentBrowseBinding
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@AndroidEntryPoint
|
||||
class BrowseFragment :
|
||||
BaseFragment<BrowseViewModel, FragmentBrowseBinding>(BrowseViewModel::class.java) {
|
||||
|
||||
override val bindingInflater: (LayoutInflater, ViewGroup?, Boolean) -> FragmentBrowseBinding
|
||||
get() = FragmentBrowseBinding::inflate
|
||||
|
||||
private val settings: SharedPreferences by lazy {
|
||||
PreferenceManager.getDefaultSharedPreferences(requireContext())
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.dzeio.openhealth.ui.browse
|
||||
|
||||
import com.dzeio.openhealth.core.BaseViewModel
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
class BrowseViewModel @Inject internal constructor() : BaseViewModel()
|
@ -22,7 +22,6 @@ class ExtensionFragment :
|
||||
override val bindingInflater: (LayoutInflater, ViewGroup?, Boolean) -> FragmentExtensionBinding =
|
||||
FragmentExtensionBinding::inflate
|
||||
|
||||
|
||||
private val args: ExtensionFragmentArgs by navArgs()
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.dzeio.openhealth.ui.water
|
||||
|
||||
import android.graphics.Color
|
||||
import android.view.LayoutInflater
|
||||
import androidx.core.view.marginBottom
|
||||
import com.dzeio.openhealth.R
|
||||
import com.dzeio.openhealth.core.BaseDialog
|
||||
import com.dzeio.openhealth.databinding.DialogWaterSizeSelectorBinding
|
||||
@ -31,35 +31,10 @@ class WaterSizeSelectorDialog :
|
||||
}
|
||||
|
||||
viewModel.cupSize.observe(this) {
|
||||
binding.customSizeText.text = String.format(
|
||||
binding.customSize.text = String.format(
|
||||
getString(R.string.custom_amount),
|
||||
"${it}ml"
|
||||
)
|
||||
binding.size100ml.setBackgroundColor(Color.TRANSPARENT)
|
||||
binding.size250ml.setBackgroundColor(Color.TRANSPARENT)
|
||||
binding.size500ml.setBackgroundColor(Color.TRANSPARENT)
|
||||
binding.size1000ml.setBackgroundColor(Color.TRANSPARENT)
|
||||
binding.customSize.setBackgroundColor(Color.TRANSPARENT)
|
||||
val back = resources.getColor(
|
||||
com.google.android.material.R.color.material_dynamic_primary95,
|
||||
)
|
||||
when (it) {
|
||||
100 -> {
|
||||
binding.size100ml.setBackgroundColor(back)
|
||||
}
|
||||
250 -> {
|
||||
binding.size250ml.setBackgroundColor(back)
|
||||
}
|
||||
500 -> {
|
||||
binding.size500ml.setBackgroundColor(back)
|
||||
}
|
||||
1000 -> {
|
||||
binding.size1000ml.setBackgroundColor(back)
|
||||
}
|
||||
else -> {
|
||||
binding.customSize.setBackgroundColor(back)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
binding.size100ml.setOnClickListener {
|
||||
@ -89,6 +64,9 @@ class WaterSizeSelectorDialog :
|
||||
.setOnCancelListener {
|
||||
it.dismiss()
|
||||
}
|
||||
.setNegativeButton(R.string.cancel) { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
}
|
||||
.setPositiveButton(
|
||||
R.string.validate
|
||||
) { dialog, _ ->
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.dzeio.openhealth.ui.weight
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.Menu
|
||||
@ -30,7 +31,7 @@ class ListWeightFragment :
|
||||
override val bindingInflater: (LayoutInflater, ViewGroup?, Boolean) -> FragmentListWeightBinding =
|
||||
FragmentListWeightBinding::inflate
|
||||
|
||||
val settings by lazy {
|
||||
val settings: SharedPreferences by lazy {
|
||||
PreferenceManager.getDefaultSharedPreferences(requireContext())
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
package com.dzeio.openhealth.utils
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
|
||||
object NavigationUtils {
|
||||
|
||||
fun navigation(fragment: Fragment) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
13
app/src/main/res/drawable/ic_outline_account_circle_24.xml
Normal file
13
app/src/main/res/drawable/ic_outline_account_circle_24.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10s10,-4.48 10,-10S17.52,2 12,2zM7.35,18.5C8.66,17.56 10.26,17 12,17s3.34,0.56 4.65,1.5C15.34,19.44 13.74,20 12,20S8.66,19.44 7.35,18.5zM18.14,17.12L18.14,17.12C16.45,15.8 14.32,15 12,15s-4.45,0.8 -6.14,2.12l0,0C4.7,15.73 4,13.95 4,12c0,-4.42 3.58,-8 8,-8s8,3.58 8,8C20,13.95 19.3,15.73 18.14,17.12z"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,6c-1.93,0 -3.5,1.57 -3.5,3.5S10.07,13 12,13s3.5,-1.57 3.5,-3.5S13.93,6 12,6zM12,11c-0.83,0 -1.5,-0.67 -1.5,-1.5S11.17,8 12,8s1.5,0.67 1.5,1.5S12.83,11 12,11z"/>
|
||||
</vector>
|
10
app/src/main/res/drawable/ic_outline_calendar_today_24.xml
Normal file
10
app/src/main/res/drawable/ic_outline_calendar_today_24.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,3h-1L19,1h-2v2L7,3L7,1L5,1v2L4,3c-1.1,0 -2,0.9 -2,2v16c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,5c0,-1.1 -0.9,-2 -2,-2zM20,21L4,21L4,10h16v11zM20,8L4,8L4,5h16v3z"/>
|
||||
</vector>
|
10
app/src/main/res/drawable/ic_outline_home_24.xml
Normal file
10
app/src/main/res/drawable/ic_outline_home_24.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,5.69l5,4.5V18h-2v-6H9v6H7v-7.81l5,-4.5M12,3L2,12h3v8h6v-6h2v6h6v-8h3L12,3z"/>
|
||||
</vector>
|
11
app/src/main/res/drawable/ic_outline_list_24.xml
Normal file
11
app/src/main/res/drawable/ic_outline_list_24.xml
Normal 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="?attr/colorControlNormal"
|
||||
android:autoMirrored="true">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M3,13h2v-2L3,11v2zM3,17h2v-2L3,15v2zM3,9h2L5,7L3,7v2zM7,13h14v-2L7,11v2zM7,17h14v-2L7,15v2zM7,7v2h14L21,7L7,7zM3,13h2v-2L3,11v2zM3,17h2v-2L3,15v2zM3,9h2L5,7L3,7v2zM7,13h14v-2L7,11v2zM7,17h14v-2L7,15v2zM7,7v2h14L21,7L7,7z"/>
|
||||
</vector>
|
5
app/src/main/res/drawable/shape_rounded.xml
Normal file
5
app/src/main/res/drawable/shape_rounded.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="8dp" />
|
||||
<solid android:color="@color/black" />
|
||||
</shape>
|
@ -1,22 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:id="@+id/coordinatorLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/app_bar"
|
||||
style="@style/Widget.Material3.AppBarLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
app:titleCentered="true"
|
||||
style="@style/ThemeOverlay.Material3.Toolbar.Surface"
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:titleCentered="true" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
@ -34,13 +43,25 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
app:defaultNavHost="true"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
app:defaultNavHost="true"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:navGraph="@navigation/mobile_navigation" />
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/bottom_nav"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:menu="@menu/bottom_menu" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -32,129 +32,66 @@
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:drawableLeft="@drawable/ic_outline_local_drink_24"
|
||||
android:layout_weight="1"
|
||||
android:id="@+id/size_100ml"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="100ml"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
|
||||
/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:drawableLeft="@drawable/ic_outline_local_drink_24"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_outline_local_drink_24" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="100ml" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/size_250ml"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="8dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
android:text="250ml"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_outline_local_drink_24" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
style="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="250ml" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:drawableLeft="@drawable/ic_outline_local_drink_24"
|
||||
android:layout_weight="1"
|
||||
android:id="@+id/size_500ml"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:padding="16dp">
|
||||
android:text="500ml"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_outline_local_drink_24" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
style="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="500ml" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:drawableLeft="@drawable/ic_outline_local_drink_24"
|
||||
android:id="@+id/size_1000ml"
|
||||
android:layout_marginStart="8dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp">
|
||||
android:layout_weight="1"
|
||||
android:text="1000ml"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_outline_local_drink_24" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
style="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="1000ml" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/custom_size"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/material_dynamic_primary90"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_outline_edit_24" />
|
||||
|
||||
<TextView
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:drawableLeft="@drawable/ic_outline_edit_24"
|
||||
android:id="@+id/custom_size"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/custom_size_text"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/custom_amount"
|
||||
tools:text="Custom amount: 100ml" />
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
tools:text="Custom amount: 1234ml"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@ -164,7 +101,7 @@
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@ -172,7 +109,7 @@
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="@android:string/cancel" />
|
||||
|
||||
<Button
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/validate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
72
app/src/main/res/layout/fragment_activity.xml
Normal file
72
app/src/main/res/layout/fragment_activity.xml
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_margin="16dp"
|
||||
tools:context=".ui.browse.BrowseFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:layout_marginBottom="16dp">
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_baseline_add_24" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="Activity"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_baseline_add_24" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Steps" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="4500 of 5000 steps" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
||||
</LinearLayout>
|
308
app/src/main/res/layout/fragment_browse.xml
Normal file
308
app/src/main/res/layout/fragment_browse.xml
Normal file
@ -0,0 +1,308 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_margin="16dp"
|
||||
tools:context=".ui.browse.BrowseFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:layout_marginBottom="16dp">
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_baseline_add_24" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="Activity"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_baseline_add_24" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Steps" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="4500 of 5000 steps" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:layout_marginBottom="16dp">
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_baseline_add_24" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="Heart"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_baseline_add_24" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Heart Rate" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:layout_marginBottom="16dp">
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_baseline_add_24" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="Measurements"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_baseline_add_24" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Weight" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_baseline_add_24" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Height" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Coming soon" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:layout_marginBottom="16dp">
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_baseline_add_24" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="Food"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_baseline_add_24" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Water Intake" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_baseline_add_24" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Food Calories" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</LinearLayout>
|
23
app/src/main/res/menu/bottom_menu.xml
Normal file
23
app/src/main/res/menu/bottom_menu.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_dashboard"
|
||||
android:icon="@drawable/ic_outline_home_24"
|
||||
android:title="@string/menu_dashboard" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:title="@string/menu_browse"
|
||||
android:icon="@drawable/ic_outline_list_24"/>
|
||||
<item
|
||||
android:id="@+id/action_extensions"
|
||||
android:title="@string/menu_activity"
|
||||
android:icon="@drawable/ic_outline_calendar_today_24" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_about"
|
||||
android:title="@string/menu_extensions"
|
||||
android:icon="@drawable/ic_outline_account_circle_24"/>
|
||||
</menu>
|
@ -44,6 +44,12 @@
|
||||
<action
|
||||
android:id="@+id/action_nav_home_to_aboutFragment"
|
||||
app:destination="@id/aboutFragment" />
|
||||
<action
|
||||
android:id="@+id/action_nav_home_to_browseFragment"
|
||||
app:destination="@id/browseFragment" />
|
||||
<action
|
||||
android:id="@+id/action_nav_home_to_activityFragment"
|
||||
app:destination="@id/activityFragment" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
@ -173,4 +179,16 @@
|
||||
android:name="com.dzeio.openhealth.ui.about.AboutFragment"
|
||||
android:label="AboutFragment"
|
||||
tools:layout="@layout/fragment_about"/>
|
||||
<fragment
|
||||
android:id="@+id/browseFragment"
|
||||
android:name="com.dzeio.openhealth.ui.browse.BrowseFragment"
|
||||
android:label="fragment_activity"
|
||||
tools:layout="@layout/fragment_activity" />
|
||||
|
||||
|
||||
<fragment
|
||||
android:id="@+id/activityFragment"
|
||||
android:name="com.dzeio.openhealth.ui.activity.ActivityFragment"
|
||||
android:label="fragment_activity"
|
||||
tools:layout="@layout/fragment_activity" />
|
||||
</navigation>
|
||||
|
@ -31,4 +31,9 @@
|
||||
<string name="about_star_on_github">Mettez une étoile sur Github</string>
|
||||
<string name="contact_us">Contactez-nous</string>
|
||||
<string name="licenses">Licenses</string>
|
||||
<string name="cancel">Annuler</string>
|
||||
<string name="menu_dashboard">Dashboard</string>
|
||||
<string name="menu_browse">Browse</string>
|
||||
<string name="menu_activity">Activity</string>
|
||||
|
||||
</resources>
|
||||
|
@ -41,4 +41,8 @@
|
||||
<string name="about_star_on_github">Star on Github</string>
|
||||
<string name="contact_us">Contact us</string>
|
||||
<string name="licenses">Licenses</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="menu_dashboard">Dashboard</string>
|
||||
<string name="menu_browse">Browse</string>
|
||||
<string name="menu_activity">Activity</string>
|
||||
</resources>
|
||||
|
@ -7,4 +7,9 @@
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="ShapeAppearance.OpenHealth.Corner.Medium" parent="">
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSize">16dp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user