Skip to content

Commit

Permalink
Debug: Rendering for UI
Browse files Browse the repository at this point in the history
  • Loading branch information
highjun committed Jan 1, 2025
1 parent 40e7ddb commit 278f173
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
.externalNativeBuild
.cxx
local.properties
tracker-library/libs/
tracker-library/libs/*
2 changes: 1 addition & 1 deletion galaxywatch-monitor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {

defaultConfig {
applicationId = "kaist.iclab.lab_galaxywatch_tracker"
minSdk = 24
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion phone/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {

defaultConfig {
applicationId = "kaist.iclab.field_tracker"
minSdk = 22
minSdk = 26
targetSdk = 35
versionCode = 1
versionName = "1.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package kaist.iclab.field_tracker.ui

import kaist.iclab.tracker.CollectorUtil
import kaist.iclab.tracker.TrackerUtil
import kaist.iclab.tracker.controller.CollectorControllerInterface


Expand Down Expand Up @@ -33,11 +33,11 @@ class MainViewModelImpl(
}

override fun getDeviceInfo(): String {
return CollectorUtil.getDeviceModel()
return TrackerUtil.getDeviceModel()
}

override fun getAppVersion(): String {
return CollectorUtil.getAppVersion()
return TrackerUtil.getAppVersion()
}

// override fun sync() {
Expand Down
71 changes: 71 additions & 0 deletions phone/src/main/java/kaist/iclab/field_tracker/ui/components/Row.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package kaist.iclab.field_tracker.ui.components

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.Switch
import androidx.compose.material3.SwitchDefaults
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp


@Composable
fun SwitchItem(
label: String,
isChecked: Boolean,
onCheckedChange: (Boolean) -> Unit
) {
Box(
modifier = Modifier
.size(48.dp), // Accessibility Guide
contentAlignment = Alignment.Center
){
Switch(
checked = isChecked,
onCheckedChange = onCheckedChange,
modifier = Modifier
.width(26.dp) // Switch 너비
.height(14.dp), // Switch 높이
colors = SwitchDefaults.colors(
checkedThumbColor = Color.White,
uncheckedThumbColor = Color.White,
checkedTrackColor = Color(0xFF3579FF),
uncheckedTrackColor = Color(0xFF9A999E)
),
thumbContent = {
Box(
modifier = Modifier
.size(12.dp) // Thumb 크기 설정
.background(Color.White, shape = CircleShape)
)
}
)
}
}

@Preview(showBackground = true, widthDp = 50, heightDp = 50)
@Composable
fun SwitchItemPreview() {
var isChecked by remember { mutableStateOf(true) }
SwitchItem(
label = "ActivityRecognitionStat",
isChecked = isChecked,
onCheckedChange = { isChecked = it }
)
}
4 changes: 2 additions & 2 deletions tracker-library/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ plugins {

android {
namespace = "kaist.iclab.tracker"
compileSdk = 34
compileSdk = 35

defaultConfig {
minSdk = 22
minSdk = 26
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package kaist.iclab.tracker.notification

import android.app.Service
import android.content.Context
import android.content.Intent

interface NotificationManagerInterface {

Expand Down

0 comments on commit 278f173

Please sign in to comment.