I have a keyboard where the user can switch between two different views. According to their choice, I return the layout in onCreateInputView ()
layout = (RelativeLayout)getLayoutInflater().inflate(R.layout.activity_main, null);
return layout;
XML 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"/>
<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"/>
<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>
<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 that I try to make my layout full screen on the device, it does not get full screen. At the top of the layout, the application’s layout is displayed, in which my application now opens.
What needs to be done to solve it? or is it impossible
** This keyboard is not application specific and can be opened in any application that has already been made, and also exchanges an image.
source
share