Skip to content

Commit

Permalink
Rework footer for drawer activity
Browse files Browse the repository at this point in the history
Move navigation view above the footer.
  • Loading branch information
pranavpandey committed Jul 24, 2024
1 parent 327380e commit 74d5103
Show file tree
Hide file tree
Showing 8 changed files with 306 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018-2024 Pranav Pandey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ads_activity_root"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout
android:id="@+id/ads_coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/ads_footer_frame"
android:fitsSystemWindows="true">

<com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout
android:id="@+id/ads_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp">

<com.pranavpandey.android.dynamic.support.widget.DynamicCollapsingToolbarLayout
android:id="@+id/ads_collapsing_toolbar_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/ads_collapsing_toolbar_height"
android:clipChildren="false"
app:expandedTitleMarginStart="@dimen/ads_toolbar_margin_start_collapsing"
app:expandedTitleMarginEnd="@dimen/ads_toolbar_margin_end_collapsing"
app:collapsedTitleTextAppearance="?attr/ads_textAppearanceToolbarTitle"
app:expandedTitleTextAppearance="?attr/ads_textAppearanceToolbarTitleExpanded"
app:layout_scrollFlags="scroll|enterAlways|snap">

<FrameLayout
android:id="@+id/ads_backdrop_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_collapseMode="parallax" />

<include layout="@layout/ads_toolbar_collapsing" />

</com.pranavpandey.android.dynamic.support.widget.DynamicCollapsingToolbarLayout>

<include layout="@layout/ads_layout_header_frame" />

</com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout>

<include layout="@layout/ads_content_frame" />

<include layout="@layout/ads_layout_bottom_sheet" />

<include layout="@layout/ads_layout_fab_bottom" />

<include layout="@layout/ads_layout_fab_extended_bottom" />

<include layout="@layout/ads_layout_bottom_bar_shadow_bottom" />

</com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout>

</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018-2024 Pranav Pandey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ads_activity_root"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout
android:id="@+id/ads_coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/ads_footer_frame"
android:fitsSystemWindows="true">

<com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout
android:id="@+id/ads_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp">

<com.pranavpandey.android.dynamic.support.widget.DynamicCollapsingToolbarLayout
android:id="@+id/ads_collapsing_toolbar_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/ads_collapsing_toolbar_height"
android:clipChildren="false"
app:expandedTitleMarginStart="@dimen/ads_toolbar_margin_start_collapsing"
app:expandedTitleMarginEnd="@dimen/ads_toolbar_margin_end_collapsing"
app:collapsedTitleTextAppearance="?attr/ads_textAppearanceToolbarTitle"
app:expandedTitleTextAppearance="?attr/ads_textAppearanceToolbarTitleExpanded"
app:layout_scrollFlags="scroll|enterAlways|snap">

<FrameLayout
android:id="@+id/ads_backdrop_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_collapseMode="parallax" />

<include layout="@layout/ads_toolbar_collapsing" />

</com.pranavpandey.android.dynamic.support.widget.DynamicCollapsingToolbarLayout>

<include layout="@layout/ads_layout_header_frame" />

</com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout>

<include layout="@layout/ads_content" />

<include layout="@layout/ads_layout_bottom_bar_shadow_bottom" />

<include layout="@layout/ads_layout_fab_bottom" />

<include layout="@layout/ads_layout_fab_extended_bottom" />

<include layout="@layout/ads_layout_bottom_sheet" />

</com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout>

</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>
14 changes: 11 additions & 3 deletions dynamic-support/src/main/res/layout/ads_activity_drawer.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018-2022 Pranav Pandey
Copyright 2018-2024 Pranav Pandey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -25,9 +25,10 @@
<com.pranavpandey.android.dynamic.support.widget.DynamicDrawerLayout
android:id="@+id/ads_drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:layout_above="@id/ads_footer_frame">

<include layout="@layout/ads_activity" />
<include layout="@layout/ads_activity_no_footer" />

<com.pranavpandey.android.dynamic.support.widget.DynamicNavigationView
style="?attr/ads_widgetNavigationView"
Expand All @@ -40,4 +41,11 @@

</com.pranavpandey.android.dynamic.support.widget.DynamicDrawerLayout>

<include layout="@layout/ads_layout_footer_frame" />

<include
layout="@layout/ads_layout_navigation_shadow"
android:layout_width="@dimen/ads_navigation_bar_shadow_size"
android:layout_height="match_parent" />

</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018-2022 Pranav Pandey
Copyright 2018-2024 Pranav Pandey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -25,9 +25,10 @@
<com.pranavpandey.android.dynamic.support.widget.DynamicDrawerLayout
android:id="@+id/ads_drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:layout_above="@id/ads_footer_frame">

<include layout="@layout/ads_activity_collapsing" />
<include layout="@layout/ads_activity_collapsing_no_footer" />

<com.pranavpandey.android.dynamic.support.widget.DynamicNavigationView
style="?attr/ads_widgetNavigationView"
Expand All @@ -40,4 +41,11 @@

</com.pranavpandey.android.dynamic.support.widget.DynamicDrawerLayout>

<include layout="@layout/ads_layout_footer_frame" />

<include
layout="@layout/ads_layout_navigation_shadow"
android:layout_width="@dimen/ads_navigation_bar_shadow_size"
android:layout_height="match_parent" />

</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018-2022 Pranav Pandey
Copyright 2018-2024 Pranav Pandey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -25,9 +25,10 @@
<com.pranavpandey.android.dynamic.support.widget.DynamicDrawerLayout
android:id="@+id/ads_drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:layout_above="@id/ads_footer_frame">

<include layout="@layout/ads_activity_collapsing_frame" />
<include layout="@layout/ads_activity_collapsing_frame_no_footer" />

<com.pranavpandey.android.dynamic.support.widget.DynamicNavigationView
style="?attr/ads_widgetNavigationView"
Expand All @@ -40,4 +41,11 @@

</com.pranavpandey.android.dynamic.support.widget.DynamicDrawerLayout>

<include layout="@layout/ads_layout_footer_frame" />

<include
layout="@layout/ads_layout_navigation_shadow"
android:layout_width="@dimen/ads_navigation_bar_shadow_size"
android:layout_height="match_parent" />

</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>
14 changes: 11 additions & 3 deletions dynamic-support/src/main/res/layout/ads_activity_drawer_frame.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018-2022 Pranav Pandey
Copyright 2018-2024 Pranav Pandey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -25,9 +25,10 @@
<com.pranavpandey.android.dynamic.support.widget.DynamicDrawerLayout
android:id="@+id/ads_drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:layout_above="@id/ads_footer_frame">

<include layout="@layout/ads_activity_frame" />
<include layout="@layout/ads_activity_frame_no_footer" />

<com.pranavpandey.android.dynamic.support.widget.DynamicNavigationView
style="?attr/ads_widgetNavigationView"
Expand All @@ -40,4 +41,11 @@

</com.pranavpandey.android.dynamic.support.widget.DynamicDrawerLayout>

<include layout="@layout/ads_layout_footer_frame" />

<include
layout="@layout/ads_layout_navigation_shadow"
android:layout_width="@dimen/ads_navigation_bar_shadow_size"
android:layout_height="match_parent" />

</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018-2024 Pranav Pandey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ads_activity_root"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout
android:id="@+id/ads_coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/ads_footer_frame"
android:fitsSystemWindows="true">

<com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout
android:id="@+id/ads_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp">

<include layout="@layout/ads_toolbar_scroll" />

<include layout="@layout/ads_layout_header_frame" />

</com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout>

<include layout="@layout/ads_content_frame" />

<include layout="@layout/ads_layout_bottom_sheet" />

<include layout="@layout/ads_layout_fab_bottom" />

<include layout="@layout/ads_layout_fab_extended_bottom" />

<include layout="@layout/ads_layout_bottom_bar_shadow_bottom" />

</com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout>

</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>
56 changes: 56 additions & 0 deletions dynamic-support/src/main/res/layout/ads_activity_no_footer.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2018-2024 Pranav Pandey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/ads_activity_root"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout
android:id="@+id/ads_coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/ads_footer_frame"
android:fitsSystemWindows="true">

<com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout
android:id="@+id/ads_app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp">

<include layout="@layout/ads_toolbar_scroll" />

<include layout="@layout/ads_layout_header_frame" />

</com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout>

<include layout="@layout/ads_content" />

<include layout="@layout/ads_layout_bottom_bar_shadow_bottom" />

<include layout="@layout/ads_layout_fab_bottom" />

<include layout="@layout/ads_layout_fab_extended_bottom" />

<include layout="@layout/ads_layout_bottom_sheet" />

</com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout>

</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>

0 comments on commit 74d5103

Please sign in to comment.