Skip to content

Commit 74d5103

Browse files
committed
Rework footer for drawer activity
Move navigation view above the footer.
1 parent 327380e commit 74d5103

8 files changed

+306
-12
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2018-2024 Pranav Pandey
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout
19+
xmlns:android="http://schemas.android.com/apk/res/android"
20+
xmlns:app="http://schemas.android.com/apk/res-auto"
21+
android:id="@+id/ads_activity_root"
22+
android:layout_width="match_parent"
23+
android:layout_height="match_parent">
24+
25+
<com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout
26+
android:id="@+id/ads_coordinator_layout"
27+
android:layout_width="match_parent"
28+
android:layout_height="match_parent"
29+
android:layout_above="@id/ads_footer_frame"
30+
android:fitsSystemWindows="true">
31+
32+
<com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout
33+
android:id="@+id/ads_app_bar_layout"
34+
android:layout_width="match_parent"
35+
android:layout_height="wrap_content"
36+
app:elevation="0dp">
37+
38+
<com.pranavpandey.android.dynamic.support.widget.DynamicCollapsingToolbarLayout
39+
android:id="@+id/ads_collapsing_toolbar_layout"
40+
android:layout_width="match_parent"
41+
android:layout_height="@dimen/ads_collapsing_toolbar_height"
42+
android:clipChildren="false"
43+
app:expandedTitleMarginStart="@dimen/ads_toolbar_margin_start_collapsing"
44+
app:expandedTitleMarginEnd="@dimen/ads_toolbar_margin_end_collapsing"
45+
app:collapsedTitleTextAppearance="?attr/ads_textAppearanceToolbarTitle"
46+
app:expandedTitleTextAppearance="?attr/ads_textAppearanceToolbarTitleExpanded"
47+
app:layout_scrollFlags="scroll|enterAlways|snap">
48+
49+
<FrameLayout
50+
android:id="@+id/ads_backdrop_frame"
51+
android:layout_width="match_parent"
52+
android:layout_height="match_parent"
53+
app:layout_collapseMode="parallax" />
54+
55+
<include layout="@layout/ads_toolbar_collapsing" />
56+
57+
</com.pranavpandey.android.dynamic.support.widget.DynamicCollapsingToolbarLayout>
58+
59+
<include layout="@layout/ads_layout_header_frame" />
60+
61+
</com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout>
62+
63+
<include layout="@layout/ads_content_frame" />
64+
65+
<include layout="@layout/ads_layout_bottom_sheet" />
66+
67+
<include layout="@layout/ads_layout_fab_bottom" />
68+
69+
<include layout="@layout/ads_layout_fab_extended_bottom" />
70+
71+
<include layout="@layout/ads_layout_bottom_bar_shadow_bottom" />
72+
73+
</com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout>
74+
75+
</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2018-2024 Pranav Pandey
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout
19+
xmlns:android="http://schemas.android.com/apk/res/android"
20+
xmlns:app="http://schemas.android.com/apk/res-auto"
21+
android:id="@+id/ads_activity_root"
22+
android:layout_width="match_parent"
23+
android:layout_height="match_parent">
24+
25+
<com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout
26+
android:id="@+id/ads_coordinator_layout"
27+
android:layout_width="match_parent"
28+
android:layout_height="match_parent"
29+
android:layout_above="@id/ads_footer_frame"
30+
android:fitsSystemWindows="true">
31+
32+
<com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout
33+
android:id="@+id/ads_app_bar_layout"
34+
android:layout_width="match_parent"
35+
android:layout_height="wrap_content"
36+
app:elevation="0dp">
37+
38+
<com.pranavpandey.android.dynamic.support.widget.DynamicCollapsingToolbarLayout
39+
android:id="@+id/ads_collapsing_toolbar_layout"
40+
android:layout_width="match_parent"
41+
android:layout_height="@dimen/ads_collapsing_toolbar_height"
42+
android:clipChildren="false"
43+
app:expandedTitleMarginStart="@dimen/ads_toolbar_margin_start_collapsing"
44+
app:expandedTitleMarginEnd="@dimen/ads_toolbar_margin_end_collapsing"
45+
app:collapsedTitleTextAppearance="?attr/ads_textAppearanceToolbarTitle"
46+
app:expandedTitleTextAppearance="?attr/ads_textAppearanceToolbarTitleExpanded"
47+
app:layout_scrollFlags="scroll|enterAlways|snap">
48+
49+
<FrameLayout
50+
android:id="@+id/ads_backdrop_frame"
51+
android:layout_width="match_parent"
52+
android:layout_height="match_parent"
53+
app:layout_collapseMode="parallax" />
54+
55+
<include layout="@layout/ads_toolbar_collapsing" />
56+
57+
</com.pranavpandey.android.dynamic.support.widget.DynamicCollapsingToolbarLayout>
58+
59+
<include layout="@layout/ads_layout_header_frame" />
60+
61+
</com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout>
62+
63+
<include layout="@layout/ads_content" />
64+
65+
<include layout="@layout/ads_layout_bottom_bar_shadow_bottom" />
66+
67+
<include layout="@layout/ads_layout_fab_bottom" />
68+
69+
<include layout="@layout/ads_layout_fab_extended_bottom" />
70+
71+
<include layout="@layout/ads_layout_bottom_sheet" />
72+
73+
</com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout>
74+
75+
</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>

dynamic-support/src/main/res/layout/ads_activity_drawer.xml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
Copyright 2018-2022 Pranav Pandey
3+
Copyright 2018-2024 Pranav Pandey
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -25,9 +25,10 @@
2525
<com.pranavpandey.android.dynamic.support.widget.DynamicDrawerLayout
2626
android:id="@+id/ads_drawer_layout"
2727
android:layout_width="match_parent"
28-
android:layout_height="match_parent">
28+
android:layout_height="match_parent"
29+
android:layout_above="@id/ads_footer_frame">
2930

30-
<include layout="@layout/ads_activity" />
31+
<include layout="@layout/ads_activity_no_footer" />
3132

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

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

44+
<include layout="@layout/ads_layout_footer_frame" />
45+
46+
<include
47+
layout="@layout/ads_layout_navigation_shadow"
48+
android:layout_width="@dimen/ads_navigation_bar_shadow_size"
49+
android:layout_height="match_parent" />
50+
4351
</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>

dynamic-support/src/main/res/layout/ads_activity_drawer_collapsing.xml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
Copyright 2018-2022 Pranav Pandey
3+
Copyright 2018-2024 Pranav Pandey
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -25,9 +25,10 @@
2525
<com.pranavpandey.android.dynamic.support.widget.DynamicDrawerLayout
2626
android:id="@+id/ads_drawer_layout"
2727
android:layout_width="match_parent"
28-
android:layout_height="match_parent">
28+
android:layout_height="match_parent"
29+
android:layout_above="@id/ads_footer_frame">
2930

30-
<include layout="@layout/ads_activity_collapsing" />
31+
<include layout="@layout/ads_activity_collapsing_no_footer" />
3132

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

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

44+
<include layout="@layout/ads_layout_footer_frame" />
45+
46+
<include
47+
layout="@layout/ads_layout_navigation_shadow"
48+
android:layout_width="@dimen/ads_navigation_bar_shadow_size"
49+
android:layout_height="match_parent" />
50+
4351
</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>

dynamic-support/src/main/res/layout/ads_activity_drawer_collapsing_frame.xml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
Copyright 2018-2022 Pranav Pandey
3+
Copyright 2018-2024 Pranav Pandey
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -25,9 +25,10 @@
2525
<com.pranavpandey.android.dynamic.support.widget.DynamicDrawerLayout
2626
android:id="@+id/ads_drawer_layout"
2727
android:layout_width="match_parent"
28-
android:layout_height="match_parent">
28+
android:layout_height="match_parent"
29+
android:layout_above="@id/ads_footer_frame">
2930

30-
<include layout="@layout/ads_activity_collapsing_frame" />
31+
<include layout="@layout/ads_activity_collapsing_frame_no_footer" />
3132

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

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

44+
<include layout="@layout/ads_layout_footer_frame" />
45+
46+
<include
47+
layout="@layout/ads_layout_navigation_shadow"
48+
android:layout_width="@dimen/ads_navigation_bar_shadow_size"
49+
android:layout_height="match_parent" />
50+
4351
</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>

dynamic-support/src/main/res/layout/ads_activity_drawer_frame.xml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
Copyright 2018-2022 Pranav Pandey
3+
Copyright 2018-2024 Pranav Pandey
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -25,9 +25,10 @@
2525
<com.pranavpandey.android.dynamic.support.widget.DynamicDrawerLayout
2626
android:id="@+id/ads_drawer_layout"
2727
android:layout_width="match_parent"
28-
android:layout_height="match_parent">
28+
android:layout_height="match_parent"
29+
android:layout_above="@id/ads_footer_frame">
2930

30-
<include layout="@layout/ads_activity_frame" />
31+
<include layout="@layout/ads_activity_frame_no_footer" />
3132

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

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

44+
<include layout="@layout/ads_layout_footer_frame" />
45+
46+
<include
47+
layout="@layout/ads_layout_navigation_shadow"
48+
android:layout_width="@dimen/ads_navigation_bar_shadow_size"
49+
android:layout_height="match_parent" />
50+
4351
</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2018-2024 Pranav Pandey
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout
19+
xmlns:android="http://schemas.android.com/apk/res/android"
20+
xmlns:app="http://schemas.android.com/apk/res-auto"
21+
android:id="@+id/ads_activity_root"
22+
android:layout_width="match_parent"
23+
android:layout_height="match_parent">
24+
25+
<com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout
26+
android:id="@+id/ads_coordinator_layout"
27+
android:layout_width="match_parent"
28+
android:layout_height="match_parent"
29+
android:layout_above="@id/ads_footer_frame"
30+
android:fitsSystemWindows="true">
31+
32+
<com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout
33+
android:id="@+id/ads_app_bar_layout"
34+
android:layout_width="match_parent"
35+
android:layout_height="wrap_content"
36+
app:elevation="0dp">
37+
38+
<include layout="@layout/ads_toolbar_scroll" />
39+
40+
<include layout="@layout/ads_layout_header_frame" />
41+
42+
</com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout>
43+
44+
<include layout="@layout/ads_content_frame" />
45+
46+
<include layout="@layout/ads_layout_bottom_sheet" />
47+
48+
<include layout="@layout/ads_layout_fab_bottom" />
49+
50+
<include layout="@layout/ads_layout_fab_extended_bottom" />
51+
52+
<include layout="@layout/ads_layout_bottom_bar_shadow_bottom" />
53+
54+
</com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout>
55+
56+
</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2018-2024 Pranav Pandey
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout
19+
xmlns:android="http://schemas.android.com/apk/res/android"
20+
xmlns:app="http://schemas.android.com/apk/res-auto"
21+
android:id="@+id/ads_activity_root"
22+
android:layout_width="match_parent"
23+
android:layout_height="match_parent">
24+
25+
<com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout
26+
android:id="@+id/ads_coordinator_layout"
27+
android:layout_width="match_parent"
28+
android:layout_height="match_parent"
29+
android:layout_above="@id/ads_footer_frame"
30+
android:fitsSystemWindows="true">
31+
32+
<com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout
33+
android:id="@+id/ads_app_bar_layout"
34+
android:layout_width="match_parent"
35+
android:layout_height="wrap_content"
36+
app:elevation="0dp">
37+
38+
<include layout="@layout/ads_toolbar_scroll" />
39+
40+
<include layout="@layout/ads_layout_header_frame" />
41+
42+
</com.pranavpandey.android.dynamic.support.widget.DynamicAppBarLayout>
43+
44+
<include layout="@layout/ads_content" />
45+
46+
<include layout="@layout/ads_layout_bottom_bar_shadow_bottom" />
47+
48+
<include layout="@layout/ads_layout_fab_bottom" />
49+
50+
<include layout="@layout/ads_layout_fab_extended_bottom" />
51+
52+
<include layout="@layout/ads_layout_bottom_sheet" />
53+
54+
</com.pranavpandey.android.dynamic.support.widget.DynamicCoordinatorLayout>
55+
56+
</com.pranavpandey.android.dynamic.support.widget.DynamicRootLayout>

0 commit comments

Comments
 (0)