Updated the layout and dimensions to get us ready for lots of real estate.
This commit is contained in:
@@ -13,50 +13,88 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout 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="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:elevation="@dimen/appbar_elevation"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
|
||||
<!-- These FrameLayouts are only there to line the image up with the keyline correctly, since
|
||||
we cannot do addition of dimensions/attributes otherwise -->
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/abc_list_item_padding_horizontal_material"
|
||||
android:layout_marginStart="@dimen/abc_list_item_padding_horizontal_material"
|
||||
>
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/list_icon"
|
||||
android:layout_marginStart="@dimen/list_icon"
|
||||
android:paddingLeft="@dimen/abc_list_item_padding_horizontal_material"
|
||||
android:paddingStart="@dimen/abc_list_item_padding_horizontal_material">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="?attr/listPreferredItemHeight"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/ic_logo"
|
||||
android:scaleType="center"/>
|
||||
</android.support.v7.widget.Toolbar>
|
||||
android:contentDescription="@string/app_name"/>
|
||||
</FrameLayout>
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="false"
|
||||
android:divider="?android:attr/dividerHorizontal"
|
||||
android:orientation="horizontal"
|
||||
tools:context="com.example.android.sunshine.app.MainActivity">
|
||||
|
||||
<!--
|
||||
This layout is a two-pane layout for the Items master/detail flow.
|
||||
-->
|
||||
<!-- This is used as a strut to create two columns in our RelativeLayout -->
|
||||
<android.support.v4.widget.Space
|
||||
android:id="@+id/layout_center"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/fragment_forecast"
|
||||
android:name="com.example.android.sunshine.app.ForecastFragment"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:layout_alignEnd="@id/layout_center"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignRight="@id/layout_center"
|
||||
android:layout_below="@id/appbar"
|
||||
tools:layout="@android:layout/list_content" />
|
||||
|
||||
<!-- We set elevation here only so the detail view doesn't get occluded
|
||||
by the AppBar -->
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/weather_detail_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="4" />
|
||||
android:layout_alignLeft="@id/layout_center"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="?attr/actionBarSize"
|
||||
android:layout_alignStart="@id/layout_center"
|
||||
android:elevation="@dimen/appbar_elevation"
|
||||
android:paddingRight="@dimen/abc_list_item_padding_horizontal_material"
|
||||
android:paddingEnd="@dimen/abc_list_item_padding_horizontal_material"
|
||||
android:paddingBottom="@dimen/abc_list_item_padding_horizontal_material"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
@@ -38,4 +38,9 @@
|
||||
<!-- Extra Padding -->
|
||||
<dimen name="detail_view_extra_padding">@dimen/abc_list_item_padding_horizontal_material</dimen>
|
||||
|
||||
<!-- Needed if we aren't including the Material Design Library -->
|
||||
<dimen name="appbar_elevation">4dp</dimen>
|
||||
|
||||
<!-- The amount we want the details view to overlap the app bar -->
|
||||
<dimen name="details_app_bar_overlap">24dp</dimen>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user