bottomnavigationview

Can't remove space on top of nav_host_fragment

Deadly 提交于 2020-08-22 09:21:27
问题 I just implemented a bottom navigation (AS's default - File -> New -> Activity -> Bottom Navigation Activity) Everything is fine except for a space on the top of the nav_host_fragment . Since it was generated in a ConstraintLayout, I tried to clean the constraints and set the top constraint with parent , setting margin to '0dp' and set height to match_constraint . I unsuccessfully deleted the constraints and tried over and over again. I used Clean Project . I changed to RelativeLayout and set

Viewpager2 in fragment of bottomNavigation: NullPointerException

ε祈祈猫儿з 提交于 2020-08-10 19:35:10
问题 I have 3 fragments used in bottom navigation in Main Activity. In one of the fragments, I have screenslidepagefragment in viewpager2 which has 3 buttons. When I click on any of these 3 buttons I have this error E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.headlines, PID: 3209 java.lang.NullPointerException: Attempt to invoke virtual method 'androidx.lifecycle.LiveData com.example.headlines.Model.NewsViewModel.getData(java.lang.String)' on a null object reference at com.example

How to pass arguments to a fragment using bottom navigation view and Android Navigation component?

血红的双手。 提交于 2020-08-02 06:17:48
问题 Is it possible to pass and access arguments in a fragment using a bottom navigation view and the Navigation component? I'm using a one activity with many fragments approach where my top level fragment requires an argument(Usually done via the newInstance generated method). I've had a look at the Navigation component developer guide and the codelab but it only mentions using safeargs and adding argument tags in the destinations and actions. Here's my navigation graph: <navigation xmlns:app=

React native bottom tab bar pushing itself up when opening keyboard

≡放荡痞女 提交于 2020-07-09 05:25:12
问题 We are using createBottomTabNavigator. In one of the tab contains search bar at the top. While clicking on that search bar, we are opening the keyboard. But the keyboard pushing up the bottom tab bar also. We need the bottom tab bar remains at the bottom when opening keyboard. One of the solution I have tried is, in android manifest, I have changed android:windowSoftInputMode="adjustPan" or "adjustNothing". It is working fine as expected. But we are using chat layout in another tab which

Bottom Sheet Above Bottom Navigation

蓝咒 提交于 2020-07-05 10:28:19
问题 My goal is to place a "bottom sheet" on top of a BottomNavigationView like this: But it stays the following way. Both views collapse: This is the xml of my main activity: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android

Android Bottom Navigation Activity gives a Null Pointer Exception in onCreate

痞子三分冷 提交于 2020-06-17 09:47:05
问题 I added a Bottom Navigation Activity to my project but when i start the relevant activity it gives out a Null Pointer Exception. It says that the exception is fired at line number 28 at lk.apiit.eea.mobile.Activities.CompanyProfile.onCreate(CompanyProfile.java:28) Following is the Exception and the Code PLease help me fix this.. Thank you java.lang.RuntimeException: Unable to start activity ComponentInfo{lk.apiit.eea.mobile/lk.apiit.eea.mobile.Activities.CompanyProfile}: java.lang

Error inflating class com.google.android.material.bottomnavigation.BottomNavigationView

给你一囗甜甜゛ 提交于 2020-06-08 19:02:11
问题 I'm trying to add BottomNavigationView to my layout with this library: implementation 'com.google.android.material:material:1.0.0' This is my layout: <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".home.HomeActivity"> <androidx.appcompat.widget

Programmatically expand/collapse Bottom Navigation View in CoordinatorLayout

拜拜、爱过 提交于 2020-05-31 06:03:09
问题 I have a CoordinatorLayout that contains a BottomNavigationView and an AppBarLayout with a ToolBar inside of it. (The BottomNavigationView is not inside the AppBarLayout , as doing it breaks the position of the BottomNavigationView ). I need to show/hide the AppBarLayout and the BottomNavigationView programmatically, when certain events happen (e.g. on a fragment's onResume ), and so far I've managed setting appBarLayout.setExpanded(true, true) in order to show/hide the AppBar, but I can't

How to show menu item icon without tint color in BottomNavigationView

家住魔仙堡 提交于 2020-05-27 06:01:13
问题 I have created a BottomNavigationView with three items. One of it was user tab . For the guest tab, there is an image but the TintColor is applying and we can't see that. So how to remove tint colour for that particular item? I have tried if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { item.setIconTintList(null); } But no luck. And it applies to above api 26 My activity <com.google.android.material.bottomnavigation.BottomNavigationView android:id="@+id/bottomNavigationView" android