Advertisement
Guest User

hourly_list_item.xml

a guest
Jun 28th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.41 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <layout xmlns:android="http://schemas.android.com/apk/res/android"
  3.    xmlns:app="http://schemas.android.com/apk/res-auto"
  4.    xmlns:tools="http://schemas.android.com/tools">
  5.     <data>
  6.         <variable
  7.        name="hour"
  8.        type="com.example.karan.stormy.Weather.Hour"/>
  9.     </data>
  10.  
  11. <RelativeLayout
  12.    android:id="@+id/hourlyListView"
  13.    android:layout_width="match_parent"
  14.    android:layout_height="wrap_content"
  15.    android:paddingTop="8dp"
  16.    android:paddingBottom="8dp"
  17.    tools:background="@color/appBackground">
  18.  
  19.     <TextView
  20.        android:id="@+id/timeLabel"
  21.        android:layout_width="80dp"
  22.        android:layout_height="wrap_content"
  23.        android:layout_alignParentStart="true"
  24.        android:layout_alignParentLeft="true"
  25.        android:layout_centerVertical="true"
  26.        android:text="@{String.valueOf(hour.time)}"
  27.        android:textColor="@android:color/white"
  28.        android:textSize="24sp"
  29.        tools:text="12 PM"/>
  30.  
  31.     <ImageView
  32.        android:id="@+id/iconImageView"
  33.        android:layout_width="wrap_content"
  34.        android:layout_height="wrap_content"
  35.        android:layout_centerVertical="true"
  36.        android:layout_toRightOf="@+id/timeLabel"
  37.        android:layout_toEndOf="@+id/timeLabel"
  38.        app:srcCompat="@drawable/partly_cloudy" />
  39.  
  40.     <TextView
  41.        android:id="@+id/temperatureLabel"
  42.        android:layout_width="wrap_content"
  43.        android:layout_height="wrap_content"
  44.        android:layout_alignParentEnd="true"
  45.        android:layout_centerVertical="true"
  46.        android:layout_alignParentTop="false"
  47.        android:layout_alignParentRight="true"
  48.        android:text="@{String.valueOf(hour.temperature)}"
  49.        android:textColor="@android:color/white"
  50.        android:textSize="24sp"
  51.        tools:text="100"/>
  52.  
  53.     <TextView
  54.        android:id="@+id/summaryLabel"
  55.        android:layout_width="wrap_content"
  56.        android:layout_height="wrap_content"
  57.        android:layout_centerVertical="true"
  58.        android:layout_toRightOf="@+id/iconImageView"
  59.        android:layout_toEndOf="@+id/iconImageView"
  60.        android:paddingLeft="15dp"
  61.        android:paddingRight="15dp"
  62.        android:text="@{String.valueOf(hour.summary)}"
  63.        android:textColor="@android:color/white"
  64.        android:textSize="24sp"
  65.        tools:text="Partly cloudy"/>
  66. </RelativeLayout>
  67. </layout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement