Skip to content
Snippets Groups Projects
content_main.xml 6.92 KiB
Newer Older
mp5's avatar
mp5 committed
<?xml version="1.0" encoding="utf-8"?>
gsun's avatar
 
gsun committed
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
mp5's avatar
mp5 committed
    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"
gsun's avatar
 
gsun committed
    android:gravity="center_horizontal"
    android:background="@android:color/white"
mp5's avatar
mp5 committed
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context=".MainActivity"
    tools:showIn="@layout/activity_main">

gsun's avatar
 
gsun committed

    <LinearLayout
        android:id="@+id/weather_panel"
mp5's avatar
mp5 committed
        android:layout_width="wrap_content"
gsun's avatar
 
gsun committed
        android:visibility="visible"
mp5's avatar
mp5 committed
        android:layout_height="wrap_content"
gsun's avatar
 
gsun committed
        android:orientation="vertical">

        <TextView
            android:id="@+id/tex_city_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/colorPrimary"
            android:textSize="24sp"
            android:textStyle="bold"
            android:text="Fetching City Name..."/>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <ImageView
                android:id="@+id/img_weather"
                android:layout_width="80dp"
                android:layout_height="80dp"
                android:src="@mipmap/ic_launcher"/>

            <TextView
                android:id="@+id/text0"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/colorPrimary"
                android:layout_marginLeft="8dp"
                android:textSize="50sp"
                android:textStyle="bold"
                android:text="14 C"/>

        </LinearLayout>

        <TextView
            android:id="@+id/txt_description"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/colorPrimary"
            android:layout_marginLeft="8dp"
            android:textSize="18sp"
            android:textStyle="bold"
            android:text="Fetching Description"/>

        <TextView
            android:id="@+id/txt_date_time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/colorPrimary"
            android:layout_marginLeft="8dp"
            android:textSize="18sp"
            android:textStyle="bold"
            android:text="Fetching Date Time"/>

        <TableLayout
            android:background="@drawable/border"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:stretchColumns="*"
            android:padding="16dp">

            <TableRow
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">

                <TextView
                    android:text="Wind"
                    android:background="@drawable/cell"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>

                <TextView
                    android:id="@+id/txt_wind"
                    android:text="Speed:1 Deg: 1"
                    android:background="@drawable/cell"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="8dp"/>

            </TableRow>

            <TableRow
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">

            <TextView
                android:text="Pressure"
                android:background="@drawable/cell"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>

            <TextView
                android:id="@+id/txt_pressure"
                android:text="1013.75 hpa"
                android:background="@drawable/cell"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="8dp"/>

        </TableRow>

            <TableRow
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">

                <TextView
                    android:text="Humidity"
                    android:background="@drawable/cell"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>

                <TextView
                    android:id="@+id/txt_humidity"
                    android:text="100%"
                    android:background="@drawable/cell"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="8dp"/>

            </TableRow>

            <TableRow
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">

                <TextView
                    android:text="Sunrise"
                    android:background="@drawable/cell"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>

                <TextView
                    android:id="@+id/txt_sunrise"
                    android:text="11:00"
                    android:background="@drawable/cell"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="8dp"/>

            </TableRow>

            <TableRow
                android:layout_width="wrap_content"
                android:layout_height="wrap_content">

                <TextView
                    android:text="Sunset"
                    android:background="@drawable/cell"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"/>

                <TextView
                    android:id="@+id/txt_sunset"
                    android:text="18:00"
                    android:background="@drawable/cell"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="8dp"/>

            </TableRow>
        </TableLayout>

    </LinearLayout>

<!--    <ProgressBar-->
<!--        android:layout_width="wrap_content"-->
<!--        android:layout_height="wrap_content"-->
<!--        android:id="@+id/loading"-->
<!--        android:indeterminate="true"-->
<!--        android:layout_centerInParent="true"/>-->
    
</RelativeLayout>