Idamed android ilovasi haqida


} button.setOnClickListener {


Download 38.3 Kb.
bet2/2
Sana13.04.2023
Hajmi38.3 Kb.
#1349471
1   2
Bog'liq
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" />





Download 38.3 Kb.

Do'stlaringiz bilan baham:
1   2




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling