This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lyla
committed
Mar 4, 2015
1 parent
5da9899
commit 1ea4116
Showing
7 changed files
with
67 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<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="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. | ||
--> | ||
|
||
<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" | ||
tools:layout="@android:layout/list_content" /> | ||
|
||
<FrameLayout | ||
android:id="@+id/weather_detail_container" | ||
android:layout_width="0dp" | ||
android:layout_height="match_parent" | ||
android:layout_weight="4" /> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" | ||
android:layout_width="match_parent" android:layout_height="match_parent" | ||
tools:context="com.example.android.sunshine.app.DetailActivity" tools:ignore="MergeRootFrame" /> | ||
|
||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/weather_detail_container" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context="com.example.android.sunshine.app.DetailActivity" | ||
tools:ignore="MergeRootFrame" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" | ||
android:layout_width="match_parent" android:layout_height="match_parent" | ||
tools:context=".MainActivity" tools:ignore="MergeRootFrame" /> | ||
<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" | ||
android:layout_height="match_parent" | ||
android:layout_marginLeft="16dp" | ||
android:layout_marginRight="16dp" | ||
tools:context="com.example.android.sunshine.app.ForecastFragment" | ||
tools:layout="@android:layout/list_content" /> |
This file was deleted.
Oops, something went wrong.
1ea4116
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, I am using an emulator for this to try out the two pane UI, the device being used is nexus 7 but i'm still not getting a two pane UI.
The line in MainAcitivty.java "if (findViewById(R.id.weather_detail_container) != null)" always returns a null. Can someone help me out here?
1ea4116
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also have this question before,but you may use the nexus 9 to test or change the value of “layout-600dp” a bit smaller,like“layout-400dp” or even smaller
1ea4116
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had this too. The skin definition AVD configuration seems to be the cause: http://stackoverflow.com/a/32722831 As a result noticed a 'skin not large enough to view entire screen' warning when the skin definition is a default 'nexus_7_2013'.
That may explain the emulator screen being apparently less than 600dp and hence showing the phone layout. However, it looks like the warning is present in all default configured AVDs. Setting the skin to 'No Skin' resolves it nevertheless.
1ea4116
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HEADS UP - BLANK FORECAST FRAGMENT
Is your tablet showing nothing on your forecast view?
Chances are like me you spun up a fresh tablet VM, to test your hard work was successful. This will result in a blank forecast because you have not yet downloaded any forecast data from the server and saved it locally to your sqlite db.
Currently there is no logic built to detect that you have an empty database, and force a call to updateWeather(). Just use the refresh control in the menu. After the first run it will always have some data to display.
(/me spend 20 mins trying to figure out what I had done wrong until I <facepalmed> :) )