I am trying to use a GitHub library (MeowBottomNavigation)in Android Studio.But its written in kotlin and i cant use the listeners in it. The only thing which is given is this
bottomNavigation.setOnShowListener {
}
bottomNavigation.setOnClickMenuListener {
}
the suggestions shows to use
(Function1)
i am not sure as to how to implement this in java . Any help will be appreciated.
I am familiar with java but the library is written in Kotlin. Is there any way to use these listeners in java?
bottomNavigation.setOnClickMenuListener(new
Function1<MeowBottomNavigation.Model, Unit>() {
@Override
public Unit invoke(MeowBottomNavigation.Model p1) {
int i = p1.getId();
switch (i){
case 4:
Toast.makeText(UserMainActivity.this, i, Toast.LENGTH_SHORT).show();
break;
case 1:
Toast.makeText(UserMainActivity.this, i, Toast.LENGTH_SHORT).show();
break;
case 2:
Toast.makeText(UserMainActivity.this, i, Toast.LENGTH_SHORT).show();
break;
case 3:
Toast.makeText(UserMainActivity.this, i, Toast.LENGTH_SHORT).show();
break;
}
return Unit.INSTANCE;
}
});