Skip to content

Commit c0501e4

Browse files
committed
Prep for "Too Little Real Estate"
1 parent b081ffb commit c0501e4

5 files changed

Lines changed: 116 additions & 28 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!--
2+
Copyright (C) 2015 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
17+
xmlns:tools="http://schemas.android.com/tools"
18+
android:layout_width="match_parent"
19+
android:layout_height="match_parent"
20+
tools:context="com.example.android.sunshine.app.ForecastFragment">
21+
<ListView
22+
style="@style/ForecastListStyle"
23+
android:id="@+id/listview_forecast"
24+
android:layout_width="match_parent"
25+
android:layout_height="match_parent"
26+
android:divider="@null" />
27+
<!-- empty list -->
28+
<TextView
29+
android:id="@+id/listview_forecast_empty"
30+
android:text="@string/empty_forecast_list"
31+
android:layout_width="match_parent"
32+
android:layout_height="match_parent"
33+
android:gravity="center_horizontal"
34+
android:paddingRight="@dimen/activity_horizontal_margin"
35+
android:paddingEnd="@dimen/activity_horizontal_margin"
36+
android:paddingLeft="@dimen/activity_horizontal_margin"
37+
android:paddingStart="@dimen/activity_horizontal_margin"
38+
android:paddingTop="@dimen/activity_vertical_margin"
39+
android:paddingBottom="@dimen/activity_vertical_margin"
40+
/>
41+
</FrameLayout>

app/src/main/res/layout/activity_main.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
-->
16-
<LinearLayout
16+
<FrameLayout
1717
xmlns:android="http://schemas.android.com/apk/res/android"
1818
android:layout_width="match_parent"
19-
android:layout_height="wrap_content"
20-
android:orientation="vertical">
19+
android:layout_height="wrap_content">
2120

2221
<android.support.v7.widget.Toolbar
2322
android:id="@+id/toolbar"
@@ -40,6 +39,5 @@
4039
android:name="com.example.android.sunshine.app.ForecastFragment"
4140
android:layout_width="match_parent"
4241
android:layout_height="match_parent"
43-
tools:context="com.example.android.sunshine.app.ForecastFragment"
4442
tools:layout="@android:layout/list_content" />
45-
</LinearLayout>
43+
</FrameLayout>

app/src/main/res/layout/fragment_main.xml

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,35 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
-->
16-
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
17-
xmlns:tools="http://schemas.android.com/tools"
16+
<RelativeLayout
17+
xmlns:android="http://schemas.android.com/apk/res/android"
18+
xmlns:app="http://schemas.android.com/apk/res-auto"
1819
android:layout_width="match_parent"
19-
android:layout_height="match_parent"
20-
tools:context="com.example.android.sunshine.app.ForecastFragment">
21-
<ListView
22-
style="@style/ForecastListStyle"
23-
android:id="@+id/listview_forecast"
24-
android:layout_width="match_parent"
20+
android:layout_height="match_parent">
21+
<include layout="@layout/fragment_main_base"
22+
android:layout_below="@+id/appbar"
2523
android:layout_height="match_parent"
26-
android:divider="@null" />
27-
<!-- empty list -->
28-
<TextView
29-
android:id="@+id/listview_forecast_empty"
30-
android:text="@string/empty_forecast_list"
24+
android:layout_width="match_parent"/>
25+
<LinearLayout
26+
android:id="@+id/appbar"
3127
android:layout_width="match_parent"
32-
android:layout_height="match_parent"
33-
android:gravity="center_horizontal"
34-
android:paddingRight="@dimen/activity_horizontal_margin"
35-
android:paddingEnd="@dimen/activity_horizontal_margin"
36-
android:paddingLeft="@dimen/activity_horizontal_margin"
37-
android:paddingStart="@dimen/activity_horizontal_margin"
38-
android:paddingTop="@dimen/activity_vertical_margin"
39-
android:paddingBottom="@dimen/activity_vertical_margin"
40-
/>
41-
</FrameLayout>
28+
android:layout_height="wrap_content"
29+
android:layout_alignParentTop="true"
30+
android:background="?attr/colorPrimary"
31+
android:orientation="vertical">
32+
<android.support.v7.widget.Toolbar
33+
android:id="@+id/toolbar"
34+
android:layout_height="?attr/actionBarSize"
35+
android:layout_width="match_parent"
36+
android:elevation="0dp"
37+
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
38+
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
39+
<ImageView
40+
android:layout_width="match_parent"
41+
android:layout_height="?attr/listPreferredItemHeight"
42+
android:layout_gravity="center"
43+
android:scaleType="center"
44+
android:src="@drawable/ic_logo"
45+
android:contentDescription="@string/app_name"/>
46+
</LinearLayout>
47+
</RelativeLayout>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!--
2+
Copyright (C) 2015 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
17+
xmlns:tools="http://schemas.android.com/tools"
18+
android:layout_width="match_parent"
19+
android:layout_height="match_parent"
20+
android:elevation="@dimen/appbar_elevation"
21+
tools:context="com.example.android.sunshine.app.ForecastFragment">
22+
<ListView
23+
style="@style/ForecastListStyle"
24+
android:id="@+id/listview_forecast"
25+
android:layout_width="match_parent"
26+
android:layout_height="match_parent"
27+
android:divider="@null" />
28+
<!-- empty list -->
29+
<TextView
30+
android:id="@+id/listview_forecast_empty"
31+
android:text="@string/empty_forecast_list"
32+
android:layout_width="match_parent"
33+
android:layout_height="match_parent"
34+
android:gravity="center_horizontal"
35+
android:paddingRight="@dimen/activity_horizontal_margin"
36+
android:paddingEnd="@dimen/activity_horizontal_margin"
37+
android:paddingLeft="@dimen/activity_horizontal_margin"
38+
android:paddingStart="@dimen/activity_horizontal_margin"
39+
android:paddingTop="@dimen/activity_vertical_margin"
40+
android:paddingBottom="@dimen/activity_vertical_margin"
41+
/>
42+
</FrameLayout>

app/src/main/res/values/dimens.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@
5151
<dimen name="detail_container_bottom_margin">@dimen/detail_view_padding</dimen>
5252

5353
<dimen name="detail_card_elevation">6dp</dimen>
54+
<dimen name="landscape_forecast_view_width">360dp</dimen>
5455
</resources>

0 commit comments

Comments
 (0)