1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16export default class StyleConfiguration { 17 static getInputStyle(islandSpace, isRkDevice, deviceType) { 18 if (isRkDevice) { 19 return { 20 basicButtonWidth: $r("app.float.rk_basic_button_width"), 21 basicButtonHeight: $r("app.float.rk_basic_button_height"), 22 featurePicSize: $r("app.float.rk_feature_picSize"), 23 switchButtonWidth: $r("app.float.rk_switch_button_width"), 24 returnPicSize: $r("app.float.rk_return_picSize"), 25 returnButtonWidthType_1: $r("app.float.rk_return_button_widthType_1"), 26 returnButtonWidthType_2: $r("app.float.rk_return_button_widthType_2"), 27 spaceButtonWidth_1: $r("app.float.rk_space_button_width_1"), 28 spaceButtonWidth_2: $r("app.float.rk_space_button_width_2"), 29 paddingTop: $r("app.float.rk_padding_top"), 30 paddingLeftRight: $r("app.float.rk_padding_left_right"), 31 downMenuHeight: $r("app.float.rk_downMenu_height"), 32 downMenuPicWidth: $r("app.float.rk_downMenu_pic_width"), 33 downMenuPicHeight: $r("app.float.rk_downMenu_pic_height"), 34 downMenuWidth: $r("app.float.rk_downMenu_width"), 35 litterNumberFontSize: $r("app.float.rk_litter_number_fontSize"), 36 en_fontSize: $r("app.float.rk_en_fontSize"), 37 symbol_fontSize: $r("app.float.rk_en_fontSize"), 38 switchNumberFontSize: $r("app.float.rk_switch_number_fontSize"), 39 number1234ontFSize: $r("app.float.rk_number_1234_fontSize"), 40 keyboardHeight: $r("app.float.rk_keyboard_height") 41 } 42 } else if(deviceType == 'tablet') { 43 if (islandSpace) { 44 return { 45 deviceType: 'tablet_landSpace', 46 basicButtonWidth: $r("app.float.landSpace_basic_button_width"), 47 basicButtonHeight: $r("app.float.landSpace_basic_button_height"), 48 featurePicSize: $r("app.float.landSpace_feature_picSize"), 49 switchButtonWidth: $r("app.float.landSpace_switch_button_width"), 50 returnPicSize: $r("app.float.landSpace_return_picSize"), 51 returnButtonWidthType_1: $r("app.float.landSpace_return_button_widthType_1"), 52 returnButtonWidthType_2: $r("app.float.landSpace_return_button_widthType_2"), 53 spaceButtonWidth_1: $r("app.float.landSpace_space_button_width_1"), 54 spaceButtonWidth_2: $r("app.float.landSpace_space_button_width_2"), 55 paddingTop: $r("app.float.landSpace_padding_top"), 56 paddingLeftRight: $r("app.float.landSpace_padding_left_right"), 57 downMenuHeight: $r("app.float.landSpace_downMenu_height"), 58 downMenuPicWidth: $r("app.float.landSpace_downMenu_pic_width"), 59 downMenuPicHeight: $r("app.float.landSpace_downMenu_pic_height"), 60 downMenuWidth: $r("app.float.landSpace_downMenu_width"), 61 litterNumberFontSize: $r("app.float.landSpace_litter_number_fontSize"), 62 en_fontSize: $r("app.float.landSpace_en_fontSize"), 63 symbol_fontSize: $r("app.float.landSpace_symbol_fontSize"), 64 switchNumberFontSize: $r("app.float.landSpace_switch_number_fontSize"), 65 keyboardHeight: $r("app.float.landSpace_keyboard_height") 66 } 67 } else { 68 return { 69 deviceType: 'tablet_portrait', 70 basicButtonWidth: $r("app.float.portrait_basic_button_width"), 71 basicButtonHeight: $r("app.float.portrait_basic_button_height"), 72 featurePicSize: $r("app.float.portrait_feature_picSize"), 73 switchButtonWidth: $r("app.float.portrait_switch_button_width"), 74 returnPicSize: $r("app.float.portrait_return_picSize"), 75 returnButtonWidthType_1: $r("app.float.portrait_return_button_widthType_1"), 76 returnButtonWidthType_2: $r("app.float.portrait_return_button_widthType_2"), 77 spaceButtonWidth_1: $r("app.float.portrait_space_button_width_1"), 78 spaceButtonWidth_2: $r("app.float.portrait_space_button_width_2"), 79 paddingTop: $r("app.float.portrait_padding_top"), 80 paddingLeftRight: $r("app.float.portrait_padding_left_right"), 81 downMenuHeight: $r("app.float.portrait_downMenu_height"), 82 downMenuPicWidth: $r("app.float.portrait_downMenu_pic_width"), 83 downMenuPicHeight: $r("app.float.portrait_downMenu_pic_height"), 84 downMenuWidth: $r("app.float.portrait_downMenu_width"), 85 litterNumberFontSize: $r("app.float.portrait_litter_number_fontSize"), 86 en_fontSize: $r("app.float.portrait_en_fontSize"), 87 symbol_fontSize: $r("app.float.landSpace_symbol_fontSize"), 88 switchNumberFontSize: $r("app.float.portrait_switch_number_fontSize"), 89 keyboardHeight: $r("app.float.portrait_keyboard_height") 90 } 91 } 92 } 93 else { 94 if (!islandSpace) { 95 return { 96 basicButtonWidth: $r("app.float.s_basic_button_width"), 97 basicButtonHeight: $r("app.float.s_basic_button_height"), 98 featurePicSize: $r("app.float.s_feature_picSize"), 99 switchButtonWidth: $r("app.float.s_switch_button_width"), 100 returnPicSize: $r("app.float.return_picSize"), 101 returnButtonWidthType_1: $r("app.float.s_return_button_widthType_1"), 102 returnButtonWidthType_2: $r("app.float.s_return_button_widthType_2"), 103 spaceButtonWidth_1: $r("app.float.s_space_button_width_1"), 104 spaceButtonWidth_2: $r("app.float.s_space_button_width_2"), 105 paddingTop: $r("app.float.s_padding_top"), 106 paddingLeftRight: $r("app.float.s_padding_left_right"), 107 downMenuHeight: $r("app.float.downMenu_height"), 108 downMenuPicWidth: $r("app.float.downMenu_pic_width"), 109 downMenuPicHeight: $r("app.float.downMenu_pic_height"), 110 downMenuWidth: $r("app.float.downMenu_width"), 111 litterNumberFontSize: $r("app.float.litter_number_fontSize"), 112 en_fontSize: $r("app.float.en_fontSize"), 113 symbol_fontSize: $r("app.float.en_fontSize"), 114 switchNumberFontSize: $r("app.float.switch_number_fontSize"), 115 number1234ontFSize: $r("app.float.number_1234_fontSize"), 116 keyboardHeight: $r("app.float.keyboard_height") 117 } 118 } else { 119 return { 120 basicButtonWidth: $r("app.float.h_basic_button_width"), 121 basicButtonHeight: $r("app.float.h_basic_button_height"), 122 featurePicSize: $r("app.float.h_feature_picSize"), 123 switchButtonWidth: $r("app.float.h_switch_button_width"), 124 returnPicSize: $r("app.float.return_picSize"), 125 returnButtonWidthType_1: $r("app.float.h_return_button_widthType_1"), 126 returnButtonWidthType_2: $r("app.float.h_return_button_widthType_2"), 127 spaceButtonWidth_1: $r("app.float.h_space_button_width_1"), 128 spaceButtonWidth_2: $r("app.float.h_space_button_width_2"), 129 paddingTop: $r("app.float.h_padding_top"), 130 paddingLeftRight: $r("app.float.h_padding_left_right"), 131 downMenuHeight: $r("app.float.downMenu_height"), 132 downMenuPicWidth: $r("app.float.downMenu_pic_width"), 133 downMenuPicHeight: $r("app.float.downMenu_pic_height"), 134 downMenuWidth: $r("app.float.downMenu_width"), 135 litterNumberFontSize: $r("app.float.litter_number_fontSize"), 136 en_fontSize: $r("app.float.en_fontSize"), 137 symbol_fontSize: $r("app.float.en_fontSize"), 138 switchNumberFontSize: $r("app.float.switch_number_fontSize"), 139 number1234ontFSize: $r("app.float.number_1234_fontSize"), 140 keyboardHeight: $r("app.float.keyboard_height") 141 } 142 } 143 144 } 145 } 146}