This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private fun setProgressBar(progressStatus: Int) { | |
| waterTable?.let { | |
| goalWater.text = "${it.todayWater}ml" | |
| todayWater.text = "${it.goalWater}ml" | |
| val percent : Int = (100 * (it.todayWater!!.toDouble() / it.goalWater!!.toDouble())).toInt() | |
| percentLoop(0.0, percent.toDouble()) | |
| if (percent < 100) { remainWater.text = "${it.goalWater!! - it.todayWater!!}ml" } | |
| else { remainWater.text = "0ml" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <ProgressBar | |
| android:id="@+id/waterProgressbar" | |
| android:layout_width="280dp" | |
| android:layout_height="280dp" | |
| android:layoutDirection="rtl" | |
| android:progress="40" | |
| android:indeterminate="false" | |
| android:indeterminateDrawable="@drawable/indeterminate_progress" | |
| android:progressDrawable="@drawable/circular_progress_bar" | |
| android:background="@drawable/circle_shape" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?><!--<layer-list>--> | |
| <rotate xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:fromDegrees="0" | |
| android:toDegrees="360"> | |
| <layer-list> | |
| <item> | |
| <rotate xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:fromDegrees="-90" | |
| android:toDegrees="-90"> | |
| <shape |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private fun setProgressBar() { | |
| view?.run { | |
| waterTable = RealmHelper.instance.getTodayWaterGoal() | |
| waterTable?.let { | |
| waterGoal.text = "${it.goalWater}ml" | |
| todayWater.text = "${it.todayWater}ml" | |
| val percent : Int = (100 * (it.todayWater!!.toDouble() / it.goalWater!!.toDouble())).toInt() | |
| percentLoop(0.0, percent.toDouble()) | |
| waterProgressbar.setProgress(it.todayWater!!, it.goalWater!!) | |
| if (percent < 100) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <animation-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
| <item | |
| android:drawable="@drawable/gradient_01" | |
| android:duration="3000" /> | |
| <item | |
| android:drawable="@drawable/gradient_02" | |
| android:duration="3000" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> | |
| <gradient | |
| android:startColor="@color/mainColor" | |
| android:endColor="@color/logoFontColor" | |
| android:angle="180"/> | |
| </shape> | |
| <?xml version="1.0" encoding="utf-8"?> | |
| <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private fun initWaterTypeCheck() { | |
| val selectWaterType = waterType?.run { | |
| this | |
| } ?: kotlin.run { | |
| RealmHelper.instance.queryFirst(Goals::class.java)?.waterType | |
| } | |
| when(selectWaterType) { | |
| Const.type200 -> { | |
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private fun setMyTargetButton() { | |
| view?.run { | |
| val myTargetIntent = MyTargetWaterActivity.newIntent(mContext) | |
| val logoImagePair = Pair.create(myTargetImage as View, "logoImage") | |
| val typeImagePair = Pair.create(waterTypeIcon as View, "typeImage") | |
| val targetTextPair = Pair.create(waterGoal as View, "waterText") | |
| val options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity!!, logoImagePair, targetTextPair, typeImagePair) | |
| myTargetButton.clicks() | |
| .throttleFirst(500, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <EditText | |
| android:id="@+id/myTargetText" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:background="@null" | |
| android:hint="@string/inputMyTargetTextHint" | |
| android:fontFamily="@font/nanumbareunpen" | |
| android:inputType="number" | |
| android:paddingBottom="8dp" | |
| android:paddingTop="8dp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <TextView | |
| android:id="@+id/waterGoal" | |
| android:transitionName="waterText" | |
| android:fontFamily="@font/nanumbareunpen" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:paddingBottom="3dp" | |
| android:textColor="@color/whiteColor" | |
| android:textSize="18sp" /> | |
NewerOlder