Updated forecast layout on phones to match our new design.
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
-->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
@@ -23,16 +22,20 @@
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||
<ImageView
|
||||
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:scaleType="center"/>
|
||||
android:scaleType="center"
|
||||
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:name="com.example.android.sunshine.app.ForecastFragment"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -15,26 +15,30 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<!-- 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_height="wrap_content"
|
||||
android:background="@drawable/touch_selector"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/touch_selector">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="wrap_content">
|
||||
android:paddingLeft="@dimen/abc_list_item_padding_horizontal_material"
|
||||
android:paddingRight="@dimen/abc_list_item_padding_horizontal_material"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/list_item_icon"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"/>
|
||||
|
||||
</FrameLayout>
|
||||
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"
|
||||
@@ -46,38 +50,37 @@
|
||||
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"/>
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"/>
|
||||
|
||||
<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"/>
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
android:textColor="@color/secondary_text"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="5"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<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_gravity="center"
|
||||
android:fontFamily="sans-serif-condensed"
|
||||
android:textAppearance="?android:textAppearanceLarge"/>
|
||||
android:gravity="right"
|
||||
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
|
||||
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_gravity="center"
|
||||
android:fontFamily="sans-serif-condensed"
|
||||
android:textAppearance="?android:textAppearanceSmall"/>
|
||||
android:gravity="right"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:textColor="@color/forecast_low_text"
|
||||
android:textSize="@dimen/forecast_text_size"/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
@@ -1,3 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 The Android Open Source Project
|
||||
|
||||
@@ -14,73 +15,74 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<!-- 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_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/today_touch_selector">
|
||||
|
||||
<LinearLayout
|
||||
android:background="@drawable/touch_selector_white"
|
||||
android:elevation="4dp"
|
||||
>
|
||||
<android.support.v7.widget.GridLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="7"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginLeft="60dp"
|
||||
android:layout_marginStart="60dp"
|
||||
android:orientation="vertical">
|
||||
app:columnCount="2">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/list_item_date_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:textAppearanceLarge"
|
||||
android:fontFamily="sans-serif-condensed"
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/list_item_high_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
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">
|
||||
android:layout_marginBottom="@dimen/abc_list_item_padding_horizontal_material"
|
||||
android:layout_marginTop="@dimen/abc_list_item_padding_horizontal_material"
|
||||
android:fontFamily="sans-serif"
|
||||
android:gravity="center_horizontal"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="@color/secondary_text"
|
||||
app:layout_columnSpan="2"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="fill_horizontal"
|
||||
tools:text="Today, April 03" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/list_item_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:adjustViewBounds="true"/>
|
||||
android:layout_width="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:maxHeight="@dimen/today_icon"
|
||||
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
|
||||
android:id="@+id/list_item_forecast_textview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-condensed"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textAppearance="?android:textAppearanceLarge"
|
||||
android:textColor="@color/white"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
android:layout_width="0dp"
|
||||
android:fontFamily="sans-serif"
|
||||
android:gravity="center_horizontal"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="@color/secondary_text"
|
||||
app:layout_columnWeight="1"
|
||||
tools:text="Rainy" />
|
||||
|
||||
<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>
|
||||
Reference in New Issue
Block a user