6

I am creating suggestion based search feature using EditText & PopupWindowdue to some GUI requirements. Search and suggestions are working perfect, but I'm unable to navigate through search EditText and list items of PopupWindow via Dpad.

following is the layout of my whole screen:

<?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">

<View
    android:id="@+id/center_baseline"
    android:layout_width="match_parent"
    android:layout_height="1dp"
    android:layout_centerInParent="true" />

<View
    android:id="@+id/top_baseline"
    android:layout_width="match_parent"
    android:layout_height="1dp"
    android:layout_above="@+id/center_baseline"
    android:layout_marginBottom="50dp" />

<View
    android:id="@+id/bottom_baseline"
    android:layout_width="match_parent"
    android:layout_height="1dp"
    android:layout_below="@+id/center_baseline"
    android:layout_marginTop="45dp" />

<RelativeLayout
    android:id="@+id/header"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignBottom="@id/bottom_baseline"
    android:layout_alignParentTop="true"
    android:descendantFocusability="beforeDescendants"
    android:focusableInTouchMode="true">

    <ImageView
        android:id="@+id/top_shelf_image"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:alpha="@dimen/top_shelf_image_alpha"
        android:contentDescription="@string/app_name"
        android:scaleType="fitXY" />

    <View
        android:layout_width="match_parent"
        android:layout_height="@dimen/home_screen_top_bar_height"
        android:layout_alignParentTop="true"
        android:alpha="@dimen/home_screen_top_bar_alpha"
        android:background="@color/black" />

    <ImageView
        android:id="@+id/app_logo"
        android:layout_width="wrap_content"
        android:layout_height="@dimen/home_screen_logo_height"
        android:layout_marginLeft="20dp"
        android:contentDescription="@string/app_name"
        android:gravity="center"
        android:padding="5dp"
        android:src="@drawable/ic_app_logo" />

    <EditText
        android:id="@+id/team_search_bar"
        android:layout_width="@dimen/home_screen_search_bar_width"
        android:layout_height="@dimen/home_screen_logo_height"
        android:layout_alignParentRight="true"
        android:layout_marginRight="20dp"
        android:hint="@string/lb_search_bar_hint"
        android:imeOptions="actionSearch"
        android:inputType="text"
        android:lines="1"
        android:digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
        android:padding="8dp" />

    <TextView
        android:id="@+id/team_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/logo"
        android:layout_marginLeft="@dimen/home_screen_content_margin_left"
        android:layout_marginTop="20dp"
        android:text="@string/home_title"
        android:textColor="@color/white"
        android:textSize="@dimen/home_screen_title" />

    <TextView
        android:id="@+id/team_description"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/team_title"
        android:layout_marginEnd="600dp"
        android:layout_marginLeft="@dimen/home_screen_content_margin_left"
        android:layout_marginStart="25dp"
        android:layout_marginTop="10dp"
        android:maxLines="4"
        android:maxWidth="600dp"
        android:scrollHorizontally="false"
        android:text="@string/short_description"
        android:textColor="@color/team_desciption_color"
        android:textSize="@dimen/home_screen_short_description" />

</RelativeLayout>

<fragment
    android:id="@+id/main_browse_fragment"
    android:name=".ui.HomeFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentBottom="true"
    android:layout_alignTop="@+id/top_baseline"
    android:nextFocusUp="@+id/team_search_bar"
    tools:context=".ui.HomeActivity"
    tools:deviceIds="tv"
    tools:ignore="MergeRootFrame" />

</RelativeLayout>  

BrowseFragment contains some details in card. Everything is working fine except I am not able to navigate through EditText and ListView items of PopupWindow.

Is there any way from which I can make navigation work using D-pad???

Uniruddh
  • 4,427
  • 3
  • 52
  • 86

0 Answers0