Skip to content

Commit

Permalink
Merge pull request #465 from TeamNado-Sunbae/fix/464_dropdown_align
Browse files Browse the repository at this point in the history
#464 [FIX] drop down align
  • Loading branch information
gimangi authored Mar 11, 2022
2 parents ccb5ea6 + 7e780d7 commit 3ec7e85
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import androidx.recyclerview.widget.RecyclerView
import com.nadosunbae_android.app.R
import com.nadosunbae_android.domain.model.main.SelectableData
import kotlinx.coroutines.selects.select
import timber.log.Timber


/*
Expand Down Expand Up @@ -88,7 +89,12 @@ private fun showCustomDropDownByContext(viewModel: DropDownSelectableViewModel,

val inflater = layoutInflater.inflate(R.layout.view_drop_down, null, false)

val popup = PopupWindow(inflater, width ?: RelativeLayout.LayoutParams.WRAP_CONTENT, height ?: RelativeLayout.LayoutParams.WRAP_CONTENT, true)
val popup = PopupWindow(
inflater,
width ?: RelativeLayout.LayoutParams.WRAP_CONTENT,
height ?: RelativeLayout.LayoutParams.WRAP_CONTENT,
true
)

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
popup.elevation = 10F
Expand All @@ -114,7 +120,8 @@ private fun showCustomDropDownByContext(viewModel: DropDownSelectableViewModel,
adapter.notifyDataSetChanged()

popup.overlapAnchor = overlapAnchor
popup.showAsDropDown(view, xOff ?: 0, yOff ?: 0)

popup.showAsDropDown(view, xOff ?: 0, yOff ?: 0, Gravity.RIGHT)
}

interface DropDownSelectableViewModel {
Expand Down

0 comments on commit 3ec7e85

Please sign in to comment.