File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
sheetmenu/src/main/java/ru/whalemare/sheetmenu Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -51,15 +51,15 @@ open class SheetMenu(
5151 dialog.show()
5252 }
5353
54- open protected fun processGrid (root : View ) {
55- if (root.findViewById(R .id.text_title).visibility != View .VISIBLE ) {
54+ protected open fun processGrid (root : View ) {
55+ if (root.findViewById< View > (R .id.text_title).visibility != View .VISIBLE ) {
5656 if (layoutManager is GridLayoutManager ) {
5757 root.marginTop(24 )
5858 }
5959 }
6060 }
6161
62- open protected fun processTitle (textTitle : TextView ) {
62+ protected open fun processTitle (textTitle : TextView ) {
6363 if (titleId > 0 ) {
6464 textTitle.setText(titleId)
6565 textTitle.visibility = View .VISIBLE
@@ -71,7 +71,7 @@ open class SheetMenu(
7171 }
7272 }
7373
74- open protected fun processRecycler (recycler : RecyclerView , dialog : BottomSheetDialog ) {
74+ protected open fun processRecycler (recycler : RecyclerView , dialog : BottomSheetDialog ) {
7575 if (menu > 0 ) {
7676 if (layoutManager == null ) {
7777 layoutManager = LinearLayoutManager (recycler.context, LinearLayoutManager .VERTICAL , false )
Original file line number Diff line number Diff line change 11package ru.whalemare.sheetmenu.extension
22
3+ import android.annotation.SuppressLint
34import android.content.Context
45import android.support.annotation.MenuRes
56import android.support.v7.view.SupportMenuInflater
@@ -17,10 +18,11 @@ import android.view.ViewGroup
1718 */
1819fun Menu.toList (): List <MenuItem > {
1920 val menuItems = ArrayList <MenuItem >(this .size())
20- (0 .. this .size() - 1 ).mapTo(menuItems) { this .getItem(it) }
21+ (0 until this .size()).mapTo(menuItems) { this .getItem(it) }
2122 return menuItems
2223}
2324
25+ @SuppressLint(" RestrictedApi" )
2426fun Context.inflate (@MenuRes menuRes : Int ): Menu {
2527 val menu = MenuBuilder (this )
2628 val menuInflater = SupportMenuInflater (this )
You can’t perform that action at this time.
0 commit comments