pull/21/head
FongMi 3 years ago
parent 4daecbe1a7
commit c00897d601
  1. 3
      app/src/leanback/java/com/fongmi/android/tv/ui/custom/CustomKeyboard.java
  2. 7
      app/src/leanback/res/layout/activity_search.xml

@ -2,8 +2,6 @@ package com.fongmi.android.tv.ui.custom;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import androidx.recyclerview.widget.GridLayoutManager;
import com.fongmi.android.tv.R; import com.fongmi.android.tv.R;
import com.fongmi.android.tv.databinding.ActivitySearchBinding; import com.fongmi.android.tv.databinding.ActivitySearchBinding;
import com.fongmi.android.tv.ui.adapter.KeyboardAdapter; import com.fongmi.android.tv.ui.adapter.KeyboardAdapter;
@ -22,7 +20,6 @@ public class CustomKeyboard implements KeyboardAdapter.OnClickListener {
private void initView() { private void initView() {
binding.keyboard.setHasFixedSize(true); binding.keyboard.setHasFixedSize(true);
binding.keyboard.setLayoutManager(new GridLayoutManager(binding.getRoot().getContext(), 10));
binding.keyboard.addItemDecoration(new SpaceItemDecoration(10, 8)); binding.keyboard.addItemDecoration(new SpaceItemDecoration(10, 8));
binding.keyboard.setAdapter(new KeyboardAdapter(this)); binding.keyboard.setAdapter(new KeyboardAdapter(this));
} }

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:keepScreenOn="true"> android:keepScreenOn="true">
@ -51,7 +52,11 @@
android:layout_toEndOf="@+id/word" android:layout_toEndOf="@+id/word"
android:clipChildren="false" android:clipChildren="false"
android:clipToPadding="false" android:clipToPadding="false"
android:padding="12dp" /> android:padding="12dp"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="10"
tools:itemCount="40"
tools:listitem="@layout/adapter_keyboard_text" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"

Loading…
Cancel
Save