Compare commits
10 Commits
b1f05c0d1c
...
7768210d64
Author | SHA1 | Date | |
---|---|---|---|
7768210d64 | |||
1aa29f0e23 | |||
7474a84575 | |||
e2882ad0f6 | |||
c8cf5e4099 | |||
5e9a54443f | |||
649229579b | |||
db9c19a17a | |||
d96b96bf42 | |||
d8cb493832 |
@ -50,6 +50,7 @@ dependencies {
|
||||
implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
|
||||
implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
|
||||
|
||||
implementation ("com.github.PhilJay:MPAndroidChart:v3.1.0")
|
||||
|
||||
// Firebase libraries
|
||||
implementation(libs.firebase.database)
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
xmlns:tools="http://schemas.android.com/tools" >
|
||||
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
|
||||
@ -13,7 +13,14 @@
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.HealthJournal"
|
||||
tools:targetApi="31">
|
||||
tools:targetApi="31" >
|
||||
<activity
|
||||
android:name=".ui.laporan.laporan"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".laporan"
|
||||
android:exported="false"
|
||||
android:theme="@style/Theme.HealthJournal" />
|
||||
<activity
|
||||
android:name=".ui.journal.detail.DetailJournalActivity"
|
||||
android:exported="false" />
|
||||
@ -37,10 +44,10 @@
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.login.LoginActivity"
|
||||
android:exported="false"/>
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".ui.dashboard.MainActivity"
|
||||
android:exported="true">
|
||||
android:exported="true" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
BIN
app/src/main/ic_launcher-playstore.png
Normal file
After Width: | Height: | Size: 207 KiB |
@ -21,14 +21,14 @@ class AlgoritmaKesehatan {
|
||||
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."
|
||||
healthData.bloodSugar in 70.0..130.0 -> "Gula darah normal, pertahankan pola makan sehat."
|
||||
healthData.bloodSugar > 130 -> "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."
|
||||
healthData.bloodSugar in 70.0..120.0 -> "Gula darah normal, jaga pola makan seimbang."
|
||||
healthData.bloodSugar > 120 -> "Gula darah tinggi, batasi konsumsi gula dan periksa kesehatan secara berkala."
|
||||
else -> "Data gula darah tidak valid."
|
||||
}
|
||||
else -> "Data gula darah tidak valid."
|
||||
@ -74,7 +74,6 @@ class AlgoritmaKesehatan {
|
||||
fun getTaskBasedData(healthData: HealthData): List<Map<String, Any>> {
|
||||
val tasks = mutableListOf<Map<String, Any>>()
|
||||
|
||||
// Task for Blood Sugar Control
|
||||
when {
|
||||
healthData.bloodSugar > 140 -> {
|
||||
tasks.add(mapOf("task" to "Kurangi konsumsi makanan tinggi gula dan karbohidrat olahan.", "completed" to false))
|
||||
@ -91,7 +90,6 @@ class AlgoritmaKesehatan {
|
||||
}
|
||||
}
|
||||
|
||||
// Task for Blood Pressure Control
|
||||
when {
|
||||
healthData.systolicBP > 120 || healthData.diastolicBP > 80 -> {
|
||||
tasks.add(mapOf("task" to "Lakukan olahraga ringan seperti jalan kaki selama 30 menit.", "completed" to false))
|
||||
@ -107,7 +105,6 @@ class AlgoritmaKesehatan {
|
||||
}
|
||||
}
|
||||
|
||||
// Task for BMI Control
|
||||
when {
|
||||
healthData.BMI > 25 -> {
|
||||
tasks.add(mapOf("task" to "Lakukan olahraga rutin minimal 3 kali seminggu.", "completed" to false))
|
||||
|
@ -0,0 +1,62 @@
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Rect
|
||||
import android.widget.Button
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import com.github.mikephil.charting.components.MarkerView
|
||||
import com.github.mikephil.charting.data.Entry
|
||||
import com.github.mikephil.charting.highlight.Highlight
|
||||
import com.github.mikephil.charting.utils.MPPointF
|
||||
import com.healthjournal.R
|
||||
import com.healthjournal.data.ResultData
|
||||
import com.healthjournal.ui.journal.detail.DetailJournalActivity
|
||||
|
||||
class MyMarkerView(
|
||||
private val context: Context,
|
||||
private val dataList: List<ResultData>
|
||||
) : MarkerView(context, R.layout.marker_view) {
|
||||
|
||||
private val tvContent: TextView = findViewById(R.id.tvContent)
|
||||
private var lastHighlightedIndex: Int? = null
|
||||
|
||||
override fun refreshContent(e: Entry?, highlight: Highlight?) {
|
||||
e?.let {
|
||||
val index = e.x.toInt()
|
||||
lastHighlightedIndex = index
|
||||
if (index in dataList.indices) {
|
||||
val item = dataList[index]
|
||||
val content = """
|
||||
Hari: ${getIndonesianDayName(item.date)}
|
||||
Tanggal: ${item.date}
|
||||
Gula Darah: ${item.bloodSugar}
|
||||
BMI: ${item.BMI.toString().substring(0, 4)}
|
||||
Tekanan Darah: ${item.systolicBP}/${item.diastolicBP} mmHg
|
||||
""".trimIndent()
|
||||
tvContent.text = content
|
||||
} else {
|
||||
tvContent.text = ""
|
||||
}
|
||||
}
|
||||
super.refreshContent(e, highlight)
|
||||
}
|
||||
|
||||
override fun getOffset(): MPPointF {
|
||||
return MPPointF(-(width / 2).toFloat(), -height.toFloat())
|
||||
}
|
||||
|
||||
private fun getIndonesianDayName(dateString: String): String {
|
||||
return try {
|
||||
val sdf = java.text.SimpleDateFormat("dd/MM/yyyy", java.util.Locale("id", "ID"))
|
||||
val date = sdf.parse(dateString)
|
||||
if (date != null) {
|
||||
val dayFormat = java.text.SimpleDateFormat("EEEE", java.util.Locale("id", "ID"))
|
||||
dayFormat.format(date)
|
||||
} else {
|
||||
"-"
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
"-"
|
||||
}
|
||||
}
|
||||
}
|
@ -11,18 +11,21 @@ import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
import com.google.firebase.Firebase
|
||||
import com.google.firebase.auth.FirebaseAuth
|
||||
import com.google.firebase.database.DataSnapshot
|
||||
import com.google.firebase.database.DatabaseError
|
||||
import com.google.firebase.database.FirebaseDatabase
|
||||
import com.google.firebase.database.database
|
||||
import com.google.firebase.database.ValueEventListener
|
||||
import com.healthjournal.R
|
||||
import com.healthjournal.data.ResultData
|
||||
import com.healthjournal.databinding.ActivityMainBinding
|
||||
import com.healthjournal.receiver.ReminderReceiver
|
||||
import com.healthjournal.ui.journal.input.JournalInputActivity
|
||||
import com.healthjournal.ui.laporan.laporan
|
||||
import com.healthjournal.ui.login.LoginActivity
|
||||
import com.healthjournal.ui.profile.ProfileActivity
|
||||
import com.healthjournal.ui.recommendation.RecommendationActivity
|
||||
import com.healthjournal.ui.users.UsersInputActivity
|
||||
import com.healthjournal.utils.NotificationUtils
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Calendar
|
||||
@ -39,29 +42,25 @@ class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
// Create notification channel
|
||||
NotificationUtils.createNotificationChannel(this)
|
||||
|
||||
// Schedule reminders
|
||||
scheduleHealthReminders(this)
|
||||
|
||||
setContentView(binding.root)
|
||||
user = FirebaseAuth.getInstance()
|
||||
database = FirebaseDatabase.getInstance()
|
||||
|
||||
userCheck()
|
||||
setupListener()
|
||||
populateHistory()
|
||||
navigationBottomBar()
|
||||
}
|
||||
|
||||
private fun scheduleHealthReminders(context: Context) {
|
||||
val alarmManager = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
||||
|
||||
val daysOfWeek = listOf(Calendar.MONDAY, Calendar.WEDNESDAY, Calendar.FRIDAY)
|
||||
|
||||
for (day in daysOfWeek.shuffled().take(3)) {
|
||||
val calendar = Calendar.getInstance().apply {
|
||||
set(Calendar.DAY_OF_WEEK, day)
|
||||
set(Calendar.HOUR_OF_DAY, 9) // Set reminder at 9 AM
|
||||
set(Calendar.HOUR_OF_DAY, 9)
|
||||
set(Calendar.MINUTE, 0)
|
||||
set(Calendar.SECOND, 0)
|
||||
}
|
||||
@ -74,13 +73,12 @@ class MainActivity : AppCompatActivity() {
|
||||
alarmManager.setRepeating(
|
||||
AlarmManager.RTC_WAKEUP,
|
||||
calendar.timeInMillis,
|
||||
AlarmManager.INTERVAL_DAY * 7, // Repeat every week
|
||||
AlarmManager.INTERVAL_DAY * 7,
|
||||
pendingIntent
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun navigationBottomBar() {
|
||||
val bottomNav = findViewById<BottomNavigationView>(R.id.nav_view)
|
||||
|
||||
@ -102,14 +100,13 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
binding.ivAdd.setOnClickListener {
|
||||
if (dailyReport) {
|
||||
Toast.makeText(this, "Daily Report Already Created", Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(this, "Laporan harian sudah dibuat", Toast.LENGTH_SHORT).show()
|
||||
} else {
|
||||
startActivity(Intent(this, JournalInputActivity::class.java))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun getWeekCount() {
|
||||
val today = Calendar.getInstance()
|
||||
val userID = user.currentUser!!.uid
|
||||
@ -118,21 +115,25 @@ class MainActivity : AppCompatActivity() {
|
||||
val dateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.getDefault())
|
||||
|
||||
today.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY)
|
||||
val startDate = dateFormat.format(today.time)
|
||||
val startDate = today.time
|
||||
|
||||
val endDate = today.clone() as Calendar
|
||||
endDate.add(Calendar.DAY_OF_WEEK, 6)
|
||||
val endDateString = dateFormat.format(endDate.time)
|
||||
val endDateDate = endDate.time
|
||||
|
||||
database.getReference("users").child(userID).child("journal")
|
||||
.get()
|
||||
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
|
||||
val dateString = snapshot.child("date").value.toString()
|
||||
val entryDate = try {
|
||||
dateFormat.parse(dateString)
|
||||
} catch (e: Exception) {
|
||||
null
|
||||
}
|
||||
Log.d("debug", "Entries found: $count for week: $startDate - $endDateString")
|
||||
entryDate?.let { it in startDate..endDateDate } ?: false
|
||||
}
|
||||
Log.d("debug", "Jumlah entri: $count minggu ini: ${dateFormat.format(startDate)} - ${dateFormat.format(endDateDate)}")
|
||||
binding.tvDailyCounter.text = "$count/7"
|
||||
} else {
|
||||
Log.e("error", task.exception?.message.toString())
|
||||
@ -141,39 +142,29 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupListener() {
|
||||
binding.btnRecomendation.setOnClickListener {
|
||||
startActivity(Intent(this, RecommendationActivity::class.java))
|
||||
}
|
||||
|
||||
|
||||
private fun addJournal(){
|
||||
if (dailyReport != false){
|
||||
Toast.makeText(this, "Daily Report Already Created", Toast.LENGTH_SHORT).show()
|
||||
binding.btnInputData.setOnClickListener {
|
||||
if (dailyReport) {
|
||||
Toast.makeText(this, "Laporan harian sudah dibuat", Toast.LENGTH_SHORT).show()
|
||||
} else {
|
||||
startActivity(Intent(this, JournalInputActivity::class.java))
|
||||
}
|
||||
}
|
||||
|
||||
private fun home(){
|
||||
}
|
||||
|
||||
private fun profile(){
|
||||
intent = Intent(this, ProfileActivity::class.java)
|
||||
binding.btnReport.setOnClickListener {
|
||||
val intent = Intent(this, laporan::class.java)
|
||||
intent.putExtra("healthDataList", ArrayList(healthDataList))
|
||||
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() {
|
||||
getWeekCount()
|
||||
val today = SimpleDateFormat("dd/MM/yyyy", Locale.getDefault()).format(android.icu.util.Calendar.getInstance().time).toString()
|
||||
val today = SimpleDateFormat("dd/MM/yyyy", Locale.getDefault()).format(Calendar.getInstance().time)
|
||||
val userID = user.currentUser!!.uid
|
||||
database.getReference("users").child(userID).child("journal").get().addOnCompleteListener { task ->
|
||||
if (task.isSuccessful) {
|
||||
@ -192,11 +183,12 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun switchLayout(){
|
||||
if (binding.clDailyReport1.visibility == View.VISIBLE){
|
||||
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.btnInputData.visibility = View.GONE
|
||||
binding.ivCuboidIndicator1Green.visibility = View.VISIBLE
|
||||
binding.ivCuboidIndicator2Green.visibility = View.VISIBLE
|
||||
binding.ivCuboidIndicator1Orange.visibility = View.INVISIBLE
|
||||
@ -205,6 +197,7 @@ class MainActivity : AppCompatActivity() {
|
||||
binding.clDailyReport1.visibility = View.VISIBLE
|
||||
binding.clDailyReport2.visibility = View.INVISIBLE
|
||||
binding.btnRecomendation.visibility = View.GONE
|
||||
binding.btnInputData.visibility = View.VISIBLE
|
||||
binding.ivCuboidIndicator1Green.visibility = View.INVISIBLE
|
||||
binding.ivCuboidIndicator2Green.visibility = View.INVISIBLE
|
||||
binding.ivCuboidIndicator1Orange.visibility = View.VISIBLE
|
||||
@ -213,22 +206,31 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
private fun userCheck() {
|
||||
val user = FirebaseAuth.getInstance().currentUser
|
||||
if (user == null) {
|
||||
Toast.makeText(this, "Please Login to an account", Toast.LENGTH_SHORT).show()
|
||||
|
||||
// Redirect to LoginActivity
|
||||
val intent = Intent(this, LoginActivity::class.java)
|
||||
startActivity(intent)
|
||||
finish()
|
||||
|
||||
} else {
|
||||
Toast.makeText(this, "Welcome back!", Toast.LENGTH_SHORT).show()
|
||||
val firebaseUser = user.currentUser
|
||||
if (firebaseUser != null) {
|
||||
val userID = firebaseUser.uid
|
||||
val userRef = database.getReference("users").child(userID)
|
||||
userRef.get().addOnCompleteListener { task ->
|
||||
if (task.isSuccessful) {
|
||||
if (task.result.exists() && task.result.childrenCount > 0) {
|
||||
Toast.makeText(this, "Selamat datang kembali!", Toast.LENGTH_SHORT).show()
|
||||
dailycheck()
|
||||
getWeekCount()
|
||||
populateHistory()
|
||||
} else {
|
||||
Toast.makeText(this, "Data kesehatan belum tersedia. Silakan isi profil terlebih dahulu.", Toast.LENGTH_LONG).show()
|
||||
startActivity(Intent(this@MainActivity, UsersInputActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this, "Gagal mengambil data pengguna.", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
startActivity(Intent(this, LoginActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun populateHistory() {
|
||||
val userID = user.currentUser!!.uid
|
||||
@ -239,46 +241,58 @@ class MainActivity : AppCompatActivity() {
|
||||
layoutManager = LinearLayoutManager(this@MainActivity)
|
||||
}
|
||||
|
||||
database.getReference("users").child(userID).child("journal").get()
|
||||
.addOnCompleteListener { task ->
|
||||
if (task.isSuccessful) {
|
||||
val historyRef = database.getReference("users").child(userID).child("journal")
|
||||
|
||||
historyRef.addValueEventListener(object : ValueEventListener {
|
||||
override fun onDataChange(snapshot: DataSnapshot) {
|
||||
healthDataList.clear()
|
||||
task.result.children.forEach { snapshot ->
|
||||
val journalID = snapshot.key.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 task = snapshot.child("recommendation").child("task").value as? List<Map<String, Any>> ?: emptyList()
|
||||
snapshot.children.forEach { data ->
|
||||
val journalID = data.key.toString()
|
||||
val bloodSugar = data.child("bloodSugar").value.toString().toFloatOrNull() ?: 0f
|
||||
val diastolicBP = data.child("bloodPressureDIA").value.toString().toIntOrNull() ?: 0
|
||||
val systolicBP = data.child("bloodPressureSYS").value.toString().toIntOrNull() ?: 0
|
||||
val BMI = data.child("BMI").value.toString().toFloatOrNull() ?: 0f
|
||||
val date = data.child("date").value.toString()
|
||||
val task = data.child("recommendation").child("tasks").value as? List<Map<String, Any>> ?: emptyList()
|
||||
|
||||
val resultData = ResultData(journalID, bloodSugar, diastolicBP, systolicBP, BMI, date, task)
|
||||
healthDataList.add(resultData)
|
||||
}
|
||||
|
||||
val dateFormat = SimpleDateFormat("dd/MM/yyyy", Locale.getDefault())
|
||||
healthDataList.sortByDescending { it.date.let { date -> dateFormat.parse(date) } }
|
||||
|
||||
mainAdapter.notifyDataSetChanged()
|
||||
} else {
|
||||
Log.d("error", task.exception?.message.toString())
|
||||
Toast.makeText(this, task.exception?.message, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCancelled(error: DatabaseError) {
|
||||
Log.d("error", error.message)
|
||||
Toast.makeText(this@MainActivity, error.message, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun populateTodayReport(referencePath: String) {
|
||||
if (!::user.isInitialized || user.currentUser == null) {
|
||||
Log.e("MainActivity", "Pengguna belum login, tidak bisa ambil laporan hari ini.")
|
||||
return
|
||||
}
|
||||
|
||||
private fun populateTodayReport(referencePath: String){
|
||||
val userID = user.currentUser!!.uid
|
||||
database.getReference("users").child(userID).child("journal").child(referencePath).get().addOnCompleteListener {
|
||||
database.getReference("users").child(userID).child("journal").child(referencePath)
|
||||
.get().addOnCompleteListener {
|
||||
if (it.isSuccessful) {
|
||||
binding.tvBloodsugarLevel.text = it.result.child("bloodSugar").value.toString()+" mg/dL"
|
||||
val bmiValue = it.result.child("BMI").value.toString().toDoubleOrNull() ?: 0.0
|
||||
binding.tvBloodsugarLevel.text = it.result.child("bloodSugar").value.toString() + " mg/dL"
|
||||
binding.tvBloodsugarDesc.text = it.result.child("recommendation").child("bloodSugarAnalysis").value.toString()
|
||||
binding.tvBloodpressureLevel.text = it.result.child("bloodPressureDIA").value.toString()+"/"+it.result.child("bloodPressureSYS").value.toString()+" mm Hg"
|
||||
binding.tvBloodpressureLevel.text = it.result.child("bloodPressureSYS").value.toString() + "/" + it.result.child("bloodPressureDIA").value.toString() + " mm Hg"
|
||||
binding.tvBloodpressureDesc.text = it.result.child("recommendation").child("bloodPressureAnalysis").value.toString()
|
||||
binding.tvBmiLevel.text = it.result.child("BMI").value.toString() +" BMI"
|
||||
binding.tvBmiLevel.text = String.format(Locale.getDefault(), "%.2f BMI", bmiValue)
|
||||
binding.tvBmiDesc.text = it.result.child("recommendation").child("BMIAnalysis").value.toString()
|
||||
} else {
|
||||
Log.d("error", it.exception!!.message.toString())
|
||||
Toast.makeText(this, it.exception!!.message, Toast.LENGTH_SHORT).show()
|
||||
Log.e("MainActivity", "Gagal mengambil laporan hari ini: ${it.exception?.message}")
|
||||
Toast.makeText(this, it.exception?.message, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -10,76 +10,73 @@ import com.healthjournal.R
|
||||
import com.healthjournal.data.ResultData
|
||||
import com.healthjournal.ui.journal.detail.DetailJournalActivity
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
import java.util.*
|
||||
|
||||
class MainAdapter(private val healthDataList: MutableList<ResultData>) : RecyclerView.Adapter<MainAdapter.HealthViewHolder>() {
|
||||
class MainAdapter(private val daftarDataKesehatan: MutableList<ResultData>) : RecyclerView.Adapter<MainAdapter.HolderDataKesehatan>() {
|
||||
|
||||
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)
|
||||
val tvGoals: TextView = view.findViewById(R.id.tv_goals_count)
|
||||
class HolderDataKesehatan(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val tvHari: TextView = view.findViewById(R.id.tv_day)
|
||||
val tvTanggal: TextView = view.findViewById(R.id.tv_date)
|
||||
val tvGulaDarah: TextView = view.findViewById(R.id.tv_BS_Level)
|
||||
val tvTekananDarah: TextView = view.findViewById(R.id.tv_BP_Level)
|
||||
val tvTugas: TextView = view.findViewById(R.id.tv_goals_count)
|
||||
}
|
||||
|
||||
// Function to update the list and notify the adapter
|
||||
fun setData(newData: List<ResultData>) {
|
||||
healthDataList.clear()
|
||||
healthDataList.addAll(newData)
|
||||
fun perbaruiData(dataBaru: List<ResultData>) {
|
||||
daftarDataKesehatan.clear()
|
||||
daftarDataKesehatan.addAll(dataBaru)
|
||||
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 {
|
||||
private fun dapatkanHariDariTanggal(tanggal: 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)
|
||||
val formatTanggal = SimpleDateFormat("dd/MM/yyyy", Locale("id", "ID"))
|
||||
val tanggalTerurai = formatTanggal.parse(tanggal)
|
||||
if (tanggalTerurai != null) {
|
||||
SimpleDateFormat("EEEE", Locale("id", "ID")).format(tanggalTerurai)
|
||||
.replaceFirstChar { it.uppercaseChar() }
|
||||
} else {
|
||||
"Invalid Date"
|
||||
"Tanggal Tidak Valid"
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
"Invalid Date"
|
||||
"Tanggal Tidak Valid"
|
||||
}
|
||||
}
|
||||
|
||||
private fun countGoals (list: List<Map<String, Any>>): String {
|
||||
var completedGoals = 0
|
||||
var goalsCount = 0
|
||||
for (item in list) {
|
||||
if (item["completed"] == true) {
|
||||
completedGoals++
|
||||
private fun hitungTugasRekomendasi(daftarTugas: List<Map<String, Any>>): String {
|
||||
val total = daftarTugas.size
|
||||
val selesai = daftarTugas.count { (it["completed"] as? Boolean) == true }
|
||||
|
||||
return when {
|
||||
total == 0 -> "Tidak ada tugas"
|
||||
selesai == 0 -> "Belum ada tugas selesai"
|
||||
else -> "$selesai dari $total tugas selesai"
|
||||
}
|
||||
goalsCount++
|
||||
}
|
||||
if (completedGoals == 0) {
|
||||
return "No goals completed"
|
||||
}
|
||||
return "$completedGoals/$goalsCount goals completed"
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: HealthViewHolder, position: Int) {
|
||||
val healthData = healthDataList[position]
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): HolderDataKesehatan {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_health_history, parent, false)
|
||||
return HolderDataKesehatan(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: HolderDataKesehatan, posisi: Int) {
|
||||
val data = daftarDataKesehatan[posisi]
|
||||
|
||||
holder.tvHari.text = dapatkanHariDariTanggal(data.date)
|
||||
holder.tvTanggal.text = data.date
|
||||
holder.tvGulaDarah.text = "${data.bloodSugar} mg/dL"
|
||||
holder.tvTekananDarah.text = "${data.systolicBP}/${data.diastolicBP} mmHg"
|
||||
holder.tvTugas.text = hitungTugasRekomendasi(data.task)
|
||||
|
||||
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.tvGoals.text = countGoals(healthData.task)
|
||||
holder.itemView.setOnClickListener {
|
||||
val context = holder.itemView.context
|
||||
val intent = Intent(context, DetailJournalActivity::class.java).apply {
|
||||
putExtra("JOURNAL_KEY", healthData.journalID)
|
||||
putExtra("JOURNAL_KEY", data.journalID)
|
||||
}
|
||||
context.startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = healthDataList.size
|
||||
override fun getItemCount(): Int = daftarDataKesehatan.size
|
||||
}
|
||||
|
@ -3,15 +3,10 @@ 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.google.firebase.database.ktx.database
|
||||
import com.google.firebase.ktx.Firebase
|
||||
import com.healthjournal.databinding.ActivityDetailJournalBinding
|
||||
|
||||
class DetailJournalActivity : AppCompatActivity() {
|
||||
@ -45,6 +40,7 @@ class DetailJournalActivity : AppCompatActivity() {
|
||||
else -> "$completedGoals/$totalGoals goals completed"
|
||||
}
|
||||
}
|
||||
|
||||
private fun populateDetailJournal() {
|
||||
val userID = user.currentUser?.uid
|
||||
val journalID = intent.getStringExtra("JOURNAL_KEY")
|
||||
@ -55,16 +51,17 @@ class DetailJournalActivity : AppCompatActivity() {
|
||||
if (task.isSuccessful) {
|
||||
val result = task.result
|
||||
if (result.exists()) {
|
||||
val bmiValue = result.child("BMI").value.toString().toFloatOrNull() ?: 0f
|
||||
|
||||
binding.tvBloodsugarLevel2.text = "${result.child("bloodSugar").value ?: "N/A"} mg/dL"
|
||||
binding.tvBloodsugarDesc.text = result.child("recommendation").child("bloodSugarAnalysis").value?.toString() ?: "No data"
|
||||
binding.tvBloodpressureLevel2.text = "${result.child("bloodPressureDIA").value ?: "N/A"}/${result.child("bloodPressureSYS").value ?: "N/A"} mm Hg"
|
||||
binding.tvBloodpressureLevel2.text = "${result.child("bloodPressureSYS").value ?: "N/A"}/${result.child("bloodPressureDIA").value ?: "N/A"} mm Hg"
|
||||
binding.tvBloodpressureDesc.text = result.child("recommendation").child("bloodPressureAnalysis").value?.toString() ?: "No data"
|
||||
binding.tvBMILevel2.text = "${result.child("BMI").value ?: "N/A"} BMI"
|
||||
binding.tvBMILevel2.text = String.format("%.2f BMI", bmiValue)
|
||||
binding.tvBMIDesc.text = result.child("recommendation").child("BMIAnalysis").value?.toString() ?: "No data"
|
||||
binding.tvJournalNote.text = result.child("note").value?.toString() ?: "No notes available"
|
||||
|
||||
val taskListSnapshot = result.child("recommendation").child("tasks")
|
||||
Log.d("debug", taskListSnapshot.toString())
|
||||
val taskList = mutableListOf<Map<String, Any>>()
|
||||
if (taskListSnapshot.exists()) {
|
||||
for (taskSnapshot in taskListSnapshot.children) {
|
||||
@ -87,29 +84,28 @@ class DetailJournalActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
val journalID = intent.getStringExtra("JOURNAL_KEY")
|
||||
if (userID != null && journalID != null) {
|
||||
database.getReference("users").child(userID).child("journal").child(journalID)
|
||||
.removeValue()
|
||||
.addOnCompleteListener(DetailJournalActivity()) {
|
||||
.addOnCompleteListener(this) {
|
||||
if (it.isSuccessful) {
|
||||
Toast.makeText(this, "History deleted successfully", Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
Toast.makeText(this, "History deleted successfully", Toast.LENGTH_SHORT).show()
|
||||
finish()
|
||||
} else {
|
||||
Toast.makeText(this, it.exception!!.message, Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(this, it.exception?.message, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this, "Gagal menghapus: ID tidak ditemukan", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupListener() {
|
||||
binding.btnDeleteHistory.setOnClickListener() {
|
||||
binding.btnDeleteHistory.setOnClickListener {
|
||||
deleteHistory()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -97,7 +97,7 @@ class JournalInputActivity : AppCompatActivity() {
|
||||
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 healthData = HealthData(bloodSugar.toFloat(),bloodPressureDIA.toInt(),bloodPressureSYS.toInt(), BMI,age,gender)
|
||||
val recommendation = AlgoritmaKesehatan().recommendationOfTheDay(healthData)
|
||||
|
||||
val data = hashMapOf(
|
||||
|
197
app/src/main/java/com/healthjournal/ui/laporan/Laporan.kt
Normal file
@ -0,0 +1,197 @@
|
||||
package com.healthjournal.ui.laporan
|
||||
|
||||
import MyMarkerView
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.MotionEvent
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.github.mikephil.charting.charts.LineChart
|
||||
import com.github.mikephil.charting.components.XAxis
|
||||
import com.github.mikephil.charting.data.*
|
||||
import com.github.mikephil.charting.formatter.IndexAxisValueFormatter
|
||||
import com.github.mikephil.charting.highlight.Highlight
|
||||
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet
|
||||
import com.github.mikephil.charting.listener.ChartTouchListener
|
||||
import com.github.mikephil.charting.listener.OnChartGestureListener
|
||||
import com.github.mikephil.charting.listener.OnChartValueSelectedListener
|
||||
import com.healthjournal.R
|
||||
import com.healthjournal.data.ResultData
|
||||
import com.healthjournal.ui.journal.detail.DetailJournalActivity
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
class laporan : AppCompatActivity() {
|
||||
|
||||
private lateinit var chartBMI: LineChart
|
||||
private lateinit var chartSugar: LineChart
|
||||
private lateinit var chartPressure: LineChart
|
||||
|
||||
private lateinit var resultList: List<ResultData>
|
||||
private val sdf = SimpleDateFormat("dd/MM/yyyy", Locale.getDefault())
|
||||
|
||||
private lateinit var sharedMarkerView: MyMarkerView
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_laporan)
|
||||
|
||||
supportActionBar?.title = "Laporan Kesehatan"
|
||||
|
||||
chartBMI = findViewById(R.id.chartBMI)
|
||||
chartSugar = findViewById(R.id.chartSugar)
|
||||
chartPressure = findViewById(R.id.chartPressure)
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
resultList = intent.getSerializableExtra("healthDataList") as? List<ResultData> ?: emptyList()
|
||||
renderCharts(resultList)
|
||||
}
|
||||
|
||||
private fun renderCharts(data: List<ResultData>) {
|
||||
val labels = ArrayList<String>()
|
||||
val bmiEntries = ArrayList<Entry>()
|
||||
val sugarEntries = ArrayList<Entry>()
|
||||
val systolicEntries = ArrayList<Entry>()
|
||||
val diastolicEntries = ArrayList<Entry>()
|
||||
|
||||
val sorted = data.sortedBy { sdf.parse(it.date) }
|
||||
|
||||
sorted.forEachIndexed { index, item ->
|
||||
labels.add("[${getIndonesianDayName(item.date)}] \n${item.date}")
|
||||
bmiEntries.add(Entry(index.toFloat(), item.BMI))
|
||||
sugarEntries.add(Entry(index.toFloat(), item.bloodSugar))
|
||||
systolicEntries.add(Entry(index.toFloat(), item.systolicBP.toFloat()))
|
||||
diastolicEntries.add(Entry(index.toFloat(), item.diastolicBP.toFloat()))
|
||||
}
|
||||
|
||||
sharedMarkerView = MyMarkerView(this, sorted)
|
||||
|
||||
drawChart(chartBMI, listOf(LineDataSet(bmiEntries, "BMI").apply {
|
||||
val color = ContextCompat.getColor(this@laporan, R.color.chart_bmi)
|
||||
setColor(color)
|
||||
setCircleColor(color)
|
||||
lineWidth = 2f
|
||||
valueTextSize = 10f
|
||||
}), labels)
|
||||
|
||||
drawChart(chartSugar, listOf(LineDataSet(sugarEntries, "Gula Darah").apply {
|
||||
val color = ContextCompat.getColor(this@laporan, R.color.chart_sugar)
|
||||
setColor(color)
|
||||
setCircleColor(color)
|
||||
lineWidth = 2f
|
||||
valueTextSize = 10f
|
||||
}), labels)
|
||||
|
||||
drawChart(chartPressure, listOf(
|
||||
LineDataSet(systolicEntries, "Sistolik").apply {
|
||||
val color = ContextCompat.getColor(this@laporan, R.color.chart_systolic)
|
||||
setColor(color)
|
||||
setCircleColor(color)
|
||||
lineWidth = 2f
|
||||
valueTextSize = 10f
|
||||
},
|
||||
LineDataSet(diastolicEntries, "Diastolik").apply {
|
||||
val color = ContextCompat.getColor(this@laporan, R.color.chart_diastolic)
|
||||
setColor(color)
|
||||
setCircleColor(color)
|
||||
lineWidth = 2f
|
||||
valueTextSize = 10f
|
||||
}
|
||||
), labels)
|
||||
|
||||
setupHighlightListeners()
|
||||
setupDoubleTapNavigation(chartBMI, sorted)
|
||||
setupDoubleTapNavigation(chartSugar, sorted)
|
||||
setupDoubleTapNavigation(chartPressure, sorted)
|
||||
}
|
||||
|
||||
private fun drawChart(chart: LineChart, dataSets: List<ILineDataSet>, labels: List<String>) {
|
||||
chart.data = LineData(dataSets)
|
||||
|
||||
chart.xAxis.apply {
|
||||
valueFormatter = IndexAxisValueFormatter(labels)
|
||||
position = XAxis.XAxisPosition.BOTTOM
|
||||
granularity = 1f
|
||||
labelRotationAngle = -45f
|
||||
}
|
||||
|
||||
chart.axisRight.isEnabled = false
|
||||
chart.description.isEnabled = false
|
||||
chart.legend.isEnabled = true
|
||||
|
||||
chart.setTouchEnabled(true)
|
||||
chart.isDragEnabled = true
|
||||
chart.setScaleEnabled(true)
|
||||
chart.setPinchZoom(true)
|
||||
chart.setDoubleTapToZoomEnabled(false)
|
||||
chart.setVisibleXRangeMaximum(7f)
|
||||
chart.moveViewToX(chart.data.entryCount.toFloat())
|
||||
|
||||
chart.marker = sharedMarkerView
|
||||
chart.invalidate()
|
||||
}
|
||||
|
||||
private fun setupHighlightListeners() {
|
||||
val charts = listOf(chartBMI, chartSugar, chartPressure)
|
||||
|
||||
for (chart in charts) {
|
||||
chart.setOnChartValueSelectedListener(object : OnChartValueSelectedListener {
|
||||
override fun onValueSelected(e: Entry?, h: Highlight?) {
|
||||
charts.filter { it != chart }.forEach {
|
||||
it.highlightValue(null, true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onNothingSelected() {}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupDoubleTapNavigation(chart: LineChart, data: List<ResultData>) {
|
||||
var lastTapTime = 0L
|
||||
var lastEntry: Entry? = null
|
||||
|
||||
chart.setOnChartGestureListener(object : OnChartGestureListener {
|
||||
override fun onChartSingleTapped(me: MotionEvent?) {
|
||||
me ?: return
|
||||
val highlight = chart.getHighlightByTouchPoint(me.x, me.y)
|
||||
val entry = highlight?.let { chart.data.getEntryForHighlight(it) }
|
||||
|
||||
val currentTime = System.currentTimeMillis()
|
||||
if (entry != null && lastEntry == entry && currentTime - lastTapTime < 400) {
|
||||
val index = entry.x.toInt()
|
||||
if (index in data.indices) {
|
||||
val item = data[index]
|
||||
val intent = Intent(this@laporan, DetailJournalActivity::class.java).apply {
|
||||
putExtra("JOURNAL_KEY", item.journalID)
|
||||
}
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
|
||||
lastEntry = entry
|
||||
lastTapTime = currentTime
|
||||
}
|
||||
|
||||
override fun onChartGestureStart(me: MotionEvent?, lastPerformedGesture: ChartTouchListener.ChartGesture?) {}
|
||||
override fun onChartGestureEnd(me: MotionEvent?, lastPerformedGesture: ChartTouchListener.ChartGesture?) {}
|
||||
override fun onChartLongPressed(me: MotionEvent?) {}
|
||||
override fun onChartDoubleTapped(me: MotionEvent?) {}
|
||||
override fun onChartFling(me1: MotionEvent?, me2: MotionEvent?, velocityX: Float, velocityY: Float) {}
|
||||
override fun onChartScale(me: MotionEvent?, scaleX: Float, scaleY: Float) {}
|
||||
override fun onChartTranslate(me: MotionEvent?, dX: Float, dY: Float) {}
|
||||
})
|
||||
}
|
||||
|
||||
private fun getIndonesianDayName(dateString: String): String {
|
||||
return try {
|
||||
val date = sdf.parse(dateString) ?: return ""
|
||||
val locale = Locale("id", "ID")
|
||||
val dayFormat = SimpleDateFormat("EEEE", locale)
|
||||
dayFormat.format(date)
|
||||
} catch (e: Exception) {
|
||||
""
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -6,19 +6,23 @@ 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.databinding.ActivityLoginBinding
|
||||
import com.healthjournal.ui.dashboard.MainActivity
|
||||
import com.healthjournal.ui.register.RegisterActivity
|
||||
import com.healthjournal.ui.users.UsersInputActivity
|
||||
|
||||
class LoginActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityLoginBinding
|
||||
private lateinit var user: FirebaseAuth
|
||||
private lateinit var database: FirebaseDatabase
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityLoginBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
user = FirebaseAuth.getInstance()
|
||||
database = FirebaseDatabase.getInstance()
|
||||
setuplistener()
|
||||
}
|
||||
|
||||
@ -44,8 +48,7 @@ class LoginActivity : AppCompatActivity() {
|
||||
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()
|
||||
checkUserdata()
|
||||
}
|
||||
else{
|
||||
Toast.makeText(this, task.exception!!.message, Toast.LENGTH_SHORT).show()
|
||||
@ -54,4 +57,28 @@ class LoginActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkUserdata() {
|
||||
val firebaseUser = user.currentUser
|
||||
if (firebaseUser != null) {
|
||||
val userID = firebaseUser.uid
|
||||
val userRef = database.getReference("users").child(userID)
|
||||
userRef.get().addOnCompleteListener { task ->
|
||||
if (task.isSuccessful) {
|
||||
if (task.result.exists() && task.result.childrenCount > 0) {
|
||||
// User has data, proceed to MainActivity
|
||||
startActivity(Intent(this@LoginActivity, MainActivity::class.java))
|
||||
finish()
|
||||
} else {
|
||||
Toast.makeText(this, "No user data found. Please set up your profile.", Toast.LENGTH_LONG).show()
|
||||
startActivity(Intent(this@LoginActivity, UsersInputActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(this, "Failed to retrieve user data.", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.healthjournal.ui.profile
|
||||
|
||||
import android.app.DatePickerDialog
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
@ -14,6 +15,7 @@ import com.google.firebase.database.database
|
||||
import com.healthjournal.R
|
||||
import com.healthjournal.databinding.ActivityProfileBinding
|
||||
import com.healthjournal.ui.login.LoginActivity
|
||||
import java.util.Calendar
|
||||
|
||||
class ProfileActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityProfileBinding
|
||||
@ -36,15 +38,36 @@ class ProfileActivity : AppCompatActivity() {
|
||||
binding.btnLogout.setOnClickListener {
|
||||
logout()
|
||||
}
|
||||
|
||||
binding.btnUpdateData.setOnClickListener {
|
||||
updateData()
|
||||
}
|
||||
binding.edtDate.setOnClickListener {
|
||||
datepicker()
|
||||
}
|
||||
}
|
||||
|
||||
private fun logout(){
|
||||
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.edtDate.setText(selectedDate)
|
||||
},
|
||||
year, month, day
|
||||
)
|
||||
datePickerDialog.show()
|
||||
}
|
||||
|
||||
private fun logout() {
|
||||
user.signOut()
|
||||
startActivity(Intent(this, LoginActivity::class.java))
|
||||
val intent = Intent(this, LoginActivity::class.java)
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||
startActivity(intent)
|
||||
finish()
|
||||
}
|
||||
|
||||
@ -70,6 +93,8 @@ class ProfileActivity : AppCompatActivity() {
|
||||
userRef.get().addOnCompleteListener(this) {
|
||||
if (it.isSuccessful) {
|
||||
binding.edtName.setText(it.result.child("name").value.toString())
|
||||
binding.tvMyname.text = it.result.child("name").value.toString()
|
||||
binding.tvMyemail.text = user.currentUser?.email.toString()
|
||||
binding.edtDate.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())
|
||||
@ -79,7 +104,4 @@ class ProfileActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -14,7 +14,7 @@ class RecommendationAdapter(
|
||||
) : RecyclerView.Adapter<RecommendationAdapter.RecommendationViewHolder>() {
|
||||
|
||||
inner class RecommendationViewHolder(view: View) : RecyclerView.ViewHolder(view) {
|
||||
val tvGoalName: TextView = view.findViewById(R.id.tv_goal_name)
|
||||
val tvGoal: TextView = view.findViewById(R.id.tv_goal)
|
||||
val checkBox: CheckBox = view.findViewById(R.id.toggle)
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ class RecommendationAdapter(
|
||||
|
||||
override fun onBindViewHolder(holder: RecommendationViewHolder, position: Int) {
|
||||
val (task, isCompleted) = recommendationList[position]
|
||||
holder.tvGoalName.text = task
|
||||
holder.tvGoal.text = task
|
||||
holder.checkBox.isChecked = isCompleted
|
||||
holder.checkBox.setOnCheckedChangeListener { _, isChecked ->
|
||||
onCheckedChange(position, isChecked)
|
||||
|
@ -39,11 +39,13 @@ class RecommendationActivity : AppCompatActivity() {
|
||||
if (task.isSuccessful) {
|
||||
task.result.children.forEach {
|
||||
if (it.child("date").value.toString() == today) {
|
||||
val bmiValue = it.child("BMI").value.toString().toDoubleOrNull() ?: 0.0
|
||||
|
||||
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.tvBloodpressureLevel2.text = "${it.child("bloodPressureSYS").value}/${it.child("bloodPressureDIA").value} mm Hg"
|
||||
binding.tvBloodpressureDesc.text = it.child("recommendation").child("bloodPressureAnalysis").value.toString()
|
||||
binding.tvBMILevel2.text = "${it.child("BMI").value} BMI"
|
||||
binding.tvBMILevel2.text = String.format(Locale.getDefault(), "%.2f BMI", bmiValue)
|
||||
binding.tvBMIDesc.text = it.child("recommendation").child("BMIAnalysis").value.toString()
|
||||
|
||||
val tasks = it.child("recommendation").child("tasks").value
|
||||
|
@ -7,6 +7,7 @@ import android.widget.Toast
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.google.firebase.auth.FirebaseAuth
|
||||
import com.healthjournal.databinding.ActivityRegisterBinding
|
||||
import com.healthjournal.ui.login.LoginActivity
|
||||
import com.healthjournal.ui.users.UsersInputActivity
|
||||
|
||||
class RegisterActivity : AppCompatActivity() {
|
||||
@ -26,7 +27,8 @@ class RegisterActivity : AppCompatActivity() {
|
||||
registerUser()
|
||||
}
|
||||
binding.btnLogin.setOnClickListener{
|
||||
|
||||
startActivity(Intent(this@RegisterActivity, LoginActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,21 +0,0 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
@ -26,7 +26,6 @@ class UsersInputActivity : AppCompatActivity() {
|
||||
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)
|
||||
|
||||
|
4
app/src/main/res/drawable/color_circle.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<solid android:color="?attr/colorPrimary" />
|
||||
</shape>
|
23
app/src/main/res/drawable/ic_input_button.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="64dp"
|
||||
android:height="64dp"
|
||||
android:viewportWidth="64"
|
||||
android:viewportHeight="64">
|
||||
<path
|
||||
android:pathData="M32,32m-32,0a32,32 0,1 1,64 0a32,32 0,1 1,-64 0"
|
||||
android:fillColor="#E8F4F8"/>
|
||||
<path
|
||||
android:pathData="M32,21.333V42.667M21.333,32H42.667M58.667,32C58.667,46.728 46.728,58.667 32,58.667C17.272,58.667 5.333,46.728 5.333,32C5.333,17.272 17.272,5.333 32,5.333C46.728,5.333 58.667,17.272 58.667,32Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="4"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#1E1E1E"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M32,21.333V42.667M21.333,32H42.667M58.667,32C58.667,46.728 46.728,58.667 32,58.667C17.272,58.667 5.333,46.728 5.333,32C5.333,17.272 17.272,5.333 32,5.333C46.728,5.333 58.667,17.272 58.667,32Z"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="4"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#006C6C"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
BIN
app/src/main/res/drawable/logog.png
Normal file
After Width: | Height: | Size: 20 KiB |
18
app/src/main/res/drawable/marker_background.xml
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="#CC000000" />
|
||||
|
||||
<corners android:radius="8dp" />
|
||||
|
||||
<padding
|
||||
android:left="8dp"
|
||||
android:top="8dp"
|
||||
android:right="8dp"
|
||||
android:bottom="8dp" />
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#88000000" />
|
||||
</shape>
|
@ -5,14 +5,14 @@
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/Secondary_Light"
|
||||
android:background="@color/background"
|
||||
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"
|
||||
android:layout_height="265dp"
|
||||
android:background="@drawable/bg_dashboard"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@ -22,7 +22,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="JOURNAL DETAIL"
|
||||
android:text="DETAIL JURNAL"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="20sp"
|
||||
@ -35,13 +35,13 @@
|
||||
android:id="@+id/tv_bloodsugar_level1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Blood Sugar Level :"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Tingkat Gula Darah :"
|
||||
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_constraintHorizontal_bias="0.248"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
||||
|
||||
@ -60,29 +60,29 @@
|
||||
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="10sp"
|
||||
android:textColor="@color/black"
|
||||
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." />
|
||||
tools:text="olahraga teratur." />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodpressure_level1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Blood Pressure Level :"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Tingkat Tekanan Darah :"
|
||||
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_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_bloodsugar_level1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodsugar_desc" />
|
||||
|
||||
<TextView
|
||||
@ -100,29 +100,29 @@
|
||||
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="10sp"
|
||||
android:textColor="@color/black"
|
||||
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." />
|
||||
tools:text="Tingkat tekanan darah Anda berada dalam kisaran normal. Pertahankan pola makan seimbang dan olahraga teratur." />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_BMI_level1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="BMI(Body Mass Index) :"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="BMI (Indeks Massa Tubuh) :"
|
||||
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_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_bloodpressure_level1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodpressure_desc" />
|
||||
|
||||
<TextView
|
||||
@ -141,45 +141,43 @@
|
||||
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="10sp"
|
||||
android:textColor="@color/black"
|
||||
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." />
|
||||
tools:text="Ini masih dianggap kisaran yang dapat diterima, dan berhubungan dengan kesehatan yang baik." />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_goals1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Goals Completed :"
|
||||
android:text="Tugas yang Dicapai :"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_title"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_BMI_level1"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_title"
|
||||
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_marginLeft="2dp"
|
||||
android:textColor="@color/Accent_Light_Red"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_goals1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_goals1"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_goals1"
|
||||
tools:text="3" />
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_goals1"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_goals1"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_goals1"
|
||||
tools:text="Goals Completed" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
@ -187,7 +185,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="JOURNAL NOTES"
|
||||
android:text="CATATAN JURNAL"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="20sp"
|
||||
@ -205,6 +203,7 @@
|
||||
android:layout_marginTop="5dp"
|
||||
android:padding="10dp"
|
||||
android:textSize="11sp"
|
||||
android:textColor="@color/black"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title_note"
|
||||
@ -217,7 +216,7 @@
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:text="Delete History"
|
||||
android:text="Hapus Riwayat"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
@ -227,4 +226,3 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_journal_note" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Please input your today data"
|
||||
android:text="Silakan Masukkan Laporan Hari Ini"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@ -48,7 +48,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Blood Pressure\n(SYS) (mm/HG)"
|
||||
android:text="Tekanan Darah\n(Sistolik) \n(mm/Hg)"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="8sp"
|
||||
@ -65,11 +65,12 @@
|
||||
android:inputType="number"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
android:maxLength="3"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_input_blood_pressure_SYS"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_input_blood_pressure_SYS"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_input_blood_pressure_SYS" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@ -89,7 +90,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Blood Pressure\n(DIA) (mm/HG)"
|
||||
android:text="Tekanan Darah\n(Diastolik)\n(mm/Hg)"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="8sp"
|
||||
@ -106,11 +107,12 @@
|
||||
android:inputType="number"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
android:maxLength="2"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_input_blood_pressure_DIA"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_input_blood_pressure_DIA"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_input_blood_pressure_DIA" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@ -125,12 +127,13 @@
|
||||
app:layout_constraintStart_toStartOf="@+id/cl_input_note"
|
||||
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 (mg/dL)"
|
||||
android:text="Kadar Gula\nDarah (mg/dL)"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="8sp"
|
||||
@ -147,6 +150,8 @@
|
||||
android:inputType="number"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
android:maxLength="3"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_input_blood_sugar"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_input_blood_sugar"
|
||||
@ -171,7 +176,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Weight\n(kg)"
|
||||
android:text="Berat Badan\n(kg)"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="8sp"
|
||||
@ -188,6 +193,8 @@
|
||||
android:inputType="number"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
android:maxLength="3"
|
||||
android:textAlignment="center"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_input_weight"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_input_weight"
|
||||
@ -195,33 +202,28 @@
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_gender"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_age"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edt_height"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:background="@color/white"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@ -241,7 +243,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="NOTES"
|
||||
android:text="Catatan"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="8sp"
|
||||
@ -253,13 +255,15 @@
|
||||
<EditText
|
||||
android:id="@+id/edt_input_note"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="155dp"
|
||||
android:layout_height="165dp"
|
||||
android:padding="10dp"
|
||||
android:background="@drawable/bg_input_box"
|
||||
android:gravity="start|top"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="textMultiLine|textCapSentences"
|
||||
android:maxLines="10"
|
||||
android:minLines="4"
|
||||
android:textSize="11sp"
|
||||
android:overScrollMode="always"
|
||||
android:scrollbars="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@ -273,7 +277,7 @@
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginBottom="36dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:text="Input Data"
|
||||
android:text="Kirim Data"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
|
233
app/src/main/res/layout/activity_laporan.xml
Normal file
@ -0,0 +1,233 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/background"
|
||||
android:fillViewport="true">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Laporan Kesehatan"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@android:color/black"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardBMI"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:cardElevation="4dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvHeader"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="12dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="BMI"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<com.github.mikephil.charting.charts.LineChart
|
||||
android:id="@+id/chartBMI"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp" />
|
||||
|
||||
<!-- Hint/Legend -->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:backgroundTint="@color/chart_bmi"
|
||||
android:background="@drawable/color_circle" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" BMI"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginStart="4dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/scrollIndicatorBMI"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="← Lama (Older) | Baru (Newer) →"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
android:textSize="14sp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="4dp" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- Sugar Chart Card -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardSugar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:cardElevation="4dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/cardBMI"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="12dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Gula Darah"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<com.github.mikephil.charting.charts.LineChart
|
||||
android:id="@+id/chartSugar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp" />
|
||||
|
||||
<!-- Hint/Legend -->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:backgroundTint="@color/chart_sugar"
|
||||
android:background="@drawable/color_circle" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" Gula Darah"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginStart="4dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/scrollIndicatorSugar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="← Lama (Older) | Baru (Newer) →"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
android:textSize="14sp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="4dp" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- Blood Pressure Chart Card -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardPressure"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:cardElevation="4dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/cardSugar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="12dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Tekanan Darah"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<com.github.mikephil.charting.charts.LineChart
|
||||
android:id="@+id/chartPressure"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp" />
|
||||
|
||||
<!-- Hint/Legend -->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:backgroundTint="@color/chart_systolic"
|
||||
android:background="@drawable/color_circle" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" Sistolik"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginEnd="12dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:backgroundTint="@color/chart_diastolic"
|
||||
android:background="@drawable/color_circle" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" Diastolik"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginStart="4dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/scrollIndicatorPressure"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="← Lama (Older) | Baru (Newer) →"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
android:textSize="14sp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="4dp" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
@ -14,10 +14,9 @@
|
||||
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">
|
||||
app:layout_constraintVertical_bias="0.377">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView8"
|
||||
@ -67,9 +66,9 @@
|
||||
android:layout_marginTop="20dp"
|
||||
android:fontFamily="@font/poppins_regular"
|
||||
android:text="Email"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView10" />
|
||||
|
||||
@ -122,8 +121,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ems="10"
|
||||
android:textColor="@color/black"
|
||||
android:inputType="textPassword"
|
||||
android:textColor="@color/black"
|
||||
tools:ignore="SpeakableTextPresentCheck" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/background"
|
||||
tools:context=".ui.dashboard.MainActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@ -22,6 +23,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"
|
||||
tools:visibility="invisible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@ -198,6 +200,7 @@ z
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
@ -210,7 +213,7 @@ z
|
||||
android:text="TODAY HEALTH REPORT"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="20sp"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@ -225,6 +228,7 @@ z
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Primary_Light"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title_2" />
|
||||
@ -236,7 +240,7 @@ z
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="Blood Sugar Level : "
|
||||
android:text="Tingkat Gula Darah : "
|
||||
android:textColor="@color/Primary_Light"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_title_2"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_sub_title_2" />
|
||||
@ -256,10 +260,11 @@ z
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodsugar_desc"
|
||||
android:layout_width="190dp"
|
||||
android:layout_width="200dp"
|
||||
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"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_bloodsugar_level"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_title_BSL"
|
||||
@ -271,7 +276,7 @@ z
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/Primary_Light"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="Blood Pressure Level : "
|
||||
android:text="Tingkat Tekanan Darah : "
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_title_2"
|
||||
@ -291,10 +296,11 @@ z
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodpressure_desc"
|
||||
android:layout_width="190dp"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Your blood pressure is within the normal range. Continue a heart-healthy lifestyle."
|
||||
android:textSize="8sp"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/black"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_title_BPL"
|
||||
@ -306,7 +312,7 @@ z
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:textColor="@color/Primary_Light"
|
||||
android:text="BMI(Body Mass Index) : "
|
||||
android:text="BMI(Inkes Massa Tubuh) : "
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_sub_title_2"
|
||||
@ -330,10 +336,11 @@ z
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bmi_desc"
|
||||
android:layout_width="190dp"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="This is still considered an acceptable range, and is associated with good health."
|
||||
android:textSize="8sp"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/black"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_title_BMI"
|
||||
@ -451,7 +458,6 @@ z
|
||||
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"
|
||||
@ -464,28 +470,45 @@ z
|
||||
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"
|
||||
android:visibility="gone"
|
||||
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_constraintEnd_toEndOf="@+id/fl_daily_counter"
|
||||
app:layout_constraintHorizontal_bias="0.48"
|
||||
app:layout_constraintStart_toStartOf="@+id/fl_daily_counter"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fl_daily_counter"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_report"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:text="Lihat Laporan"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:backgroundTint="@color/Primary_Dark"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fl_daily_counter"/>
|
||||
</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"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_Health_Report"
|
||||
app:layout_constraintBottom_toTopOf="@id/nav_view"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:listitem="@layout/item_health_history"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_Health_Report" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:itemCount="2"
|
||||
tools:listitem="@layout/item_health_history" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_add"
|
||||
|
@ -278,7 +278,7 @@
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:text="Input Data"
|
||||
android:text="Update Profile"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
|
@ -1,22 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.core.widget.NestedScrollView
|
||||
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:id="@+id/nestedScrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
tools:context=".ui.recommendation.RecommendationActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout"
|
||||
android:layout_width="0dp"
|
||||
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"
|
||||
android:background="@drawable/bg_dashboard"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
@ -28,23 +33,23 @@
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintEnd_toEndOf="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:layout_marginTop="8dp"
|
||||
android:text="Tingkat Gula Darah :"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.375"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.18" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bloodsugar_level2"
|
||||
@ -52,99 +57,97 @@
|
||||
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"
|
||||
tools:text="100 mg/dL"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_bloodsugar_level1"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_bloodsugar_level1"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_bloodsugar_level1"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_bloodsugar_level1"
|
||||
tools:text="100 mg/dL" />
|
||||
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.02" />
|
||||
|
||||
<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"
|
||||
android:textSize="12sp"
|
||||
tools:text="Your blood sugar level is within the normal range. Maintain a balanced diet and regular exercise."
|
||||
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." />
|
||||
app:layout_constraintStart_toStartOf="@id/tv_bloodsugar_level1"
|
||||
app:layout_constraintEnd_toEndOf="@id/tv_bloodsugar_level2" />
|
||||
|
||||
<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:layout_marginTop="4dp"
|
||||
android:text="Tingkat Tekanan Darah :"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodsugar_desc"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_bloodsugar_level1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.408"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodsugar_desc" />
|
||||
app:layout_constraintHorizontal_bias="0.0" />
|
||||
|
||||
<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"
|
||||
tools:text="119/70 mm Hg"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_bloodpressure_level1"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_bloodpressure_level1"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_bloodpressure_level1"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodsugar_desc"
|
||||
tools:text="119/70 mm Hg" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.018" />
|
||||
|
||||
<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"
|
||||
android:textSize="12sp"
|
||||
tools:text="Your blood sugar level is within the normal range. Maintain a balanced diet and regular exercise."
|
||||
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." />
|
||||
app:layout_constraintStart_toStartOf="@id/tv_bloodpressure_level1"
|
||||
app:layout_constraintEnd_toEndOf="@id/tv_bloodpressure_level2" />
|
||||
|
||||
<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:layout_marginTop="4dp"
|
||||
android:text="BMI (Indeks Massa Tubuh) :"
|
||||
android:textColor="@color/Primary_Dark"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodpressure_desc"
|
||||
app:layout_constraintStart_toStartOf="@id/tv_bloodpressure_level1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.426"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_bloodpressure_desc" />
|
||||
app:layout_constraintHorizontal_bias="0.0" />
|
||||
|
||||
<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"
|
||||
android:maxLength="9"
|
||||
tools:text="22.03 BMI"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_BMI_level1"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_BMI_level1"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_BMI_level1"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_BMI_level1"
|
||||
tools:text="22.03 BMI" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.02" />
|
||||
|
||||
<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"
|
||||
android:textSize="12sp"
|
||||
tools:text="This is still considered an acceptable range, and is associated with good health."
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_BMI_level1"
|
||||
tools:text="This is still considered an acceptable range, and is associated with good health." />
|
||||
app:layout_constraintStart_toStartOf="@id/tv_BMI_level1"
|
||||
app:layout_constraintEnd_toEndOf="@id/tv_BMI_level2" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@ -152,25 +155,26 @@
|
||||
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:layout_marginTop="16dp"
|
||||
android:text="TODAY REKOMENDASI"
|
||||
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_constraintTop_toBottomOf="@id/constraintLayout"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout" />
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<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" />
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title_recommendation"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:paddingBottom="16dp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
@ -170,7 +170,7 @@
|
||||
android:layout_height="39dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:background="@drawable/bg_button"
|
||||
android:text="REGISTER"
|
||||
android:text="Register"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
|
@ -1,10 +0,0 @@
|
||||
<?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>
|
@ -122,6 +122,7 @@
|
||||
android:background="@drawable/bg_input_box"
|
||||
android:textColor="@color/black"
|
||||
android:textAlignment="center"
|
||||
android:maxLength="3"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@ -164,6 +165,7 @@
|
||||
android:background="@drawable/bg_input_box"
|
||||
android:textColor="@color/black"
|
||||
android:textAlignment="center"
|
||||
android:maxLength="3"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -2,7 +2,7 @@
|
||||
<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_height="80dp"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/bg_profile">
|
||||
|
||||
@ -20,9 +20,9 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_goal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:maxLines="2"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:text="Exercise for 40 Minutes "
|
||||
android:textSize="16sp"
|
||||
|
@ -1,7 +1,6 @@
|
||||
<?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:padding="5dp"
|
||||
@ -13,7 +12,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="280dp"
|
||||
android:text="Friday"
|
||||
android:text="Jumat"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@ -49,16 +49,17 @@
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_date"
|
||||
app:layout_constraintVertical_bias="0.647" />
|
||||
app:layout_constraintVertical_bias="0.388" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sub_BSL"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Blood Sugar Level : "
|
||||
android:textColor="@color/black"
|
||||
android:text="Kadar Gula Darah : "
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.21"
|
||||
app:layout_constraintHorizontal_bias="0.176"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_user"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.346" />
|
||||
@ -81,13 +82,14 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="88dp"
|
||||
android:text="Blood Pressure Level :"
|
||||
android:text="Kadar Tekanan Darah :"
|
||||
android:textColor="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.604"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_user"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_BSL"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_sub_BSL"
|
||||
app:layout_constraintVertical_bias="0.042" />
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_BP_Level"
|
||||
@ -107,18 +109,20 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="28dp"
|
||||
android:text="Recommended goals completed"
|
||||
android:text="Target yang Disarankan Tercapai"
|
||||
android:textColor="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.666"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_user"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_BPL"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_sub_BPL"
|
||||
app:layout_constraintVertical_bias="0.038" />
|
||||
app:layout_constraintVertical_bias="0.071" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_goals_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
android:text="[lorem ipsum]"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tv_sub_goals"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_sub_goals"
|
||||
|
19
app/src/main/res/layout/marker_view.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/marker_background"
|
||||
android:padding="12dp"
|
||||
android:orientation="vertical"
|
||||
android:elevation="6dp"
|
||||
android:descendantFocusability="blocksDescendants">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:paddingBottom="6dp" />
|
||||
</LinearLayout>
|
@ -1,6 +1,5 @@
|
||||
<?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" />
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
@ -1,6 +1,5 @@
|
||||
<?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" />
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 3.4 KiB |
BIN
app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp
Normal file
After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 982 B After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp
Normal file
After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 5.2 KiB |
BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp
Normal file
After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp
Normal file
After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp
Normal file
After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 23 KiB |
3
app/src/main/res/values-land/dimens.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<dimen name="fab_margin">48dp</dimen>
|
||||
</resources>
|
8
app/src/main/res/values-v23/themes.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<style name="Theme.HealthJournal" parent="Base.Theme.HealthJournal">
|
||||
<!-- Transparent system bars for edge-to-edge. -->
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">?attr/isLightTheme</item>
|
||||
</style>
|
||||
</resources>
|
3
app/src/main/res/values-w1240dp/dimens.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<dimen name="fab_margin">200dp</dimen>
|
||||
</resources>
|
3
app/src/main/res/values-w600dp/dimens.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<dimen name="fab_margin">48dp</dimen>
|
||||
</resources>
|
@ -2,6 +2,7 @@
|
||||
<resources>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="background">#E8F4F8</color>
|
||||
|
||||
<color name="Primary_Dark">#004343</color>
|
||||
<color name="Primary_Light">#006C6C</color>
|
||||
@ -9,8 +10,13 @@
|
||||
<color name="Secondary_Dark">#7ABDBD</color>
|
||||
<color name="Secondary_Light">#E8F4F8</color>
|
||||
|
||||
<color name="Accent_Dark_Gray">#D9D9D9</color>
|
||||
<color name="Accent_Dark_Gray">#EFEDED</color>
|
||||
|
||||
<color name="Accent_Light_Orange">#FF5722</color>
|
||||
<color name="Accent_Light_Red">#FF0000</color>
|
||||
|
||||
<color name="chart_bmi">#388E3C</color>
|
||||
<color name="chart_sugar">#D32F2F</color>
|
||||
<color name="chart_systolic">#1976D2</color>
|
||||
<color name="chart_diastolic">#F57C00</color>
|
||||
</resources>
|
3
app/src/main/res/values/dimens.xml
Normal file
@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
</resources>
|
4
app/src/main/res/values/ic_launcher_background.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#FDFDFD</color>
|
||||
</resources>
|
@ -7,6 +7,48 @@
|
||||
<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>
|
||||
<!-- Strings used for fragments for navigation -->
|
||||
<string name="first_fragment_label">First Fragment</string>
|
||||
<string name="second_fragment_label">Second Fragment</string>
|
||||
<string name="next">Next</string>
|
||||
<string name="previous">Previous</string>
|
||||
|
||||
<string name="lorem_ipsum">
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam in scelerisque sem. Mauris
|
||||
volutpat, dolor id interdum ullamcorper, risus dolor egestas lectus, sit amet mattis purus
|
||||
dui nec risus. Maecenas non sodales nisi, vel dictum dolor. Class aptent taciti sociosqu ad
|
||||
litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse blandit eleifend
|
||||
diam, vel rutrum tellus vulputate quis. Aliquam eget libero aliquet, imperdiet nisl a,
|
||||
ornare ex. Sed rhoncus est ut libero porta lobortis. Fusce in dictum tellus.\n\n
|
||||
Suspendisse interdum ornare ante. Aliquam nec cursus lorem. Morbi id magna felis. Vivamus
|
||||
egestas, est a condimentum egestas, turpis nisl iaculis ipsum, in dictum tellus dolor sed
|
||||
neque. Morbi tellus erat, dapibus ut sem a, iaculis tincidunt dui. Interdum et malesuada
|
||||
fames ac ante ipsum primis in faucibus. Curabitur et eros porttitor, ultricies urna vitae,
|
||||
molestie nibh. Phasellus at commodo eros, non aliquet metus. Sed maximus nisl nec dolor
|
||||
bibendum, vel congue leo egestas.\n\n
|
||||
Sed interdum tortor nibh, in sagittis risus mollis quis. Curabitur mi odio, condimentum sit
|
||||
amet auctor at, mollis non turpis. Nullam pretium libero vestibulum, finibus orci vel,
|
||||
molestie quam. Fusce blandit tincidunt nulla, quis sollicitudin libero facilisis et. Integer
|
||||
interdum nunc ligula, et fermentum metus hendrerit id. Vestibulum lectus felis, dictum at
|
||||
lacinia sit amet, tristique id quam. Cras eu consequat dui. Suspendisse sodales nunc ligula,
|
||||
in lobortis sem porta sed. Integer id ultrices magna, in luctus elit. Sed a pellentesque
|
||||
est.\n\n
|
||||
Aenean nunc velit, lacinia sed dolor sed, ultrices viverra nulla. Etiam a venenatis nibh.
|
||||
Morbi laoreet, tortor sed facilisis varius, nibh orci rhoncus nulla, id elementum leo dui
|
||||
non lorem. Nam mollis ipsum quis auctor varius. Quisque elementum eu libero sed commodo. In
|
||||
eros nisl, imperdiet vel imperdiet et, scelerisque a mauris. Pellentesque varius ex nunc,
|
||||
quis imperdiet eros placerat ac. Duis finibus orci et est auctor tincidunt. Sed non viverra
|
||||
ipsum. Nunc quis augue egestas, cursus lorem at, molestie sem. Morbi a consectetur ipsum, a
|
||||
placerat diam. Etiam vulputate dignissim convallis. Integer faucibus mauris sit amet finibus
|
||||
convallis.\n\n
|
||||
Phasellus in aliquet mi. Pellentesque habitant morbi tristique senectus et netus et
|
||||
malesuada fames ac turpis egestas. In volutpat arcu ut felis sagittis, in finibus massa
|
||||
gravida. Pellentesque id tellus orci. Integer dictum, lorem sed efficitur ullamcorper,
|
||||
libero justo consectetur ipsum, in mollis nisl ex sed nisl. Donec maximus ullamcorper
|
||||
sodales. Praesent bibendum rhoncus tellus nec feugiat. In a ornare nulla. Donec rhoncus
|
||||
libero vel nunc consequat, quis tincidunt nisl eleifend. Cras bibendum enim a justo luctus
|
||||
vestibulum. Fusce dictum libero quis erat maximus, vitae volutpat diam dignissim.
|
||||
</string>
|
||||
|
||||
// Activity Login
|
||||
|
||||
@ -18,5 +60,12 @@
|
||||
|
||||
// Activity Recommendation
|
||||
|
||||
// Activity S
|
||||
|
||||
<string-array name="filter_options">
|
||||
<item>Daily</item>
|
||||
<item>Weekly</item>
|
||||
<item>Monthly</item>
|
||||
</string-array>
|
||||
|
||||
|
||||
</resources>
|
@ -2,15 +2,18 @@
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.HealthJournal" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<item name="colorPrimary">@color/Primary_Dark</item>
|
||||
<item name="colorPrimaryVariant">@color/Primary_Dark</item>
|
||||
<item name="colorOnPrimary">@color/Primary_Light</item>
|
||||
<item name="colorPrimaryVariant">@color/Primary_Light</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<item name="colorSecondary">@color/Accent_Light_Orange</item>
|
||||
<item name="colorOnSecondary">@color/Primary_Dark</item>
|
||||
|
||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
||||
<item name="colorOnSecondary">@color/white</item>
|
||||
<item name="android:statusBarColor">@color/Primary_Dark</item>
|
||||
<item name="android:navigationBarColor">@color/Primary_Dark</item>
|
||||
<item name="android:textColorPrimary">@color/black</item>
|
||||
<item name="android:textColorSecondary">@color/Secondary_Dark</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.HealthJournal" parent="Base.Theme.HealthJournal" />
|
||||
|
||||
<style name="CategoryItemStyle">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
|
@ -12,6 +12,8 @@ constraintlayout = "2.1.4"
|
||||
googleGmsGoogleServices = "4.4.2"
|
||||
firebaseDatabase = "21.0.0"
|
||||
firebaseAuth = "23.1.0"
|
||||
navigationFragmentKtx = "2.8.5"
|
||||
navigationUiKtx = "2.8.5"
|
||||
|
||||
[libraries]
|
||||
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||
@ -24,6 +26,8 @@ androidx-activity = { group = "androidx.activity", name = "activity", version.re
|
||||
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
|
||||
firebase-database = { group = "com.google.firebase", name = "firebase-database", version.ref = "firebaseDatabase" }
|
||||
firebase-auth = { group = "com.google.firebase", name = "firebase-auth", version.ref = "firebaseAuth" }
|
||||
androidx-navigation-fragment-ktx = { group = "androidx.navigation", name = "navigation-fragment-ktx", version.ref = "navigationFragmentKtx" }
|
||||
androidx-navigation-ui-ktx = { group = "androidx.navigation", name = "navigation-ui-ktx", version.ref = "navigationUiKtx" }
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
|
@ -16,6 +16,7 @@ dependencyResolutionManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven(url = "https://jitpack.io")
|
||||
}
|
||||
}
|
||||
|
||||
|