Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #41 from googlecodelabs/layout_tools
Browse files Browse the repository at this point in the history
Add update layout files to add tools namespace and reformat code
  • Loading branch information
ceruleanotter committed Dec 11, 2018
2 parents 445d180 + d8df685 commit 2bbc0ac
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 48 deletions.
12 changes: 6 additions & 6 deletions .idea/navEditor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions app/src/main/res/layout-h470dp/navigation_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,27 @@
<LinearLayout
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:orientation="vertical">
android:orientation="vertical"
tools:context="com.example.android.codelabs.navigation.MainActivity">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark"/>
android:theme="@style/ThemeOverlay.AppCompat.Dark" />

<fragment
android:id="@+id/my_nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="@+id/my_nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
app:navGraph="@navigation/mobile_navigation"
app:defaultNavHost="true"
/>
app:navGraph="@navigation/mobile_navigation" />

<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_nav_view"
Expand Down
24 changes: 14 additions & 10 deletions app/src/main/res/layout-w960dp/navigation_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
<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"
tools:context="com.example.android.codelabs.navigation.MainActivity">

<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
Expand All @@ -28,27 +30,29 @@
app:elevation="0dp"
app:headerLayout="@layout/nav_view_header"
app:menu="@menu/nav_drawer_menu" />

<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_toEndOf="@id/nav_view"
android:background="?android:attr/listDivider"/>
android:background="?android:attr/listDivider" />

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
android:layout_alignParentTop="true"
android:layout_toEndOf="@id/nav_view"
android:layout_alignParentTop="true"/>
android:background="@color/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark" />

<fragment
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/my_nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
app:navGraph="@navigation/mobile_navigation"
app:defaultNavHost="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar"
android:layout_toEndOf="@id/nav_view"
android:layout_below="@id/toolbar"/>
app:defaultNavHost="true"
app:navGraph="@navigation/mobile_navigation" />
</RelativeLayout>
19 changes: 13 additions & 6 deletions app/src/main/res/layout/deeplink_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,26 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
<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:padding="8dp">
<TextView android:id="@+id/text"
android:orientation="vertical"
android:padding="8dp"
tools:context="com.example.android.codelabs.navigation.DeepLinkFragment">

<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
android:layout_height="wrap_content" />

<EditText
android:id="@+id/args_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/deep_link_instructions" />

<Button
android:id="@+id/send_notification_button"
android:layout_width="match_parent"
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/res/layout/flow_step_one_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
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"
tools:context="com.example.android.codelabs.navigation.FlowStepFragment">

<TextView
android:id="@+id/text"
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/res/layout/flow_step_two_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
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"
tools:context="com.example.android.codelabs.navigation.FlowStepFragment">

<TextView
android:id="@+id/text"
Expand Down
7 changes: 4 additions & 3 deletions app/src/main/res/layout/home_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
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:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout_editor_absoluteY="25dp">
tools:context="com.example.android.codelabs.navigation.HomeFragment">

<TextView
android:id="@+id/text"
Expand All @@ -39,8 +40,8 @@
android:id="@+id/navigate_destination_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:text="@string/navigate_destination_button"
app:layout_constraintBottom_toTopOf="@+id/navigate_action_button"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
12 changes: 7 additions & 5 deletions app/src/main/res/layout/nav_view_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
~ limitations under the License.
-->

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize">
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:orientation="vertical">

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_gravity="bottom"
android:background="?android:attr/listDivider"/>
android:background="?android:attr/listDivider" />
</FrameLayout>
15 changes: 9 additions & 6 deletions app/src/main/res/layout/navigation_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
<androidx.drawerlayout.widget.DrawerLayout
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:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
tools:context="com.example.android.codelabs.navigation.MainActivity">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -27,15 +30,15 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark"/>
android:theme="@style/ThemeOverlay.AppCompat.Dark" />

<fragment
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/my_nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
app:navGraph="@navigation/mobile_navigation"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
/>
app:navGraph="@navigation/mobile_navigation" />
</LinearLayout>

<com.google.android.material.navigation.NavigationView
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/settings_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
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"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/shopping_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ShoppingFragment" >
tools:context=".ShoppingFragment">

<TextView
android:id="@+id/text"
Expand Down

0 comments on commit 2bbc0ac

Please sign in to comment.