i can' scroll my listView in DrawerLayout.
mycode activity_main:
<androidx.drawerlayout.widget.DrawerLayout 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:orientation="vertical"
android:id="#+id/drawerLayout"
tools:openDrawer="start"
android:fitsSystemWindows="true"
android:layout_height="match_parent"
tools:context=".activities.MapActivity">
<com.google.android.material.navigation.NavigationView
android:layout_width="match_parent"
android:id="#+id/navigationViewRight"
android:layout_marginTop="30dp"
android:layout_marginBottom="5dp"
android:layout_height="match_parent"
android:layout_gravity="end">
<include
layout="#layout/layout_evennements"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.google.android.material.navigation.NavigationView>
<com.google.android.material.navigation.NavigationView
android:layout_width="match_parent"
android:id="#+id/navigationViewLeft"
android:layout_marginTop="30dp"
android:layout_marginBottom="5dp"
android:layout_height="match_parent"
android:layout_gravity="start">
<include
layout="#layout/layout_balises"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.google.android.material.navigation.NavigationView>
</androidx.drawerlayout.widget.DrawerLayout >
my Layout_events code :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:clickable="true"
android:id="#+id/layout_evennements"
android:theme="#style/Theme.GPRStest.NoActionBar"
android:layout_height="match_parent"
android:focusable="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/dashmap2"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="#color/backgroundcolor"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="#drawable/ic_baseline_close_24"
android:layout_marginStart="15dp"
tools:ignore="ContentDescription" />
</LinearLayout>
<com.gabontech.gprstest.utils.ListViewForEmbeddingInScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ListView
android:id="#+id/listview_evennements"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_below="#id/dashmap2"
android:layout_marginRight="5dp"
android:choiceMode="singleChoice"
android:divider="#android:color/transparent"
android:dividerHeight="0dp"
android:listSelector="#BFB9AF" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="#id/listview_evennements"
android:layout_gravity="center"
android:background="#color/white"
android:orientation="horizontal">
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="#+id/rien_a_voir"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:visibility="gone"
android:gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="#string/noEventsData"/>
</RelativeLayout>
</RelativeLayout>
i would like to scroll mylistView but it does not scrolling.i use api to fetch data and display them in my ListView. then onDrawerOpen, ListView shows data but not scrolling. hope someone may help and bring a hand on it.
Related
I have a toolbar and a recyclerview to show notification list when clicked on the badge on tool bar.but my recyclerview is overlapping the toolbar. I need the recycler to start below the toolbar so the user can close it by touching the badge again.how can I solve this problem, can anyone help out?
LAYOUT_FILE.xml
<android.support.v4.widget.DrawerLayout 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:id="#+id/dd_drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".NavigationDrawerActivity">
<LinearLayout
android:id="#+id/toollbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="#layout/navigation_actionbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"></include>
<WebView
android:id="#+id/webViewID"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:id="#+id/left_drawer_parent"
android:layout_width="280dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="left|start">
<include
layout="#layout/drawer_header"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v7.widget.RecyclerView
android:id="#+id/left_drawer"
android:layout_width="280dp"
android:layout_height="match_parent"
android:paddingRight="10dp"
android:layout_gravity="left|start"
android:background="#color/gray"
android:choiceMode="singleChoice"
android:divider="#null"
android:scrollbars="vertical"
app:layoutManager="android.support.v7.widget.LinearLayoutManager" />
</LinearLayout>
<RelativeLayout
android:id="#+id/rlNotificLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/black"
android:layout_alignParentTop="true"
android:layout_marginTop="50dp"
android:padding="7dp"
android:visibility="gone" >
<android.support.v7.widget.RecyclerView
android:id="#+id/listView_Notific_Link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#c4c3bf"
android:scrollbars="vertical"
android:divider="#c4c3bf"
android:dividerHeight="7dp"
android:paddingRight="2dp"
android:paddingLeft="2dp"
android:paddingBottom="7dp"
/>
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
You should use constraint layout: check out documentation here
Here's a nefty workaround on that. Set a top margin on your recyclerview. Use the layout_marginTop property and set it to ?actionBarSize. It should begin its layout below the toolbar.
You should use
app:layout_behavior="#string/appbar_scrolling_view_behavior"
inside your recyclerview
Try putting layout to the top. Topmost layout goes bottom.
<android.support.v4.widget.DrawerLayout 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:id="#+id/dd_drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".NavigationDrawerActivity">
<LinearLayout
android:id="#+id/toollbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/rlNotificLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="50dp"
android:background="#color/black"
android:padding="7dp"
android:visibility="gone">
<android.support.v7.widget.RecyclerView
android:id="#+id/listView_Notific_Link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#c4c3bf"
android:divider="#c4c3bf"
android:dividerHeight="7dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:paddingBottom="7dp"
android:scrollbars="vertical" />
</RelativeLayout>
<include
layout="#layout/navigation_actionbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<WebView
android:id="#+id/webViewID"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:id="#+id/left_drawer_parent"
android:layout_width="280dp"
android:layout_height="match_parent"
android:layout_gravity="left|start"
android:orientation="vertical">
<include
layout="#layout/drawer_header"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v7.widget.RecyclerView
android:id="#+id/left_drawer"
android:layout_width="280dp"
android:layout_height="match_parent"
android:layout_gravity="left|start"
android:background="#color/gray"
android:choiceMode="singleChoice"
android:divider="#null"
android:paddingRight="10dp"
android:scrollbars="vertical"
app:layoutManager="android.support.v7.widget.LinearLayoutManager" />
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
You can use SlidingUpPanel layout.
https://github.com/umano/AndroidSlidingUpPanel
I was implementing a swipe to refresh the Relative layout inside a drawer layout
.It was all working fine before implementing the swipe to refresh once added it , the recyclerview element is not getting displayed
Am adding my layout below
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="com.example.pratheesh.madfest_sample.Mainpage"
android:background="#color/feed_bg"
android:id="#+id/drawerlayout"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="#layout/activity_madfext__toolbar"
android:id="#+id/mainpage_toolbar"
>
</include>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="80dp"
tools:context="com.example.pratheesh.madfest_sample.CardRow"
android:background="#drawable/feed_background"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:id="#+id/mainpage_add"
android:layout_below="#+id/mainpage_toolbar"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="#dimen/feed_item_padding_top_bottom"
android:paddingTop="#dimen/feed_item_padding_top_bottom"
android:paddingLeft="#dimen/feed_item_padding_left_right"
android:paddingRight="#dimen/feed_item_padding_left_right" >
<com.example.pratheesh.madfest_sample.AspectRatioImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:src="#drawable/images"
android:id="#+id/mainpage_imageview_profile1"
android:scaleType="fitCenter"
android:layout_centerVertical="true"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click to add Feeds"
android:id="#+id/mainpage_feeds"
android:textStyle="normal"
android:textColor="#000000"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/mainpage_imageview_profile1"
android:layout_margin="5dp"
android:layout_marginTop="5dp"/>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v4.widget.SwipeRefreshLayout
android:id="#+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="#+id/my_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:layout_marginTop="0dp"
android:layout_below="#+id/mainpage_add"/>
</android.support.v4.widget.SwipeRefreshLayout>
</RelativeLayout>
</FrameLayout>
</ScrollView>
<android.support.design.widget.NavigationView
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:id="#+id/navigationview"
app:menu="#menu/drawer"
app:headerLayout="#layout/activity_navigation_header"
app:itemTextAppearance="#style/NavigationDrawerStyle"
>
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
I am using drawerlayout with custom view instead of toolbar,when drawer open custom view faded,but i want when drawerlayout open custom header view should not fade.
my view look now drawerlayout screen
mainactivity.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="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.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="#+id/header_view"
layout="#layout/layout_header_view"
android:layout_width="fill_parent"
android:layout_height="50dp" />
<FrameLayout
android:id="#+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/footer_RL"
android:layout_below="#+id/header_view">
</FrameLayout>
<RelativeLayout
android:id="#+id/footer_RL"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<include
layout="#layout/layout_footer_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/drawer_List"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:layout_marginTop="50dp"
android:background="#color/white"
android:choiceMode="singleChoice"
android:orientation="vertical"
android:weightSum="10">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:background="#color/white"
android:orientation="vertical"
android:visibility="gone"
android:weightSum="5">
</LinearLayout>
<ListView
android:id="#+id/drawer_List1"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#color/white"
android:choiceMode="singleChoice" />
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
You can use toolbar instead of using header view.
toolbar layout
<android.support.v7.widget.Toolbar android:background="#color/colorPrimary"
android:elevation="4dp"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
local:popupTheme="#style/ThemeOverlay.AppCompat.Light"
local:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto">
<include layout="#layout/textview"/>
</android.support.v7.widget.Toolbar>
textview layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Welcome"
android:textColor="#color/colorPrimaryDark"
android:textStyle="bold"
android:textAppearance="?android:textAppearanceLarge"/>
</LinearLayout>
your layout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="#layout/layout_toolBar"/>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="#+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/footer_RL"
>
</FrameLayout>
<RelativeLayout
android:id="#+id/footer_RL"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<!--<include-->
<!--layout="#layout/layout_footer_view"-->
<!--android:layout_width="fill_parent"-->
<!--android:layout_height="wrap_content" />-->
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/drawer_List"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:layout_marginTop="50dp"
android:background="#color/colorPrimary"
android:choiceMode="singleChoice"
android:orientation="vertical"
android:weightSum="10">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:background="#color/colorPrimary"
android:orientation="vertical"
android:visibility="gone"
android:weightSum="5">
</LinearLayout>
<ListView
android:id="#+id/drawer_List1"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#color/colorPrimary"
android:choiceMode="singleChoice" />
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
In my activity i need banner, grid-view and slider but the grid-view is not fit to screen after installing app into mobile please help me. here is my xml file.and also set scrollview to all contents in xml.I need output like this screenBut my screen display like this
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/container_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar" />
</LinearLayout>
<ViewFlipper
android:id="#+id/flipper1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:flipInterval="3000"
android:inAnimation="#android:anim/slide_in_left"
android:outAnimation="#android:anim/slide_out_right">
<ImageView
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-9dp"
android:contentDescription="ImageOne"
android:src="#drawable/banners" />
<!-- <ImageView
android:src="#drawable/handmadeproducts"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="ImageTwo"
android:layout_gravity="center_horizontal"
/>-->
</ViewFlipper>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<GridView
android:id="#+id/grid"
android:layout_width="fill_parent"
android:layout_height="270dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_margin="30dp"
android:layout_marginTop="-10dp"
android:columnWidth="200dp"
android:gravity="center"
android:horizontalSpacing="25dp"
android:numColumns="3"
android:verticalSpacing="20dp" />
<android.support.v7.widget.RecyclerView
android:id="#+id/my_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:scrollbars="none" />
</LinearLayout>
</ScrollView>
</LinearLayout>
<FrameLayout
android:id="#+id/container_body"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<fragment
android:id="#+id/fragment_navigation_drawer"
android:name="com.dk.buyolx.activity.FragmentDrawer"
android:layout_width="#dimen/nav_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout="#layout/fragment_navigation_drawer"
tools:layout="#layout/fragment_navigation_drawer" />
</android.support.v4.widget.DrawerLayout>
In my home screen I want to add the search box with navigation drawer but I am not able to set the non scrollable edittext over scrollview.
Here is my Code
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="#ecedf1">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/viewpager"
android:layout_width="match_parent"
android:layout_height="#dimen/_200sdp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="#dimen/_200sdp"
>
<EditText
android:layout_width="#dimen/_280sdp"
android:layout_centerHorizontal="true"
android:layout_marginTop="#dimen/_10sdp"
android:layout_height="#dimen/_40sdp"
android:text="fdgsdfhsfhsfghhsfhsfhf"
android:background="#drawable/customedittext"/>
</RelativeLayout>
<RelativeLayout
android:id="#+id/viewPagerIndicator"
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_marginTop="#dimen/_180sdp"
android:gravity="center">
<LinearLayout
android:id="#+id/viewPagerCountDots"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center"
android:orientation="horizontal" />
</RelativeLayout>
<com.information.aanjana.aanjanainformation.NonScrollGridView
android:id="#+id/gv_android"
android:layout_width="#dimen/_299sdp"
android:layout_height="match_parent"
android:horizontalSpacing="8dp"
android:layout_centerHorizontal="true"
android:numColumns="2"
android:paddingLeft="#dimen/_4sdp"
android:paddingRight="#dimen/_4sdp"
android:layout_marginTop="#dimen/_220sdp"
android:verticalSpacing="8dp"/>
</RelativeLayout>
</ScrollView>
<android.support.design.widget.NavigationView
android:id="#+id/navigation_view"
android:layout_height="match_parent"
android:layout_width="#dimen/_170sdp"
android:layout_gravity="start"
app:menu="#menu/drawer"
/>
</android.support.v4.widget.DrawerLayout>
I want a edittext with navigation drawer which should be sticky and do not scroll with rest of the layout. How can I achive it.
What I want is explained in screenshot below:
Try my below code:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="#ecedf1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/viewpager"
android:layout_width="match_parent"
android:layout_height="#dimen/_200sdp" />
<RelativeLayout
android:id="#+id/viewPagerIndicator"
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_marginTop="#dimen/_180sdp"
android:gravity="center">
<LinearLayout
android:id="#+id/viewPagerCountDots"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center"
android:orientation="horizontal" />
</RelativeLayout>
<com.information.aanjana.aanjanainformation.NonScrollGridView
android:id="#+id/gv_android"
android:layout_width="#dimen/_299sdp"
android:layout_height="match_parent"
android:horizontalSpacing="8dp"
android:layout_centerHorizontal="true"
android:numColumns="2"
android:paddingLeft="#dimen/_4sdp"
android:paddingRight="#dimen/_4sdp"
android:layout_marginTop="#dimen/_220sdp"
android:verticalSpacing="8dp"/>
</RelativeLayout>
</ScrollView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="#dimen/_200sdp"
android:layout_alignParentTop="true"
>
<EditText
android:layout_width="#dimen/_280sdp"
android:layout_centerHorizontal="true"
android:layout_marginTop="#dimen/_10sdp"
android:layout_height="#dimen/_40sdp"
android:text="fdgsdfhsfhsfghhsfhsfhf"
android:background="#drawable/customedittext"/>
</RelativeLayout>
</RelativeLayout>
<android.support.design.widget.NavigationView
android:id="#+id/navigation_view"
android:layout_height="match_parent"
android:layout_width="#dimen/_170sdp"
android:layout_gravity="start"
app:menu="#menu/drawer"
/>
</android.support.v4.widget.DrawerLayout>
Here Only thing which I have changed is kept the editText outside the scrollView.
Why don't you try to put it out outside the ScrollView. Then just overlay it with a RelativeLayout and the gravity set to top. I can't run it now but in xml should look like something like this
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="#ecedf1">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/viewpager"
android:layout_width="match_parent"
android:layout_height="#dimen/_200sdp" />
<RelativeLayout
android:id="#+id/viewPagerIndicator"
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_marginTop="#dimen/_180sdp"
android:gravity="center">
<LinearLayout
android:id="#+id/viewPagerCountDots"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center"
android:orientation="horizontal" />
</RelativeLayout>
<com.information.aanjana.aanjanainformation.NonScrollGridView
android:id="#+id/gv_android"
android:layout_width="#dimen/_299sdp"
android:layout_height="match_parent"
android:horizontalSpacing="8dp"
android:layout_centerHorizontal="true"
android:numColumns="2"
android:paddingLeft="#dimen/_4sdp"
android:paddingRight="#dimen/_4sdp"
android:layout_marginTop="#dimen/_220sdp"
android:verticalSpacing="8dp"/>
</RelativeLayout>
</ScrollView>
<!-- Here we add the layout outside the ScrollView -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="#dimen/_200sdp"
android:gravity="top"> <!-- GRAVITY ADJUST -->
<EditText
android:layout_width="#dimen/_280sdp"
android:layout_centerHorizontal="true"
android:layout_marginTop="#dimen/_10sdp"
android:layout_height="#dimen/_40sdp"
android:text="fdgsdfhsfhsfghhsfhsfhf"
android:background="#drawable/customedittext"/>
</RelativeLayout>
<android.support.design.widget.NavigationView
android:id="#+id/navigation_view"
android:layout_height="match_parent"
android:layout_width="#dimen/_170sdp"
android:layout_gravity="start"
app:menu="#menu/drawer"
/>
</android.support.v4.widget.DrawerLayout>
Hopefully, it runs smoothly and turns out helpful.