xlmnxp / nativescript-menu

A plugin that adds a pop-up menu to NativeScript
MIT License
20 stars 8 forks source link

fix(android popup instantiation): enable design customization #14

Closed Alexander-Bliznyuk closed 5 years ago

Alexander-Bliznyuk commented 5 years ago

PR Checklist

What is the current behavior?

It's impossible to apply android styles to popup. There was a request (#1) to implement mechanism to change default look. Although such an implementation is impossible or really challenging due to popups' nature, Android provides means to style them. Here's a simple example:

res/values/styles.xml

    <style name="AppTheme" parent="AppThemeBase">       
        <item name="android:popupMenuStyle">@style/PopupMenu</item>      
    </style>    
    <style name="PopupMenu" parent="@android:style/Widget.PopupMenu">    
        <item name="android:popupBackground">#fbae17</item>    
    </style>

An Activity(instead of Application) class should be passed to PopupMenu constructor in order to apply this style.

What is the new behavior?

Popup styles take effect.

Fixes/Implements/Closes #1 .

xlmnxp commented 5 years ago

thank you, I will not close issue because I want support customize iOS

xlmnxp commented 5 years ago

thank you again

xlmnxp commented 5 years ago

📦 nativescript-menu@1.1.3 merged