Android/Kotlin Series: Make your Popup Menu Style Great Again

How we change style of popup menu?

<style name="BasePopupMenu" parent="Widget.AppCompat.PopupMenu">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_gravity">center</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">@color/textColorPrimary</item>
<item name="android:textSize">@dimen/text_size_normal</item>
<item name="android:fontFamily">@font/comfortaa_regular</item>
</style>
val wrapper = ContextThemeWrapper(this, R.style.BasePopupMenu)
val popup = PopupMenu(wrapper, view)

--

--

--

🎓 A true Software Engineer aspires to build a strong community and help other people grow up.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Unity3D: Unable to list target platforms. When I try to build to Android

Implementing an Active Network-State Monitor in Android

Turn OFF the Quick Open Camera Setting on Android 12

Why the Dagger Needs a New Hilt?

Kotlin data class copy and equal behavior need to know.

Android: Optimizing Apps in your hands? — Part 2

A little reflection about coroutines

Android Stack Weekly — Issue #13

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Hau NGUYEN (Leo)

Hau NGUYEN (Leo)

🎓 A true Software Engineer aspires to build a strong community and help other people grow up.

More from Medium

Android — Shortcut Manager

Since November 19, 2019 at 7 pm German local time I was busy with the development for the…

Why You Shouldn’t Fall for the iPhone vs. Android Debate

Solve Problem: Duplicate attribute ‘{http://schemas.android.com/apk/res/android}textColor'.