Comments (12)
I modified MeowBottomNavigation.kt file like adding interface and that is worked in java project.
Here how i did,
declare at top level
private var mOnBottomNavigationItemClickListener: IBottomNavigationItemClickListener? = null
interface IBottomNavigationItemClickListener {
fun mOnBottomNavigationItemClickedListener(model: Model)
}
replace add method
fun add(model: Model) {
val cell = MeowBottomNavigationCell(context)
cell.apply {
val params = LinearLayout.LayoutParams(0, heightCell, 1f)
layoutParams = params
icon = model.icon
count = model.count
circleColor = [email protected]
countTextColor = [email protected]
countBackgroundColor = [email protected]
countTypeface = [email protected]
rippleColor = [email protected]
defaultIconColor = [email protected]
selectedIconColor = [email protected]
onClickListener = {
if (!cell.isEnabledCell && !isAnimating) {
show(model.id)
mOnClickedListener(model)
mOnBottomNavigationItemClickListener?.mOnBottomNavigationItemClickedListener (model)
} else {
if (callListenerWhenIsSelected) {
mOnClickedListener(model)
mOnBottomNavigationItemClickListener?.mOnBottomNavigationItemClickedListener (model)
}
}
}
disableCell()
ll_cells.addView(this)
}
cells.add(cell)
models.add(model)
}
//add this method to set listener in java
fun setOnBottomNavigationItemClickListener(listener: IBottomNavigationItemClickListener) {
mOnBottomNavigationItemClickListener = listener
}
//In java
bottomNavigation.setOnBottomNavigationItemClickListener(new MeowBottomNavigation.IBottomNavigationItemClickListener() {
@Override
public void mOnBottomNavigationItemClickedListener(@NonNull MeowBottomNavigation.Model model) {
switch (model.getId()) {
case 1:
Toast.makeText(MainActivity.this, "1", Toast.LENGTH_SHORT).show();
break;
case 2:
Toast.makeText(MainActivity.this, "2", Toast.LENGTH_SHORT).show();
break;
case 3:
Toast.makeText(MainActivity.this, "3", Toast.LENGTH_SHORT).show();
break;
default:
Toast.makeText(MainActivity.this, "default", Toast.LENGTH_SHORT).show();
break;
}
}
});
from meowbottomnavigation.
from meowbottomnavigation.
I modified MeowBottomNavigation.kt file like adding interface and that is worked in java project.
Here how i did,
//declare at top levelprivate var mOnBottomNavigationItemClickListener: IBottomNavigationItemClickListener? = null
interface IBottomNavigationItemClickListener {
fun mOnBottomNavigationItemClickedListener(model: Model)
}//replace add method
fun add(model: Model) {
val cell = MeowBottomNavigationCell(context)
cell.apply {
val params = LinearLayout.LayoutParams(0, heightCell, 1f)
layoutParams = params
icon = model.icon
count = model.count
circleColor = [email protected]
countTextColor = [email protected]
countBackgroundColor = [email protected]
countTypeface = [email protected]
rippleColor = [email protected]
defaultIconColor = [email protected]
selectedIconColor = [email protected]
onClickListener = {
if (!cell.isEnabledCell && !isAnimating) {
show(model.id)
mOnClickedListener(model)
mOnBottomNavigationItemClickListener?.mOnBottomNavigationItemClickedListener (model)
} else {
if (callListenerWhenIsSelected) {
mOnClickedListener(model)
mOnBottomNavigationItemClickListener?.mOnBottomNavigationItemClickedListener (model)
}
}
}
disableCell()
ll_cells.addView(this)
}cells.add(cell) models.add(model) }
//add this method to set listener in java
fun setOnBottomNavigationItemClickListener(listener: IBottomNavigationItemClickListener) {
mOnBottomNavigationItemClickListener = listener
}//In java
bottomNavigation.setOnBottomNavigationItemClickListener(new MeowBottomNavigation.IBottomNavigationItemClickListener() {
@OverRide
public void mOnBottomNavigationItemClickedListener(@nonnull MeowBottomNavigation.Model model) {
switch (model.getId()) {
case 1:
Toast.makeText(MainActivity.this, "1", Toast.LENGTH_SHORT).show();
break;
case 2:
Toast.makeText(MainActivity.this, "2", Toast.LENGTH_SHORT).show();
break;
case 3:
Toast.makeText(MainActivity.this, "3", Toast.LENGTH_SHORT).show();
break;
default:
Toast.makeText(MainActivity.this, "default", Toast.LENGTH_SHORT).show();
break;
}
}
});
Hi I saw your issue and even was looking for the same implementation. Thanks for posting an issue on this.
Yet I am facing issues.
We have below code initialized in MeowBottomNavigation.kt
private var mOnClickedListener: IBottomNavigationListener = {}
private var mOnShowListener: IBottomNavigationListener = {}
which is creating issues and giving errors
What did you pass instead of IBottomNavigationListener
in both variable above?
Thanks for the headsup on that
Been looking at this repo for a while
from meowbottomnavigation.
Nevermind figured out. Thanks for the solution
from meowbottomnavigation.
@lingesh10 Can you provide the final dependency please ? I did as you mentioned by edditing MeowBottomNavigation.kt but i get an this error "Unable to start activity ComponentInfo{com.example.medifind/com.example.medifind.liste_pharmacie}: android.view.InflateException: Binary XML file line #198: Error inflating class com.etebarian.meowbottomnavigation.MeowBottomNavigation"
from meowbottomnavigation.
hi pro ,please if you dont mind . iam trying for 2 week in this library .
i want when click open view in the same screen
notes:- and i dont how to do fragment
plesssssssssss
from meowbottomnavigation.
Can you post some sample to what you trying to achieve, then only we can help
from meowbottomnavigation.
from meowbottomnavigation.
Can you post some sample to what you trying to achieve, then only we can help
Can you just post the dependency after you edited it because I did same as you did and I hade to assemble the dependency and it's like I did nothing !
And after your edit is it possible to use it between activities ?
from meowbottomnavigation.
check this like using this project i created a sample porject with fragment implementaion. https://github.com/lingesh10/Android/tree/master/hotelmenus/
from meowbottomnavigation.
ok i will chek after 7 hour becouse know iam in plane
i hope its help me and tank tank you very much
if you want any thing from libya dont be shy pro iam libyan thankss
from meowbottomnavigation.
I updated ReadMe.md file. Just check it.
from meowbottomnavigation.
Related Issues (20)
- Any way to add Lottie icon ? or perhaps a Gif ?
- Png images not showing correctly
- how to set circle navigation & icon size?
- How to change current cell position?
- The first page doesn't show any thing HOT 1
- Unselect all
- bottom navigation bar color not changing
- How to use this with NavController
- How can I hide the bottom navigation in secondary fragments?
- Meowbottomnavigation.ClickListner not working in Android with Java Project
- Unable to add Drawable icon
- Lack of recognition in Java HOT 7
- how to set selected item
- How can we customize the curves?
- Library Not working in my android Kotlin project HOT 1
- The library cannot be downloaded (Failed to resolve: com.etebarian:meow-bottom-navigation:1.3.1) HOT 7
- support issue
- How to use drawable or bitmap get from internet image
- How to add top left, top right corner into bottom navigation
- 1.3.1 dont show icons correctly HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meowbottomnavigation.