}
button.setOnClickListener {
səhifə 2/2 tarix 31.03.2023 ölçüsü 38,3 Kb. #91804
IDAMED android ilovasi haqida
}
button.setOnClickListener {
if (TextUtils.isEmpty(editTextHb.text .toString ()) || TextUtils.isEmpty(
editTextEritrotsit.text .toString ()
)
) {
Toast.makeText(
this,
"Gemoglobin miqdori yoki Eritrotsitlar soni kiritilmagan ",
Toast.LENGTH_SHORT
).show()
} else {
rangkorsatkichResult =
(editTextHb.text .toString ().toDouble () * 3) / ((eritrotsitString.toString ()
.toDouble () * 100).toString().take (3).toDouble ())
rangKorsatkichText.setTextColor(Color.RED )
rangKorsatkichText.textSize = 20F
rangKorsatkichText.text = "Rang ko'rsatkich natijasi \n $rangkorsatkichResult "
btnD.visibility = View.VISIBLE
}
}
UI (User Interface) qismimizda esa quyidagicha kod yozdik.
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Login">
android:id="@+id/animationView"
android:layout_width="200dp"
android:layout_height="200dp"
app:lottie_rawRes="@raw/doctor"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/greeting"
app:layout_constraintRight_toRightOf="parent"
/>
android:background="@drawable/back"
android:id="@+id/greeting"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_marginBottom="48dp"
android:fontFamily="sans-serif-black"
android:textSize="16sp"
android:text="@string/salom"
android:textAlignment="center"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
android:id="@+id/edittext_box"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="48dp"
app:boxCornerRadiusTopEnd="20dp"
app:boxCornerRadiusTopStart="20dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/greeting">
android:id="@+id/edittextName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/ismingizni_yozing"
android:inputType="text" />
android:id="@+id/start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="48dp"
android:text="Boshlash"
android:textColor="@color/black"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/edittext_box" />
Yuqoridagi kodlar dasturimizda ishlaydigan kodlarning bir qismidir
Loyihadan ko’zlangan asosiy maqsad esa Tibbiyot sohasining bir qismini raqamlashtirish ya’ni raqamlashtirish orqali foydalanuvchiga yengillik yaratishdir.
Hozirgi kunda ham loyihaning qulayliklarini kengaytirishga harakat qilinmoqda Dostları ilə paylaş: