javaandroidkotlinandroid-tvon-screen-keyboard

How to get rid of landscape background in smart tv keyboard?


I have a problem with keyboard layout for smart tv (android tv). I want to get rid of white background above the keyboard. How do I do this?

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.customknobkeyboard"
    android:versionCode="1"
    android:versionName="1.0">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/KeyboardTheme">

        <service
            android:name=".KnobKeyboardApp"
            android:label="@string/app_name"
            android:permission="android.permission.BIND_INPUT_METHOD"
            android:exported="true">
            <intent-filter>
                <action android:name="android.view.InputMethod" />
            </intent-filter>

            <meta-data
                android:name="android.view.im"
                android:resource="@xml/knob_method" />
        </service>

        <activity android:name=".MainActivity"
            android:exported="true"
            android:theme="@android:style/Theme.Translucent.NoTitleBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

</manifest>

enter image description here

I try changing androidmanifest.xml android:imeOptions="flagNoExtractUI",


Solution

  • Try this one, should do the trick:

        @Override
        public boolean onEvaluateFullscreenMode() {
            return false;
        }
    

    This one deactivate full-screen mod, which is default for landscape view.