Skip to content

Commit

Permalink
[YDS-BottomBar] selectedIndex의 매직 넘버를 기호 상수로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ByeongsuPark committed May 24, 2022
1 parent 5d27460 commit d3dea74
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ class BottomBar @JvmOverloads constructor(
tabList.map { it.primaryName }
.indexOf(primaryName)
} catch (e: Exception) {
-1
INVALID_SELECTED_INDEX
}

if (selectedIndex != -1) {
if (selectedIndex != INVALID_SELECTED_INDEX) {
this.bottomTabType.set(selectedIndex)
tabClickListener?.tabChanged(primaryName)

Expand Down Expand Up @@ -145,6 +145,8 @@ class BottomBar @JvmOverloads constructor(
}

companion object {
private const val INVALID_SELECTED_INDEX = -1

@JvmStatic
@BindingAdapter("setTabClickListener")
fun setTabClickListener(bottomBar: BottomBar, tabClickListener: TabClickListener) {
Expand Down

0 comments on commit d3dea74

Please sign in to comment.