2-Laboratoriya ishi
Mavzu: Java tilida obyektga yo’naltirilgan dasturlash tamoyillari
2-Laboratoriya ishida kalkulyator yasash hisoblanib bunda quyidagi amallarni bajaraniz:
XML qismi:
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=".MainActivity">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Result :"
android:textSize="30sp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintVertical_bias="0.3"
app:layout_constraintHorizontal_bias="0.25"/>
android:id="@+id/result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textSize="30sp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintVertical_bias="0.3"
app:layout_constraintHorizontal_bias="0.6"/>
android:id="@+id/firstNumber"
android:layout_width="150dp"
android:layout_height="wrap_content"
tools:text="First number"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
android:id="@+id/secondNumber"
android:layout_width="150dp"
android:layout_height="wrap_content"
tools:text="Second number"
app:layout_constraintTop_toBottomOf="@id/result"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintVertical_bias="0.4"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+"
android:textSize="24sp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/multiplys"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintVertical_bias="0.7"/>
Do'stlaringiz bilan baham: |