4

I have a keyboard where user can switch between two different view. According to their selection i return the layout in onCreateInputView()

layout = (RelativeLayout)getLayoutInflater().inflate(R.layout.activity_main, null);

return layout;

XML of Layout

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:background="#FFF"
    android:layout_alignParentTop="true"
    tools:context="com.main.MainActivity"  
    >

    <Button 
        android:id="@+id/tag"
        android:layout_width="150dp"
        android:layout_height="50dp"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:text="#Test"
        android:visibility="visible"
        android:singleLine="true"/>


    <ImageButton 
        android:id="@+id/popular"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_toLeftOf="@+id/myCaps"
        android:src="@drawable/connection"
        android:visibility="visible"
        android:background="@null"
        android:layout_marginRight="5dp"/>


    <Button 
        android:id="@+id/myCaps"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_alignParentTop="true"
        android:layout_alignParentRight="true"
        android:drawableStart="@drawable/like"
        android:visibility="visible"

        android:background="@null"/>


   <!-- <GridView

        android:id="@+id/gridView_images"
        android:layout_width="fill_parent"
        android:layout_height="150dp"
        android:layout_below="@+id/myCaps"
        android:columnWidth="80dp"
        android:numColumns="5"
        android:stretchMode="none" 
        android:layout_marginBottom="20dp"

        >

     </GridView> -->


    <com.jess.ui.TwoWayGridView
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="#E8E8E8"
    android:id="@+id/gridView_images"
    android:layout_width="fill_parent" 
    android:layout_height="150dp"
    app:cacheColorHint="#E8E8E8"
    android:layout_below="@+id/myCaps"
    app:columnWidth="80dp"
    app:rowHeight="80dp"
    app:numColumns="2"
    app:numRows="2"
    app:verticalSpacing="0dp"
    app:horizontalSpacing="0dp"
    app:stretchMode="none"
    app:scrollDirectionPortrait="horizontal"
    app:scrollDirectionLandscape="horizontal"
    app:gravity="center"/>

<com.jess.ui.TwoWayGridView
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="#E8E8E8"
    android:id="@+id/gridView_tags"
    android:layout_width="fill_parent" 
    android:layout_height="150dp"
    app:cacheColorHint="#E8E8E8"
    android:layout_below="@+id/gridView_images"
    app:columnWidth="80dp"
    app:rowHeight="80dp"
    app:numColumns="2"
    app:numRows="2"
    app:verticalSpacing="0dp"
    app:horizontalSpacing="0dp"
    app:stretchMode="none"
    app:scrollDirectionPortrait="horizontal"
    app:scrollDirectionLandscape="horizontal"
    app:gravity="center"
    android:visibility="gone"/>

<!--      <GridView -->

<!--         android:id="@+id/gridView_tags" -->
<!--         android:layout_width="fill_parent" -->
<!--         android:layout_height="150dp" -->
<!--         android:columnWidth="80dp" -->
<!--         android:layout_below="@+id/gridView_images" -->
<!--         android:numColumns="5" -->
<!--         android:stretchMode="none"  -->
<!--         android:layout_marginBottom="20dp" -->
<!--         android:visibility="gone" -->
<!--         > -->

<!--      </GridView> -->


     <EditText 
         android:id="@+id/inputText"
         android:layout_below="@+id/gridView_tags"
         android:layout_width="fill_parent"
         android:layout_height="50dp"
         android:background="@drawable/edit_textfield"
         android:hint="Message"
         android:padding="5dp"
         android:visibility="gone"/>


     <LinearLayout 
         android:id="@+id/buttons"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_below="@+id/inputText"
         android:orientation="horizontal"
         android:visibility="gone"
         >


     <Button 
         android:id="@+id/b1"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_weight="1"
         android:text="..."
         android:textSize="10sp"
         android:singleLine="true"
        />

      <Button 
         android:id="@+id/b2"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_weight="1"
         android:text="..."
         android:textSize="10sp"
         android:singleLine="true"
        />

      <Button 
          android:id="@+id/b3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:text="..."
          android:textSize="10sp"
          android:singleLine="true"
          />

       <Button 
          android:id="@+id/b4"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:text="..."
          android:textSize="12sp"
          />

      </LinearLayout>

    <!--  
    <GridView   
    android:id="@+id/gridView_keys" 
    android:layout_width="fill_parent"
    android:layout_height="150dp"
    android:layout_below="@+id/inputText"
    android:columnWidth="150dp"
    android:gravity="center"
    android:layout_centerHorizontal="true"
    android:numColumns="4"
    android:stretchMode="columnWidth"
    android:layout_marginBottom="20dp"
    android:visibility="gone"/> -->


<com.main.MyKeyboardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/keyboard1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/buttons"
    android:keyBackground="@color/background_color"
    android:keyTextColor="#000000"
    android:keyTextSize="26sp"
    android:keyPreviewLayout ="@layout/preview"
    android:background="#FFFFFF"
/>  


</RelativeLayout>

The problem is when i am trying my this layout to be full screen in device it is not becoming full screen. At the top of the layout it shows the layout of the application in which my application is now opened.

What needs to be done to solve it?? or it is not possible

** This keyboard is not application specific and can be open at any application which are already done and also shares image.

Fay007
  • 2,707
  • 3
  • 28
  • 58

0 Answers0