Skip to content

Commit

Permalink
Prepared release 3.4.0.
Browse files Browse the repository at this point in the history
Updated README, CHANGELOG and generated new docs.
Minor test & lint fixes
  • Loading branch information
Piotr Zawadzki authored and zawadz88 committed May 2, 2019
1 parent b25d413 commit ab65b75
Show file tree
Hide file tree
Showing 23 changed files with 313 additions and 46 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [3.4.0]
### Added
- An option to display an icon at the end of each item which indicates a nested submenu.
- `viewBoundCallback` added to default items as well
- Allow customizing default popup style via theme attribute (#53, thanks to @Tunous)
- Make it possible to dismiss popup from `viewBoundCallback` (#57, thanks to @Tunous)

### Fixed
- Disabled `clipToPadding` on menu `RecyclerView ` (#54, thanks to @Tunous)
Expand Down Expand Up @@ -94,7 +98,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
Initial release of the library.

[Unreleased]: https://github.com/zawadz88/MaterialPopupMenu/compare/3.3.0...HEAD
[Unreleased]: https://github.com/zawadz88/MaterialPopupMenu/compare/3.4.0...HEAD
[3.4.0]: https://github.com/zawadz88/MaterialPopupMenu/compare/3.3.0...3.4.0
[3.3.0]: https://github.com/zawadz88/MaterialPopupMenu/compare/3.2.0...3.3.0
[3.2.0]: https://github.com/zawadz88/MaterialPopupMenu/compare/3.1.0...3.2.0
[3.1.0]: https://github.com/zawadz88/MaterialPopupMenu/compare/3.0.0...3.1.0
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This library allows to create simple popup menus programmatically with a nice [t

## Download (from JCenter)
```groovy
implementation 'com.github.zawadz88.materialpopupmenu:material-popup-menu:3.3.0'
implementation 'com.github.zawadz88.materialpopupmenu:material-popup-menu:3.4.0'
```

## Getting started
Expand Down Expand Up @@ -87,10 +87,12 @@ To create a popup menu with 2 sections and a section title in the second one:
* Custom view items
* Setting item label text color & icon color for each individual item
* Setting custom popup background color
* Customizing default popup style via theme attribute
* Adding additional offsets to where the dialog should be shown
* Keeping popup open after clicking on item
* Dimming background behind popup
* Customizing popup padding
* Displaying an icon at the end of each item which indicates a nested submenu

## Custom views
<img src ="./art/sample_custom_items.png" width="360" />
Expand Down
8 changes: 8 additions & 0 deletions docs/material-popup-menu/alltypes/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ <h3>All Types</h3>
RecyclerView. Each section can have an arbitrary number of items.</p>
</td>
</tr>
<tr>
<td>
<a href="../com.github.zawadz88.materialpopupmenu/-view-bound-callback/index.html">com.github.zawadz88.materialpopupmenu.ViewBoundCallback</a></td>
<td>
<p>Callback to be invoked once the custom item view gets created and bound.
It is to be used when some views inside need to be updated once inflated.</p>
</td>
</tr>
</tbody>
</table>
</BODY>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<a href="../../index.html">material-popup-menu</a>&nbsp;/&nbsp;<a href="../index.html">androidx.appcompat.widget</a>&nbsp;/&nbsp;<a href="index.html">MaterialRecyclerViewPopupWindow</a>&nbsp;/&nbsp;<a href="./-init-.html">&lt;init&gt;</a><br/>
<br/>
<h1>&lt;init&gt;</h1>
<a name="androidx.appcompat.widget.MaterialRecyclerViewPopupWindow$&lt;init&gt;(android.content.Context, kotlin.Int, kotlin.Int)"></a>
<code><span class="identifier">MaterialRecyclerViewPopupWindow</span><span class="symbol">(</span><span class="identifier" id="androidx.appcompat.widget.MaterialRecyclerViewPopupWindow$<init>(android.content.Context, kotlin.Int, kotlin.Int)/context">context</span><span class="symbol">:</span>&nbsp;<a href="https://developer.android.com/reference/android/content/Context.html"><span class="identifier">Context</span></a><span class="symbol">, </span><span class="identifier" id="androidx.appcompat.widget.MaterialRecyclerViewPopupWindow$<init>(android.content.Context, kotlin.Int, kotlin.Int)/dropDownGravity">dropDownGravity</span><span class="symbol">:</span>&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html"><span class="identifier">Int</span></a><span class="symbol">, </span><span class="identifier">@StyleRes</span> <span class="identifier" id="androidx.appcompat.widget.MaterialRecyclerViewPopupWindow$<init>(android.content.Context, kotlin.Int, kotlin.Int)/defStyleRes">defStyleRes</span><span class="symbol">:</span>&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html"><span class="identifier">Int</span></a><span class="symbol">)</span></code>
<a name="androidx.appcompat.widget.MaterialRecyclerViewPopupWindow$&lt;init&gt;(android.content.Context, kotlin.Int)"></a>
<code><span class="identifier">MaterialRecyclerViewPopupWindow</span><span class="symbol">(</span><span class="identifier" id="androidx.appcompat.widget.MaterialRecyclerViewPopupWindow$<init>(android.content.Context, kotlin.Int)/context">context</span><span class="symbol">:</span>&nbsp;<a href="https://developer.android.com/reference/android/content/Context.html"><span class="identifier">Context</span></a><span class="symbol">, </span><span class="identifier" id="androidx.appcompat.widget.MaterialRecyclerViewPopupWindow$<init>(android.content.Context, kotlin.Int)/dropDownGravity">dropDownGravity</span><span class="symbol">:</span>&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html"><span class="identifier">Int</span></a><span class="symbol">)</span></code>
<p>A more Material version of <a href="#">ListPopupWindow</a> based on <a href="#">RecyclerView</a>.</p>
<p>Its width is a multiple of 56dp units with a minimum of 112dp and a maximum of 280dp
as stated in the Material documentation</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h3>Constructors</h3>
<p><a href="-init-.html">&lt;init&gt;</a></p>
</td>
<td>
<code><span class="identifier">MaterialRecyclerViewPopupWindow</span><span class="symbol">(</span><span class="identifier" id="androidx.appcompat.widget.MaterialRecyclerViewPopupWindow$<init>(android.content.Context, kotlin.Int, kotlin.Int)/context">context</span><span class="symbol">:</span>&nbsp;<a href="https://developer.android.com/reference/android/content/Context.html"><span class="identifier">Context</span></a><span class="symbol">, </span><span class="identifier" id="androidx.appcompat.widget.MaterialRecyclerViewPopupWindow$<init>(android.content.Context, kotlin.Int, kotlin.Int)/dropDownGravity">dropDownGravity</span><span class="symbol">:</span>&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html"><span class="identifier">Int</span></a><span class="symbol">, </span><span class="identifier" id="androidx.appcompat.widget.MaterialRecyclerViewPopupWindow$<init>(android.content.Context, kotlin.Int, kotlin.Int)/defStyleRes">defStyleRes</span><span class="symbol">:</span>&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html"><span class="identifier">Int</span></a><span class="symbol">)</span></code>
<code><span class="identifier">MaterialRecyclerViewPopupWindow</span><span class="symbol">(</span><span class="identifier" id="androidx.appcompat.widget.MaterialRecyclerViewPopupWindow$<init>(android.content.Context, kotlin.Int)/context">context</span><span class="symbol">:</span>&nbsp;<a href="https://developer.android.com/reference/android/content/Context.html"><span class="identifier">Context</span></a><span class="symbol">, </span><span class="identifier" id="androidx.appcompat.widget.MaterialRecyclerViewPopupWindow$<init>(android.content.Context, kotlin.Int)/dropDownGravity">dropDownGravity</span><span class="symbol">:</span>&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html"><span class="identifier">Int</span></a><span class="symbol">)</span></code>
<p>A more Material version of <a href="#">ListPopupWindow</a> based on <a href="#">RecyclerView</a>.</p>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,28 @@ <h3>Properties</h3>
Defaults to <code>true</code>.</p>
</td>
</tr>
<tr>
<td>
<p><a href="view-bound-callback.html">viewBoundCallback</a></p>
</td>
<td>
<code><span class="keyword">var </span><span class="identifier">viewBoundCallback</span><span class="symbol">: </span><span class="symbol">(</span><a href="https://developer.android.com/reference/android/view/View.html"><span class="identifier">View</span></a><span class="symbol">)</span>&nbsp;<span class="symbol">-&gt;</span>&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html"><span class="identifier">Unit</span></a></code>
<p>Callback to be invoked once the item view gets created and bound.
It is to be used when some views inside need to be updated once inflated.</p>
</td>
</tr>
</tbody>
</table>
<h3>Functions</h3>
<table>
<tbody>
<tr>
<td>
<p><a href="resolve-view-bound-callback.html">resolveViewBoundCallback</a></p>
</td>
<td>
<code><span class="keyword">fun </span><span class="identifier">resolveViewBoundCallback</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><a href="../../-view-bound-callback/index.html"><span class="identifier">ViewBoundCallback</span></a></code></td>
</tr>
</tbody>
</table>
<h3>Inheritors</h3>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<HTML>
<HEAD>
<meta charset="UTF-8">
<title>MaterialPopupMenuBuilder.AbstractItemHolder.resolveViewBoundCallback - material-popup-menu</title>
<link rel="stylesheet" href="../../../../style.css">
</HEAD>
<BODY>
<a href="../../../index.html">material-popup-menu</a>&nbsp;/&nbsp;<a href="../../index.html">com.github.zawadz88.materialpopupmenu</a>&nbsp;/&nbsp;<a href="../index.html">MaterialPopupMenuBuilder</a>&nbsp;/&nbsp;<a href="index.html">AbstractItemHolder</a>&nbsp;/&nbsp;<a href="./resolve-view-bound-callback.html">resolveViewBoundCallback</a><br/>
<br/>
<h1>resolveViewBoundCallback</h1>
<a name="com.github.zawadz88.materialpopupmenu.MaterialPopupMenuBuilder.AbstractItemHolder$resolveViewBoundCallback()"></a>
<code><span class="keyword">protected</span> <span class="keyword">fun </span><span class="identifier">resolveViewBoundCallback</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><a href="../../-view-bound-callback/index.html"><span class="identifier">ViewBoundCallback</span></a></code>
</BODY>
</HTML>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<HTML>
<HEAD>
<meta charset="UTF-8">
<title>MaterialPopupMenuBuilder.AbstractItemHolder.viewBoundCallback - material-popup-menu</title>
<link rel="stylesheet" href="../../../../style.css">
</HEAD>
<BODY>
<a href="../../../index.html">material-popup-menu</a>&nbsp;/&nbsp;<a href="../../index.html">com.github.zawadz88.materialpopupmenu</a>&nbsp;/&nbsp;<a href="../index.html">MaterialPopupMenuBuilder</a>&nbsp;/&nbsp;<a href="index.html">AbstractItemHolder</a>&nbsp;/&nbsp;<a href="./view-bound-callback.html">viewBoundCallback</a><br/>
<br/>
<h1>viewBoundCallback</h1>
<a name="com.github.zawadz88.materialpopupmenu.MaterialPopupMenuBuilder.AbstractItemHolder$viewBoundCallback"></a>
<code><span class="keyword">var </span><span class="identifier">viewBoundCallback</span><span class="symbol">: </span><span class="symbol">(</span><a href="https://developer.android.com/reference/android/view/View.html"><span class="identifier">View</span></a><span class="symbol">)</span>&nbsp;<span class="symbol">-&gt;</span>&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html"><span class="identifier">Unit</span></a></code>
<p>Callback to be invoked once the item view gets created and bound.
It is to be used when some views inside need to be updated once inflated.</p>
<p>You can set this to <a href="../../-view-bound-callback/index.html">ViewBoundCallback</a> to gain access to additional
features.</p>
<p><strong>See Also</strong><br/>
<p><a href="../../-view-bound-callback/index.html">ViewBoundCallback</a></p>
</p>
</BODY>
</HTML>
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,6 @@ <h3>Properties</h3>
<p>Layout ID of the view to be used for this item.</p>
</td>
</tr>
<tr>
<td>
<p><a href="view-bound-callback.html">viewBoundCallback</a></p>
</td>
<td>
<code><span class="keyword">var </span><span class="identifier">viewBoundCallback</span><span class="symbol">: </span><span class="symbol">(</span><a href="https://developer.android.com/reference/android/view/View.html"><span class="identifier">View</span></a><span class="symbol">)</span>&nbsp;<span class="symbol">-&gt;</span>&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html"><span class="identifier">Unit</span></a></code>
<p>Callback to be invoked once the custom item view gets created and bound.
It is to be used when some views inside need to be updated once inflated.</p>
</td>
</tr>
</tbody>
</table>
<h3>Inherited Properties</h3>
Expand All @@ -70,6 +60,16 @@ <h3>Inherited Properties</h3>
Defaults to <code>true</code>.</p>
</td>
</tr>
<tr>
<td>
<p><a href="../-abstract-item-holder/view-bound-callback.html">viewBoundCallback</a></p>
</td>
<td>
<code><span class="keyword">var </span><span class="identifier">viewBoundCallback</span><span class="symbol">: </span><span class="symbol">(</span><a href="https://developer.android.com/reference/android/view/View.html"><span class="identifier">View</span></a><span class="symbol">)</span>&nbsp;<span class="symbol">-&gt;</span>&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html"><span class="identifier">Unit</span></a></code>
<p>Callback to be invoked once the item view gets created and bound.
It is to be used when some views inside need to be updated once inflated.</p>
</td>
</tr>
</tbody>
</table>
<h3>Functions</h3>
Expand All @@ -84,5 +84,17 @@ <h3>Functions</h3>
</tr>
</tbody>
</table>
<h3>Inherited Functions</h3>
<table>
<tbody>
<tr>
<td>
<p><a href="../-abstract-item-holder/resolve-view-bound-callback.html">resolveViewBoundCallback</a></p>
</td>
<td>
<code><span class="keyword">fun </span><span class="identifier">resolveViewBoundCallback</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><a href="../../-view-bound-callback/index.html"><span class="identifier">ViewBoundCallback</span></a></code></td>
</tr>
</tbody>
</table>
</BODY>
</HTML>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<HTML>
<HEAD>
<meta charset="UTF-8">
<title>MaterialPopupMenuBuilder.ItemHolder.hasNestedItems - material-popup-menu</title>
<link rel="stylesheet" href="../../../../style.css">
</HEAD>
<BODY>
<a href="../../../index.html">material-popup-menu</a>&nbsp;/&nbsp;<a href="../../index.html">com.github.zawadz88.materialpopupmenu</a>&nbsp;/&nbsp;<a href="../index.html">MaterialPopupMenuBuilder</a>&nbsp;/&nbsp;<a href="index.html">ItemHolder</a>&nbsp;/&nbsp;<a href="./has-nested-items.html">hasNestedItems</a><br/>
<br/>
<h1>hasNestedItems</h1>
<a name="com.github.zawadz88.materialpopupmenu.MaterialPopupMenuBuilder.ItemHolder$hasNestedItems"></a>
<code><span class="keyword">var </span><span class="identifier">hasNestedItems</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a></code>
<p>Optional. If set to <em>true</em> this will show a "menu-end" icon, which indicates that there might be a submenu shown.
<em>false</em> by default.</p>
</BODY>
</HTML>
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ <h3>Properties</h3>
<tbody>
<tr>
<td>
<p><a href="has-nested-items.html">hasNestedItems</a></p>
</td>
<td>
<code><span class="keyword">var </span><span class="identifier">hasNestedItems</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a></code>
<p>Optional. If set to <em>true</em> this will show a "menu-end" icon, which indicates that there might be a submenu shown.
<em>false</em> by default.</p>
</td>
</tr>
<tr>
<td>
<p><a href="icon.html">icon</a></p>
</td>
<td>
Expand Down Expand Up @@ -105,6 +115,16 @@ <h3>Inherited Properties</h3>
Defaults to <code>true</code>.</p>
</td>
</tr>
<tr>
<td>
<p><a href="../-abstract-item-holder/view-bound-callback.html">viewBoundCallback</a></p>
</td>
<td>
<code><span class="keyword">var </span><span class="identifier">viewBoundCallback</span><span class="symbol">: </span><span class="symbol">(</span><a href="https://developer.android.com/reference/android/view/View.html"><span class="identifier">View</span></a><span class="symbol">)</span>&nbsp;<span class="symbol">-&gt;</span>&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html"><span class="identifier">Unit</span></a></code>
<p>Callback to be invoked once the item view gets created and bound.
It is to be used when some views inside need to be updated once inflated.</p>
</td>
</tr>
</tbody>
</table>
<h3>Functions</h3>
Expand All @@ -119,5 +139,17 @@ <h3>Functions</h3>
</tr>
</tbody>
</table>
<h3>Inherited Functions</h3>
<table>
<tbody>
<tr>
<td>
<p><a href="../-abstract-item-holder/resolve-view-bound-callback.html">resolveViewBoundCallback</a></p>
</td>
<td>
<code><span class="keyword">fun </span><span class="identifier">resolveViewBoundCallback</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><a href="../../-view-bound-callback/index.html"><span class="identifier">ViewBoundCallback</span></a></code></td>
</tr>
</tbody>
</table>
</BODY>
</HTML>
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h3>Properties</h3>
</td>
<td>
<code><span class="keyword">var </span><span class="identifier">style</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html"><span class="identifier">Int</span></a></code>
<p>Style of the popup menu. Default is <a href="#">R.style.Widget_MPM_Menu</a>.</p>
<p>Style of the popup menu.</p>
</td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
<h1>style</h1>
<a name="com.github.zawadz88.materialpopupmenu.MaterialPopupMenuBuilder$style"></a>
<code><span class="keyword">var </span><span class="identifier">style</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html"><span class="identifier">Int</span></a></code>
<p>Style of the popup menu. Default is <a href="#">R.style.Widget_MPM_Menu</a>.</p>
<p>Style of the popup menu.</p>
<p>For dark themes you should use <a href="#">R.style.Widget_MPM_Menu_Dark</a>.</p>
<p>You can also provide your own style, however make sure that all of the attributes
that are declared in <a href="#">R.style.Widget_MPM_Menu</a> are also declared in your style.</p>
<p>Setting this to <code>0</code> will make the popup use the default style resolved based on context
passed to <a href="../-material-popup-menu/show.html">MaterialPopupMenu.show</a> function. You can customize that default style by defining
<a href="#">R.attr.materialPopupMenuStyle</a> in your theme style.</p>
<p><em>NOTE:</em> make sure that all of the attributes that are declared in <a href="#">R.style.Widget_MPM_Menu</a>
are also declared in your style.</p>
</BODY>
</HTML>
Loading

0 comments on commit ab65b75

Please sign in to comment.