Updated forecast layout on phones to match our new design.

This commit is contained in:
Dan Galpin
2015-05-25 01:59:49 -07:00
parent 734aab6ec6
commit 45627b2047
3 changed files with 117 additions and 109 deletions

View File

@@ -15,7 +15,6 @@
--> -->
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
@@ -23,16 +22,20 @@
<android.support.v7.widget.Toolbar <android.support.v7.widget.Toolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="?attr/listPreferredItemHeight"
android:layout_marginTop="?attr/actionBarSize"
android:layout_gravity="center_horizontal"
android:src="@drawable/ic_logo" android:src="@drawable/ic_logo"
android:scaleType="center"/> android:scaleType="center"
</android.support.v7.widget.Toolbar> android:background="@color/primary"/>
</android.support.v7.widget.Toolbar>
<fragment <fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fragment_forecast" android:id="@+id/fragment_forecast"
android:name="com.example.android.sunshine.app.ForecastFragment" android:name="com.example.android.sunshine.app.ForecastFragment"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -15,69 +15,72 @@
limitations under the License. limitations under the License.
--> -->
<!-- Layout for weather forecast list item for future day (not today) --> <!-- Layout for weather forecast list item for future day (not today) -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <!-- Make the background of our selector a non-transparent color -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:background="@drawable/touch_selector"
android:minHeight="?android:attr/listPreferredItemHeight" >
android:orientation="horizontal"
android:background="@drawable/touch_selector">
<FrameLayout <LinearLayout
android:layout_width="60dp" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingLeft="@dimen/abc_list_item_padding_horizontal_material"
android:paddingRight="@dimen/abc_list_item_padding_horizontal_material"
android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/list_item_icon" android:id="@+id/list_item_icon"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_width="wrap_content" android:layout_width="@dimen/list_icon"
android:layout_height="@dimen/list_icon"
android:layout_marginRight="@dimen/abc_list_item_padding_horizontal_material"
android:layout_marginEnd="@dimen/abc_list_item_padding_horizontal_material"
/>
<LinearLayout
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:adjustViewBounds="true"/> android:layout_width="0dp"
android:layout_weight="7"
android:orientation="vertical">
</FrameLayout> <TextView
android:id="@+id/list_item_date_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"/>
<LinearLayout <TextView
android:layout_height="wrap_content" android:id="@+id/list_item_forecast_textview"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_weight="7" android:layout_height="wrap_content"
android:orientation="vertical"> android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:textColor="@color/secondary_text"/>
<TextView </LinearLayout>
android:id="@+id/list_item_date_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-condensed"
android:textSize="20sp"/>
<TextView
android:id="@+id/list_item_forecast_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-condensed"
android:textAppearance="?android:textAppearanceSmall"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="5"
android:layout_gravity="center"
android:orientation="vertical">
<TextView <TextView
android:id="@+id/list_item_high_textview" android:id="@+id/list_item_high_textview"
android:layout_width="wrap_content" android:layout_width="@dimen/forecast_text_width"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:fontFamily="sans-serif-condensed" android:gravity="right"
android:textAppearance="?android:textAppearanceLarge"/> android:layout_marginRight="@dimen/forecast_temperature_space"
android:layout_marginEnd="@dimen/forecast_temperature_space"
android:fontFamily="sans-serif-light"
android:textColor="@color/primary_text"
android:textSize="@dimen/forecast_text_size"/>
<TextView <TextView
android:id="@+id/list_item_low_textview" android:id="@+id/list_item_low_textview"
android:layout_width="wrap_content" android:layout_width="@dimen/forecast_text_width"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:fontFamily="sans-serif-condensed" android:gravity="right"
android:textAppearance="?android:textAppearanceSmall"/> android:fontFamily="sans-serif-light"
android:textColor="@color/forecast_low_text"
android:textSize="@dimen/forecast_text_size"/>
</LinearLayout> </LinearLayout>
</LinearLayout> </FrameLayout>

View File

@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (C) 2015 The Android Open Source Project Copyright (C) 2015 The Android Open Source Project
@@ -14,73 +15,74 @@
limitations under the License. limitations under the License.
--> -->
<!-- Layout for weather forecast list item for today --> <!-- Layout for weather forecast list item for today -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:background="@drawable/touch_selector_white"
android:minHeight="?android:attr/listPreferredItemHeight" android:elevation="4dp"
android:orientation="horizontal" >
android:background="@drawable/today_touch_selector"> <android.support.v7.widget.GridLayout
android:layout_width="match_parent"
<LinearLayout
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="0dp" app:columnCount="2">
android:layout_weight="7"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:layout_marginLeft="60dp"
android:layout_marginStart="60dp"
android:orientation="vertical">
<TextView <TextView
android:id="@+id/list_item_date_textview" android:id="@+id/list_item_date_textview"
android:layout_width="match_parent" android:layout_marginBottom="@dimen/abc_list_item_padding_horizontal_material"
android:layout_height="wrap_content" android:layout_marginTop="@dimen/abc_list_item_padding_horizontal_material"
android:textAppearance="?android:textAppearanceLarge" android:fontFamily="sans-serif"
android:fontFamily="sans-serif-condensed" android:gravity="center_horizontal"
android:textColor="@color/white" /> android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textColor="@color/secondary_text"
<TextView app:layout_columnSpan="2"
android:id="@+id/list_item_high_textview" app:layout_columnWeight="1"
android:layout_width="match_parent" app:layout_gravity="fill_horizontal"
android:layout_height="wrap_content" tools:text="Today, April 03" />
android:textSize="72sp"
android:fontFamily="sans-serif-light"
android:textColor="@color/white" />
<TextView
android:id="@+id/list_item_low_textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="36sp"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"/>
</LinearLayout>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="5"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:orientation="vertical"
android:gravity="center_horizontal|bottom">
<ImageView <ImageView
android:id="@+id/list_item_icon" android:id="@+id/list_item_icon"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:adjustViewBounds="true"
android:layout_gravity="center_horizontal" android:maxHeight="@dimen/today_icon"
android:adjustViewBounds="true"/> android:maxWidth="@dimen/today_icon"
app:layout_columnWeight="1"
app:layout_gravity="fill_horizontal"
tools:src="@drawable/art_clouds" />
<TextView
android:id="@+id/list_item_high_textview"
android:layout_width="0dp"
android:fontFamily="sans-serif-light"
android:gravity="center_horizontal"
android:textColor="@color/primary_text"
android:textSize="72sp"
app:layout_columnWeight="1"
app:layout_gravity="fill_horizontal"
tools:text="19" />
<TextView <TextView
android:id="@+id/list_item_forecast_textview" android:id="@+id/list_item_forecast_textview"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:fontFamily="sans-serif"
android:fontFamily="sans-serif-condensed" android:gravity="center_horizontal"
android:layout_gravity="center_horizontal" android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textAppearance="?android:textAppearanceLarge" android:textColor="@color/secondary_text"
android:textColor="@color/white"/> app:layout_columnWeight="1"
</LinearLayout> tools:text="Rainy" />
</LinearLayout>
<TextView
android:id="@+id/list_item_low_textview"
android:layout_width="0dp"
android:layout_marginBottom="@dimen/abc_list_item_padding_horizontal_material"
android:fontFamily="sans-serif-light"
android:gravity="center_horizontal"
android:textColor="@color/secondary_text"
android:textSize="36sp"
app:layout_columnWeight="1"
tools:text="10" />
</android.support.v7.widget.GridLayout>
</FrameLayout>