First Commit:
Version 1.0 [Non Optimized Version]
1
app/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
76
app/build.gradle.kts
Normal file
@ -0,0 +1,76 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.jetbrains.kotlin.android)
|
||||
id("com.google.gms.google-services")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.healthjournal"
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.healthjournal"
|
||||
minSdk = 24
|
||||
targetSdk = 34
|
||||
versionCode = 1
|
||||
versionName = "1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Core libraries
|
||||
implementation(libs.androidx.core.ktx) // Kotlin extensions for core Android functionality
|
||||
implementation(libs.androidx.appcompat) // AppCompat library for backward compatibility
|
||||
implementation(libs.material) // Material Design components
|
||||
implementation(libs.androidx.activity) // Activity library for managing the activity lifecycle
|
||||
implementation(libs.androidx.constraintlayout) // ConstraintLayout for flexible layouts
|
||||
implementation ("androidx.lifecycle:lifecycle-livedata-ktx:2.5.1")
|
||||
implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
|
||||
implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
|
||||
|
||||
|
||||
// Firebase libraries
|
||||
implementation(libs.firebase.database)
|
||||
implementation(libs.firebase.auth)
|
||||
testImplementation(libs.junit)
|
||||
androidTestImplementation(libs.androidx.junit)
|
||||
androidTestImplementation(libs.androidx.espresso.core)
|
||||
implementation(platform("com.google.firebase:firebase-bom:33.1.2"))
|
||||
implementation("com.google.firebase:firebase-analytics")
|
||||
|
||||
// Splash screen
|
||||
implementation("androidx.core:core-splashscreen:1.0.0") // For splash screen support
|
||||
|
||||
// DataStore preferences
|
||||
implementation("androidx.datastore:datastore-preferences:1.0.0") // For storing key-value pairs
|
||||
|
||||
// Coroutines
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") // Coroutines for asynchronous programming
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2") // Coroutines for Android
|
||||
|
||||
// Circular image views
|
||||
implementation("de.hdodenhof:circleimageview:3.1.0") // For circular image views
|
||||
implementation ("com.google.android.material:material:1.7.0")
|
||||
}
|
29
app/google-services.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"project_info": {
|
||||
"project_number": "739932964546",
|
||||
"project_id": "healthjournal-3fcd9",
|
||||
"storage_bucket": "healthjournal-3fcd9.appspot.com"
|
||||
},
|
||||
"client": [
|
||||
{
|
||||
"client_info": {
|
||||
"mobilesdk_app_id": "1:739932964546:android:21b91b8876bf7e7eaf9d5b",
|
||||
"android_client_info": {
|
||||
"package_name": "com.healthjournal"
|
||||
}
|
||||
},
|
||||
"oauth_client": [],
|
||||
"api_key": [
|
||||
{
|
||||
"current_key": "AIzaSyAhq4eRgReA4iBhAoa79hOLJdbxXFsCMyI"
|
||||
}
|
||||
],
|
||||
"services": {
|
||||
"appinvite_service": {
|
||||
"other_platform_oauth_client": []
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"configuration_version": "1"
|
||||
}
|
21
app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
@ -0,0 +1,24 @@
|
||||
package com.healthjournal
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.healthjournal", appContext.packageName)
|
||||
}
|
||||
}
|
50
app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.HealthJournal"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".ui.journal.detail.DetailJournalActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.users.UsersInputActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.recommendation.RecommendationActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.splashscreen.SplashscreenActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.journal.input.JournalInputActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.profile.ProfileActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.register.RegisterActivity"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.login.LoginActivity"
|
||||
android:exported="false"/>
|
||||
<activity
|
||||
android:name=".ui.dashboard.MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
111
app/src/main/java/com/healthjournal/algorithm/Algorithm.kt
Normal file
@ -0,0 +1,111 @@
|
||||
package com.healthjournal.algorithm
|
||||
|
||||
import com.healthjournal.data.HealthData
|
||||
|
||||
class AlgoritmaKesehatan {
|
||||
fun recommendationOfTheDay(healthData: HealthData): HashMap<String, Any> {
|
||||
val bloodSugarAnalysis = getBloodSugarAnalysis(healthData)
|
||||
val bloodPressureAnalysis = getBloodPressureAnalysis(healthData)
|
||||
val BMIAnalysis = getBMIAnalysis(healthData)
|
||||
val tasks = getTaskBasedData(healthData)
|
||||
|
||||
return hashMapOf(
|
||||
"bloodSugarAnalysis" to bloodSugarAnalysis,
|
||||
"bloodPressureAnalysis" to bloodPressureAnalysis,
|
||||
"BMIAnalysis" to BMIAnalysis,
|
||||
"tasks" to tasks
|
||||
)
|
||||
}
|
||||
|
||||
fun getBloodSugarAnalysis(healthData: HealthData): String {
|
||||
return when (healthData.gender) {
|
||||
"Female", "Other" -> when {
|
||||
healthData.bloodSugar < 70 -> "Gula darah rendah, konsumsi makanan manis seperti buah atau madu."
|
||||
healthData.bloodSugar in 70.0..140.0 -> "Gula darah normal, pertahankan pola makan sehat."
|
||||
healthData.bloodSugar > 140 -> "Gula darah tinggi, kurangi makanan manis dan lakukan olahraga teratur."
|
||||
else -> "Data gula darah tidak valid."
|
||||
}
|
||||
"Male" -> when {
|
||||
healthData.bloodSugar < 70 -> "Gula darah rendah, segera konsumsi makanan berkarbohidrat."
|
||||
healthData.bloodSugar in 70.0..130.0 -> "Gula darah normal, jaga pola makan seimbang."
|
||||
healthData.bloodSugar > 130 -> "Gula darah tinggi, batasi konsumsi gula dan periksa kesehatan secara berkala."
|
||||
else -> "Data gula darah tidak valid."
|
||||
}
|
||||
else -> "Data gula darah tidak valid."
|
||||
}
|
||||
}
|
||||
|
||||
fun getBloodPressureAnalysis(healthData: HealthData): String {
|
||||
return when (healthData.gender) {
|
||||
"Female", "Other" -> when {
|
||||
healthData.systolicBP < 90 || healthData.diastolicBP < 60 -> "Tekanan darah rendah, tingkatkan asupan cairan dan garam."
|
||||
healthData.systolicBP in 90..120 && healthData.diastolicBP in 60..80 -> "Tekanan darah normal, pertahankan gaya hidup sehat."
|
||||
healthData.systolicBP > 120 || healthData.diastolicBP > 80 -> "Tekanan darah tinggi, kurangi garam dan tingkatkan aktivitas fisik."
|
||||
else -> "Data tekanan darah tidak valid."
|
||||
}
|
||||
"Male" -> when {
|
||||
healthData.systolicBP < 100 || healthData.diastolicBP < 60 -> "Tekanan darah rendah, perbanyak cairan dan istirahat."
|
||||
healthData.systolicBP in 100..130 && healthData.diastolicBP in 60..85 -> "Tekanan darah normal, pertahankan pola makan sehat."
|
||||
healthData.systolicBP > 130 || healthData.diastolicBP > 85 -> "Tekanan darah tinggi, konsultasikan dengan dokter untuk pemeriksaan lebih lanjut."
|
||||
else -> "Data tekanan darah tidak valid."
|
||||
}
|
||||
else -> "Data tekanan darah tidak valid."
|
||||
}
|
||||
}
|
||||
|
||||
fun getBMIAnalysis(healthData: HealthData): String {
|
||||
return when (healthData.gender) {
|
||||
"Female", "Other" -> when {
|
||||
healthData.BMI < 18.5 -> "BMI rendah, tingkatkan asupan kalori dengan makanan bernutrisi."
|
||||
healthData.BMI in 18.5..24.9 -> "BMI normal, pertahankan pola makan seimbang."
|
||||
healthData.BMI > 24.9 -> "BMI tinggi, lakukan olahraga teratur dan perbaiki pola makan."
|
||||
else -> "Data BMI tidak valid."
|
||||
}
|
||||
"Male" -> when {
|
||||
healthData.BMI < 20 -> "BMI rendah, tambahkan asupan protein dan makanan bergizi."
|
||||
healthData.BMI in 20.0..25.0 -> "BMI normal, teruskan pola hidup sehat."
|
||||
healthData.BMI > 25 -> "BMI tinggi, perbanyak aktivitas fisik dan atur pola makan rendah lemak."
|
||||
else -> "Data BMI tidak valid."
|
||||
}
|
||||
else -> "Data BMI tidak valid."
|
||||
}
|
||||
}
|
||||
|
||||
fun getTaskBasedData(healthData: HealthData): List<Map<String, Any>> {
|
||||
val tasks = mutableListOf<Map<String, Any>>()
|
||||
|
||||
// Task for Blood Sugar Control
|
||||
if (healthData.bloodSugar > 140) {
|
||||
tasks.add(mapOf("task" to "Cek kadar gula darah 2 kali sehari.", "completed" to false))
|
||||
tasks.add(mapOf("task" to "Kurangi konsumsi makanan tinggi gula.", "completed" to false))
|
||||
} else if (healthData.bloodSugar < 70) {
|
||||
tasks.add(mapOf("task" to "Sediakan camilan sehat seperti buah atau kacang.", "completed" to false))
|
||||
}
|
||||
|
||||
// Task for Blood Pressure Control
|
||||
if (healthData.systolicBP > 120 || healthData.diastolicBP > 80) {
|
||||
tasks.add(mapOf("task" to "Lakukan olahraga ringan seperti jalan kaki selama 30 menit.", "completed" to false))
|
||||
tasks.add(mapOf("task" to "Kurangi makanan asin dan berlemak.", "completed" to false))
|
||||
} else if (healthData.systolicBP < 90) {
|
||||
tasks.add(mapOf("task" to "Perbanyak minum air putih dan istirahat.", "completed" to false))
|
||||
}
|
||||
|
||||
// Task for BMI Control
|
||||
if (healthData.BMI > 25) {
|
||||
tasks.add(mapOf("task" to "Lakukan olahraga rutin minimal 3 kali seminggu.", "completed" to false))
|
||||
tasks.add(mapOf("task" to "Konsumsi lebih banyak sayuran dan serat.", "completed" to false))
|
||||
} else if (healthData.BMI < 18.5) {
|
||||
tasks.add(mapOf("task" to "Tambahkan makanan tinggi kalori seperti kacang dan susu.", "completed" to false))
|
||||
}
|
||||
|
||||
// Age and Gender Specific Tasks
|
||||
if (healthData.age > 50) {
|
||||
tasks.add(mapOf("task" to "Lakukan pemeriksaan kesehatan rutin setiap bulan.", "completed" to false))
|
||||
}
|
||||
if (healthData.gender == "Female" || healthData.gender == "Other") {
|
||||
tasks.add(mapOf("task" to "Perhatikan kebutuhan kalsium dan zat besi.", "completed" to false))
|
||||
}
|
||||
|
||||
return tasks
|
||||
}
|
||||
}
|
23
app/src/main/java/com/healthjournal/data/Data.kt
Normal file
@ -0,0 +1,23 @@
|
||||
package com.healthjournal.data
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
|
||||
data class HealthData(
|
||||
val bloodSugar: Float,
|
||||
val diastolicBP: Int,
|
||||
val systolicBP: Int,
|
||||
val BMI: Float,
|
||||
val age: Int,
|
||||
val gender: String
|
||||
)
|
||||
|
||||
data class ResultData(
|
||||
val journalID: String,
|
||||
val bloodSugar: Float,
|
||||
val diastolicBP: Int,
|
||||
val systolicBP: Int,
|
||||
val BMI: Float,
|
||||
val date: String
|
||||
) : Serializable
|
||||
|
@ -0,0 +1,8 @@
|
||||
package com.healthjournal.model
|
||||
|
||||
data class SessionModel (
|
||||
val userId: String,
|
||||
val name: String,
|
||||
val statusLogin: Boolean,
|
||||
val loginTimestamp: Long
|
||||
)
|
109
app/src/main/java/com/healthjournal/ui/custom/CustomEdtTxt.kt
Normal file
@ -0,0 +1,109 @@
|
||||
package com.healthjournal.ui.custom
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.text.Editable
|
||||
import android.text.InputFilter
|
||||
import android.text.InputType
|
||||
import android.text.TextWatcher
|
||||
import android.util.AttributeSet
|
||||
import android.util.Patterns
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.healthjournal.R
|
||||
import com.google.android.material.textfield.TextInputEditText
|
||||
|
||||
class CustomEditText : TextInputEditText {
|
||||
|
||||
private var errorBackground: Drawable? = null
|
||||
private var defaultBackground: Drawable? = null
|
||||
private var isError: Boolean = false
|
||||
|
||||
constructor(context: Context) : super(context) {
|
||||
init()
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
|
||||
init()
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
) {
|
||||
init()
|
||||
}
|
||||
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
super.onDraw(canvas)
|
||||
background = if (isError) {
|
||||
errorBackground
|
||||
} else {
|
||||
defaultBackground
|
||||
}
|
||||
}
|
||||
|
||||
private fun init() {
|
||||
errorBackground = ContextCompat.getDrawable(context, R.drawable.bg_edt_error)
|
||||
defaultBackground = ContextCompat.getDrawable(context, R.drawable.bg_edt_default)
|
||||
|
||||
if (inputType == InputType.TYPE_CLASS_NUMBER) {
|
||||
filters = arrayOf(InputFilter { source, _, _, _, _, _ ->
|
||||
source.filter { it.isDigit() }
|
||||
})
|
||||
}
|
||||
|
||||
addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {}
|
||||
|
||||
override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {
|
||||
val input = p0.toString()
|
||||
if (input.isEmpty()) {
|
||||
error = context.getString(R.string.empty_field)
|
||||
isError = true
|
||||
} else {
|
||||
error = null
|
||||
isError = false
|
||||
validateInput(input)
|
||||
}
|
||||
}
|
||||
|
||||
override fun afterTextChanged(p0: Editable?) {}
|
||||
})
|
||||
}
|
||||
|
||||
private fun validateInput(input: String) {
|
||||
when (inputType) {
|
||||
EMAIL -> {
|
||||
if (!Patterns.EMAIL_ADDRESS.matcher(input).matches()) {
|
||||
error = context.getString(R.string.email_validation)
|
||||
isError = true
|
||||
} else {
|
||||
isError = false
|
||||
}
|
||||
}
|
||||
PASSWORD -> {
|
||||
if (input.length < 6) {
|
||||
error = context.getString(R.string.password_length)
|
||||
isError = true
|
||||
} else {
|
||||
isError = false
|
||||
}
|
||||
}
|
||||
InputType.TYPE_CLASS_NUMBER -> {
|
||||
if (!input.matches("\\d+".toRegex())) {
|
||||
error = context.getString(R.string.empty_field)
|
||||
isError = true
|
||||
} else {
|
||||
isError = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val EMAIL = 0x00000021
|
||||
const val PASSWORD = 0x00000081
|
||||
}
|
||||
}
|
227
app/src/main/java/com/healthjournal/ui/dashboard/MainActivity.kt
Normal file
@ -0,0 +1,227 @@
|
||||
package com.healthjournal.ui.dashboard
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.google.firebase.Firebase
|
||||
import com.google.firebase.auth.FirebaseAuth
|
||||
import com.google.firebase.database.FirebaseDatabase
|
||||
import com.google.firebase.database.database
|
||||
import com.healthjournal.R
|
||||
import com.healthjournal.data.ResultData
|
||||
import com.healthjournal.databinding.ActivityMainBinding
|
||||
import com.healthjournal.ui.journal.input.JournalInputActivity
|
||||
import com.healthjournal.ui.login.LoginActivity
|
||||
import com.healthjournal.ui.profile.ProfileActivity
|
||||
import com.healthjournal.ui.recommendation.RecommendationActivity
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Calendar
|
||||
import java.util.Locale
|
||||
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityMainBinding
|
||||
private lateinit var user: FirebaseAuth
|
||||
private lateinit var mainAdapter: MainAdapter
|
||||
private val healthDataList: MutableList<ResultData> = mutableListOf()
|
||||
private val database = Firebase.database
|
||||
private var dailyReport = false
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
user = FirebaseAuth.getInstance()
|
||||
|
||||
userCheck()
|
||||
setupListener()
|
||||
populateHistory()
|
||||
navigationBottomBar()
|
||||
}
|
||||
|
||||
private fun navigationBottomBar(){
|
||||
binding.bottomNavigation.setOnItemSelectedListener {
|
||||
when(it.itemId){
|
||||
R.id.nav_add -> addJournal()
|
||||
R.id.nav_home -> home()
|
||||
R.id.nav_profile -> profile()
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
private fun getWeekCount() {
|
||||
val today = Calendar.getInstance()
|
||||
val userID = user.currentUser!!.uid
|
||||
var count = 0
|
||||
|
||||
val dateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.getDefault())
|
||||
|
||||
today.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY)
|
||||
val startDate = dateFormat.format(today.time)
|
||||
|
||||
val endDate = today.clone() as Calendar
|
||||
endDate.add(Calendar.DAY_OF_WEEK, 6)
|
||||
val endDateString = dateFormat.format(endDate.time)
|
||||
|
||||
database.getReference("users").child(userID).child("journal")
|
||||
.get()
|
||||
.addOnCompleteListener { task ->
|
||||
if (task.isSuccessful) {
|
||||
count = task.result.children.count { snapshot ->
|
||||
val date = snapshot.child("date").value.toString()
|
||||
date >= startDate && date <= endDateString
|
||||
}
|
||||
Log.d("debug", "Entries found: $count for week: $startDate - $endDateString")
|
||||
binding.tvDailyCounter.text = "$count/7"
|
||||
} else {
|
||||
Log.e("error", task.exception?.message.toString())
|
||||
Toast.makeText(this, task.exception?.message, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private fun addJournal(){
|
||||
if (dailyReport != false){
|
||||
Toast.makeText(this, "Daily Report Already Created", Toast.LENGTH_SHORT).show()
|
||||
} else {
|
||||
startActivity(Intent(this, JournalInputActivity::class.java))
|
||||
}
|
||||
}
|
||||
|
||||
private fun home(){
|
||||
}
|
||||
|
||||
private fun profile(){
|
||||
intent = Intent(this, ProfileActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
|
||||
private fun setupListener(){
|
||||
binding.btnRecomendation.setOnClickListener {
|
||||
startActivity(Intent(this, RecommendationActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
binding.btnInputData.setOnClickListener {
|
||||
startActivity(Intent(this, JournalInputActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
private fun dailycheck() {
|
||||
val today = SimpleDateFormat("dd/MM/yyyy", Locale.getDefault()).format(android.icu.util.Calendar.getInstance().time).toString()
|
||||
val userID = user.currentUser!!.uid
|
||||
database.getReference("users").child(userID).child("journal").get().addOnCompleteListener { task ->
|
||||
if (task.isSuccessful) {
|
||||
task.result.children.forEach {
|
||||
if (it.child("date").value.toString() == today) {
|
||||
dailyReport = true
|
||||
switchLayout()
|
||||
populateTodayReport()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.d("error", task.exception!!.message.toString())
|
||||
Toast.makeText(this, task.exception!!.message, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun switchLayout(){
|
||||
if (binding.clDailyReport1.visibility == View.VISIBLE){
|
||||
binding.clDailyReport1.visibility = View.INVISIBLE
|
||||
binding.clDailyReport2.visibility = View.VISIBLE
|
||||
binding.btnRecomendation.visibility = View.VISIBLE
|
||||
binding.ivCuboidIndicator1Green.visibility = View.VISIBLE
|
||||
binding.ivCuboidIndicator2Green.visibility = View.VISIBLE
|
||||
binding.ivCuboidIndicator1Orange.visibility = View.INVISIBLE
|
||||
binding.ivCuboidIndicator2Orange.visibility = View.INVISIBLE
|
||||
} else {
|
||||
binding.clDailyReport1.visibility = View.VISIBLE
|
||||
binding.clDailyReport2.visibility = View.INVISIBLE
|
||||
binding.btnRecomendation.visibility = View.GONE
|
||||
binding.ivCuboidIndicator1Green.visibility = View.INVISIBLE
|
||||
binding.ivCuboidIndicator2Green.visibility = View.INVISIBLE
|
||||
binding.ivCuboidIndicator1Orange.visibility = View.VISIBLE
|
||||
binding.ivCuboidIndicator2Orange.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
private fun userCheck() {
|
||||
val user = FirebaseAuth.getInstance().currentUser
|
||||
if (user == null) {
|
||||
Toast.makeText(this, "Please Login to an account", Toast.LENGTH_SHORT).show()
|
||||
val intent = Intent(this, LoginActivity::class.java)
|
||||
startActivity(intent)
|
||||
finish()
|
||||
} else {
|
||||
Toast.makeText(this, "Welcome back!", Toast.LENGTH_SHORT).show()
|
||||
dailycheck()
|
||||
getWeekCount()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun populateHistory() {
|
||||
val userID = user.currentUser!!.uid
|
||||
mainAdapter = MainAdapter(healthDataList)
|
||||
|
||||
binding.rvHealthHistory.apply {
|
||||
adapter = mainAdapter
|
||||
layoutManager = LinearLayoutManager(this@MainActivity)
|
||||
}
|
||||
|
||||
database.getReference("users").child(userID).child("journal").get()
|
||||
.addOnCompleteListener { task ->
|
||||
if (task.isSuccessful) {
|
||||
healthDataList.clear()
|
||||
task.result.children.forEach { snapshot ->
|
||||
val journalID = snapshot.child("date").value.toString()
|
||||
val bloodSugar = snapshot.child("bloodSugar").value.toString().toFloatOrNull() ?: 0f
|
||||
val diastolicBP = snapshot.child("bloodPressureDIA").value.toString().toIntOrNull() ?: 0
|
||||
val systolicBP = snapshot.child("bloodPressureSYS").value.toString().toIntOrNull() ?: 0
|
||||
val BMI = snapshot.child("bmi").value.toString().toFloatOrNull() ?: 0f
|
||||
val date = snapshot.child("date").value.toString()
|
||||
|
||||
val resultData = ResultData(journalID, bloodSugar, diastolicBP, systolicBP, BMI, date)
|
||||
healthDataList.add(resultData)
|
||||
}
|
||||
mainAdapter.notifyDataSetChanged()
|
||||
} else {
|
||||
Log.d("error", task.exception?.message.toString())
|
||||
Toast.makeText(this, task.exception?.message, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun populateTodayReport(){
|
||||
val today = SimpleDateFormat("dd/MM/yyyy", Locale.getDefault()).format(android.icu.util.Calendar.getInstance().time).toString()
|
||||
val userID = user.currentUser!!.uid
|
||||
database.getReference("users").child(userID).child("journal").get().addOnCompleteListener { task ->
|
||||
if (task.isSuccessful) {
|
||||
task.result.children.forEach {
|
||||
if (it.child("date").value.toString() == today) {
|
||||
binding.tvBloodsugarLevel.text = it.child("bloodSugar").value.toString()+" mg/dL"
|
||||
binding.tvBloodsugarDesc.text = it.child("recommendation").child("bloodSugarAnalysis").value.toString()
|
||||
binding.tvBloodpressureLevel.text = it.child("bloodPressureDIA").value.toString()+"/"+it.child("bloodPressureSYS").value.toString()+" mm Hg"
|
||||
binding.tvBloodpressureDesc.text = it.child("recommendation").child("bloodPressureAnalysis").value.toString()
|
||||
binding.tvBmiLevel.text = it.child("BMI").value.toString() +" BMI"
|
||||
binding.tvBmiDesc.text = it.child("recommendation").child("BMIAnalysis").value.toString()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.d("error", task.exception!!.message.toString())
|
||||
Toast.makeText(this, task.exception!!.message, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.healthjournal.ui.dashboard
|
||||
|
||||
import android.content.Intent
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.healthjournal.R
|
||||
import com.healthjournal.data.ResultData
|
||||
import com.healthjournal.ui.journal.detail.DetailJournalActivity
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
class MainAdapter(private val healthDataList: MutableList<ResultData>) : RecyclerView.Adapter<MainAdapter.HealthViewHolder>() {
|
||||
|
||||
class HealthViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val tvDay: TextView = view.findViewById(R.id.tv_day)
|
||||
val tvDate: TextView = view.findViewById(R.id.tv_date)
|
||||
val tvBloodSugar: TextView = view.findViewById(R.id.tv_BS_Level)
|
||||
val tvBloodPressure: TextView = view.findViewById(R.id.tv_BP_Level)
|
||||
}
|
||||
|
||||
// Function to update the list and notify the adapter
|
||||
fun setData(newData: List<ResultData>) {
|
||||
healthDataList.clear()
|
||||
healthDataList.addAll(newData)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): HealthViewHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_health_history, parent, false)
|
||||
return HealthViewHolder(view)
|
||||
}
|
||||
|
||||
private fun dayOfWeek(date: String): String {
|
||||
return try {
|
||||
val dateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.getDefault())
|
||||
val parsedDate = dateFormat.parse(date)
|
||||
if (parsedDate != null) {
|
||||
SimpleDateFormat("EEEE", Locale.getDefault()).format(parsedDate)
|
||||
} else {
|
||||
"Invalid Date"
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
"Invalid Date"
|
||||
}
|
||||
}
|
||||
|
||||
private fun countGoals (){
|
||||
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: HealthViewHolder, position: Int) {
|
||||
val healthData = healthDataList[position]
|
||||
|
||||
holder.tvDay.text = dayOfWeek(healthData.date)
|
||||
holder.tvDate.text = healthData.date
|
||||
holder.tvBloodSugar.text = "${healthData.bloodSugar} mg/dL"
|
||||
holder.tvBloodPressure.text = "${healthData.diastolicBP}/${healthData.systolicBP} mm Hg"
|
||||
|
||||
holder.itemView.setOnClickListener {
|
||||
val context = holder.itemView.context
|
||||
val intent = Intent(context, DetailJournalActivity::class.java).apply {
|
||||
putExtra("HEALTH_DATA", healthData)
|
||||
}
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = healthDataList.size
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package com.healthjournal.ui.journal.detail
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.google.firebase.Firebase
|
||||
import com.google.firebase.auth.FirebaseAuth
|
||||
import com.google.firebase.database.database
|
||||
import com.healthjournal.R
|
||||
import com.healthjournal.data.ResultData
|
||||
import com.healthjournal.databinding.ActivityDetailJournalBinding
|
||||
|
||||
class DetailJournalActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityDetailJournalBinding
|
||||
private lateinit var user: FirebaseAuth
|
||||
private val database = Firebase.database
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityDetailJournalBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
val healthData = intent.getSerializableExtra("HEALTH_DATA") as? ResultData
|
||||
|
||||
}
|
||||
|
||||
private fun populateDetailJournal() {
|
||||
val userID = user.currentUser?.uid
|
||||
val journalDate = intent.getStringExtra("JOURNAL_DATE")
|
||||
if (userID != null && journalDate != null) {
|
||||
database.getReference("users").child(userID).child("journal").child(journalDate).get()
|
||||
.addOnCompleteListener(DetailJournalActivity()) {
|
||||
if (it.isSuccessful) {
|
||||
val data = it.result
|
||||
if (data != null) {
|
||||
/*
|
||||
binding.tvBloodsugarLevel2.text = data.bloodSugarLevel
|
||||
binding.tvBloodsugarDesc.text = data.bloodSugarDesc
|
||||
binding.tvBloodpressureLevel2.text = data.bloodPressureLevel
|
||||
binding.tvBloodpressureDesc.text = data.bloodPressureDesc
|
||||
binding.tvBMILevel2.text = data.bmiLevel
|
||||
binding.tvBMIDesc.text = data.bmiDesc
|
||||
binding.tvGoals2.text = countGoalsCompleted(data.goalsCompleted)
|
||||
binding.tvJournalNote.text = data.journalNote
|
||||
*/
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this, it.exception!!.message, Toast.LENGTH_SHORT).show()
|
||||
Log.d("error", it.exception!!.message.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun countGoalsCompleted(goalsCompleted: List<Boolean>): String {
|
||||
var count = 0
|
||||
for (completed in goalsCompleted) {
|
||||
if (completed) {
|
||||
count++
|
||||
}
|
||||
}
|
||||
return count.toString()
|
||||
}
|
||||
|
||||
private fun deleteHistory() {
|
||||
val userID = user.currentUser?.uid
|
||||
val journalDate = intent.getStringExtra("JOURNAL_DATE")
|
||||
if (userID != null && journalDate != null) {
|
||||
database.getReference("users").child(userID).child("journal").child(journalDate)
|
||||
.removeValue()
|
||||
.addOnCompleteListener(DetailJournalActivity()) {
|
||||
if (it.isSuccessful) {
|
||||
Toast.makeText(this, "History deleted successfully", Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
finish()
|
||||
} else {
|
||||
Toast.makeText(this, it.exception!!.message, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupListener() {
|
||||
binding.btnDeleteHistory.setOnClickListener() {
|
||||
deleteHistory()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
package com.healthjournal.ui.journal.input
|
||||
|
||||
import android.content.Intent
|
||||
import android.icu.util.Calendar
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.google.firebase.auth.FirebaseAuth
|
||||
import com.google.firebase.database.FirebaseDatabase
|
||||
import com.healthjournal.algorithm.AlgoritmaKesehatan
|
||||
import com.healthjournal.databinding.ActivityJournalInputBinding
|
||||
import com.healthjournal.ui.dashboard.MainActivity
|
||||
import com.healthjournal.data.HealthData
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
class JournalInputActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityJournalInputBinding
|
||||
private lateinit var user: FirebaseAuth
|
||||
private lateinit var database: FirebaseDatabase
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityJournalInputBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
user = FirebaseAuth.getInstance()
|
||||
database = FirebaseDatabase.getInstance()
|
||||
|
||||
val userId = user.currentUser?.uid
|
||||
if (userId != null) {
|
||||
database.getReference("users").child(userId).get()
|
||||
.addOnCompleteListener { task ->
|
||||
if (task.isSuccessful && task.result.exists()) {
|
||||
binding.edtInputWeight.setText(task.result.child("weight").value.toString())
|
||||
binding.edtHeight.setText(task.result.child("height").value.toString())
|
||||
binding.edtAge.setText(task.result.child("date").value.toString())
|
||||
binding.edtGender.setText(task.result.child("gender").value.toString())
|
||||
} else {
|
||||
Toast.makeText(this, "Error: ${task.exception?.message}", Toast.LENGTH_SHORT).show()
|
||||
Log.d("error", task.exception?.message.toString())
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this, "User not logged in", Toast.LENGTH_SHORT).show()
|
||||
finish()
|
||||
}
|
||||
|
||||
setupListener()
|
||||
}
|
||||
|
||||
private fun setupListener() {
|
||||
binding.btnInputData.setOnClickListener {
|
||||
submitData()
|
||||
}
|
||||
}
|
||||
|
||||
private fun calculateBMI(weight: Int, height: Int): Float {
|
||||
val heightInMeters = height / 100f
|
||||
val BMI = weight / (heightInMeters * heightInMeters)
|
||||
return BMI
|
||||
}
|
||||
|
||||
fun calculateAge(birthDate: String): Int {
|
||||
val sdf = SimpleDateFormat("dd/MM/yyyy", Locale.getDefault())
|
||||
val date = sdf.parse(birthDate)
|
||||
val birthCalendar = Calendar.getInstance()
|
||||
birthCalendar.time = date
|
||||
val today = Calendar.getInstance()
|
||||
|
||||
var age = today.get(Calendar.YEAR) - birthCalendar.get(Calendar.YEAR)
|
||||
|
||||
if (today.get(Calendar.DAY_OF_YEAR) < birthCalendar.get(Calendar.DAY_OF_YEAR)) {
|
||||
age--
|
||||
}
|
||||
|
||||
return age
|
||||
}
|
||||
|
||||
private fun submitData() {
|
||||
val userId = user.currentUser?.uid
|
||||
if (userId == null) {
|
||||
Toast.makeText(this, "User not logged in", Toast.LENGTH_SHORT).show()
|
||||
return
|
||||
}
|
||||
val journalDate = SimpleDateFormat("dd/MM/yyyy", Locale.getDefault()).format(Calendar.getInstance().time).toString()
|
||||
val bloodPressureSYS = binding.edtInputBloodPressureSYS.text.toString()
|
||||
val bloodPressureDIA = binding.edtInputBloodPressureDIA.text.toString()
|
||||
val bloodSugar = binding.edtInputBloodSugar.text.toString()
|
||||
val weight = binding.edtInputWeight.text.toString().toInt()
|
||||
val height = binding.edtHeight.text.toString().toInt()
|
||||
val note = binding.edtInputNote.text.toString()
|
||||
val age = calculateAge(binding.edtAge.text.toString())
|
||||
val gender = binding.edtGender.text.toString()
|
||||
Log.d("journalDate", journalDate)
|
||||
if (weight != null && bloodPressureSYS.isNotEmpty() && bloodPressureDIA.isNotEmpty() && bloodSugar.isNotEmpty()) {
|
||||
database.getReference("users").child(userId).child("height").get().addOnSuccessListener { snapshot ->
|
||||
val BMI = calculateBMI(weight, height)
|
||||
val healthData = HealthData(bloodSugar.toFloat(), bloodPressureSYS.toInt(), bloodPressureDIA.toInt(), BMI,age,gender)
|
||||
val recommendation = AlgoritmaKesehatan().recommendationOfTheDay(healthData)
|
||||
|
||||
val data = hashMapOf(
|
||||
"date" to journalDate,
|
||||
"bloodPressureSYS" to bloodPressureSYS,
|
||||
"bloodPressureDIA" to bloodPressureDIA,
|
||||
"bloodSugar" to bloodSugar,
|
||||
"BMI" to BMI,
|
||||
"note" to note,
|
||||
"recommendation" to recommendation
|
||||
)
|
||||
database.getReference("users").child(userId).child("journal").push().setValue(data).addOnCompleteListener {
|
||||
if (it.isSuccessful) {
|
||||
Toast.makeText(this, "Data Input Success", Toast.LENGTH_SHORT).show()
|
||||
startActivity(Intent(this, MainActivity::class.java))
|
||||
finish()
|
||||
} else {
|
||||
Toast.makeText(this, it.exception?.message, Toast.LENGTH_SHORT).show()
|
||||
Log.d("error", it.exception?.message.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this, "Please fill all fields correctly", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.healthjournal.ui.login
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.google.firebase.auth.FirebaseAuth
|
||||
import com.healthjournal.databinding.ActivityLoginBinding
|
||||
import com.healthjournal.ui.dashboard.MainActivity
|
||||
import com.healthjournal.ui.register.RegisterActivity
|
||||
|
||||
class LoginActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityLoginBinding
|
||||
private lateinit var user: FirebaseAuth
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityLoginBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
user = FirebaseAuth.getInstance()
|
||||
setuplistener()
|
||||
}
|
||||
|
||||
private fun setuplistener() {
|
||||
binding.btnLogin.setOnClickListener{
|
||||
loginUser()
|
||||
}
|
||||
|
||||
binding.btnRegister.setOnClickListener{
|
||||
startActivity(Intent(this@LoginActivity, RegisterActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
private fun loginUser() {
|
||||
val email = binding.edtEmail.text.toString()
|
||||
val password = binding.edtPassword.text.toString()
|
||||
if (email.isEmpty() || password.isEmpty()) {
|
||||
if (email.isEmpty()) binding.edtEmail.error = "Email cannot be empty"
|
||||
if (password.isEmpty()) binding.edtPassword.error = "Password cannot be empty"
|
||||
Toast.makeText(this, "Email & Password cannot be empty", Toast.LENGTH_SHORT).show()
|
||||
} else {
|
||||
user.signInWithEmailAndPassword(email, password).addOnCompleteListener(LoginActivity()){ task ->
|
||||
if (task.isSuccessful) {
|
||||
Toast.makeText(this, "Login Success", Toast.LENGTH_SHORT).show()
|
||||
startActivity(Intent(this@LoginActivity, MainActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
else{
|
||||
Toast.makeText(this, task.exception!!.message, Toast.LENGTH_SHORT).show()
|
||||
Log.d("error", task.exception!!.message.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package com.healthjournal.ui.profile
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.google.firebase.Firebase
|
||||
import com.google.firebase.auth.FirebaseAuth
|
||||
import com.google.firebase.database.database
|
||||
import com.healthjournal.R
|
||||
import com.healthjournal.databinding.ActivityProfileBinding
|
||||
import com.healthjournal.ui.login.LoginActivity
|
||||
|
||||
class ProfileActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityProfileBinding
|
||||
private lateinit var user: FirebaseAuth
|
||||
private val database = Firebase.database
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityProfileBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
setupListener()
|
||||
populateData()
|
||||
}
|
||||
|
||||
private fun setupListener() {
|
||||
binding.btnLogout.setOnClickListener {
|
||||
logout()
|
||||
}
|
||||
|
||||
binding.btnUpdateData.setOnClickListener {
|
||||
updateData()
|
||||
}
|
||||
}
|
||||
|
||||
private fun logout(){
|
||||
user.signOut()
|
||||
startActivity(Intent(this, LoginActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
|
||||
private fun updateData(){
|
||||
val userID = user.currentUser?.uid
|
||||
val name = binding.edtName.text.toString()
|
||||
val email = binding.edtEmail.text.toString()
|
||||
val date = binding.edtDates.text.toString()
|
||||
val weight = binding.edtInputWeight.text.toString()
|
||||
val height = binding.edtInputHeight.text.toString()
|
||||
val userRef = database.getReference("users").child(userID!!)
|
||||
userRef.child("name").setValue(name)
|
||||
userRef.child("email").setValue(email)
|
||||
userRef.child("date").setValue(date)
|
||||
userRef.child("weight").setValue(weight)
|
||||
userRef.child("height").setValue(height)
|
||||
Toast.makeText(this, "Data Updated", Toast.LENGTH_SHORT).show()
|
||||
populateData()
|
||||
}
|
||||
|
||||
private fun populateData(){
|
||||
val userID = user.currentUser?.uid
|
||||
val userRef = database.getReference("users").child(userID!!)
|
||||
userRef.get().addOnCompleteListener(ProfileActivity()){
|
||||
if (it.isSuccessful){
|
||||
binding.edtName.setText(it.result.child("name").value.toString())
|
||||
binding.edtDates.setText(it.result.child("date").value.toString())
|
||||
binding.edtInputHeight.setText(it.result.child("height").value.toString())
|
||||
binding.edtInputWeight.setText(it.result.child("weight").value.toString())
|
||||
} else {
|
||||
Toast.makeText(this, it.exception.toString(), Toast.LENGTH_SHORT).show()
|
||||
Log.d("ProfileActivity", it.exception.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.healthjournal.ui.recommendation
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.CheckBox
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.healthjournal.R
|
||||
|
||||
class RecommendationAdapter(
|
||||
private val recommendationList: List<Pair<String, Boolean>>,
|
||||
private val onCheckedChange: (position: Int, isChecked: Boolean) -> Unit
|
||||
) : RecyclerView.Adapter<RecommendationAdapter.RecommendationViewHolder>() {
|
||||
|
||||
inner class RecommendationViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val tvGoalName: TextView = view.findViewById(R.id.tv_goal_name)
|
||||
val checkBox: CheckBox = view.findViewById(R.id.toggle)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecommendationViewHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_goals_recommendation, parent, false)
|
||||
return RecommendationViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: RecommendationViewHolder, position: Int) {
|
||||
val (task, isCompleted) = recommendationList[position]
|
||||
holder.tvGoalName.text = task
|
||||
holder.checkBox.isChecked = isCompleted
|
||||
holder.checkBox.setOnCheckedChangeListener { _, isChecked ->
|
||||
onCheckedChange(position, isChecked)
|
||||
}
|
||||
holder.itemView.setOnClickListener {
|
||||
holder.checkBox.isChecked = !holder.checkBox.isChecked
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = recommendationList.size
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
package com.healthjournal.ui.recommendation
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.google.firebase.auth.FirebaseAuth
|
||||
import com.google.firebase.database.FirebaseDatabase
|
||||
import com.healthjournal.databinding.ActivityRecommendationBinding
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
class RecommendationActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityRecommendationBinding
|
||||
private lateinit var user: FirebaseAuth
|
||||
private lateinit var database: FirebaseDatabase
|
||||
private lateinit var adapter: RecommendationAdapter
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityRecommendationBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
user = FirebaseAuth.getInstance()
|
||||
database = FirebaseDatabase.getInstance()
|
||||
|
||||
populateData()
|
||||
}
|
||||
|
||||
private fun populateData() {
|
||||
val userID = user.currentUser?.uid ?: return
|
||||
val today = SimpleDateFormat("dd/MM/yyyy", Locale.getDefault())
|
||||
.format(android.icu.util.Calendar.getInstance().time)
|
||||
|
||||
database.getReference("users").child(userID).child("journal")
|
||||
.get()
|
||||
.addOnCompleteListener { task ->
|
||||
if (task.isSuccessful) {
|
||||
task.result.children.forEach {
|
||||
if (it.child("date").value.toString() == today) {
|
||||
binding.tvBloodsugarLevel2.text = "${it.child("bloodSugar").value} mg/dL"
|
||||
binding.tvBloodsugarDesc.text = it.child("recommendation").child("bloodSugarAnalysis").value.toString()
|
||||
binding.tvBloodpressureLevel2.text = "${it.child("bloodPressureDIA").value}/${it.child("bloodPressureSYS").value} mm Hg"
|
||||
binding.tvBloodpressureDesc.text = it.child("recommendation").child("bloodPressureAnalysis").value.toString()
|
||||
binding.tvBMILevel2.text = "${it.child("BMI").value} BMI"
|
||||
binding.tvBMIDesc.text = it.child("recommendation").child("BMIAnalysis").value.toString()
|
||||
|
||||
val tasks = it.child("recommendation").child("tasks").value
|
||||
val referencePath = it.key ?: return@forEach
|
||||
populateRecomendation(tasks, userID, referencePath)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log.e("error", task.exception?.message.toString())
|
||||
Toast.makeText(this, task.exception?.message, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun populateRecomendation(tasks: Any?, userID: String, journalKey: String) {
|
||||
val taskList = mutableListOf<Pair<String, Boolean>>()
|
||||
|
||||
// Handle List format for tasks
|
||||
if (tasks is List<*>) {
|
||||
tasks.forEach { taskData ->
|
||||
if (taskData is Map<*, *> && taskData["task"] != null && taskData["completed"] != null) {
|
||||
val taskDescription = taskData["task"].toString()
|
||||
val isCompleted = taskData["completed"] as? Boolean ?: false
|
||||
taskList.add(Pair(taskDescription, isCompleted))
|
||||
}
|
||||
}
|
||||
|
||||
// Set up RecyclerView and Adapter
|
||||
adapter = RecommendationAdapter(taskList) { position, isChecked ->
|
||||
taskList[position] = taskList[position].copy(second = isChecked)
|
||||
|
||||
// Update Firebase
|
||||
database.getReference("users")
|
||||
.child(userID)
|
||||
.child("journal")
|
||||
.child(journalKey)
|
||||
.child("recommendation")
|
||||
.child("tasks")
|
||||
.child(position.toString())
|
||||
.child("completed")
|
||||
.setValue(isChecked)
|
||||
}
|
||||
|
||||
binding.rvTasks.apply {
|
||||
layoutManager = LinearLayoutManager(this@RecommendationActivity)
|
||||
adapter = this@RecommendationActivity.adapter
|
||||
}
|
||||
} else {
|
||||
Log.e("error", "Invalid tasks data format")
|
||||
Log.e("error", tasks.toString())
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.healthjournal.ui.register
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.google.firebase.auth.FirebaseAuth
|
||||
import com.healthjournal.databinding.ActivityRegisterBinding
|
||||
import com.healthjournal.ui.users.UsersInputActivity
|
||||
|
||||
class RegisterActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityRegisterBinding
|
||||
private lateinit var user: FirebaseAuth
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityRegisterBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
user = FirebaseAuth.getInstance()
|
||||
setuplistener()
|
||||
}
|
||||
|
||||
private fun setuplistener(){
|
||||
binding.btnRegister.setOnClickListener{
|
||||
registerUser()
|
||||
}
|
||||
binding.btnLogin.setOnClickListener{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private fun registerUser(){
|
||||
val email = binding.edtEmail.text.toString()
|
||||
val password = binding.edtPassword.text.toString()
|
||||
val confirmPassword = binding.edtPasswordConfirm.text.toString()
|
||||
|
||||
if (email.isEmpty() || password.isEmpty() || confirmPassword.isEmpty()){
|
||||
if (email.isEmpty()) binding.edtEmail.error = "Email cannot be empty"
|
||||
if (password.isEmpty()) binding.edtPassword.error = "Password cannot be empty"
|
||||
if (confirmPassword.isEmpty()) binding.edtPasswordConfirm.error = "Confirm Password cannot be empty"
|
||||
} else {
|
||||
if (password == confirmPassword){
|
||||
user.createUserWithEmailAndPassword(email, password).addOnCompleteListener(RegisterActivity()){ task ->
|
||||
if(task.isSuccessful){
|
||||
Toast.makeText(this, "Register Success", Toast.LENGTH_SHORT).show()
|
||||
startActivity(Intent(this@RegisterActivity,UsersInputActivity::class.java))
|
||||
finish()
|
||||
} else{
|
||||
Toast.makeText(this, task.exception!!.message, Toast.LENGTH_SHORT).show()
|
||||
Log.d("error", task.exception!!.message.toString())
|
||||
}
|
||||
}
|
||||
} else {
|
||||
binding.edtPasswordConfirm.error = "Password does not match"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.healthjournal.ui.splashscreen
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.healthjournal.R
|
||||
|
||||
class SplashscreenActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
setContentView(R.layout.activity_splashscreen)
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
|
||||
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||
insets
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package com.healthjournal.ui.users
|
||||
|
||||
import android.app.DatePickerDialog
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.google.firebase.Firebase
|
||||
import com.google.firebase.auth.FirebaseAuth
|
||||
import com.google.firebase.database.database
|
||||
import com.healthjournal.databinding.ActivityUsersInputBinding
|
||||
import com.healthjournal.ui.dashboard.MainActivity
|
||||
import java.util.Calendar
|
||||
|
||||
class UsersInputActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityUsersInputBinding
|
||||
private lateinit var user: FirebaseAuth
|
||||
private val database = Firebase.database
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityUsersInputBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
user = FirebaseAuth.getInstance()
|
||||
val gender = arrayOf("Male", "Female", "Other")
|
||||
|
||||
// Adapter for conditions
|
||||
val conditionAdapter = ArrayAdapter(this, android.R.layout.simple_list_item_1, gender)
|
||||
binding.dropdownGender.setAdapter(conditionAdapter)
|
||||
|
||||
userCheck()
|
||||
setuplistener()
|
||||
}
|
||||
|
||||
private fun userCheck(){
|
||||
if(user.currentUser != null){
|
||||
user.currentUser?.let {
|
||||
binding.tvEmail.text = it.email
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setuplistener(){
|
||||
binding.btnInput.setOnClickListener{
|
||||
inputUserData()
|
||||
}
|
||||
|
||||
binding.edtDateOfBirth.setOnClickListener{
|
||||
datepicker()
|
||||
}
|
||||
}
|
||||
|
||||
private fun datepicker(){
|
||||
val calendar = Calendar.getInstance()
|
||||
val year = calendar.get(Calendar.YEAR)
|
||||
val month = calendar.get(Calendar.MONTH)
|
||||
val day = calendar.get(Calendar.DAY_OF_MONTH)
|
||||
|
||||
val datePickerDialog = DatePickerDialog(
|
||||
this,
|
||||
{ _, selectedYear, selectedMonth, selectedDay ->
|
||||
val selectedDate = "$selectedDay/${selectedMonth + 1}/$selectedYear"
|
||||
binding.edtDateOfBirth.setText(selectedDate)
|
||||
},
|
||||
year, month, day
|
||||
)
|
||||
datePickerDialog.show()
|
||||
}
|
||||
|
||||
private fun inputUserData() {
|
||||
val userID = user.currentUser?.uid
|
||||
val name = binding.edtName.text.toString()
|
||||
val gender = binding.dropdownGender.text.toString()
|
||||
val date = binding.edtDateOfBirth.text.toString()
|
||||
val weight = binding.edtInputWeight.text.toString()
|
||||
val height = binding.edtInputHeigh.text.toString()
|
||||
if(userID != null){
|
||||
if (name.isNotEmpty() && gender.isNotEmpty() && date.isNotEmpty() && weight.isNotEmpty() && height.isNotEmpty()){
|
||||
val data = hashMapOf(
|
||||
"name" to name,
|
||||
"gender" to gender,
|
||||
"date" to date,
|
||||
"height" to height,
|
||||
"weight" to weight)
|
||||
database.getReference("users").child(userID).setValue(data).addOnCompleteListener(UsersInputActivity()){
|
||||
if(it.isSuccessful){
|
||||
Toast.makeText(this, "Data Input Success", Toast.LENGTH_SHORT).show()
|
||||
startActivity(Intent(this@UsersInputActivity, MainActivity::class.java))
|
||||
finish()
|
||||
} else{
|
||||
Toast.makeText(this, it.exception!!.message, Toast.LENGTH_SHORT).show()
|
||||
Log.d("error", it.exception!!.message.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
9
app/src/main/res/drawable/bg_button.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="10dp"/>
|
||||
<solid android:color="@color/Primary_Light"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
8
app/src/main/res/drawable/bg_edt_default.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<stroke android:color="@color/Primary_Dark" android:width="2dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
8
app/src/main/res/drawable/bg_edt_error.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<stroke android:color="@color/design_default_color_error" android:width="2dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
12
app/src/main/res/drawable/bg_form.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="10dp"/>
|
||||
<solid android:color="@color/white"/>
|
||||
<stroke
|
||||
android:width="3dp"
|
||||
android:color="@color/Primary_Dark" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
12
app/src/main/res/drawable/bg_input.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="10dp"/>
|
||||
<solid android:color="@color/Secondary_Light"/>
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/Primary_Dark" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
BIN
app/src/main/res/drawable/bg_login.png
Normal file
After Width: | Height: | Size: 58 KiB |
12
app/src/main/res/drawable/bg_profile.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="10dp"/>
|
||||
<solid android:color="@color/Accent_Dark_Gray"/>
|
||||
<stroke
|
||||
android:width="3dp"
|
||||
android:color="@color/Primary_Dark" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
BIN
app/src/main/res/drawable/cuboid.png
Normal file
After Width: | Height: | Size: 843 B |
BIN
app/src/main/res/drawable/cuboid_green.png
Normal file
After Width: | Height: | Size: 881 B |
12
app/src/main/res/drawable/daily_counter.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="10dp"/>
|
||||
<solid android:color="@color/white"/>
|
||||
<stroke
|
||||
android:width="2dp"
|
||||
android:color="@color/Primary_Dark" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
BIN
app/src/main/res/drawable/frame_1.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
app/src/main/res/drawable/frame_2.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/drawable/frame_3.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
app/src/main/res/drawable/frame_4.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
app/src/main/res/drawable/ic_add.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
app/src/main/res/drawable/ic_home.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
170
app/src/main/res/drawable/ic_launcher_background.xml
Normal file
@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
30
app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<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">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
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"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
BIN
app/src/main/res/drawable/ic_profile.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
app/src/main/res/drawable/profile_dummy_img.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/font/poppins_regular.ttf
Normal file
229
app/src/main/res/layout/activity_detail_journal.xml
Normal file
@ -0,0 +1,229 @@
|
||||
<?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/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/Secondary_Light"
|
||||
tools:context=".ui.journal.detail.DetailJournalActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="250dp"
|
||||
android:background="@color/Accent_Dark_Gray"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="JOURNAL DETAIL"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodsugar_level1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Blood Sugar Level :"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.375"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodsugar_level2"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/Accent_Light_Red"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="10dp"
|
||||
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.02"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_bloodsugar_level1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title"
|
||||
tools:text="100 mg/dL" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodsugar_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="8sp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_bloodsugar_level2"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_bloodsugar_level1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodsugar_level1"
|
||||
tools:text="Your blood sugar level is within the normal range. Maintain a balanced diet and regular exercise." />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodpressure_level1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Blood Pressure Level :"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.408"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodsugar_desc" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodpressure_level2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/Accent_Light_Red"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.02"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_bloodpressure_level1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodsugar_desc"
|
||||
tools:text="119/70 mm Hg" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodpressure_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="8sp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_bloodpressure_level2"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_bloodpressure_level1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodpressure_level1"
|
||||
tools:text="Your blood sugar level is within the normal range. Maintain a balanced diet and regular exercise." />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_BMI_level1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="BMI(Body Mass Index) :"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.426"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodpressure_desc" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_BMI_level2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/Accent_Light_Red"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.02"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_BMI_level1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodpressure_desc"
|
||||
tools:text="22.03 BMI" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_BMI_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="8sp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_BMI_level2"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_BMI_level1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_BMI_level1"
|
||||
tools:text="This is still considered an acceptable range, and is associated with good health." />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_goals1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Recommend Goals Completed :"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.554"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_BMI_desc" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_goals2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/Accent_Light_Red"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.02"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_goals1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_BMI_desc"
|
||||
tools:text="3" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title_note"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="JOURNAL NOTES"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_journal_note"
|
||||
android:layout_width="320dp"
|
||||
android:layout_height="325dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:padding="5dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title_note"
|
||||
android:background="@drawable/bg_form">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_journal_note"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vehicula quam et diam consequat, et vestibulum odio consequat. Curabitur sit amet ex auctor ex pharetra placerat a lacinia sapien. In semper nisl eu elit elementum ultrices. Ut hendrerit urna lacinia efficitur euismod. In hac habitasse platea dictumst. Phasellus id tellus sed justo scelerisque vestibulum sit amet commodo tellus. Proin commodo magna purus, non ullamcorper mi blandit sed. Curabitur scelerisque eros nisi, vitae bibendum quam malesuada et. Suspendisse potenti. Vestibulum eu dui a odio posuere laoreet sed ut lectus. Vivamus ultrices sem sit amet enim dictum rhoncus. Nullam pharetra, purus sed bibendum volutpat, diam nibh blandit nunc, ut gravida velit sem eget eros. Maecenas in arcu accumsan, maximus enim id, ullamcorper metus. Morbi blandit nisi non justo hendrerit, in semper velit feugiat. Vestibulum vestibulum nisl sit amet facilisis ullamcorper."
|
||||
android:textSize="10sp"
|
||||
tools:layout_editor_absoluteX="0dp"
|
||||
tools:layout_editor_absoluteY="0dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_delete_history"
|
||||
android:layout_width="320dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:text="Delete History"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:backgroundTint="@color/Accent_Light_Orange"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_journal_note" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
320
app/src/main/res/layout/activity_journal_input.xml
Normal file
@ -0,0 +1,320 @@
|
||||
<?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/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/Secondary_Light"
|
||||
tools:context=".ui.journal.input.JournalInputActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_body"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="600dp"
|
||||
android:background="@drawable/bg_profile"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title_journal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Please input your today data"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<de.hdodenhof.circleimageview.CircleImageView
|
||||
android:id="@+id/iv_user"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:src="@drawable/profile_dummy_img"
|
||||
app:civ_border_color="@color/Primary_Dark"
|
||||
app:civ_border_width="2dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title_journal" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_input_blood_pressure_SYS"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:padding="5dp"
|
||||
android:background="@drawable/bg_input"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_user"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_user"
|
||||
app:layout_constraintVertical_bias="0.02">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_input_blood_pressure_SYS"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Blood Pressure\n(SYS)"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="8sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_input_blood_pressure_SYS"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="25dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_input_blood_pressure_SYS">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_input_blood_pressure_SYS"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:inputType="number" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_input_blood_pressure_DIA"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:padding="5dp"
|
||||
android:background="@drawable/bg_input"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.6"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_input_blood_pressure_SYS"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_user"
|
||||
app:layout_constraintVertical_bias="0.019">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_input_blood_pressure_DIA"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Blood Pressure\n(DIA)"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="8sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_input_blood_pressure_DIA"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_input_blood_pressure_DIA">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_input_blood_pressure_DIA"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:inputType="number" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_input_blood_sugar"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:padding="5dp"
|
||||
android:background="@drawable/bg_input"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_user"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_input_blood_pressure_SYS"
|
||||
app:layout_constraintVertical_bias="0.05">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_input_blood_sugar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Blood Sugar \nLevel"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="8sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_input_blood_sugar"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="25dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_input_blood_sugar">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_input_blood_sugar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:inputType="number" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_input_weight"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:padding="5dp"
|
||||
android:background="@drawable/bg_input"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.6"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_input_blood_pressure_SYS"
|
||||
app:layout_constraintTop_toBottomOf="@id/cl_input_blood_pressure_DIA"
|
||||
app:layout_constraintVertical_bias="0.05">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_input_weight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Weight"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="8sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_input_weight"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginTop="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_input_weight">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_input_weight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:inputType="number" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
<EditText
|
||||
android:id="@+id/edt_gender"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:visibility="gone"
|
||||
android:background="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
<EditText
|
||||
android:id="@+id/edt_age"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:visibility="gone"
|
||||
android:background="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
<EditText
|
||||
android:id="@+id/edt_height"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:visibility="gone"
|
||||
android:background="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_input_note"
|
||||
android:layout_width="224dp"
|
||||
android:layout_height="200dp"
|
||||
android:background="@drawable/bg_input"
|
||||
app:layout_constraintBottom_toTopOf="@+id/btn_input_data"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_input_weight"
|
||||
app:layout_constraintVertical_bias="0.538">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_input_note"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="NOTES"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="8sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_input_note"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_input_note">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_input_note"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="text"
|
||||
android:background="@color/white" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_input_data"
|
||||
android:layout_width="254dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginBottom="36dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:text="Input Data"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:backgroundTint="@color/Primary_Dark"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
173
app/src/main/res/layout/activity_login.xml
Normal file
@ -0,0 +1,173 @@
|
||||
<?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/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_login"
|
||||
tools:context=".ui.login.LoginActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="336dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_form"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.493"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.36">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView8"
|
||||
android:layout_width="106dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Welcome to"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView9"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="128dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Health Journal"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Login to your account and documented your health"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_email"
|
||||
android:layout_width="37dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Email"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView10" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_email"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_email">
|
||||
|
||||
<com.healthjournal.ui.custom.CustomEditText
|
||||
android:id="@+id/edt_email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="textEmailAddress"
|
||||
tools:ignore="SpeakableTextPresentCheck" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_password"
|
||||
android:layout_width="63dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Password"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tl_email" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_password"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
app:endIconMode="password_toggle"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_password">
|
||||
|
||||
<com.healthjournal.ui.custom.CustomEditText
|
||||
android:id="@+id/edt_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:textColor="@color/black"
|
||||
android:inputType="textPassword"
|
||||
tools:ignore="SpeakableTextPresentCheck" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_forgot_pswd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Forgot Password"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/tl_password"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tl_password" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_login"
|
||||
android:layout_width="254dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:text="Login"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:backgroundTint="@color/Primary_Dark"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tl_password"
|
||||
app:layout_constraintStart_toStartOf="@+id/tl_password"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tl_password" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_register"
|
||||
android:layout_width="166dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Don't have an account? Register"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/btn_login"
|
||||
app:layout_constraintStart_toStartOf="@+id/btn_login"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btn_login" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
405
app/src/main/res/layout/activity_main.xml
Normal file
@ -0,0 +1,405 @@
|
||||
<?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/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.dashboard.MainActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_Health_Report"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="20dp"
|
||||
android:background="@color/Accent_Dark_Gray"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_Daily_Report_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="HEALTH REPORT"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sub_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="Instruksi Pengukuran Data Yang Optimal"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_instruction_1"
|
||||
android:layout_width="203dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:background="@drawable/frame_1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_sub_title" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_instruction_2"
|
||||
android:layout_width="203dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="2dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:background="@drawable/frame_2"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_instruction_1"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_instruction_3"
|
||||
android:layout_width="203dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:background="@drawable/frame_3"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_instruction_2"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_instruction_4"
|
||||
android:layout_width="203dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:background="@drawable/frame_4"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_instruction_3"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_Daily_Report_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="TODAY HEALTH REPORT"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sub_title_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="Hasil Data Yang Diambil Hari Ini"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Light"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title_2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sub_title_BSL"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="Blood Sugar Level : "
|
||||
android:textColor="@color/Primary_Light"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_title_2"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_sub_title_2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodsugar_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:text="100 mg/dL"
|
||||
android:textColor="@color/Accent_Light_Red"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_sub_title_BSL"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_sub_title_BSL"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_sub_title_2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodsugar_desc"
|
||||
android:layout_width="190dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Your blood sugar level is within the normal range. Maintain a balanced diet and regular exercise."
|
||||
android:textSize="8sp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_bloodsugar_level"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_title_BSL"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_sub_title_BSL" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sub_title_BPL"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/Primary_Light"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="Blood Pressure Level : "
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_title_2"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_bloodsugar_desc" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodpressure_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="119/70 mm Hg"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" android:textColor="@color/Accent_Light_Red"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_sub_title_BPL"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_sub_title_BPL"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_sub_title_BPL"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodpressure_desc"
|
||||
android:layout_width="190dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Your blood pressure is within the normal range. Continue a heart-healthy lifestyle."
|
||||
android:textSize="8sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_title_BPL"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_sub_title_BPL" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sub_title_BMI"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:textColor="@color/Primary_Light"
|
||||
android:text="BMI(Body Mass Index) : "
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_sub_title_2"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_title_2"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_bloodpressure_desc" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bmi_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="22.03 BMI"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/Accent_Light_Red"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_sub_title_BMI"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_sub_title_BMI"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_sub_title_BMI"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bmi_desc"
|
||||
android:layout_width="190dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="This is still considered an acceptable range, and is associated with good health."
|
||||
android:textSize="8sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_title_BMI"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_sub_title_BMI" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:id="@+id/materialDivider"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.700" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/fl_daily_counter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:padding="5dp"
|
||||
android:background="@drawable/daily_counter"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.496"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/materialDivider">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cuboid_indicator_1_orange"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/cuboid"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_title_dailycounter"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cuboid_indicator_1_green"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/cuboid_green"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_title_dailycounter"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title_dailycounter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Pemeriksaan Minggu ini"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textStyle="bold"
|
||||
android:textAllCaps="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_daily_counter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0 / 7"
|
||||
android:textColor="@color/Accent_Light_Red"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title_dailycounter" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cuboid_indicator_2_orange"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/cuboid"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_title_dailycounter"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_cuboid_indicator_2_green"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/cuboid_green"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_title_dailycounter"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_input_data"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:text="Masukan Data Sekarang"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:backgroundTint="@color/Accent_Light_Orange"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.496"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fl_daily_counter"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_recomendation"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:visibility="gone"
|
||||
android:text="Rekomendasi Sekarang"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:backgroundTint="@color/Primary_Light"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.496"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fl_daily_counter"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_health_history"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:listitem="@layout/item_health_history"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_Health_Report" />
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/bottom_navigation"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@color/Primary_Light"
|
||||
app:itemIconTint="@color/white"
|
||||
app:itemTextColor="@color/white"
|
||||
app:menu="@menu/bottom_nav_menu"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
305
app/src/main/res/layout/activity_profile.xml
Normal file
@ -0,0 +1,305 @@
|
||||
<?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/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_login"
|
||||
tools:context=".ui.profile.ProfileActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/bg_profile"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<de.hdodenhof.circleimageview.CircleImageView
|
||||
android:id="@+id/iv_user"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="90dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="5dp"
|
||||
android:src="@drawable/profile_dummy_img"
|
||||
app:civ_border_color="@color/Primary_Dark"
|
||||
app:civ_border_width="2dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.081"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_myname"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Dias Syahadatputra"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_user"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.365" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_myemail"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="diassdp.school@gmail.com"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_myname"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_myname" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_body"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="28dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/bg_profile"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_header">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Name"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_name"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_name">
|
||||
|
||||
<com.healthjournal.ui.custom.CustomEditText
|
||||
android:id="@+id/edt_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:ems="10"
|
||||
android:inputType="textEmailAddress"
|
||||
tools:ignore="SpeakableTextPresentCheck" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_email"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Email"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tl_name" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_email"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_email">
|
||||
|
||||
<com.healthjournal.ui.custom.CustomEditText
|
||||
android:id="@+id/edt_email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:ems="10"
|
||||
android:inputType="textEmailAddress"
|
||||
tools:ignore="SpeakableTextPresentCheck" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Date Of Birth"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tl_email" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_dates"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tl_email"
|
||||
app:layout_constraintVertical_bias="0.119">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_dates"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:background="@color/white" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_input_height"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:background="@drawable/bg_input"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.096"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tl_dates"
|
||||
app:layout_constraintVertical_bias="0.226">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_input_height"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="HEIGHT"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="8sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_input_height"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_input_height">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_input_height"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:background="@color/white" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_input_weight"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:background="@drawable/bg_input"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.828"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_input_height"
|
||||
app:layout_constraintTop_toTopOf="@id/cl_input_height"
|
||||
app:layout_constraintVertical_bias="0.0">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_input_weight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="WEIGHT"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="8sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_input_weight"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_input_weight">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_input_weight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:background="@color/white" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_update_data"
|
||||
android:layout_width="254dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:text="Input Data"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:backgroundTint="@color/Primary_Dark"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.496"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_input_height" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_logout"
|
||||
android:layout_width="254dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_margin="20dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:text="Logout"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:backgroundTint="@color/Accent_Light_Orange"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.52"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btn_update_data"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
176
app/src/main/res/layout/activity_recommendation.xml
Normal file
@ -0,0 +1,176 @@
|
||||
<?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/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.recommendation.RecommendationActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="250dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:background="@color/Accent_Dark_Gray"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="TODAY HEALTH"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodsugar_level1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="Blood Sugar Level :"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.375"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodsugar_level2"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/Accent_Light_Red"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_bloodsugar_level1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.02"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_bloodsugar_level1"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_bloodsugar_level1"
|
||||
tools:text="100 mg/dL" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodsugar_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="8sp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_bloodsugar_level2"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_bloodsugar_level1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodsugar_level1"
|
||||
tools:text="Your blood sugar level is within the normal range. Maintain a balanced diet and regular exercise." />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodpressure_level1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="Blood Pressure Level :"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.408"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodsugar_desc" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodpressure_level2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textColor="@color/Accent_Light_Red"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_bloodpressure_level1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.018"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_bloodpressure_level1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodsugar_desc"
|
||||
tools:text="119/70 mm Hg" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodpressure_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="8sp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_bloodpressure_level2"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_bloodpressure_level1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodpressure_level1"
|
||||
tools:text="Your blood sugar level is within the normal range. Maintain a balanced diet and regular exercise." />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_BMI_level1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="BMI(Body Mass Index) :"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.426"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodpressure_desc" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_BMI_level2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLength="9"
|
||||
android:textColor="@color/Accent_Light_Red"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_BMI_level1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.02"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_BMI_level1"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_BMI_level1"
|
||||
tools:text="22.03 BMI" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_BMI_desc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="8sp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_BMI_level2"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_BMI_level1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_BMI_level1"
|
||||
tools:text="This is still considered an acceptable range, and is associated with good health." />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title_recommendation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="TODAY RECOMMENDATION"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_tasks"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:itemCount="4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:listitem="@layout/item_goals_recommendation"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title_recommendation" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
198
app/src/main/res/layout/activity_register.xml
Normal file
@ -0,0 +1,198 @@
|
||||
<?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/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_login"
|
||||
tools:context=".ui.register.RegisterActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="336dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_form"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.493"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.36">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView8"
|
||||
android:layout_width="106dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Welcome to"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView9"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="128dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Health Journal"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Login to your account and documented your health"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_email"
|
||||
android:layout_width="37dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Email"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView10" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_email"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_email">
|
||||
|
||||
<com.healthjournal.ui.custom.CustomEditText
|
||||
android:id="@+id/edt_email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:textColor="@color/black"
|
||||
android:inputType="textEmailAddress"
|
||||
tools:ignore="SpeakableTextPresentCheck" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_password"
|
||||
android:layout_width="63dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Password"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tl_email" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_password"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
app:endIconMode="password_toggle"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_password">
|
||||
|
||||
<com.healthjournal.ui.custom.CustomEditText
|
||||
android:id="@+id/edt_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:textColor="@color/black"
|
||||
android:inputType="textPassword"
|
||||
tools:ignore="SpeakableTextPresentCheck" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_password_confirm"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Confirm Password"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tl_password" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_password_confirm"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
app:endIconMode="password_toggle"
|
||||
android:textColor="@color/black"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_password_confirm">
|
||||
|
||||
<com.healthjournal.ui.custom.CustomEditText
|
||||
android:id="@+id/edt_password_confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:inputType="textPassword"
|
||||
android:textColor="@color/black"
|
||||
tools:ignore="SpeakableTextPresentCheck" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_register"
|
||||
android:layout_width="254dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:text="Login"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:backgroundTint="@color/Primary_Dark"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tl_password_confirm"
|
||||
app:layout_constraintStart_toStartOf="@+id/tl_password_confirm"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tl_password_confirm" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_login"
|
||||
android:layout_width="166dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Already have an account? Login"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/btn_register"
|
||||
app:layout_constraintStart_toStartOf="@+id/btn_register"
|
||||
app:layout_constraintTop_toBottomOf="@+id/btn_register" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
10
app/src/main/res/layout/activity_splashscreen.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?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/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.splashscreen.SplashscreenActivity">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
299
app/src/main/res/layout/activity_users_input.xml
Normal file
@ -0,0 +1,299 @@
|
||||
<?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/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_login"
|
||||
tools:context=".ui.users.UsersInputActivity">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="336dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_form"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.493"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.36">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView8"
|
||||
android:layout_width="106dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="60dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Welcome to"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView9"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="160dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Health Journal"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Please input your starting data"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView8" />
|
||||
|
||||
<de.hdodenhof.circleimageview.CircleImageView
|
||||
android:id="@+id/iv_user"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="20dp"
|
||||
android:src="@drawable/profile_dummy_img"
|
||||
app:civ_border_color="@color/Primary_Dark"
|
||||
app:civ_border_width="2dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView10"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_email"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
tools:text="Email"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_user" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_input_blood_pressure_SYS"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:padding="10dp"
|
||||
android:background="@drawable/bg_input"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_user"
|
||||
app:layout_constraintHorizontal_bias="0.779"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_email"
|
||||
app:layout_constraintVertical_bias="0.021">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_input_weight"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Berat\nBadan"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_input_weight"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="40dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_input_weight">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_input_weight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_input_blood_pressure_DIA"
|
||||
android:layout_width="100dp"
|
||||
android:padding="10dp"
|
||||
android:layout_height="100dp"
|
||||
android:background="@drawable/bg_input"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.687"
|
||||
app:layout_constraintStart_toEndOf="@+id/cl_input_blood_pressure_SYS"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_email"
|
||||
app:layout_constraintVertical_bias="0.021">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_input_height"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Tinggi\nBadan"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_input_heigh"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_input_height">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_input_heigh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:textColor="@color/black" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Name"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cl_input_blood_pressure_DIA" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_name"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_name">
|
||||
<com.healthjournal.ui.custom.CustomEditText
|
||||
android:id="@+id/edt_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:textColor="@color/black"
|
||||
android:ems="10"
|
||||
tools:ignore="SpeakableTextPresentCheck" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
<TextView
|
||||
android:id="@+id/tv_gender"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Gender"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tl_name" />
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_gender"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:hint="Select Gender"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_gender">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/dropdown_gender"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
android:inputType="none" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Date Of Birth"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tl_gender" />
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tl_date_of_birth"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="32dp"
|
||||
android:hint="Select Date of Birth"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_date">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_date_of_birth"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:focusable="false"
|
||||
android:clickable="true"
|
||||
android:textColor="@color/black" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_input"
|
||||
android:layout_width="254dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:text="Input Data"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:backgroundTint="@color/Primary_Dark"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tl_date_of_birth" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
41
app/src/main/res/layout/item_goals_recommendation.xml
Normal file
@ -0,0 +1,41 @@
|
||||
<?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"
|
||||
android:layout_width="320dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/bg_profile">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_goal_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:singleLine="true"
|
||||
android:text="Today Goal"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_goal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:text="Exercise for 40 Minutes "
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_goal_name" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
124
app/src/main/res/layout/item_health_history.xml
Normal file
@ -0,0 +1,124 @@
|
||||
<?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:background="@drawable/bg_profile"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_width="350dp"
|
||||
android:layout_height="120dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_day"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="280dp"
|
||||
android:text="Friday"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_date"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.043" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="12/07/2024"
|
||||
android:textColor="@color/Primary_Light"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.058"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_day"
|
||||
app:layout_constraintVertical_bias="0.038" />
|
||||
|
||||
<de.hdodenhof.circleimageview.CircleImageView
|
||||
android:id="@+id/iv_user"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginStart="20dp"
|
||||
android:src="@drawable/profile_dummy_img"
|
||||
app:civ_border_color="@color/Primary_Dark"
|
||||
app:civ_border_width="2dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_date"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_date"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sub_BSL"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Blood Sugar Level : "
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.086"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_user"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.346" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_BS_Level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="100 mg/dL"
|
||||
android:textColor="@color/Accent_Light_Red"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_sub_BSL"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_sub_BSL"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_sub_BSL"
|
||||
app:layout_constraintVertical_bias="0.326" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sub_BPL"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="88dp"
|
||||
android:text="Blood Pressure Level :"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.342"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_user"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_sub_BSL"
|
||||
app:layout_constraintVertical_bias="0.042" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_BP_Level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="119/70 mm Hg"
|
||||
android:textColor="@color/Accent_Light_Red"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_sub_BPL"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_sub_BPL"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_sub_BPL"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sub_goals"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="28dp"
|
||||
android:text="Recommended goals completed"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.387"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_user"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_sub_BPL"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="[lorem ipsum]"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_sub_goals"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_goals"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_sub_goals" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
15
app/src/main/res/menu/bottom_nav_menu.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/nav_home"
|
||||
android:icon="@drawable/ic_home"
|
||||
android:title="Home"/>
|
||||
<item
|
||||
android:id="@+id/nav_add"
|
||||
android:icon="@drawable/ic_add"
|
||||
android:title="Add"/>
|
||||
<item
|
||||
android:id="@+id/nav_profile"
|
||||
android:icon="@drawable/ic_profile"
|
||||
android:title="Profile"/>
|
||||
</menu>
|
6
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
6
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
BIN
app/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 982 B |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Normal file
After Width: | Height: | Size: 7.6 KiB |
7
app/src/main/res/values-night/themes.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.HealthJournal" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your dark theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
||||
</style>
|
||||
</resources>
|
16
app/src/main/res/values/colors.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
|
||||
<color name="Primary_Dark">#004343</color>
|
||||
<color name="Primary_Light">#006C6C</color>
|
||||
|
||||
<color name="Secondary_Dark">#7ABDBD</color>
|
||||
<color name="Secondary_Light">#E8F4F8</color>
|
||||
|
||||
<color name="Accent_Dark_Gray">#D9D9D9</color>
|
||||
|
||||
<color name="Accent_Light_Orange">#FF5722</color>
|
||||
<color name="Accent_Light_Red">#FF0000</color>
|
||||
</resources>
|
10
app/src/main/res/values/strings.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<resources>
|
||||
<string name="app_name">Health Journal</string>
|
||||
|
||||
|
||||
// Validation
|
||||
<string name="email_validation">Masukkan alamat email yang valid!</string>
|
||||
<string name="password_length">Kolom ini tidak boleh kurang dari 8 karakter!</string>
|
||||
<string name="empty_field">Kolom ini tidak boleh kosong!</string>
|
||||
<string name="required_field">This field is required!</string>
|
||||
</resources>
|
9
app/src/main/res/values/themes.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.HealthJournal" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your light theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
||||
</style>
|
||||
|
||||
<style name="Theme.HealthJournal" parent="Base.Theme.HealthJournal" />
|
||||
</resources>
|
13
app/src/main/res/xml/backup_rules.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample backup rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/guide/topics/data/autobackup
|
||||
for details.
|
||||
Note: This file is ignored for devices older that API 31
|
||||
See https://developer.android.com/about/versions/12/backup-restore
|
||||
-->
|
||||
<full-backup-content>
|
||||
<!--
|
||||
<include domain="sharedpref" path="."/>
|
||||
<exclude domain="sharedpref" path="device.xml"/>
|
||||
-->
|
||||
</full-backup-content>
|
19
app/src/main/res/xml/data_extraction_rules.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample data extraction rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
|
||||
for details.
|
||||
-->
|
||||
<data-extraction-rules>
|
||||
<cloud-backup>
|
||||
<!-- TODO: Use <include> and <exclude> to control what is backed up.
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
-->
|
||||
</cloud-backup>
|
||||
<!--
|
||||
<device-transfer>
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
</device-transfer>
|
||||
-->
|
||||
</data-extraction-rules>
|
17
app/src/test/java/com/healthjournal/ExampleUnitTest.kt
Normal file
@ -0,0 +1,17 @@
|
||||
package com.healthjournal
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
class ExampleUnitTest {
|
||||
@Test
|
||||
fun addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2)
|
||||
}
|
||||
}
|