From 8f5005ea28f673952c156b1fb3a58b0e5dc7c51d Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Fri, 29 Oct 2021 10:30:26 +0200 Subject: [PATCH 01/20] - introduce initial alpha version with rethemed drawer items to match the new material3 spec - https://m3.material.io/components/navigation-drawer/specs - requires material 1.5.0-x --- README.md | 22 ++++++------ .../materialdrawer/app/CustomApplication.kt | 3 ++ .../main/res/layout/activity_mini_drawer.xml | 3 +- app/src/main/res/layout/activity_sample.xml | 3 +- .../res/layout/activity_sample_crossfader.xml | 3 +- .../res/layout/activity_sample_fragment.xml | 3 +- .../res/layout/activity_sample_fullscreen.xml | 3 +- .../main/res/layout/activity_sample_nav.xml | 3 +- app/src/main/res/values/themes.xml | 27 +++----------- build.gradle | 6 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- .../model/ProfileSettingDrawerItem.kt | 7 ++-- .../materialdrawer/util/DrawerUtils.kt | 2 +- .../com/mikepenz/materialdrawer/util/Utils.kt | 31 +++++++++------- .../main/res/color/color_drawer_item_text.xml | 5 +++ .../layout/material_drawer_item_divider.xml | 2 ++ .../material_drawer_item_expandable.xml | 6 ++-- .../material_drawer_item_expandable_badge.xml | 8 ++--- .../layout/material_drawer_item_primary.xml | 4 +-- .../layout/material_drawer_item_profile.xml | 22 ++++++------ .../material_drawer_item_profile_setting.xml | 16 +++++---- .../layout/material_drawer_item_secondary.xml | 4 +-- .../material_drawer_item_secondary_switch.xml | 4 +-- .../material_drawer_item_secondary_toggle.xml | 4 +-- .../layout/material_drawer_item_section.xml | 8 +++-- .../layout/material_drawer_item_switch.xml | 4 +-- .../layout/material_drawer_item_toggle.xml | 4 +-- materialdrawer/src/main/res/values/dimens.xml | 36 ++++++++++--------- materialdrawer/src/main/res/values/styles.xml | 30 +++++----------- 29 files changed, 132 insertions(+), 143 deletions(-) create mode 100644 materialdrawer/src/main/res/color/color_drawer_item_text.xml diff --git a/README.md b/README.md index f510421bf..ec4bf228b 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,8 @@ ## Latest releases đź›  -- Kotlin && New | [v8.4.5](https://github.com/mikepenz/MaterialDrawer/tree/v8.4.5) -- Kotlin | [v7.0.0](https://github.com/mikepenz/MaterialDrawer/tree/v7.0.0) | (Builder approach like v6.x) +- Kotlin && Material 3 | [v9.0.0-a01](https://github.com/mikepenz/MaterialDrawer/tree/v9.0.0-a01) +- Kotlin | [v8.4.5](https://github.com/mikepenz/MaterialDrawer/tree/v8.4.5) - Java && AndroidX | [v6.1.2](https://github.com/mikepenz/MaterialDrawer/tree/v6.1.2) - Java && AppCompat | [v6.0.9](https://github.com/mikepenz/MaterialDrawer/tree/v6.0.9) @@ -64,7 +64,7 @@ implementation "com.mikepenz:materialdrawer:${lastestMaterialDrawerRelease}" implementation "androidx.appcompat:appcompat:${versions.appcompat}" implementation "androidx.recyclerview:recyclerview:${versions.recyclerView}" implementation "androidx.annotation:annotation:${versions.annotation}" -implementation "com.google.android.material:material:${versions.material}" +implementation "com.google.android.material:material:1.5.0-alpha05" // requires at least 1.5.0-x implementation "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}" // Add for NavController support @@ -100,7 +100,7 @@ The `MaterialDrawerSliderView` has to be provided as child of the `DrawerLayout` ### 3. Add the `DrawerStyle` to your theme ```xml - // define a custom header style @@ -289,7 +289,7 @@ Create your custom style. If you don't need a custom theme see the next section, // define the custom styles for the theme - - - - + - - - - - - \ No newline at end of file From d4b66b0f67ef8ddba2c6197d14e00ae372493ede Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Fri, 29 Oct 2021 10:39:02 +0200 Subject: [PATCH 02/20] - add proper spacing if no icon provided --- .../model/BaseDescribeableDrawerItem.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/materialdrawer/src/main/java/com/mikepenz/materialdrawer/model/BaseDescribeableDrawerItem.kt b/materialdrawer/src/main/java/com/mikepenz/materialdrawer/model/BaseDescribeableDrawerItem.kt index e0a48f596..3ec8f072c 100644 --- a/materialdrawer/src/main/java/com/mikepenz/materialdrawer/model/BaseDescribeableDrawerItem.kt +++ b/materialdrawer/src/main/java/com/mikepenz/materialdrawer/model/BaseDescribeableDrawerItem.kt @@ -3,7 +3,10 @@ package com.mikepenz.materialdrawer.model import android.content.Context import android.content.res.ColorStateList import android.view.View +import androidx.core.view.isVisible +import androidx.core.view.updatePadding import com.google.android.material.shape.ShapeAppearanceModel +import com.mikepenz.materialdrawer.R import com.mikepenz.materialdrawer.holder.ImageHolder import com.mikepenz.materialdrawer.holder.StringHolder import com.mikepenz.materialdrawer.model.interfaces.Describable @@ -72,6 +75,14 @@ abstract class BaseDescribeableDrawerItem : BaseDrawerIt ImageHolder.applyMultiIconTo(icon, selectedIcon, iconColor, isIconTinted, viewHolder.icon) } + if (viewHolder.icon.isVisible) { + viewHolder.name.updatePadding(left = 0) + viewHolder.description.updatePadding(left = 0) + } else { + viewHolder.name.updatePadding(left = ctx.resources.getDimensionPixelSize(R.dimen.material_drawer_item_primary_icon_padding_left)) + viewHolder.description.updatePadding(left = ctx.resources.getDimensionPixelSize(R.dimen.material_drawer_item_primary_icon_padding_left)) + } + //for android API 17 --> Padding not applied via xml viewHolder.view.setDrawerVerticalPadding(level) From 47d54c25f8b5454f0093cfc18b2e28126f63a54e Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Fri, 29 Oct 2021 10:44:45 +0200 Subject: [PATCH 03/20] - remove semicolon --- .../java/com/mikepenz/materialdrawer/app/CustomApplication.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/mikepenz/materialdrawer/app/CustomApplication.kt b/app/src/main/java/com/mikepenz/materialdrawer/app/CustomApplication.kt index 38ceb0581..ed7bc3073 100644 --- a/app/src/main/java/com/mikepenz/materialdrawer/app/CustomApplication.kt +++ b/app/src/main/java/com/mikepenz/materialdrawer/app/CustomApplication.kt @@ -25,7 +25,7 @@ class CustomApplication : MultiDexApplication() { Iconics.init(this) - DynamicColors.applyToActivitiesIfAvailable(this); + DynamicColors.applyToActivitiesIfAvailable(this) //initialize and create the image loader logic /* From 8c7df7c29ce2d6360c4f1f4e5cdc6615c5e69962 Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Fri, 29 Oct 2021 11:28:23 +0200 Subject: [PATCH 04/20] - [release] v9.0.0-a01 --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index f7162c897..a61cb2d48 100644 --- a/build.gradle +++ b/build.gradle @@ -3,8 +3,8 @@ buildscript { ext { release = [ - versionName: "8.4.5", - versionCode: 8045 + versionName: "9.0.0-a01", + versionCode: 9000 ] setup = [ From de2873a03800fc685ba5b121313dd771c0ed2447 Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Fri, 5 Nov 2021 13:40:33 +0100 Subject: [PATCH 05/20] - enhance layouts to better handle the spacings for the badge in Material3 themed items - add padding top and bottom for drawer items --- README.md | 4 + .../materialdrawer/app/DrawerActivity.kt | 147 +++++++++++++----- app/src/main/res/layout/activity_sample.xml | 1 - .../material_drawer_item_primary_centered.xml | 4 +- app/src/main/res/values/themes.xml | 1 - build.gradle | 8 +- .../widget/MaterialDrawerSliderView.kt | 3 +- .../layout/material_drawer_item_primary.xml | 4 +- .../material_drawer_item_profile_setting.xml | 4 +- .../layout/material_drawer_item_secondary.xml | 4 +- .../layout/material_drawer_recycler_view.xml | 3 + materialdrawer/src/main/res/values/dimens.xml | 1 + 12 files changed, 128 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index ec4bf228b..2a67808f6 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,10 @@ The `MaterialDrawerSliderView` has to be provided as child of the `DrawerLayout` Great. Your drawer is now ready to use. +### Note + +> Using v9.x with Material 3 theming requires a `Material3` theme as base for the activity. + # Additional Setup ### Add items and adding some functionality diff --git a/app/src/main/java/com/mikepenz/materialdrawer/app/DrawerActivity.kt b/app/src/main/java/com/mikepenz/materialdrawer/app/DrawerActivity.kt index d08482b7c..c672f6998 100755 --- a/app/src/main/java/com/mikepenz/materialdrawer/app/DrawerActivity.kt +++ b/app/src/main/java/com/mikepenz/materialdrawer/app/DrawerActivity.kt @@ -42,16 +42,31 @@ class DrawerActivity : AppCompatActivity() { supportActionBar?.setDisplayHomeAsUpEnabled(false) supportActionBar?.setHomeButtonEnabled(true) - actionBarDrawerToggle = ActionBarDrawerToggle(this, binding.root, binding.toolbar, com.mikepenz.materialdrawer.R.string.material_drawer_open, com.mikepenz.materialdrawer.R.string.material_drawer_close) + actionBarDrawerToggle = ActionBarDrawerToggle( + this, + binding.root, + binding.toolbar, + com.mikepenz.materialdrawer.R.string.material_drawer_open, + com.mikepenz.materialdrawer.R.string.material_drawer_close + ) binding.root.addDrawerListener(actionBarDrawerToggle) // Create a few sample profile // NOTE you have to define the loader logic too. See the CustomApplication for more details - val profile = ProfileDrawerItem().apply { nameText = "Mike Penz"; descriptionText = "mikepenz@gmail.com"; iconUrl = "https://avatars3.githubusercontent.com/u/1476232?v=3&s=460"; identifier = 100 } - val profile2 = ProfileDrawerItem().apply { nameText = "Demo User"; descriptionText = "demo@github.com"; iconUrl = "https://avatars2.githubusercontent.com/u/3597376?v=3&s=460"; identifier = 101 } - val profile3 = ProfileDrawerItem().apply { nameText = "Max Muster"; descriptionText = "max.mustermann@gmail.com"; iconRes = R.drawable.profile2; identifier = 102 } - val profile4 = ProfileDrawerItem().apply { nameText = "Felix House"; descriptionText = "felix.house@gmail.com"; iconRes = R.drawable.profile3; identifier = 103 } - val profile5 = ProfileDrawerItem().apply { nameText = "Mr. X"; descriptionText = "mister.x.super@gmail.com"; iconRes = R.drawable.profile4; identifier = 104 } + val profile = ProfileDrawerItem().apply { + nameText = "Mike Penz"; descriptionText = "mikepenz@gmail.com"; iconUrl = "https://avatars3.githubusercontent.com/u/1476232?v=3&s=460"; identifier = + 100 + } + val profile2 = ProfileDrawerItem().apply { + nameText = "Demo User"; descriptionText = "demo@github.com"; iconUrl = "https://avatars2.githubusercontent.com/u/3597376?v=3&s=460"; identifier = + 101 + } + val profile3 = + ProfileDrawerItem().apply { nameText = "Max Muster"; descriptionText = "max.mustermann@gmail.com"; iconRes = R.drawable.profile2; identifier = 102 } + val profile4 = + ProfileDrawerItem().apply { nameText = "Felix House"; descriptionText = "felix.house@gmail.com"; iconRes = R.drawable.profile3; identifier = 103 } + val profile5 = + ProfileDrawerItem().apply { nameText = "Mr. X"; descriptionText = "mister.x.super@gmail.com"; iconRes = R.drawable.profile4; identifier = 104 } val profile6 = ProfileDrawerItem().apply { nameText = "Batman"; descriptionText = "batman@gmail.com"; iconRes = R.drawable.profile5; identifier = 105; badgeText = "123" badgeStyle = BadgeStyle().apply { @@ -64,22 +79,28 @@ class DrawerActivity : AppCompatActivity() { headerView = AccountHeaderView(this).apply { attachToSliderView(binding.slider) addProfiles( - profile, - profile2, - profile3, - profile4, - profile5, - profile6, - //don't ask but google uses 14dp for the add account icon in gmail but 20dp for the normal icons (like manage account) - ProfileSettingDrawerItem().apply { nameText = "Add Account"; descriptionText = "Add new GitHub Account"; iconDrawable = IconicsDrawable(context, GoogleMaterial.Icon.gmd_add).apply { actionBar(); paddingDp = 5 }.mutate(); isIconTinted = true; identifier = PROFILE_SETTING.toLong() }, - ProfileSettingDrawerItem().apply { nameText = "Manage Account"; iconicsIcon = GoogleMaterial.Icon.gmd_settings; identifier = 100001 } + profile, + profile2, + profile3, + profile4, + profile5, + profile6, + //don't ask but google uses 14dp for the add account icon in gmail but 20dp for the normal icons (like manage account) + ProfileSettingDrawerItem().apply { + nameText = "Add Account"; descriptionText = "Add new GitHub Account"; iconDrawable = + IconicsDrawable(context, GoogleMaterial.Icon.gmd_add).apply { actionBar(); paddingDp = 5 }.mutate(); isIconTinted = true; identifier = + PROFILE_SETTING.toLong() + }, + ProfileSettingDrawerItem().apply { nameText = "Manage Account"; iconicsIcon = GoogleMaterial.Icon.gmd_settings; identifier = 100001 } ) onAccountHeaderListener = { view, profile, current -> //sample usage of the onProfileChanged listener //if the clicked item has the identifier 1 add a new profile ;) if (profile is IDrawerItem<*> && profile.identifier == PROFILE_SETTING.toLong()) { val count = 100 + (profiles?.size ?: 0) + 1 - val newProfile = ProfileDrawerItem().withNameShown(true).withName("Batman$count").withEmail("batman$count@gmail.com").withIcon(R.drawable.profile5).withIdentifier(count.toLong()) + val newProfile = + ProfileDrawerItem().withNameShown(true).withName("Batman$count").withEmail("batman$count@gmail.com").withIcon(R.drawable.profile5) + .withIdentifier(count.toLong()) profiles?.let { //we know that there are 2 setting elements. set the new profile above them ;) addProfile(newProfile, it.size - 2) @@ -94,27 +115,74 @@ class DrawerActivity : AppCompatActivity() { binding.slider.apply { addItems( - PrimaryDrawerItem().apply { nameRes = R.string.drawer_item_compact_header; descriptionRes = R.string.drawer_item_compact_header_desc; iconicsIcon = GoogleMaterial.Icon.gmd_brightness_5; isSelectable = false; identifier = 1 }, - PrimaryDrawerItem().apply { nameRes = R.string.drawer_item_action_bar_drawer; descriptionRes = R.string.drawer_item_action_bar_drawer_desc; iconicsIcon = FontAwesome.Icon.faw_home; isSelectable = false; identifier = 2 }, - PrimaryDrawerItem().apply { nameRes = R.string.drawer_item_multi_drawer; descriptionRes = R.string.drawer_item_multi_drawer_desc; iconicsIcon = FontAwesome.Icon.faw_gamepad; isSelectable = false; identifier = 3 }, - PrimaryDrawerItem().apply { nameRes = R.string.drawer_item_advanced_drawer; descriptionRes = R.string.drawer_item_advanced_drawer_desc; iconicsIcon = GoogleMaterial.Icon.gmd_adb; isSelectable = false; identifier = 5 }, - PrimaryDrawerItem().apply { nameRes = R.string.drawer_item_embedded_drawer; descriptionRes = R.string.drawer_item_embedded_drawer_desc; iconicsIcon = GoogleMaterial.Icon.gmd_battery_full; isSelectable = false; identifier = 7 }, - PrimaryDrawerItem().apply { nameRes = R.string.drawer_item_fullscreen_drawer; descriptionRes = R.string.drawer_item_fullscreen_drawer_desc; iconicsIcon = GoogleMaterial.Icon.gmd_label; isSelectable = false; identifier = 8 }, - PrimaryDrawerItem().apply { nameRes = R.string.drawer_item_menu_drawer; descriptionRes = R.string.drawer_item_menu_drawer_desc; iconicsIcon = GoogleMaterial.Icon.gmd_filter_list; isSelectable = false; identifier = 10 }, - PrimaryDrawerItem().apply { nameRes = R.string.drawer_item_mini_drawer; descriptionRes = R.string.drawer_item_mini_drawer_desc; iconicsIcon = GoogleMaterial.Icon.gmd_battery_charging_full; isSelectable = false; identifier = 11 }, - PrimaryDrawerItem().apply { nameRes = R.string.drawer_item_fragment_drawer; descriptionRes = R.string.drawer_item_fragment_drawer_desc; iconicsIcon = GoogleMaterial.Icon.gmd_disc_full; isSelectable = false; identifier = 12 }, - PrimaryDrawerItem().apply { nameRes = R.string.drawer_item_collapsing_toolbar_drawer; descriptionRes = R.string.drawer_item_collapsing_toolbar_drawer_desc; iconicsIcon = GoogleMaterial.Icon.gmd_camera_rear; isSelectable = false; identifier = 13 }, - PrimaryDrawerItem().apply { nameRes = R.string.drawer_item_persistent_compact_header; descriptionRes = R.string.drawer_item_persistent_compact_header_desc; iconicsIcon = GoogleMaterial.Icon.gmd_brightness_5; isSelectable = false; identifier = 14 }, - PrimaryDrawerItem().apply { nameRes = R.string.drawer_item_crossfade_drawer_layout_drawer; descriptionRes = R.string.drawer_item_crossfade_drawer_layout_drawer_desc; iconicsIcon = GoogleMaterial.Icon.gmd_format_bold; isSelectable = false; identifier = 15 }, - PrimaryDrawerItem().apply { nameRes = R.string.drawer_item_navigation_drawer; descriptionRes = R.string.drawer_item_navigation_drawer_desc; iconicsIcon = GoogleMaterial.Icon.gmd_navigation; isSelectable = false; identifier = 1305 }, - ExpandableBadgeDrawerItem().apply { - nameText = "Collapsable Badge"; iconicsIcon = GoogleMaterial.Icon.gmd_format_bold; identifier = 18; isSelectable = false; badge = StringHolder("100") - badgeStyle = BadgeStyle().apply { textColor = ColorHolder.fromColor(Color.WHITE); color = ColorHolder.fromColorRes(R.color.colorAccent) } - subItems = mutableListOf( - SecondaryDrawerItem().apply { nameText = "CollapsableItem"; level = 2; iconicsIcon = GoogleMaterial.Icon.gmd_format_bold; identifier = 2000 }, - SecondaryDrawerItem().apply { nameText = "CollapsableItem 2"; level = 2; iconicsIcon = GoogleMaterial.Icon.gmd_format_bold; identifier = 2001 } - ) - }, + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_item_compact_header; descriptionRes = R.string.drawer_item_compact_header_desc; iconicsIcon = + GoogleMaterial.Icon.gmd_brightness_5; isSelectable = false; identifier = 1 + }, + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_item_action_bar_drawer; descriptionRes = R.string.drawer_item_action_bar_drawer_desc; iconicsIcon = + FontAwesome.Icon.faw_home; isSelectable = false; identifier = 2 + }, + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_item_multi_drawer; descriptionRes = R.string.drawer_item_multi_drawer_desc; iconicsIcon = + FontAwesome.Icon.faw_gamepad; isSelectable = false; identifier = 3 + }, + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_item_advanced_drawer; descriptionRes = R.string.drawer_item_advanced_drawer_desc; iconicsIcon = + GoogleMaterial.Icon.gmd_adb; isSelectable = false; identifier = 5 + }, + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_item_embedded_drawer; descriptionRes = R.string.drawer_item_embedded_drawer_desc; iconicsIcon = + GoogleMaterial.Icon.gmd_battery_full; isSelectable = false; identifier = 7 + }, + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_item_fullscreen_drawer; descriptionRes = R.string.drawer_item_fullscreen_drawer_desc; iconicsIcon = + GoogleMaterial.Icon.gmd_label; isSelectable = false; identifier = 8 + }, + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_item_menu_drawer; descriptionRes = R.string.drawer_item_menu_drawer_desc; iconicsIcon = + GoogleMaterial.Icon.gmd_filter_list; isSelectable = false; identifier = 10 + }, + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_item_mini_drawer; descriptionRes = R.string.drawer_item_mini_drawer_desc; iconicsIcon = + GoogleMaterial.Icon.gmd_battery_charging_full; isSelectable = false; identifier = 11 + }, + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_item_fragment_drawer; descriptionRes = R.string.drawer_item_fragment_drawer_desc; iconicsIcon = + GoogleMaterial.Icon.gmd_disc_full; isSelectable = false; identifier = 12 + }, + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_item_collapsing_toolbar_drawer; descriptionRes = + R.string.drawer_item_collapsing_toolbar_drawer_desc; iconicsIcon = GoogleMaterial.Icon.gmd_camera_rear; isSelectable = false; identifier = + 13 + }, + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_item_persistent_compact_header; descriptionRes = + R.string.drawer_item_persistent_compact_header_desc; iconicsIcon = GoogleMaterial.Icon.gmd_brightness_5; isSelectable = false; identifier = + 14 + }, + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_item_crossfade_drawer_layout_drawer; descriptionRes = + R.string.drawer_item_crossfade_drawer_layout_drawer_desc; iconicsIcon = GoogleMaterial.Icon.gmd_format_bold; isSelectable = + false; identifier = 15 + }, + PrimaryDrawerItem().apply { + nameRes = R.string.drawer_item_navigation_drawer; descriptionRes = R.string.drawer_item_navigation_drawer_desc; iconicsIcon = + GoogleMaterial.Icon.gmd_navigation; isSelectable = false; identifier = 1305 + }, + ExpandableBadgeDrawerItem().apply { + nameText = "Collapsable Badge"; iconicsIcon = GoogleMaterial.Icon.gmd_format_bold; identifier = 18; isSelectable = false; badge = + StringHolder("100") + badgeStyle = BadgeStyle().apply { textColor = ColorHolder.fromColor(Color.WHITE); color = ColorHolder.fromColorRes(R.color.colorAccent) } + subItems = mutableListOf( + SecondaryDrawerItem().apply { + nameText = "CollapsableItem"; level = 2; iconicsIcon = GoogleMaterial.Icon.gmd_format_bold; identifier = 2000 + }, + SecondaryDrawerItem().apply { + nameText = "CollapsableItem 2"; level = 2; iconicsIcon = GoogleMaterial.Icon.gmd_format_bold; identifier = 2001 + } + ) + }, ExpandableDrawerItem().apply { nameText = "Collapsable"; iconicsIcon = GoogleMaterial.Icon.gmd_filter_list; identifier = 19; isSelectable = false subItems = mutableListOf( @@ -166,10 +234,7 @@ class DrawerActivity : AppCompatActivity() { drawerItem.identifier == 14L -> intent = Intent(this@DrawerActivity, PersistentDrawerActivity::class.java) drawerItem.identifier == 15L -> intent = Intent(this@DrawerActivity, CrossfadeDrawerLayoutActvitiy::class.java) drawerItem.identifier == 1305L -> intent = Intent(this@DrawerActivity, NavControllerActivity::class.java) - drawerItem.identifier == 20L -> intent = LibsBuilder() - .withFields(R.string::class.java.fields) - .withLicenseShown(true) - .intent(this@DrawerActivity) + drawerItem.identifier == 20L -> intent = LibsBuilder().intent(this@DrawerActivity) } if (intent != null) { this@DrawerActivity.startActivity(intent) diff --git a/app/src/main/res/layout/activity_sample.xml b/app/src/main/res/layout/activity_sample.xml index e20eaa899..115d92ed1 100755 --- a/app/src/main/res/layout/activity_sample.xml +++ b/app/src/main/res/layout/activity_sample.xml @@ -15,7 +15,6 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:elevation="4dp" - android:theme="@style/ThemeOverlay.Material3.Dark" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> diff --git a/app/src/main/res/layout/material_drawer_item_primary_centered.xml b/app/src/main/res/layout/material_drawer_item_primary_centered.xml index 2bc542fd1..76b80d52e 100755 --- a/app/src/main/res/layout/material_drawer_item_primary_centered.xml +++ b/app/src/main/res/layout/material_drawer_item_primary_centered.xml @@ -59,8 +59,8 @@ android:layout_height="wrap_content" android:layout_marginStart="@dimen/material_drawer_padding" android:layout_marginLeft="@dimen/material_drawer_padding" - android:layout_marginEnd="0dp" - android:layout_marginRight="0dp" + android:layout_marginEnd="@dimen/material_drawer_padding" + android:layout_marginRight="@dimen/material_drawer_padding" android:fontFamily="sans-serif" android:gravity="center" android:lines="1" diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index d684a7ba1..21b25b36b 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -3,7 +3,6 @@