You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A powerful & customizable menu implementation for android. It supports any level of nested menu structures along with custom header and footer views, and much more. Follow the steps below to import the library to your project. You will also find some sample codes.
You can use methods that follow builder pattern to set properties of different components of the menu. For example the following code snippet sets background, divider, menu icon place holder (in case a menu item does not have an icon), expand icon (for indicating submenu of a menu item), a title and finally it shows the menu. There are other constructors where you can set these properties all at once.
62
-
```
63
-
bottomSheetMenu
64
-
.menuBackground(
65
-
AppCompatResources.getDrawable(
66
-
MainActivity.this,
67
-
R.drawable.menu_bg
68
-
)
69
-
)
70
-
.dividerDrawable(
71
-
BottomSheetMenu.getSystemDefaultDivider(
72
-
MainActivity.this
73
-
)
74
-
)
75
-
.menuIconPlaceHolder(
76
-
AppCompatResources.getDrawable(
77
-
MainActivity.this,
78
-
R.drawable.ic_menu_item
79
-
)
80
-
)
81
-
.menuExpandIcon(
82
-
AppCompatResources.getDrawable(
83
-
MainActivity.this,
84
-
R.drawable.ic_arrow_forward
85
-
)
86
-
)
87
-
.menuTitle("Property Setting Demo")
88
-
.show();
89
-
```
90
-
You can obtain various default properties with the static methods available in the BottomSheetMenu class, for example ```BottomSheetMenu.getDefaultExpandIcon(context)``` returns the default drawable used as the expand icon. There are other methods for other properties as well. But you don't need to explicitly call these methods, these properties are set by default.
91
-
92
-
<br />
45
+
To create an instance do something like...
93
46
94
-
The menu supports custom header and footer views. You can select different header and footer views for different menu items, and also for initial call to ```show()```. There may be many use cases for different header and footer views, such as description of the the submenu of a menu item can be placed as the footer view. See the code snippet below to know how you can define these selectors.
zip = new AndroidZip(MainActivity.this, documentFile);
51
+
} catch (Exception e) {
52
+
e.printStackTrace();
53
+
} finally {
54
+
if(zip != null){
55
+
List<ZipEntry> entries = zip.entries();
56
+
for (int i = 0; i < entries.size(); i++) {
57
+
// do something
117
58
}
118
-
)
119
-
.menuTitle("View Selecting Demo")
120
-
.show();
59
+
}
60
+
}
121
61
```
122
-
The above code selects different views for different selected menu item(having submenu). Also, it selects an initial header view. Similarly, you can set footer views with ```footerViewSelector(...)``` method.
123
62
124
63
<br />
125
64
126
-
## Images
127
-
Here are some example images of the menu containing a header and a footer view. The one above the top divider line is the header view, and the one below the bottom divider line is the footer view. You can select your desider header or footer views, or customize the menu styles and behaviours by following the topics above. Note, the styling applied to the menu does not apply on header and footer views, they are external views and you should apply necessary styling to them before using them in the menu.
65
+
Then you can use different methods that are similar to the standard java ZipFile class. For example here are the
0 commit comments