From 03c5115352fb4d97523a40084867f32b3e40f943 Mon Sep 17 00:00:00 2001 From: Phillip Thelen Date: Tue, 14 Jun 2022 11:30:23 +0200 Subject: [PATCH] Implement basic habit screen --- .../habitica/ui/views/CurrencyViews.kt | 6 +- wearos/src/main/AndroidManifest.xml | 1 + .../data/repositories/TaskLocalRepository.kt | 11 +++ .../data/repositories/TaskRepository.kt | 6 ++ .../ui/activities/HabitDirectionActivity.kt | 39 ++++++++ .../ui/activities/TaskListActivity.kt | 5 +- .../ui/viewHolders/tasks/HabitViewHolder.kt | 23 ++++- .../ui/viewmodels/HabitDrectionViewModel.kt | 29 ++++++ .../wearos/habitica/ui/views/AddTaskButton.kt | 2 +- .../ui/views/HabitDirectionPickerButton.kt | 91 ++++++++++++++++++ .../main/res/drawable-hdpi/habit_diagonal.png | Bin 0 -> 636 bytes .../drawable-hdpi/watch_habit_negative.png | Bin 0 -> 149 bytes .../drawable-hdpi/watch_habit_positive.png | Bin 0 -> 167 bytes .../res/drawable-hdpi/watch_habit_posneg.png | Bin 0 -> 184 bytes .../main/res/drawable-hdpi/watch_task_add.png | Bin 0 -> 232 bytes .../res/drawable-hdpi/watch_task_minus.png | Bin 0 -> 168 bytes .../main/res/drawable-mdpi/habit_diagonal.png | Bin 0 -> 636 bytes .../drawable-mdpi/watch_habit_negative.png | Bin 0 -> 131 bytes .../drawable-mdpi/watch_habit_positive.png | Bin 0 -> 146 bytes .../res/drawable-mdpi/watch_habit_posneg.png | Bin 0 -> 150 bytes .../main/res/drawable-mdpi/watch_task_add.png | Bin 0 -> 192 bytes .../res/drawable-mdpi/watch_task_minus.png | Bin 0 -> 156 bytes .../res/drawable-xhdpi/habit_diagonal.png | Bin 0 -> 1101 bytes .../drawable-xhdpi/watch_habit_negative.png | Bin 0 -> 156 bytes .../drawable-xhdpi/watch_habit_positive.png | Bin 0 -> 186 bytes .../res/drawable-xhdpi/watch_habit_posneg.png | Bin 0 -> 195 bytes .../res/drawable-xhdpi/watch_task_add.png | Bin 0 -> 220 bytes .../res/drawable-xhdpi/watch_task_minus.png | Bin 0 -> 181 bytes .../res/drawable-xxhdpi/habit_diagonal.png | Bin 0 -> 1626 bytes .../drawable-xxhdpi/watch_habit_negative.png | Bin 0 -> 166 bytes .../drawable-xxhdpi/watch_habit_positive.png | Bin 0 -> 203 bytes .../drawable-xxhdpi/watch_habit_posneg.png | Bin 0 -> 219 bytes .../res/drawable-xxhdpi/watch_task_add.png | Bin 0 -> 279 bytes .../res/drawable-xxhdpi/watch_task_minus.png | Bin 0 -> 209 bytes .../drawable-xxxhdpi/watch_habit_negative.png | Bin 0 -> 181 bytes .../drawable-xxxhdpi/watch_habit_positive.png | Bin 0 -> 220 bytes .../drawable-xxxhdpi/watch_habit_posneg.png | Bin 0 -> 243 bytes .../res/drawable-xxxhdpi/watch_task_add.png | Bin 0 -> 292 bytes .../res/drawable-xxxhdpi/watch_task_minus.png | Bin 0 -> 230 bytes .../res/drawable/habit_button_diagonal_bg.xml | 14 +++ .../main/res/drawable/habit_button_round.xml | 9 ++ .../res/layout/activity_habit_direction.xml | 45 +++++++++ wearos/src/main/res/layout/row_habit.xml | 14 ++- wearos/src/main/res/values/attrs.xml | 7 ++ wearos/src/main/res/values/strings.xml | 1 + 45 files changed, 293 insertions(+), 10 deletions(-) create mode 100644 wearos/src/main/java/com/habitrpg/wearos/habitica/ui/activities/HabitDirectionActivity.kt create mode 100644 wearos/src/main/java/com/habitrpg/wearos/habitica/ui/viewmodels/HabitDrectionViewModel.kt create mode 100644 wearos/src/main/java/com/habitrpg/wearos/habitica/ui/views/HabitDirectionPickerButton.kt create mode 100644 wearos/src/main/res/drawable-hdpi/habit_diagonal.png create mode 100644 wearos/src/main/res/drawable-hdpi/watch_habit_negative.png create mode 100644 wearos/src/main/res/drawable-hdpi/watch_habit_positive.png create mode 100644 wearos/src/main/res/drawable-hdpi/watch_habit_posneg.png create mode 100644 wearos/src/main/res/drawable-hdpi/watch_task_add.png create mode 100644 wearos/src/main/res/drawable-hdpi/watch_task_minus.png create mode 100644 wearos/src/main/res/drawable-mdpi/habit_diagonal.png create mode 100644 wearos/src/main/res/drawable-mdpi/watch_habit_negative.png create mode 100644 wearos/src/main/res/drawable-mdpi/watch_habit_positive.png create mode 100644 wearos/src/main/res/drawable-mdpi/watch_habit_posneg.png create mode 100644 wearos/src/main/res/drawable-mdpi/watch_task_add.png create mode 100644 wearos/src/main/res/drawable-mdpi/watch_task_minus.png create mode 100644 wearos/src/main/res/drawable-xhdpi/habit_diagonal.png create mode 100644 wearos/src/main/res/drawable-xhdpi/watch_habit_negative.png create mode 100644 wearos/src/main/res/drawable-xhdpi/watch_habit_positive.png create mode 100644 wearos/src/main/res/drawable-xhdpi/watch_habit_posneg.png create mode 100644 wearos/src/main/res/drawable-xhdpi/watch_task_add.png create mode 100644 wearos/src/main/res/drawable-xhdpi/watch_task_minus.png create mode 100644 wearos/src/main/res/drawable-xxhdpi/habit_diagonal.png create mode 100644 wearos/src/main/res/drawable-xxhdpi/watch_habit_negative.png create mode 100644 wearos/src/main/res/drawable-xxhdpi/watch_habit_positive.png create mode 100644 wearos/src/main/res/drawable-xxhdpi/watch_habit_posneg.png create mode 100644 wearos/src/main/res/drawable-xxhdpi/watch_task_add.png create mode 100644 wearos/src/main/res/drawable-xxhdpi/watch_task_minus.png create mode 100644 wearos/src/main/res/drawable-xxxhdpi/watch_habit_negative.png create mode 100644 wearos/src/main/res/drawable-xxxhdpi/watch_habit_positive.png create mode 100644 wearos/src/main/res/drawable-xxxhdpi/watch_habit_posneg.png create mode 100644 wearos/src/main/res/drawable-xxxhdpi/watch_task_add.png create mode 100644 wearos/src/main/res/drawable-xxxhdpi/watch_task_minus.png create mode 100644 wearos/src/main/res/drawable/habit_button_diagonal_bg.xml create mode 100644 wearos/src/main/res/drawable/habit_button_round.xml create mode 100644 wearos/src/main/res/layout/activity_habit_direction.xml create mode 100644 wearos/src/main/res/values/attrs.xml diff --git a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/CurrencyViews.kt b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/CurrencyViews.kt index 8ee76d044..134a0089c 100644 --- a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/CurrencyViews.kt +++ b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/CurrencyViews.kt @@ -43,14 +43,14 @@ class CurrencyViews : LinearLayout { get() = gemTextView.visibility set(value) { gemTextView.visibility = value } - constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) { - val attributes = context?.theme?.obtainStyledAttributes( + constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) { + val attributes = context.theme?.obtainStyledAttributes( attrs, R.styleable.CurrencyViews, 0, 0 ) setupViews() - val fallBackLight = context?.isUsingNightModeResources() != true + val fallBackLight = !context.isUsingNightModeResources() lightBackground = attributes?.getBoolean(R.styleable.CurrencyViews_hasLightBackground, fallBackLight) ?: fallBackLight } diff --git a/wearos/src/main/AndroidManifest.xml b/wearos/src/main/AndroidManifest.xml index b79825d79..541a59495 100644 --- a/wearos/src/main/AndroidManifest.xml +++ b/wearos/src/main/AndroidManifest.xml @@ -37,6 +37,7 @@ + diff --git a/wearos/src/main/java/com/habitrpg/wearos/habitica/data/repositories/TaskLocalRepository.kt b/wearos/src/main/java/com/habitrpg/wearos/habitica/data/repositories/TaskLocalRepository.kt index e538140e2..4f7a3361a 100644 --- a/wearos/src/main/java/com/habitrpg/wearos/habitica/data/repositories/TaskLocalRepository.kt +++ b/wearos/src/main/java/com/habitrpg/wearos/habitica/data/repositories/TaskLocalRepository.kt @@ -7,6 +7,7 @@ import com.habitrpg.wearos.habitica.models.tasks.Task import com.habitrpg.wearos.habitica.models.tasks.TaskList import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.emptyFlow +import kotlinx.coroutines.flow.flowOf import javax.inject.Inject import javax.inject.Singleton @@ -46,4 +47,14 @@ class TaskLocalRepository @Inject constructor() { } tasks[task.type]?.value = oldList } + + fun getTask(taskID: String): Flow { + for (type in tasks.values) { + val task = type.value?.firstOrNull { it.id == taskID } + if (task != null) { + return flowOf(task) + } + } + return emptyFlow() + } } \ No newline at end of file diff --git a/wearos/src/main/java/com/habitrpg/wearos/habitica/data/repositories/TaskRepository.kt b/wearos/src/main/java/com/habitrpg/wearos/habitica/data/repositories/TaskRepository.kt index 973f058f3..6c86f520c 100644 --- a/wearos/src/main/java/com/habitrpg/wearos/habitica/data/repositories/TaskRepository.kt +++ b/wearos/src/main/java/com/habitrpg/wearos/habitica/data/repositories/TaskRepository.kt @@ -7,6 +7,7 @@ import com.habitrpg.wearos.habitica.data.ApiClient import com.habitrpg.wearos.habitica.models.tasks.Task import com.habitrpg.wearos.habitica.models.tasks.TaskList import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.emptyFlow import javax.inject.Inject class TaskRepository @Inject constructor(val apiClient: ApiClient, val localRepository: TaskLocalRepository) { @@ -28,4 +29,9 @@ class TaskRepository @Inject constructor(val apiClient: ApiClient, val localRepo } return result?.let { TaskScoringResult(it, null) } } + + fun getTask(taskID: String?): Flow { + if (taskID == null) return emptyFlow() + return localRepository.getTask(taskID) + } } \ No newline at end of file diff --git a/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/activities/HabitDirectionActivity.kt b/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/activities/HabitDirectionActivity.kt new file mode 100644 index 000000000..4a3c058b8 --- /dev/null +++ b/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/activities/HabitDirectionActivity.kt @@ -0,0 +1,39 @@ +package com.habitrpg.wearos.habitica.ui.activities + +import android.os.Bundle +import androidx.activity.viewModels +import androidx.core.content.ContextCompat +import com.habitrpg.android.habitica.databinding.ActivityHabitDirectionBinding +import com.habitrpg.common.habitica.models.responses.TaskDirection +import com.habitrpg.wearos.habitica.ui.viewmodels.HabitDrectionViewModel +import dagger.hilt.android.AndroidEntryPoint + +@AndroidEntryPoint +class HabitDirectionActivity: BaseActivity() { + override val viewModel: HabitDrectionViewModel by viewModels() + + override fun onCreate(savedInstanceState: Bundle?) { + binding = ActivityHabitDirectionBinding.inflate(layoutInflater) + super.onCreate(savedInstanceState) + + viewModel.task.observe(this) { + if (it == null) return@observe + val lightTaskColor = ContextCompat.getColor(this, it.lightTaskColor) + val mediumTaskColor = ContextCompat.getColor(this, it.mediumTaskColor) + binding.plusButton.mainTaskColor = lightTaskColor + binding.plusButton.darkerTaskColor = mediumTaskColor + binding.minusButton.mainTaskColor = lightTaskColor + binding.minusButton.darkerTaskColor = mediumTaskColor + binding.textView.text = it.text + } + + binding.plusButton.setOnClickListener { + viewModel.scoreTask(TaskDirection.UP) + finish() + } + binding.minusButton.setOnClickListener { + viewModel.scoreTask(TaskDirection.DOWN) + finish() + } + } +} \ No newline at end of file diff --git a/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/activities/TaskListActivity.kt b/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/activities/TaskListActivity.kt index 52c934f88..f1944230f 100644 --- a/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/activities/TaskListActivity.kt +++ b/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/activities/TaskListActivity.kt @@ -51,13 +51,16 @@ class TaskListActivity: BaseActivity scoreTask(it) } - binding.addTaskButton.setOnClickListener { } + binding.addTaskButton.setOnClickListener { openTaskFormActivity() } } private fun scoreTask(task: Task) { var direction = TaskDirection.UP if (task.type == TaskType.HABIT) { if (task.up == true && task.down == true) { + startActivity(Intent(this, HabitDirectionActivity::class.java).apply { + putExtra("task_id", task.id) + }) return } else { direction = if (task.up == true) TaskDirection.UP else TaskDirection.DOWN diff --git a/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/viewHolders/tasks/HabitViewHolder.kt b/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/viewHolders/tasks/HabitViewHolder.kt index 3d491841e..e4d96ea31 100644 --- a/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/viewHolders/tasks/HabitViewHolder.kt +++ b/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/viewHolders/tasks/HabitViewHolder.kt @@ -4,6 +4,7 @@ import android.content.res.ColorStateList import android.view.View import android.widget.TextView import androidx.core.content.ContextCompat +import com.habitrpg.android.habitica.R import com.habitrpg.android.habitica.databinding.RowHabitBinding import com.habitrpg.wearos.habitica.models.tasks.Task @@ -20,6 +21,26 @@ class HabitViewHolder(itemView: View) : TaskViewHolder(itemView) { override fun bind(data: Task) { super.bind(data) - binding.habitButton.backgroundTintList = ColorStateList.valueOf(ContextCompat.getColor(itemView.context, data.mediumTaskColor)) + + if (data.up == true && data.down == true) { + binding.habitButtonIcon.setBackgroundResource(R.drawable.habit_diagonal) + binding.habitButtonIcon.setImageResource(R.drawable.watch_habit_posneg) + } else { + binding.habitButtonIcon.setBackgroundResource(R.drawable.habit_button_round) + if (data.up == true) { + binding.habitButtonIcon.setImageResource(R.drawable.watch_habit_positive) + } else { + binding.habitButtonIcon.setImageResource(R.drawable.watch_habit_negative) + } + } + if (data.up != true && data.down != true) { + binding.habitButton.backgroundTintList = ColorStateList.valueOf(ContextCompat.getColor(itemView.context, R.color.gray_300)) + binding.habitButtonIcon.backgroundTintList = ColorStateList.valueOf(ContextCompat.getColor(itemView.context, R.color.gray_100)) + binding.habitButtonIcon.imageTintList = ColorStateList.valueOf(ContextCompat.getColor(itemView.context, R.color.gray_300)) + } else { + binding.habitButton.backgroundTintList = ColorStateList.valueOf(ContextCompat.getColor(itemView.context, data.lightTaskColor)) + binding.habitButtonIcon.backgroundTintList = ColorStateList.valueOf(ContextCompat.getColor(itemView.context, data.mediumTaskColor)) + binding.habitButtonIcon.imageTintList = ColorStateList.valueOf(ContextCompat.getColor(itemView.context, R.color.white)) + } } } \ No newline at end of file diff --git a/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/viewmodels/HabitDrectionViewModel.kt b/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/viewmodels/HabitDrectionViewModel.kt new file mode 100644 index 000000000..e3236e0a5 --- /dev/null +++ b/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/viewmodels/HabitDrectionViewModel.kt @@ -0,0 +1,29 @@ +package com.habitrpg.wearos.habitica.ui.viewmodels + +import androidx.lifecycle.SavedStateHandle +import androidx.lifecycle.asLiveData +import androidx.lifecycle.viewModelScope +import com.habitrpg.common.habitica.models.responses.TaskDirection +import com.habitrpg.wearos.habitica.data.repositories.TaskRepository +import com.habitrpg.wearos.habitica.data.repositories.UserRepository +import com.habitrpg.wearos.habitica.util.ExceptionHandlerBuilder +import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.launch +import javax.inject.Inject + +@HiltViewModel +class HabitDrectionViewModel @Inject constructor( + savedStateHandle: SavedStateHandle, + userRepository: UserRepository, + val taskRepository: TaskRepository, + exceptionBuilder: ExceptionHandlerBuilder +) : BaseViewModel(userRepository, exceptionBuilder) { + val taskID = savedStateHandle.get("task_id") + val task = taskRepository.getTask(taskID).asLiveData() + + fun scoreTask(direction: TaskDirection) { + viewModelScope.launch(exceptionBuilder.userFacing(this)) { + task.value?.let { taskRepository.scoreTask(it, direction) } + } + } +} diff --git a/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/views/AddTaskButton.kt b/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/views/AddTaskButton.kt index 622f3d426..859c14cd4 100644 --- a/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/views/AddTaskButton.kt +++ b/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/views/AddTaskButton.kt @@ -42,7 +42,7 @@ class AddTaskButton @JvmOverloads constructor( override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) { super.onLayout(changed, left, top, right, bottom) - rect.right = bottom.toFloat() + rect.right = right.toFloat() rect.bottom = bottom.toFloat() / 2f invalidate() } diff --git a/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/views/HabitDirectionPickerButton.kt b/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/views/HabitDirectionPickerButton.kt new file mode 100644 index 000000000..c83282367 --- /dev/null +++ b/wearos/src/main/java/com/habitrpg/wearos/habitica/ui/views/HabitDirectionPickerButton.kt @@ -0,0 +1,91 @@ +package com.habitrpg.wearos.habitica.ui.views + +import android.content.Context +import android.graphics.Canvas +import android.graphics.Paint +import android.graphics.Path +import android.graphics.RectF +import android.graphics.drawable.BitmapDrawable +import android.util.AttributeSet +import android.widget.FrameLayout +import androidx.core.content.ContextCompat +import com.habitrpg.android.habitica.R +import com.habitrpg.common.habitica.extensions.dpToPx + +class HabitDirectionPickerButton @JvmOverloads constructor( + context: Context, attrs: AttributeSet? = null +) : FrameLayout(context, attrs) { + private var drawFromTop: Boolean + private var drawable: BitmapDrawable? + + private val paint = Paint() + private val path = Path() + private val rect = RectF(0f, 0f, 0f, 0f) + private val bitmapRect = RectF(0f, 0f, 0f, 0f) + + var mainTaskColor: Int = ContextCompat.getColor(context, R.color.gray_300) + var darkerTaskColor: Int = ContextCompat.getColor(context, R.color.gray_200) + var iconColor: Int = ContextCompat.getColor(context, R.color.white) + + private val radius = 15.dpToPx(context) + + init { + paint.style = Paint.Style.FILL + paint.isAntiAlias = true + setWillNotDraw(false) + + val attributes = context.theme.obtainStyledAttributes( + attrs, + R.styleable.HabitDirectionPickerButton, + 0, 0 + ) + drawable = attributes.getDrawable(R.styleable.HabitDirectionPickerButton_drawable) as? BitmapDrawable + drawFromTop = attributes.getBoolean(R.styleable.HabitDirectionPickerButton_drawFromTop, false) + } + + override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) { + super.onLayout(changed, left, top, right, bottom) + rect.left = right.toFloat() * 0.125f + rect.right = right.toFloat() * 0.875f + if (drawFromTop) { + rect.top = -bottom.toFloat() + rect.bottom = bottom.toFloat() + } else { + rect.bottom = bottom.toFloat() / 2f + } + + val middleX = width / 2f + val middleY = height / 2f + val bitmapWidthHalf = (drawable?.bitmap?.width?.toFloat() ?: 0f) / 2f + val bitmapHeightHalf = (drawable?.bitmap?.height?.toFloat() ?: 0f) / 2f + bitmapRect.left = middleX - bitmapWidthHalf + bitmapRect.top = middleY - bitmapHeightHalf + bitmapRect.right = middleX + bitmapWidthHalf + bitmapRect.bottom = middleY + bitmapHeightHalf + + invalidate() + } + + override fun onDraw(canvas: Canvas?) { + super.onDraw(canvas) + + if (canvas == null) return + path.reset() + if (drawFromTop) { + path.addArc(rect, 0f, 180f) + } else { + path.addArc(rect, 180f, 360f) + } + paint.color = mainTaskColor + canvas.drawPath(path, paint) + + val middleX = width / 2f + val middleY = height / 2f + paint.color = darkerTaskColor + canvas.drawArc(middleX - radius, middleY - radius, middleX + radius, middleY + radius, 0f, 360f, true, paint) + drawable?.let { + paint.color = iconColor + canvas.drawBitmap(it.bitmap, null, bitmapRect, paint) + } + } +} \ No newline at end of file diff --git a/wearos/src/main/res/drawable-hdpi/habit_diagonal.png b/wearos/src/main/res/drawable-hdpi/habit_diagonal.png new file mode 100644 index 0000000000000000000000000000000000000000..e16e1f5b68696707eef792e9e99ddcb2a4b0c859 GIT binary patch literal 636 zcmeAS@N?(olHy`uVBq!ia0vp^N+8U^1|+TAxeoy;#^NA%Cx&(BWL^R}E~ycoX}-P; zT0k}j17mw80}DtA5K93u0|WB{Mh0de%?J`(zyz07TEL88gA_7VEerutGMO&^Aespz z1_XjYtO2D#>}M=1ywZU5CQlc~kOFpv3&=8R1xLXB2Q zW)s*N?H%5DsIL~h#-PjEdc;S;jqQA+jADzH)aHh1jWUL^H(5R2%rx01muPe0(n=4p z#m0_-OPT_FmBlVh(tKf-{Lp{##IFL$jbeU>k~Ga0mOD6>&9Y$2_`s55_DHaJ*)HdX zXRH>zytWZ$rP%A#Z6 zwS&b>((hFJ*G@e5bME@=e<50ZQ&Vqp#b}paO89;0>I2*Pe{`J=9Gcvc^sTT j-xgeVVEK03j5~f+K}~Zm&q@PepfGs4`njxgN@xNAq-x%a literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-hdpi/watch_habit_negative.png b/wearos/src/main/res/drawable-hdpi/watch_habit_negative.png new file mode 100644 index 0000000000000000000000000000000000000000..b33059881f3ac3b198c092dc43a5e8fafce87491 GIT binary patch literal 149 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~n#0(^#-%mddq*&4&eH|GXHuiJ>Nn{1`8HQ@F_#4S1v50%Gx{4?0J##LE{-7_*OPAmmGQTM f)F!R~65I^Ir@0k8GTLqc)i8Lv`njxgN@xNAUqmvv literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-hdpi/watch_habit_positive.png b/wearos/src/main/res/drawable-hdpi/watch_habit_positive.png new file mode 100644 index 0000000000000000000000000000000000000000..2828fd1c5c0d0819aff6240f5b1fae6bae50269b GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9Ea{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaN10(?ST-3xsF!vNd-3n0^&OM?7@85-&t{S7RDTrE!*#}JO|$q5hg5)u*~ w*f-3*0o1_X2GW(d0!VP@mGZpd<4Is(h^!LfaQa%20@TIe>FVdQ&MBb@0LDT%^#A|> literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-hdpi/watch_habit_posneg.png b/wearos/src/main/res/drawable-hdpi/watch_habit_posneg.png new file mode 100644 index 0000000000000000000000000000000000000000..449e2b35ddf97ef2ce9ccbae308b998879394661 GIT binary patch literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^Nds|B-<314Aj0zLFrnV1|bK3i%l=OhCT5r;B5V#O36KgaiS> z1P5k4J`+K~LPlnl*9uH0P8nRiaLzX3ubo80LInv41(y(ogNqvcS(b4#==~M&?(A^` P8NuM`>gTe~DWM4fOv5*! literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-hdpi/watch_task_add.png b/wearos/src/main/res/drawable-hdpi/watch_task_add.png new file mode 100644 index 0000000000000000000000000000000000000000..9388cefde219585872c60c3ec8afa4396e71362d GIT binary patch literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^GC(ZN!VDzms(q3NQY`6?zK#qG8~eHcB(ehejKx9j zP7LeL$-D%q4DbnYbuaMwj{}JPmE{8}<0uL83ub88FJbV$;QXf^o@k(0xTlL_h{WaO z1O`U2ULiJ>gj*N08jhTO@xsI5kyl9x$Awv^=V)kXthjh_A;*$Qk`gi20t>D-E@bMw zz3@Q8nb#Q!7aX36EqLu}JTuSkkl3V*hi8HoG9@xFR84c_UGPtQ6VM6b%7 literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-hdpi/watch_task_minus.png b/wearos/src/main/res/drawable-hdpi/watch_task_minus.png new file mode 100644 index 0000000000000000000000000000000000000000..d0af9df8b21648dd3d35666c42bfce7867d58e90 GIT binary patch literal 168 zcmeAS@N?(olHy`uVBq!ia0vp^(m>44!VDz2-)Xl2DVB6cUq=Rpjs4tz5?O(K#^NA% zCx&(BWL^R}`~f~8uI>ds|B-<314Aj0zLFrnV21Y%6K*a1#R252d%8G=a9mGL5GrhB zPGn;f7FSttK%wc3sKfJB3dOt}M=1ywZU5CQlc~kOFpv3&=8R1xLXB2Q zW)s*N?H%5DsIL~h#-PjEdc;S;jqQA+jADzH)aHh1jWUL^H(5R2%rx01muPe0(n=4p z#m0_-OPT_FmBlVh(tKf-{Lp{##IFL$jbeU>k~Ga0mOD6>&9Y$2_`s55_DHaJ*)HdX zXRH>zytWZ$rP%A#Z6 zwS&b>((hFJ*G@e5bME@=e<50ZQ&Vqp#b}paO89;0>I2*Pe{`J=9Gcvc^sTT j-xgeVVEK03j5~f+K}~Zm&q@PepfGs4`njxgN@xNAq-x%a literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-mdpi/watch_habit_negative.png b/wearos/src/main/res/drawable-mdpi/watch_habit_negative.png new file mode 100644 index 0000000000000000000000000000000000000000..87472b37cc61ae8f562d544226fb284cc02efe5a GIT binary patch literal 131 zcmeAS@N?(olHy`uVBq!ia0vp^AT|>tGmwm4e}6KNVo7)Ob!1@J*w6hZkrl{iEDmya zVpw-h<|UBB7T^=&`X3BJYrf`yq)USQg71fQi7Nv+e4Z|jAsp9}SL7$G$Y)?+{m=M+ Tr`QW;pbUejtDnm{r-UW|U|}WM literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-mdpi/watch_habit_positive.png b/wearos/src/main/res/drawable-mdpi/watch_habit_positive.png new file mode 100644 index 0000000000000000000000000000000000000000..33685979e9c5b13210f18a05cbbcdc17efe027a5 GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2hGm!icqpk;}SkfJR9T^xl_H+M9WCijWi-X*q z7}lMWc?slj2Ka=y{{R2qy}$=Zx-8ms5h%!1666FMGa!f`#BBb7IS mBev^6)M}{%5|KPB*ce{1aPKVnyl@gw5re0zpUXO@geCxFz$z#J literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-mdpi/watch_habit_posneg.png b/wearos/src/main/res/drawable-mdpi/watch_habit_posneg.png new file mode 100644 index 0000000000000000000000000000000000000000..595dd0614a1c455adf5d8b02d19e6261d5542ac1 GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^Vn8g�(^t+}|Pqq*&4&eH|GXHuiJ>Nn{1`8H&Xcm2@K7w p5i8b&3Qy2jgTe~DWM4fW%xjC literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-mdpi/watch_task_minus.png b/wearos/src/main/res/drawable-mdpi/watch_task_minus.png new file mode 100644 index 0000000000000000000000000000000000000000..0cb8ab9495a107f5d60feec4ed6ff29a24e770fc GIT binary patch literal 156 zcmeAS@N?(olHy`uVBq!ia0vp^LO{&I!VDw}^NSvVIO&eQjtmSN`?>!lvI6;x#X;^) z4C~IxyaaOi1AIbU|D%G5<-wvLeI-GD!S~-M#D6rd2U#HP>Eal|aXs0fq>&+wO-$qT jL`RlWMF{~7n_3u_f95FA`I@&9sEonW)z4*}Q$iB}Nf0#s literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-xhdpi/habit_diagonal.png b/wearos/src/main/res/drawable-xhdpi/habit_diagonal.png new file mode 100644 index 0000000000000000000000000000000000000000..3fbab0a14f44afafd70cd603a4f50d51ba46c6d6 GIT binary patch literal 1101 zcmeAS@N?(olHy`uVBq!ia0vp^E+EXo1|%(nCvO5$jKx9jP7LeL$-D%~q(*qA`T8rk6I|A10W*RPQh4Cz;r&2LCey_~1V}T1 z#DG8vh&7-zkj;1|HnwInke=b`;uuoF_-5*EFXljjw#T+jz5EI{eo2`D~a`M*Q?Zs`|GBvJm#JM@RxJ$cI}0UQU~-GAJSi3^Y_u| zX^A~$YnVzVd<-%R-1Yy+-z@7%QcD=#2)){=vfx!&hJfmSu1Oz5QWreBnfLEV7bnA> zj;a+5^S`~|*5B1N@l!8b#Dqfo-aXGM?c=kSo>h6gj&0Yw&>z<$!@JV##SFMt6v`Gh zm)HJ&!X@o_ESLE~q80W-^AiZYkeWKQnL za+0WgCjZ<#N26uigr07X3o{=7b_)D@ydjIvv}>Wah4nRc!5a=nZJZ4ob?+xmcSzYQ zsPfomT2EnJaDSWS%oHAp0?oD7XKq-%Re7w_+HtdZf%B0$Tq}arBC>u98t)u_xXY5Uro>dyldVUvtCw~F=X>in)3wJ^SROYu0Bww@EV&hN7?30?emqQP;8slrk(x4qICyIWoqvwc0_xgaRz z^3vVsJGeTk&pt4$;PCL7tFz1c!j7ZIW7QqZMIOpd()xMTN^rX2#Mdld2gUX@teGyhg>NK&w5Uu){`O6#D9S21k=2S`%8~YpH`?=+`jzr zMb{lQXOk`&a1|{m;dx%bdOe`o+oD-WM1lF=zqpi-`@4$;f6A$Li-Gd2r>mdKI;Vst E09XgYIRF3v literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-xhdpi/watch_habit_negative.png b/wearos/src/main/res/drawable-xhdpi/watch_habit_negative.png new file mode 100644 index 0000000000000000000000000000000000000000..31487cdf00f01ed859dfcd043bdb8b56ed8f595a GIT binary patch literal 156 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W-!VDy93YnIIIO&eQjtmSN`?>!lvI6;x#X;^) z4C~IxyaaOi1AIbU|D%G5<-wvLeI-GD!S~-M#D6rd2U#HP>Eal|aXs0fq>(9&O-$nQ jL`RlmB?$oyhOG=2q&OS+rx)G@Dr4|;^>bP0l+XkK-+nUm literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-xhdpi/watch_habit_positive.png b/wearos/src/main/res/drawable-xhdpi/watch_habit_positive.png new file mode 100644 index 0000000000000000000000000000000000000000..e762dacd5b33175994d5eb89fae46ca87989ede4 GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAd3?%E9GuQzsmUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIBn0X`wF?gc*oQ9*~KO+8SSwIs+dnBo5Wg!qQj@`^wKQ%@Ji5RU7~2@Fi? zf@~53yiLZ=&YFo|l3?zm1T2})pmUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIID%0X`wF?gc*ok$~_6Ln)BHk|4iehW85FFRuCA1>{G2x;TbtoKH?@U{G^T zXJrdn@ZynDi(1N~M~`~co&d=X%_l}ItuuIH0~ib(L}D*A2xxFzm}0n~n}OMd#hGWe zo6a%gg_^=)5|0*gu`11QiVzZ>rgA)miJysK*+Kh*-ohISfz~j1y85}Sb4q9e0LtD; A^8f$< literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-xhdpi/watch_task_minus.png b/wearos/src/main/res/drawable-xhdpi/watch_task_minus.png new file mode 100644 index 0000000000000000000000000000000000000000..d8f4536a5a5148a884eb04d00cadd37b82c8dd07 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^DnQJ^!VDyn9UPtkDVB6cUq=Rpjs4tz5?O(K#^NA% zCx&(BWL^R}LIFM@uI>ds|4~7Qq)k0gmbE0vFPK5${f7PZf9$pc1q?i0978y+CnuC} zxiTJP;&ED-;V|)_NUTN+W2}lvhoh)-&q2{x6^Yp&dorG_=3romU#9c)Xvv#)pk4+~ LS3j3^P67_U?dpM$qFWwnr?@}o+;i_g_jAts^Ll?i-_M`#^DUxp4l-G0xeNdR z6Iw7O3S{z<3=P2UH9V3C0vD zyiJV@OT?k(uWjFkO-zG zmKR5oZptcu3P(RY1;mQT&}jF}tNn!yb1dIIOam1??wv@3BXeH@h_^Gkkr2EH`vnNCJIqiObG8Q$MV#ce z?)a=sYB>g%QCaH&hK9VCoz5cWi?zzGb?=`BF}q8k_?25aXhO&Ywl1CD^7^9j$X!Fn z?LuBycvUIVPMLOIVU;*+?Uo4G7pDn$KWFc$navc45A-X^Q$$uH#x}_bFZKwlxE75V z-)J-HK`)`-X^ZX&Po~THFbPF_2QlyzR=stbekuRT^Ks2 zcCTkL%P7^+7bvxN8K@Z9Umj@Otd9d9PR2#x@)VqoJOeURWG7IFseJvsugA&)B4Z^s zZ3#zw5(y#cHl8kLxn^Fd%BL$)7{u@Qp_UMrr~@P^U3` z1taJtJg@6{hm4@**0d#jJRN6Q96vHSool`SQU{MU5q(p;J;U>)+QZXo4vDZ~TM8aY zKe4ASk``A9K#1$t2iQ_YD_8HKDX%kDY5jR*efx)!)(AaEs%@$;R3fs!5Nd z0x!goyh8373C$Whwx4gh&dU^(i_@% literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-xxhdpi/watch_habit_negative.png b/wearos/src/main/res/drawable-xxhdpi/watch_habit_negative.png new file mode 100644 index 0000000000000000000000000000000000000000..76b1ac67d5a9752e25c290b50f3daa9116af318a GIT binary patch literal 166 zcmeAS@N?(olHy`uVBq!ia0vp^azM<+!VDzUW*esiDVB6cUq=Rpjs4tz5?O(K#^NA% zCx&(BWL^R}`~f~8uI>ds|B-<314Aj0zLFrnV21Y%6K*a1#R252db&7Eak7aXC4GfmzLw znJp#Z(W90_;)R7S4|ng_!6Rfhxr3X@LW&`_k7tgAOTdpli5gLnea6hjU6owT=l0)t k?9BS2DCK|-N2w))iM;w$bK?~vKvNk!UHx3vIVCg!0J}*;EdT%j literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-xxhdpi/watch_habit_posneg.png b/wearos/src/main/res/drawable-xxhdpi/watch_habit_posneg.png new file mode 100644 index 0000000000000000000000000000000000000000..18c34f800f5bdeb33dc50bf58b2021314b8675fe GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^PC#tT!VDxYvK-zIq*&4&eH|GXHuiJ>Nn{1`8HVN`HTO8LZri8`Wc8d`HUtVnPw zTzN3#PLMC_Lz&bjQ@4O5_X`b)B0Wq=2PWtiGi0o>J)Bgae+6g@gQu&X%Q~loCIEGM BO27aB literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-xxhdpi/watch_task_add.png b/wearos/src/main/res/drawable-xxhdpi/watch_task_add.png new file mode 100644 index 0000000000000000000000000000000000000000..a65f54d00b0be3508708d6e266b3a9594444a093 GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^W+2SM3?%Ea%ijShmUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIB10X`wF?gc*ou>o1{(0xEP>?J{d!3@XmCnyLse6!{80}6F{x;TbdoK8+~ zV7PXqD3ML(z{)*)Vp!YfSOu)pU|20uY{{XLFg2OwG$)W`KP}pGidT21!N;PU1s56` z8(sIxSZfp|BxoIH4Us%kcxtL)$Kxs5DH_LlKb(4KY%IGx#?V>7&ysadU3$VX!L*f& zU*`Nc@lgBqjRQq&5lds|FHpC@6dffHS8rpe!&dK?t=@dFCEc)B=-NL)@% z;1Je7&c?+nArW!q^u}f-cD7|jF%DA?$}EqOY_{;*>C{$qhhe>po$=+uQ=-N!52pkl jcwNqxCX+br6azzgf8Wxgwu}Wp^B6o`{an^LB{Ts5qESoi literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-xxxhdpi/watch_habit_negative.png b/wearos/src/main/res/drawable-xxxhdpi/watch_habit_negative.png new file mode 100644 index 0000000000000000000000000000000000000000..31aeb3813cfb5def74c3f4d8b64c47f0a0e161d4 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^8bHj!!VDxUYZhbxDVB6cUq=Rpjs4tz5?O(K#^NA% zCx&(BWL^R}LIFM@uI>ds|4~7Qq)k0gmbE0vFPK5${f7PZf9$pc1q?i0978y+CnuC} zxiTMQ;&ECi;V|)_NU%W*W3Y}%hofk>Mzi*^2!pb23B#NqK?a7lKqFIUe@zvjUItHB KKbLh*2~7Y?8aXro literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-xxxhdpi/watch_habit_positive.png b/wearos/src/main/res/drawable-xxxhdpi/watch_habit_positive.png new file mode 100644 index 0000000000000000000000000000000000000000..d02d3382862c1779e1cf78c8d3a5cf3b932b8ade GIT binary patch literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^8X(NV3?%C=ER6$FEa{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaOi1AIbU-3xsFBLU$DhEgDXB|(0{4DS`TUtIIK3&@Z5ba4#PIRA9=MNS7r z9%gU%0QL)lEaC#2|NES0?@HLz_`PzA$favJ4@*;aYdR?0Y;Y8E2p3xKxqiotonitH z&rkH~y?e%#bM@_~3d=9en1Ao0nx^LYXuGEElOMAyz4dTp@{{@nw1&ac)z4*}Q$iB} Dlzvj* literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-xxxhdpi/watch_habit_posneg.png b/wearos/src/main/res/drawable-xxxhdpi/watch_habit_posneg.png new file mode 100644 index 0000000000000000000000000000000000000000..33d42253ebfbf7af48310fc412499943a4214554 GIT binary patch literal 243 zcmeAS@N?(olHy`uVBq!ia0vp^5kTz1!VDz8uYdm>NU@|l`Z_W&Z0zU$lgJ9>GZqKA zJ29*~C-V}>;ScZ$adj{7`HuvI9~er3^pynp1v4mYe=qR<`5Pd=$kW9!#N+tesRua^ zC+`VDnU#kj*g-iPIQmAGH6r1WZXY1PcqM|-dTJ$O&}@Ye+^F6(Y8onn9buJZ1*L#7TvJho~re}waX cUGueP6xJ(PnCNti8)!R&r>mdKI;Vst03eoL@c;k- literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-xxxhdpi/watch_task_add.png b/wearos/src/main/res/drawable-xxxhdpi/watch_task_add.png new file mode 100644 index 0000000000000000000000000000000000000000..ac116bdff91a7f5b931806f39b14ce6cc20fcee7 GIT binary patch literal 292 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xZ3?!EyURMI7SkfJR9T^xl_H+M9WCijWi-X*q z7}lMWc?skQ1^9%xx)=ETM+F^{HuXSR){-EZ5FT`K7nwUkNK+Ea7s{>g5p4s&^$Sxe^C?Ff7S(tXRkx+AY%x}RCJ zG2{q`Mdz(Ps~;lX+~qT`Y!2Yx6ZvDcjd76X(vsb60j+7DzWk5bv|^W==>A%xn&tnQ Y|Mxq5$muO>0y>q!)78&qol`;+00u*MG5`Po literal 0 HcmV?d00001 diff --git a/wearos/src/main/res/drawable-xxxhdpi/watch_task_minus.png b/wearos/src/main/res/drawable-xxxhdpi/watch_task_minus.png new file mode 100644 index 0000000000000000000000000000000000000000..283caf99b0619a3f4700afb11b306b74fc721f64 GIT binary patch literal 230 zcmeAS@N?(olHy`uVBq!ia0vp^9zZO>!VDzcds|FHpC@6dffHS8rpe!&bAt_nCTP}uX=%LgbF>FMGaqH(_W z(m~D!2OgJ;`eq6m5r^WoviO%R5ba2Bp7m{O)7+oW*&9_31Z@h+`EyqD)k0maqb`#- z^#w1U9lN-DQQ!nOxlPA + + + + + + + + + + + + + \ No newline at end of file diff --git a/wearos/src/main/res/drawable/habit_button_round.xml b/wearos/src/main/res/drawable/habit_button_round.xml new file mode 100644 index 000000000..05a7aa191 --- /dev/null +++ b/wearos/src/main/res/drawable/habit_button_round.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/wearos/src/main/res/layout/activity_habit_direction.xml b/wearos/src/main/res/layout/activity_habit_direction.xml new file mode 100644 index 000000000..47ae795f1 --- /dev/null +++ b/wearos/src/main/res/layout/activity_habit_direction.xml @@ -0,0 +1,45 @@ + + + + + + + + + \ No newline at end of file diff --git a/wearos/src/main/res/layout/row_habit.xml b/wearos/src/main/res/layout/row_habit.xml index e66adba2e..853bb563c 100644 --- a/wearos/src/main/res/layout/row_habit.xml +++ b/wearos/src/main/res/layout/row_habit.xml @@ -7,13 +7,19 @@ android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/Chip"> - + > + + + + + + + + \ No newline at end of file diff --git a/wearos/src/main/res/values/strings.xml b/wearos/src/main/res/values/strings.xml index 22bec8529..4c236dd9d 100644 --- a/wearos/src/main/res/values/strings.xml +++ b/wearos/src/main/res/values/strings.xml @@ -1,4 +1,5 @@ OK Syncing Account from Phone + How did you do? \ No newline at end of file