Skip to content

Commit

Permalink
Fix dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
whalemare committed May 4, 2018
1 parent 94e97e7 commit 3cbbaf2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions sheetmenu/src/main/java/ru/whalemare/sheetmenu/SheetMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ open class SheetMenu(
dialog.show()
}

open protected fun processGrid(root: View) {
if (root.findViewById(R.id.text_title).visibility != View.VISIBLE) {
protected open fun processGrid(root: View) {
if (root.findViewById<View>(R.id.text_title).visibility != View.VISIBLE) {
if (layoutManager is GridLayoutManager) {
root.marginTop(24)
}
}
}

open protected fun processTitle(textTitle: TextView) {
protected open fun processTitle(textTitle: TextView) {
if (titleId > 0) {
textTitle.setText(titleId)
textTitle.visibility = View.VISIBLE
Expand All @@ -71,7 +71,7 @@ open class SheetMenu(
}
}

open protected fun processRecycler(recycler: RecyclerView, dialog: BottomSheetDialog) {
protected open fun processRecycler(recycler: RecyclerView, dialog: BottomSheetDialog) {
if (menu > 0) {
if (layoutManager == null) {
layoutManager = LinearLayoutManager(recycler.context, LinearLayoutManager.VERTICAL, false)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ru.whalemare.sheetmenu.extension

import android.annotation.SuppressLint
import android.content.Context
import android.support.annotation.MenuRes
import android.support.v7.view.SupportMenuInflater
Expand All @@ -17,10 +18,11 @@ import android.view.ViewGroup
*/
fun Menu.toList(): List<MenuItem> {
val menuItems = ArrayList<MenuItem>(this.size())
(0..this.size() - 1).mapTo(menuItems) { this.getItem(it) }
(0 until this.size()).mapTo(menuItems) { this.getItem(it) }
return menuItems
}

@SuppressLint("RestrictedApi")
fun Context.inflate(@MenuRes menuRes: Int): Menu {
val menu = MenuBuilder(this)
val menuInflater = SupportMenuInflater(this)
Expand Down

0 comments on commit 3cbbaf2

Please sign in to comment.