mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
chore: Change native interface size and custom keyboard fixes
This commit is contained in:
parent
01a98f974f
commit
9954ed7db5
7 changed files with 65 additions and 55 deletions
|
|
@ -46,15 +46,6 @@ class _SearchBarState extends ConsumerState<SuggestionSearchBar> {
|
|||
bool isEmpty = true;
|
||||
final FocusNode focusNode = FocusNode();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (widget.autoFocus) {
|
||||
focusNode.requestFocus();
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ref.listen(librarySearchProvider(widget.key!).select((value) => value.searchQuery), (previous, next) {
|
||||
|
|
@ -90,6 +81,7 @@ class _SearchBarState extends ConsumerState<SuggestionSearchBar> {
|
|||
),
|
||||
builder: (context, controller, focusNode) => OutlinedTextField(
|
||||
focusNode: focusNode,
|
||||
autoFocus: widget.autoFocus,
|
||||
controller: controller,
|
||||
onSubmitted: (value) {
|
||||
widget.onSubmited!(value);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'package:fladder/providers/arguments_provider.dart';
|
||||
import 'package:fladder/providers/settings/client_settings_provider.dart';
|
||||
import 'package:fladder/providers/settings/home_settings_provider.dart';
|
||||
import 'package:fladder/screens/settings/settings_list_tile.dart';
|
||||
|
|
@ -81,7 +80,7 @@ List<Widget> buildClientSettingsAdvanced(BuildContext context, WidgetRef ref) {
|
|||
),
|
||||
),
|
||||
),
|
||||
if (ref.read(argumentsStateProvider).leanBackMode)
|
||||
if (AdaptiveLayout.inputDeviceOf(context) == InputDevice.dPad)
|
||||
SettingsListTile(
|
||||
label: Text(context.localized.clientSettingsUseSystemIMETitle),
|
||||
subLabel: Text(context.localized.clientSettingsUseSystemIMEDesc),
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class _DetailedBannerState extends ConsumerState<DetailedBanner> {
|
|||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Flexible(
|
||||
Expanded(
|
||||
child: ExcludeFocus(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16).copyWith(bottom: 4),
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import 'package:flutter/services.dart';
|
|||
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import 'package:fladder/providers/arguments_provider.dart';
|
||||
import 'package:fladder/providers/settings/client_settings_provider.dart';
|
||||
import 'package:fladder/screens/shared/animated_fade_size.dart';
|
||||
import 'package:fladder/theme.dart';
|
||||
|
|
@ -112,8 +111,8 @@ class _OutlinedTextFieldState extends ConsumerState<OutlinedTextField> {
|
|||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final useCustomKeyboard = ref.watch(argumentsStateProvider.select((value) => value.leanBackMode)) &&
|
||||
ref.watch(clientSettingsProvider.select((value) => !value.useSystemIME));
|
||||
final useCustomKeyboard = AdaptiveLayout.inputDeviceOf(context) == InputDevice.dPad &&
|
||||
ref.read(clientSettingsProvider.select((value) => !value.useSystemIME));
|
||||
if (widget.autoFocus) {
|
||||
if (useCustomKeyboard) {
|
||||
_wrapperFocus.requestFocus();
|
||||
|
|
@ -127,7 +126,7 @@ class _OutlinedTextFieldState extends ConsumerState<OutlinedTextField> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isPasswordField = widget.keyboardType == TextInputType.visiblePassword;
|
||||
final useCustomKeyboard = ref.watch(argumentsStateProvider.select((value) => value.leanBackMode)) &&
|
||||
final useCustomKeyboard = AdaptiveLayout.inputDeviceOf(context) == InputDevice.dPad &&
|
||||
ref.watch(clientSettingsProvider.select((value) => !value.useSystemIME));
|
||||
|
||||
final textField = TextField(
|
||||
|
|
|
|||
|
|
@ -2,82 +2,102 @@ class KeyboardLayouts {
|
|||
static const Map<String, Map<KeyboardLayer, List<List<String>>>> layouts = {
|
||||
'en': {
|
||||
KeyboardLayer.alpha: [
|
||||
['A', 'B', 'C', 'D', 'E', 'F', 'G', '⌫'],
|
||||
['H', 'I', 'J', 'K', 'L', 'M', 'N', '123'],
|
||||
['O', 'P', 'Q', 'R', 'S', 'T', 'U'],
|
||||
['A', 'B', 'C', 'D', 'E', '⌫'],
|
||||
['F', 'G', 'H', 'I', 'J', '123'],
|
||||
['K', 'L', 'M', 'N', 'O', 'P'],
|
||||
['Q', 'R', 'S', 'T', 'U'],
|
||||
['V', 'W', 'X', 'Y', 'Z'],
|
||||
],
|
||||
KeyboardLayer.numericExtra: [
|
||||
['1', '2', '3', '&', '#', '(', ')', '⌫'],
|
||||
['4', '5', '6', '@', '!', '?', ':', 'ABC'],
|
||||
['7', '8', '9', '.', '-', '_', '"', ':'],
|
||||
['1', '2', '3', '&', '#', '⌫'],
|
||||
['4', '5', '6', '(', ')', 'ABC'],
|
||||
['7', '8', '9', '@', '!', '?'],
|
||||
['0', '/', '\$', '%', '+', '[', ']'],
|
||||
['.', '-', '_', '"', ':']
|
||||
],
|
||||
},
|
||||
'es': {
|
||||
KeyboardLayer.alpha: [
|
||||
['A', 'B', 'C', 'D', 'E', 'F', 'G', '⌫'],
|
||||
['H', 'I', 'J', 'K', 'L', 'M', 'N', '123'],
|
||||
['O', 'P', 'Q', 'R', 'S', 'T', 'U'],
|
||||
['A', 'B', 'C', 'D', 'E', '⌫'],
|
||||
['F', 'G', 'H', 'I', 'J', '123'],
|
||||
['K', 'L', 'M', 'N', 'O', 'P'],
|
||||
['Q', 'R', 'S', 'T', 'U'],
|
||||
['V', 'W', 'X', 'Y', 'Z', 'Ñ'],
|
||||
],
|
||||
KeyboardLayer.numericExtra: [
|
||||
['1', '2', '3', '&', '#', '(', ')', '⌫'],
|
||||
['4', '5', '6', '@', '!', '?', ';', 'ABC'],
|
||||
['7', '8', '9', '.', '-', '_', '"'],
|
||||
['1', '2', '3', '&', '#', '⌫'],
|
||||
['4', '5', '6', '(', ')', 'ABC'],
|
||||
['7', '8', '9', '@', '!', '?'],
|
||||
['0', '/', '\$', '%', '+', '[', ']'],
|
||||
['.', '-', '_', '"', ':']
|
||||
],
|
||||
},
|
||||
'de': {
|
||||
KeyboardLayer.alpha: [
|
||||
['A', 'B', 'C', 'D', 'E', 'F', 'G', '⌫'],
|
||||
['H', 'I', 'J', 'K', 'L', 'M', 'N', '123'],
|
||||
['O', 'P', 'Q', 'R', 'S', 'T', 'U'],
|
||||
['V', 'W', 'X', 'Y', 'Z', 'Ä', 'Ö', 'Ü'],
|
||||
['A', 'B', 'C', 'D', 'E', '⌫'],
|
||||
['F', 'G', 'H', 'I', 'J', '123'],
|
||||
['K', 'L', 'M', 'N', 'O', 'P'],
|
||||
['Q', 'R', 'S', 'T', 'U'],
|
||||
['V', 'W', 'X', 'Y', 'Z'],
|
||||
['Ä', 'Ö', 'Ü', 'ß']
|
||||
],
|
||||
KeyboardLayer.numericExtra: [
|
||||
['1', '2', '3', '&', '#', '(', ')', '⌫'],
|
||||
['4', '5', '6', '@', '!', '?', ';', 'ABC'],
|
||||
['7', '8', '9', '.', '-', '_', '"'],
|
||||
['1', '2', '3', '&', '#', '⌫'],
|
||||
['4', '5', '6', '(', ')', 'ABC'],
|
||||
['7', '8', '9', '@', '!', '?'],
|
||||
['0', '/', '\$', '%', '+', '[', ']'],
|
||||
['.', '-', '_', '"', ':']
|
||||
],
|
||||
},
|
||||
'fr': {
|
||||
KeyboardLayer.alpha: [
|
||||
['A', 'B', 'C', 'D', 'E', 'F', 'G', '⌫'],
|
||||
['H', 'I', 'J', 'K', 'L', 'M', 'N', '123'],
|
||||
['O', 'P', 'Q', 'R', 'S', 'T', 'U'],
|
||||
['V', 'W', 'X', 'Y', 'Z', 'É', 'È', 'À'],
|
||||
['A', 'B', 'C', 'D', 'E', '⌫'],
|
||||
['F', 'G', 'H', 'I', 'J', '123'],
|
||||
['K', 'L', 'M', 'N', 'O', 'P'],
|
||||
['Q', 'R', 'S', 'T', 'U'],
|
||||
['V', 'W', 'X', 'Y', 'Z'],
|
||||
['É', 'È', 'À', 'Ç'],
|
||||
['Â', 'Ê', 'Î', 'Ô', 'Û'],
|
||||
],
|
||||
KeyboardLayer.numericExtra: [
|
||||
['1', '2', '3', '&', '#', '(', ')', '⌫'],
|
||||
['4', '5', '6', '@', '!', '?', ';', 'ABC'],
|
||||
['7', '8', '9', '.', '-', '_', '"'],
|
||||
['1', '2', '3', '&', '#', '⌫'],
|
||||
['4', '5', '6', '(', ')', 'ABC'],
|
||||
['7', '8', '9', '@', '!', '?'],
|
||||
['0', '/', '\$', '%', '+', '[', ']'],
|
||||
['.', '-', '_', '"', ':']
|
||||
],
|
||||
},
|
||||
'ja': {
|
||||
KeyboardLayer.alpha: [
|
||||
['あ', 'い', 'う', 'え', 'お', 'か', 'き', '⌫'],
|
||||
['さ', 'し', 'す', 'せ', 'そ', 'た', 'ち', '123'],
|
||||
['な', 'に', 'ぬ', 'ね', 'の', 'は', 'ひ'],
|
||||
['ふ', 'へ', 'ほ', 'ま', 'み', 'む', 'も', 'や', 'ゆ', 'よ'],
|
||||
['あ', 'い', 'う', 'え', 'お', '⌫'],
|
||||
['か', 'き', 'さ', 'し', 'す', '123'],
|
||||
['せ', 'そ', 'た', 'ち', 'な', 'に'],
|
||||
['ぬ', 'ね', 'の', 'は', 'ひ'],
|
||||
['ふ', 'へ', 'ほ', 'ま', 'み'],
|
||||
['む', 'も', 'や', 'ゆ', 'よ'],
|
||||
],
|
||||
KeyboardLayer.numericExtra: [
|
||||
['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '⌫'],
|
||||
['!', '@', '#', '\$', '%', '^', '&', '*', '(', ')', 'ABC'],
|
||||
['1', '2', '3', '4', '5', '⌫'],
|
||||
['6', '7', '8', '9', '0', 'ABC'],
|
||||
['!', '@', '#', '\$', '%'],
|
||||
['^', '&', '*', '(', ')'],
|
||||
['-', '_', '¥', '.', ',']
|
||||
],
|
||||
},
|
||||
'zh': {
|
||||
KeyboardLayer.alpha: [
|
||||
['啊', '波', '从', '的', '饿', '发', '个', '⌫'],
|
||||
['喝', '衣', '机', '卡', '拉', '马', '呢', '123'],
|
||||
['哦', '啪', '期', '然', '色', '他', '乌'],
|
||||
['啊', '波', '从', '的', '饿', '⌫'],
|
||||
['发', '个', '喝', '衣', '机', '123'],
|
||||
['卡', '拉', '马', '呢', '哦', '啪'],
|
||||
['期', '然', '色', '他', '乌'],
|
||||
['为', '西', '行', '呀', '月', '子'],
|
||||
],
|
||||
KeyboardLayer.numericExtra: [
|
||||
['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '⌫'],
|
||||
['!', '@', '#', '\$', '%', '^', '&', '*', '(', ')', 'ABC'],
|
||||
['1', '2', '3', '4', '5', '⌫'],
|
||||
['6', '7', '8', '9', '0', 'ABC'],
|
||||
['!', '@', '#', '\$', '%'],
|
||||
['^', '&', '*', '(', ')'],
|
||||
['-', '_', '¥', '·', '…']
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import 'package:fladder/widgets/keyboard/alpha_numeric_keyboard.dart';
|
|||
|
||||
ValueNotifier<bool> isKeyboardOpen = ValueNotifier<bool>(false);
|
||||
|
||||
double keyboardWidthFactor = 0.2;
|
||||
double keyboardWidthFactor = 0.25;
|
||||
|
||||
class CustomKeyboardWrapper extends StatelessWidget {
|
||||
final Widget child;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue