Skip to content

Commit e549e06

Browse files
authored
Merge pull request #2775 from mikepenz/develop
dev -> main
2 parents 8619a29 + 21e62da commit e549e06

36 files changed

+310
-219
lines changed

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949

5050
## Latest releases 🛠
5151

52-
- Kotlin && New | [v8.4.5](https://github.com/mikepenz/MaterialDrawer/tree/v8.4.5)
53-
- Kotlin | [v7.0.0](https://github.com/mikepenz/MaterialDrawer/tree/v7.0.0) | (Builder approach like v6.x)
52+
- Kotlin && Material 3 | [v9.0.0](https://github.com/mikepenz/MaterialDrawer/tree/v9.0.0)
53+
- Kotlin | [v8.4.5](https://github.com/mikepenz/MaterialDrawer/tree/v8.4.5)
5454
- Java && AndroidX | [v6.1.2](https://github.com/mikepenz/MaterialDrawer/tree/v6.1.2)
5555
- Java && AppCompat | [v6.0.9](https://github.com/mikepenz/MaterialDrawer/tree/v6.0.9)
5656

@@ -64,7 +64,7 @@ implementation "com.mikepenz:materialdrawer:${lastestMaterialDrawerRelease}"
6464
implementation "androidx.appcompat:appcompat:${versions.appcompat}"
6565
implementation "androidx.recyclerview:recyclerview:${versions.recyclerView}"
6666
implementation "androidx.annotation:annotation:${versions.annotation}"
67-
implementation "com.google.android.material:material:${versions.material}"
67+
implementation "com.google.android.material:material:1.5.0-alpha05" // requires at least 1.5.0-x
6868
implementation "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}"
6969
7070
// Add for NavController support
@@ -100,7 +100,7 @@ The `MaterialDrawerSliderView` has to be provided as child of the `DrawerLayout`
100100
### 3. Add the `DrawerStyle` to your theme
101101

102102
```xml
103-
<style name="SampleApp.DayNight" parent="Theme.MaterialComponents.DayNight.NoActionBar">
103+
<style name="SampleApp.DayNight" parent="Theme.Material3.DayNight.NoActionBar">
104104
...
105105
<item name="materialDrawerStyle">@style/Widget.MaterialDrawerStyle</item>
106106
<item name="materialDrawerHeaderStyle">@style/Widget.MaterialDrawerHeaderStyle</item>
@@ -110,6 +110,10 @@ The `MaterialDrawerSliderView` has to be provided as child of the `DrawerLayout`
110110

111111
Great. Your drawer is now ready to use.
112112

113+
### Note
114+
115+
> Using v9.x with Material 3 theming requires a `Material3` theme as base for the activity.
116+
113117
# Additional Setup
114118
### Add items and adding some functionality
115119

@@ -273,12 +277,12 @@ Create your custom style. If you don't need a custom theme see the next section,
273277
<item name="materialDrawerInsetForeground">#4000</item>
274278
<!-- MaterialDrawer specific values -->
275279
<item name="materialDrawerBackground">?colorSurface</item>
276-
<item name="materialDrawerPrimaryText">?android:textColorPrimary</item>
277-
<item name="materialDrawerPrimaryIcon">?android:textColorSecondary</item>
278-
<item name="materialDrawerSecondaryText">?android:textColorSecondary</item>
279-
<item name="materialDrawerSecondaryIcon">?android:textColorSecondary</item>
280-
<item name="materialDrawerDividerColor">?android:textColorHint</item>
281-
<item name="materialDrawerSelectedBackgroundColor">?colorPrimary</item>
280+
<item name="materialDrawerPrimaryText">@color/color_drawer_item_text</item>
281+
<item name="materialDrawerPrimaryIcon">@color/color_drawer_item_text</item>
282+
<item name="materialDrawerSecondaryText">@color/color_drawer_item_text</item>
283+
<item name="materialDrawerSecondaryIcon">@color/color_drawer_item_text</item>
284+
<item name="materialDrawerDividerColor">?colorOutline</item>
285+
<item name="materialDrawerSelectedBackgroundColor">?colorSecondaryContainer</item>
282286
</style>
283287

284288
// define a custom header style
@@ -289,7 +293,7 @@ Create your custom style. If you don't need a custom theme see the next section,
289293
</style>
290294

291295
// define the custom styles for the theme
292-
<style name="SampleApp" parent="Theme.MaterialComponents.Light.NoActionBar">
296+
<style name="SampleApp" parent="Theme.Material3.Light.NoActionBar">
293297
...
294298
<item name="materialDrawerStyle">@style/Widget.MaterialDrawerStyleCustom</item>
295299
<item name="materialDrawerHeaderStyle">@style/Widget.MaterialDrawerHeaderStyleCustom</item>

app/src/main/java/com/mikepenz/materialdrawer/app/CustomApplication.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import android.widget.ImageView
77
import androidx.multidex.MultiDexApplication
88
import coil.clear
99
import coil.load
10+
import com.google.android.material.color.DynamicColors
1011
import com.mikepenz.iconics.Iconics
1112
import com.mikepenz.iconics.IconicsDrawable
1213
import com.mikepenz.iconics.utils.backgroundColorRes
@@ -24,6 +25,8 @@ class CustomApplication : MultiDexApplication() {
2425

2526
Iconics.init(this)
2627

28+
DynamicColors.applyToActivitiesIfAvailable(this)
29+
2730
//initialize and create the image loader logic
2831
/*
2932
DrawerImageLoader.init(object : AbstractDrawerImageLoader() {

app/src/main/java/com/mikepenz/materialdrawer/app/DrawerActivity.kt

Lines changed: 106 additions & 41 deletions
Large diffs are not rendered by default.

app/src/main/res/layout/activity_mini_drawer.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
android:id="@+id/toolbar"
99
android:layout_width="match_parent"
1010
android:layout_height="wrap_content"
11-
android:background="?attr/colorPrimary"
1211
android:elevation="4dp"
13-
android:theme="@style/ThemeOverlay.MaterialComponents.Dark" />
12+
android:theme="@style/ThemeOverlay.Material3.Dark" />
1413

1514
<FrameLayout
1615
android:layout_width="match_parent"

app/src/main/res/layout/activity_sample.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
android:id="@+id/toolbar"
1515
android:layout_width="0dp"
1616
android:layout_height="wrap_content"
17-
android:background="?attr/colorPrimary"
1817
android:elevation="4dp"
19-
android:theme="@style/ThemeOverlay.MaterialComponents.Dark"
2018
app:layout_constraintEnd_toEndOf="parent"
2119
app:layout_constraintStart_toStartOf="parent"
2220
app:layout_constraintTop_toTopOf="parent" />

app/src/main/res/layout/activity_sample_crossfader.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
android:id="@+id/toolbar"
1515
android:layout_width="0dp"
1616
android:layout_height="wrap_content"
17-
android:background="?attr/colorPrimary"
1817
android:elevation="4dp"
19-
android:theme="@style/ThemeOverlay.MaterialComponents.Dark"
2018
app:layout_constraintEnd_toEndOf="parent"
2119
app:layout_constraintStart_toStartOf="parent"
2220
app:layout_constraintTop_toTopOf="parent" />

app/src/main/res/layout/activity_sample_fragment.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
android:id="@+id/toolbar"
99
android:layout_width="match_parent"
1010
android:layout_height="wrap_content"
11-
android:background="?attr/colorPrimary"
1211
android:elevation="4dp"
13-
android:theme="@style/ThemeOverlay.MaterialComponents.Dark" />
12+
android:theme="@style/ThemeOverlay.Material3.Dark" />
1413

1514
<FrameLayout
1615
android:id="@+id/fragment_container"

app/src/main/res/layout/activity_sample_fullscreen.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
android:id="@+id/toolbar"
1515
android:layout_width="0dp"
1616
android:layout_height="wrap_content"
17-
android:background="?attr/colorPrimary"
1817
android:elevation="4dp"
19-
android:theme="@style/ThemeOverlay.MaterialComponents.Dark"
18+
android:theme="@style/ThemeOverlay.Material3.Dark"
2019
app:layout_constraintEnd_toEndOf="parent"
2120
app:layout_constraintStart_toStartOf="parent"
2221
app:layout_constraintTop_toTopOf="parent" />

app/src/main/res/layout/activity_sample_nav.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
android:id="@+id/toolbar"
1515
android:layout_width="0dp"
1616
android:layout_height="wrap_content"
17-
android:background="?attr/colorPrimary"
1817
android:elevation="4dp"
19-
android:theme="@style/ThemeOverlay.MaterialComponents.Dark"
18+
android:theme="@style/ThemeOverlay.Material3.Dark"
2019
app:layout_constraintEnd_toEndOf="parent"
2120
app:layout_constraintStart_toStartOf="parent"
2221
app:layout_constraintTop_toTopOf="parent" />

app/src/main/res/layout/material_drawer_item_primary_centered.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
android:layout_height="wrap_content"
6060
android:layout_marginStart="@dimen/material_drawer_padding"
6161
android:layout_marginLeft="@dimen/material_drawer_padding"
62-
android:layout_marginEnd="0dp"
63-
android:layout_marginRight="0dp"
62+
android:layout_marginEnd="@dimen/material_drawer_padding"
63+
android:layout_marginRight="@dimen/material_drawer_padding"
6464
android:fontFamily="sans-serif"
6565
android:gravity="center"
6666
android:lines="1"

0 commit comments

Comments
 (0)