Friday, 29 November 2019

how to put button on top of android.support.design.widget.AppBarLayout?

I'm having a button that is on top of android.support.design.widget.AppBarLayout but the button stays behind it in the layout display and on the device how do i put the button in front of it ?

or in a different question how do i add a button next to the on screen options menu on the upper right side ?

here is my Layout XML >

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="apps.radwin.wintouch.activities.alignmentActivities.WorkordersSelectionActivity"
    tools:showIn="@layout/app_bar_workorders_selection">

    <Button
        android:id="@+id/filterButtonMainWorkorderSelection"
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:layout_alignParentTop="true"
        android:layout_alignParentEnd="true"
        android:layout_marginRight="50dp"

        android:layout_marginTop="20dp"
        android:background="@drawable/ic_filter_list_black_24dp"
        android:text=""
        android:textSize="30dp" />



    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="8dp"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|enterAlways"
            app:popupTheme="@style/AppTheme.PopupOverlay">

        </android.support.v7.widget.Toolbar>

        <android.support.design.widget.TabLayout
            android:id="@+id/tabsLayoutWorkorderSelection"
            android:layout_width="match_parent"
            style="@style/TabLayoutStyle"
            android:layout_height="wrap_content"
            />

    </android.support.design.widget.AppBarLayout>

    <android.support.v4.view.ViewPager
        android:id="@+id/workorderSelectionMainViewPagerContainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="end|bottom"
        android:src="@drawable/add_workorders_plus"
        android:layout_marginLeft="@dimen/fab_margin"
        android:layout_marginRight="@dimen/fab_margin"
        android:layout_marginBottom="@dimen/fab_margin"
        android:layout_alignParentBottom="true"
        android:layout_alignParentEnd="true" />



    <android.support.design.widget.CoordinatorLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/main_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">

        <android.support.v4.widget.NestedScrollView
            android:id="@+id/bottom_sheet"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clipToPadding="true"
            android:background="#293339"
            app:layout_behavior="android.support.design.widget.BottomSheetBehavior"
            >

            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_toStartOf="@+id/fab">


                <TextView
                    android:id="@+id/workorderFilterPopup_showAllText"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentStart="true"
                    android:layout_alignParentTop="true"
                    android:layout_marginLeft="10dp"
                    android:gravity="center"
                    android:paddingTop="5dp"
                    android:text="SHOW ALL"
                    android:textAppearance="?android:attr/textAppearanceLarge"
                    android:textColor="@color/white"
                    android:textSize="20dp" />

                <Button
                    android:layout_width="match_parent"
                    android:layout_height="30dp"
                    android:layout_alignParentStart="true"
                    android:layout_alignParentTop="true"
                    android:id="@+id/filter_menu_workorders_show_all"
                    android:background="@color/transparent"
                    android:layout_marginLeft="10dp"
                    android:paddingTop="5dp"
                    />

                <ImageView
                    android:id="@+id/workorderFilterPopup_showAllCheckMark"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_alignParentTop="true"
                    android:layout_marginRight="20dp"
                    android:layout_alignParentEnd="true"
                    android:src="@drawable/ic_done_black_24dp" />

                <View
                    android:layout_width="match_parent"
                    android:layout_height="2dp"
                    android:layout_marginTop="10dp"
                    android:layout_marginRight="10dp"
                    android:layout_marginLeft="10dp"
                    android:id="@+id/workorderFilterPopup_showAllTextLine"
                    android:background="@color/white"
                    android:layout_below="@+id/workorderFilterPopup_showAllText"
                    ></View>

                <ImageView
                    android:layout_width="35dp"
                    android:layout_height="35dp"
                    android:src="@drawable/ic_alarm_black_24dp"
                    android:id="@+id/workorderFilterPopup_plannedImage"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="20dp"
                    android:layout_below="@+id/workorderFilterPopup_showAllTextLine"
                    android:layout_alignParentStart="true" />

                <Button
                    android:layout_width="match_parent"
                    android:layout_height="35dp"
                    android:id="@+id/filter_menu_workorders_planned"
                    android:background="@color/transparent"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="20dp"
                    android:layout_below="@+id/workorderFilterPopup_showAllTextLine"
                    android:layout_alignParentStart="true"
                    />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textAppearance="?android:attr/textAppearanceLarge"
                    android:text="Planned"
                    android:textColor="@color/white"
                    android:layout_marginLeft="20dp"
                    android:id="@+id/workorderFilterPopup_plannedText"
                    android:layout_alignBottom="@+id/workorderFilterPopup_plannedImage"
                    android:layout_toEndOf="@+id/workorderFilterPopup_plannedImage" />

                <ImageView
                    android:id="@+id/workorderFilterPopup_PlannedCheckMark"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_marginRight="20dp"
                    android:layout_alignParentEnd="true"
                    android:layout_alignBottom="@+id/workorderFilterPopup_plannedText"
                    android:src="@drawable/ic_done_black_24dp" />

                <ImageView
                    android:layout_width="35dp"
                    android:layout_height="35dp"
                    android:src="@drawable/ic_cloud_off_black_24dp"
                    android:id="@+id/workorderFilterPopup_incompleteImage"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="20dp"
                    android:layout_below="@+id/workorderFilterPopup_plannedImage"
                    android:layout_alignParentStart="true" />

                <Button
                    android:layout_width="match_parent"
                    android:layout_height="35dp"
                    android:id="@+id/filter_menu_workorders_incomplete"
                    android:background="@color/transparent"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="20dp"
                    android:layout_below="@+id/workorderFilterPopup_plannedImage"
                    android:layout_alignParentStart="true"
                    />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textAppearance="?android:attr/textAppearanceLarge"
                    android:text="Uncompleted"
                    android:textColor="@color/white"
                    android:layout_marginLeft="20dp"
                    android:id="@+id/workorderFilterPopup_intompleteText"
                    android:layout_alignBottom="@+id/workorderFilterPopup_incompleteImage"
                    android:layout_toEndOf="@+id/workorderFilterPopup_incompleteImage" />

                <ImageView
                    android:id="@+id/workorderFilterPopup_IncompleteCheckMark"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_marginRight="20dp"
                    android:layout_alignParentEnd="true"
                    android:layout_alignBottom="@+id/workorderFilterPopup_intompleteText"
                    android:src="@drawable/ic_done_black_24dp" />

                <ImageView
                    android:layout_width="35dp"
                    android:layout_height="35dp"
                    android:src="@drawable/ic_cloud_queue_black_24dp"
                    android:id="@+id/workorderFilterPopup_CompleteImage"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="20dp"
                    android:layout_below="@+id/workorderFilterPopup_incompleteImage"
                    android:layout_alignParentStart="true" />

                <Button
                    android:layout_width="match_parent"
                    android:layout_height="35dp"
                    android:id="@+id/filter_menu_workorders_complete"
                    android:background="@color/transparent"
                    android:layout_marginLeft="10dp"
                    android:layout_marginTop="20dp"
                    android:layout_below="@+id/workorderFilterPopup_incompleteImage"
                    android:layout_alignParentStart="true"
                    />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textAppearance="?android:attr/textAppearanceLarge"
                    android:text="complete 5"
                    android:textColor="@color/white"
                    android:layout_marginLeft="20dp"
                    android:id="@+id/workorderFilterPopup_completeText"
                    android:layout_alignBottom="@+id/workorderFilterPopup_CompleteImage"
                    android:layout_toEndOf="@+id/workorderFilterPopup_CompleteImage" />

                <ImageView
                    android:id="@+id/workorderFilterPopup_completeCheckMark"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_marginRight="20dp"
                    android:layout_alignParentEnd="true"
                    android:layout_alignBottom="@+id/workorderFilterPopup_completeText"
                    android:src="@drawable/ic_done_black_24dp" />



                <View
                    android:layout_width="match_parent"
                    android:layout_height="20dp"
                    android:layout_below="@+id/workorderFilterPopup_CompleteImage"
                    ></View>


            </RelativeLayout>



        </android.support.v4.widget.NestedScrollView>

    </android.support.design.widget.CoordinatorLayout>




</RelativeLayout>


from how to put button on top of android.support.design.widget.AppBarLayout?

No comments:

Post a Comment