SSCustomBottomNavigation icon indicating copy to clipboard operation
SSCustomBottomNavigation copied to clipboard

how to fix!

Open aliking1400 opened this issue 3 years ago • 17 comments

how to fix background white bottom navigation in page ! fd fixed

aliking1400 avatar Sep 05 '22 08:09 aliking1400

@aliking1400 : Can you please provide more details on this.

MehulKK avatar Sep 05 '22 10:09 MehulKK

My screen is black, but the background color of the navigation button is white, now the background is on transport I do it, but it can't be deleted. How can I delete it?

aliking1400 avatar Sep 05 '22 10:09 aliking1400

@aliking1400 : Got your issue. We will check and let you know ASAP. Thanks for reporting.

ShwetaChauhan18 avatar Sep 05 '22 11:09 ShwetaChauhan18

Thanks 🙏

aliking1400 avatar Sep 06 '22 13:09 aliking1400

@aliking1400 : We are able to reproduce this issue. As of now we are providing workaround solution to fix this.

For your main FragmentContainerView and SSCustomBottomNavigation , you have to give constraint like below.

<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <!--Below fragment is for NavController Navigation-->
        <androidx.fragment.app.FragmentContainerView
            android:id="@+id/nav_host_fragment"
            android:name="androidx.navigation.fragment.NavHostFragment"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:defaultNavHost="true"
            app:layout_constraintBottom_toBottomOf="parent"   //  <-- This one
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:navGraph="@navigation/mobile_navigation" />

        <!--Below layout is for normal Navigation-->
        <LinearLayout
            android:id="@+id/lnrLayout"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:gravity="center"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            android:orientation="vertical">

            <TextView
                android:id="@+id/tv_selected"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:gravity="center"
                android:textColor="@android:color/black"
                android:textSize="16sp" />

        </LinearLayout>


        // You have to remove top constraint like below in you code
        <com.simform.custombottomnavigation.SSCustomBottomNavigation 
            android:id="@+id/bottomNavigation"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:background="@android:color/transparent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:ss_backgroundBottomColor="#ff0000"
            app:ss_backgroundBottomDrawable="@drawable/bottom_drawable"
            app:ss_circleColor="#ff6f00"
            app:ss_countBackgroundColor="#ff6f00"
            app:ss_countTextColor="#ffffff"
            app:ss_countTypeface="fonts/graphik_semibold.ttf"
            app:ss_defaultIconColor="@color/color_black"
            app:ss_iconTextColor="@color/color_black"
            app:ss_iconTextSize="12sp"
            app:ss_iconTextTypeface="fonts/graphik_semibold.ttf"
            app:ss_rippleColor="#2f424242"
            app:ss_selectedIconColor="#ff6f00"
            app:ss_selectedIconTextColor="#ff6f00"
            app:ss_shadowColor="#1f212121"
            app:ss_waveHeight="7" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <data>

    </data>
</layout>

Second thing in your individual fragment view, you have to give Parent layout paddingBottom like below

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/color_chat_bg"
    android:paddingBottom="56dp">.    // <-- You have to add this line 

    <TextView
        android:id="@+id/text_notifications"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="8dp"
        android:text="@string/content_chat"
        android:textAlignment="center"
        android:textColor="@color/color_white"
        android:textSize="20sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

For more information you can refer our sample example.

Till that we are finding proper solutions for this issue.

MehulKK avatar Sep 07 '22 06:09 MehulKK

You misunderstood what I meant

I say that when the background of my page is black, the bottom navigation background is white I want to remove the background of the bottom navigation dark

so that it does not have a background on all pages

aliking1400 avatar Sep 07 '22 07:09 aliking1400

@aliking1400 : We understood your issue. Just change your constraint as we mention for temporary solution. We are working on proper solution.

Your FragmentContainerView bottom constraint should be at parent instead of top of SSCustomBottomNavigation

ShwetaChauhan18 avatar Sep 07 '22 08:09 ShwetaChauhan18

@aliking1400 : We are understand your issue

Screenshot_1662538742

MehulKK avatar Sep 07 '22 08:09 MehulKK

Yes, this is my problem. Thank you for explaining my problem a little more so that I can solve it

aliking1400 avatar Sep 07 '22 08:09 aliking1400

@aliking1400 : check this solution properly we have added comment as well what you have to do for solve your issue.

https://github.com/SimformSolutionsPvtLtd/SSCustomBottomNavigation/issues/40#issuecomment-1238970785

MehulKK avatar Sep 07 '22 09:09 MehulKK

I did not understand exactly if xml Do you want to change it?

aliking1400 avatar Sep 07 '22 09:09 aliking1400

I did not understand exactly if xml Do you want to change it?

` <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="#F5F8F8" tools:context=".Activity.MainActivity" xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">

    <fragment
        android:id="@+id/fragmentContainerView"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toTopOf="@+id/bottomNavigation"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:name="androidx.navigation.fragment.NavHostFragment"
        app:defaultNavHost="true"
        />


    <com.simform.custombottomnavigation.SSCustomBottomNavigation
        android:id="@+id/bottomNavigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/fragmentContainerView"
        app:ss_backgroundBottomColor="@color/Button"
        app:ss_circleColor="#ff6f00"
        app:ss_reverseCurve="false"
        app:ss_waveHeight="7"
        app:ss_countBackgroundColor="@color/Button"
        app:ss_countTextColor="#ffffff"
        app:ss_countTypeface="fonts/font.ttf"
        app:ss_defaultIconColor="#6200EE"
        app:ss_iconTextColor="#6200EE"
        app:ss_iconTextTypeface="fonts/font.ttf"
        app:ss_rippleColor="#2f424242"
        app:ss_iconTextSize="14sp"
        app:ss_selectedIconColor="#F44336"
        app:ss_selectedIconTextColor="#F44336"
        app:ss_shadowColor="#1f212121"
        />



</androidx.constraintlayout.widget.ConstraintLayout>
`

Thank you for fixing it

aliking1400 avatar Sep 07 '22 10:09 aliking1400

I did not understand exactly if xml Do you want to change it?

` <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="#F5F8F8" tools:context=".Activity.MainActivity" xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">

    <fragment
        android:id="@+id/fragmentContainerView"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toTopOf="@+id/bottomNavigation"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:name="androidx.navigation.fragment.NavHostFragment"
        app:defaultNavHost="true"
        />


    <com.simform.custombottomnavigation.SSCustomBottomNavigation
        android:id="@+id/bottomNavigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/fragmentContainerView"
        app:ss_backgroundBottomColor="@color/Button"
        app:ss_circleColor="#ff6f00"
        app:ss_reverseCurve="false"
        app:ss_waveHeight="7"
        app:ss_countBackgroundColor="@color/Button"
        app:ss_countTextColor="#ffffff"
        app:ss_countTypeface="fonts/font.ttf"
        app:ss_defaultIconColor="#6200EE"
        app:ss_iconTextColor="#6200EE"
        app:ss_iconTextTypeface="fonts/font.ttf"
        app:ss_rippleColor="#2f424242"
        app:ss_iconTextSize="14sp"
        app:ss_selectedIconColor="#F44336"
        app:ss_selectedIconTextColor="#F44336"
        app:ss_shadowColor="#1f212121"
        />



</androidx.constraintlayout.widget.ConstraintLayout>

` Thank you for fixing it

Thank you for helping me Everything I did didn't work

aliking1400 avatar Sep 08 '22 06:09 aliking1400

Can you fix my code? I need it very much

aliking1400 avatar Sep 10 '22 08:09 aliking1400

Sure, I will check today and let you know

ShwetaChauhan18 avatar Sep 10 '22 11:09 ShwetaChauhan18

Waiting...

aliking1400 avatar Sep 12 '22 14:09 aliking1400

@aliking1400 : As of now solution is same which we provide you.

here is same library that has same issue #4 so for that they has applied same solutions for this issue.

MehulKK avatar Sep 13 '22 06:09 MehulKK