Practical No.
Aim: Develop a program to implement Button,Image Button and Toggle Button.
Code:-
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:background="@drawable/img_2"
android:padding="20dp">
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="#DFD1D6"
android:textColor="@android:color/black"
android:text="Click Me" />
<ImageButton
android:id="@+id/imageButton"
android:layout_width="250dp"
android:layout_height="250dp"
android:src="@drawable/img"
android:contentDescription="Image Button"
android:background="?attr/selectableItemBackgroundBorderless"
android:layout_marginTop="20dp"/>
<ToggleButton
android:id="@+id/toggleButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOn="Toggle ON"
android:textOff="Toggle OFF"
android:layout_marginTop="20dp"/>
</LinearLayout>
1
Output:-
Conclusion:
In this practical I Develop a program to implement Button,Image Button and Toggle Button.
Markes Obtained Dated signature of
Teacher
Process Related (10) Product Related(15) Total (25)
2
Practical No. 9
Aim: develop a program to implement login window using above UI controls
Code:-
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:background="@drawable/img_2"
android:padding="20dp">
<EditText
android:id="@+id/etUsername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="35dp"
android:textColorHint="@color/white"
android:hint="Enter Username"
android:padding="15dp"/>
<EditText
android:id="@+id/etPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Password"
android:textSize="35dp"
android:textColorHint="@color/white"
android:inputType="textPassword"
android:padding="15dp"
android:layout_marginTop="15dp"/>
<ToggleButton
android:id="@+id/toggleButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOn="Hide Password"
3
android:textOff="Show Password"
android:layout_marginTop="10dp"/>
<Button
android:id="@+id/btnLogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Login"
android:textSize="40dp"
android:textColor="@color/white"
android:backgroundTint="#A83354"
android:layout_marginTop="20dp"/>
</LinearLayout>
Output:-
4
Conclusion:
In this practical I develop a program to implement login window using above ui controls
Markes Obtained Dated signature of
Teacher
Process Related (10) Product Related(15) Total (25)
5
Practical No. 10
Aim: develop a program to implement checkbox
Code:-
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:background="@drawable/img_2"
android:padding="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select Gender"
android:textSize="30dp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginBottom="10dp"/>
<CheckBox
android:id="@+id/checkMale"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Male"
android:textColor="@color/black"
android:textSize="25dp" />
<CheckBox
android:id="@+id/checkFemale"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dp"
android:text="Female"/>
<CheckBox
android:id="@+id/checkOther"
android:layout_width="wrap_content"
android:textSize="25dp"
android:layout_height="wrap_content"
android:text="Other"/>
6
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Select Age Group"
android:textSize="30sp"
android:textStyle="bold"
android:textColor="@color/black"
android:layout_marginTop="20dp"
android:layout_marginBottom="10dp"/>
<CheckBox
android:id="@+id/checkChild"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dp"
android:text="Child (0-12 years)"/>
<CheckBox
android:id="@+id/checkTeen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dp"
android:text="Teen (13-19 years)"/>
<CheckBox
android:id="@+id/checkAdult"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dp"
android:text="Adult (20+ years)"/>
<Button
android:id="@+id/btnSubmit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Show Selection"
android:backgroundTint="#983131"
android:layout_marginTop="20dp"/>
</LinearLayout>
7
Output:-
Conclusion:
In this practical I develop a program to implement checkbox
Markes Obtained Dated signature of
Teacher
Process Related (10) Product Related(15) Total (25)
8
9