Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of recognition in Java #90

Open
mehdiwaysi opened this issue Oct 11, 2021 · 7 comments
Open

Lack of recognition in Java #90

mehdiwaysi opened this issue Oct 11, 2021 · 7 comments

Comments

@mehdiwaysi
Copy link

I acted according to the documentation and added the required libraries to the dependency, but it is not recognized in the XML file.
in java project

@SrizanX
Copy link

SrizanX commented Oct 18, 2021

I can find it using <meow.bottomnavigation.MeowBottomNavigation> instead of <com.etebarian.meowbottomnavigation.MeowBottomNavigation> but my app crashes when I add Model in java...

@mehdiwaysi
Copy link
Author

I can find it using <meow.bottomnavigation.MeowBottomNavigation> instead of <com.etebarian.meowbottomnavigation.MeowBottomNavigation> but my app crashes when I add Model in java...

Did you find a solution?

@raymondSeger
Copy link

"Did you find a solution?"... he didn't answer back, which means no, or he died of covid.

@raymondSeger
Copy link

mine also crashed by the way. Also java.

@SrizanX
Copy link

SrizanX commented Dec 25, 2021

I can find it using <meow.bottomnavigation.MeowBottomNavigation> instead of <com.etebarian.meowbottomnavigation.MeowBottomNavigation> but my app crashes when I add Model in java...

Did you find a solution?

I had to downgrade the dependency version in order to run the app. If you do not have any problem with downgrading then

Add the dependencies:

dependencies {
    ...
    implementation 'com.etebarian:meow-bottom-navigation:1.2.0'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.20"
    ...
}

Add XML Widget:

   <com.etebarian.meowbottomnavigation.MeowBottomNavigation
        android:id="@+id/bottom_nav_meow"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:mbn_backgroundBottomColor="#ffffff"
        app:mbn_circleColor="#ffffff"
        app:mbn_countBackgroundColor="#ff6f00"
        app:mbn_countTextColor="#ffffff"
        app:mbn_defaultIconColor="#90a4ae"
        app:mbn_rippleColor="#2f424242"
        app:mbn_selectedIconColor="#3c415e"
        app:mbn_shadowColor="#1f212121" />

Java:

public class MainActivity extends AppCompatActivity {

    private MeowBottomNavigation bottomNavigation_meow;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        bottomNavigation_meow = findViewById(R.id.bottom_nav_meow);
        
        bottomNavigation_meow.add(new MeowBottomNavigation.Model(1,R.drawable.ic_launcher_foreground));
        bottomNavigation_meow.add(new MeowBottomNavigation.Model(2,R.drawable.ic_launcher_foreground));
        bottomNavigation_meow.add(new MeowBottomNavigation.Model(3,R.drawable.ic_launcher_foreground));

        bottomNavigation_meow.show(1,true);

        bottomNavigation_meow.setOnClickMenuListener(new Function1<MeowBottomNavigation.Model, Unit>() {
            @Override
            public Unit invoke(MeowBottomNavigation.Model model) {
                switch (model.getId()){
                    case 1:
                        Toast.makeText(bottomNavigation_meow.getContext(), "Button 1 Clicked", Toast.LENGTH_SHORT).show();
                        break;

                    case 2:
                        Toast.makeText(bottomNavigation_meow.getContext(), "Button 2 Clicked", Toast.LENGTH_SHORT).show();
                        break;

                    case 3:
                        Toast.makeText(bottomNavigation_meow.getContext(), "Button 3 Clicked", Toast.LENGTH_SHORT).show();
                        break;
                }
                return null;
            }
        });
    }
}

@dianniseee
Copy link

This inspection reports that different IDE and Gradle plugin versions are used. This can cause inconsistencies between IDE and Gradle builds in error reporting or code behaviour.

how will i fix this kind of error. pls someone guide me

@manumathew17
Copy link

I can find it using <meow.bottomnavigation.MeowBottomNavigation> instead of <com.etebarian.meowbottomnavigation.MeowBottomNavigation> but my app crashes when I add Model in java...

Did you find a solution?

I had to downgrade the dependency version in order to run the app. If you do not have any problem with downgrading then

Add the dependencies:

dependencies {
    ...
    implementation 'com.etebarian:meow-bottom-navigation:1.2.0'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.20"
    ...
}

Add XML Widget:

   <com.etebarian.meowbottomnavigation.MeowBottomNavigation
        android:id="@+id/bottom_nav_meow"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:mbn_backgroundBottomColor="#ffffff"
        app:mbn_circleColor="#ffffff"
        app:mbn_countBackgroundColor="#ff6f00"
        app:mbn_countTextColor="#ffffff"
        app:mbn_defaultIconColor="#90a4ae"
        app:mbn_rippleColor="#2f424242"
        app:mbn_selectedIconColor="#3c415e"
        app:mbn_shadowColor="#1f212121" />

Java:

public class MainActivity extends AppCompatActivity {

    private MeowBottomNavigation bottomNavigation_meow;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        bottomNavigation_meow = findViewById(R.id.bottom_nav_meow);
        
        bottomNavigation_meow.add(new MeowBottomNavigation.Model(1,R.drawable.ic_launcher_foreground));
        bottomNavigation_meow.add(new MeowBottomNavigation.Model(2,R.drawable.ic_launcher_foreground));
        bottomNavigation_meow.add(new MeowBottomNavigation.Model(3,R.drawable.ic_launcher_foreground));

        bottomNavigation_meow.show(1,true);

        bottomNavigation_meow.setOnClickMenuListener(new Function1<MeowBottomNavigation.Model, Unit>() {
            @Override
            public Unit invoke(MeowBottomNavigation.Model model) {
                switch (model.getId()){
                    case 1:
                        Toast.makeText(bottomNavigation_meow.getContext(), "Button 1 Clicked", Toast.LENGTH_SHORT).show();
                        break;

                    case 2:
                        Toast.makeText(bottomNavigation_meow.getContext(), "Button 2 Clicked", Toast.LENGTH_SHORT).show();
                        break;

                    case 3:
                        Toast.makeText(bottomNavigation_meow.getContext(), "Button 3 Clicked", Toast.LENGTH_SHORT).show();
                        break;
                }
                return null;
            }
        });
    }
}

Thanks
Solved the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants