Write a program to display all the data types in object-oriented programming using Frame layout.

 *Program*

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    tools: context=".MainActivity">

    <TextView
        android:layout_width="match_parent"
        android:layout_height="66dp"
        android:text="Data Types in Object Oriented Programming"
        android:textSize="25dp"
        android:textStyle="bold" />

    <TextView
        android: id="@+id/pd"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="top|left|fill_vertical"
        android:layout_marginTop="80dp"
        android:text="Primitive"
        android:textSize="20dp" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dp"
        android:layout_marginTop="110dp"
        android:foregroundGravity="fill_horizontal|top"
        android:orientation="vertical">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="1) Integer" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="2) Float" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="3) Characters" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="4) Boolean" />

    </LinearLayout>

    <TextView
        android:layout_toRightOf="@+id/pd"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right|fill_vertical"
        android:layout_marginTop="80dp"
        android:text="Non-Primitive"
        android:textSize="20dp" />

    <LinearLayout

        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right"
        android:layout_marginTop="110dp"
        android:layout_marginRight="20dp"
        android:orientation="vertical">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="1) Class" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="2) Array" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="3) Interface" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="4) Object" />
    </LinearLayout>
</FrameLayout>

 

OUTPUT:


Comments

Popular posts from this blog

Write a program to display 10 students’ basic information in a table form using Table layout

Write a program to create a first display screen of any search engine using Auto Complete Text View