|
4 | 4 | use super::*; |
5 | 5 | use i_slint_core::api::{PhysicalPosition, PhysicalSize}; |
6 | 6 | use i_slint_core::graphics::{euclid, Color}; |
7 | | -use i_slint_core::items::{ColorScheme, InputType}; |
| 7 | +use i_slint_core::items::{CapsMode, ColorScheme, InputType}; |
8 | 8 | use i_slint_core::platform::WindowAdapter; |
9 | 9 | use i_slint_core::SharedString; |
10 | 10 | use jni::objects::{JClass, JObject, JString, JValue}; |
@@ -178,7 +178,21 @@ impl JavaHelper { |
178 | 178 |
|
179 | 179 | let class_it = env.find_class("android/text/InputType")?; |
180 | 180 | let input_type = match data.input_type { |
181 | | - InputType::Text => env.get_static_field(&class_it, "TYPE_CLASS_TEXT", "I")?.i()?, |
| 181 | + InputType::Text => { |
| 182 | + let caps_mode = match data.caps_mode { |
| 183 | + CapsMode::None => 0 as jint, |
| 184 | + CapsMode::Sentences => env |
| 185 | + .get_static_field(&class_it, "TYPE_TEXT_FLAG_CAP_SENTENCES", "I")? |
| 186 | + .i()?, |
| 187 | + CapsMode::Words => { |
| 188 | + env.get_static_field(&class_it, "TYPE_TEXT_FLAG_CAP_WORDS", "I")?.i()? |
| 189 | + } |
| 190 | + CapsMode::All => env |
| 191 | + .get_static_field(&class_it, "TYPE_TEXT_FLAG_CAP_CHARACTERS", "I")? |
| 192 | + .i()?, |
| 193 | + }; |
| 194 | + env.get_static_field(&class_it, "TYPE_CLASS_TEXT", "I")?.i()? | caps_mode |
| 195 | + } |
182 | 196 | InputType::Password => { |
183 | 197 | env.get_static_field(&class_it, "TYPE_TEXT_VARIATION_PASSWORD", "I")?.i()? |
184 | 198 | | env.get_static_field(&class_it, "TYPE_CLASS_TEXT", "I")?.i()? |
|
0 commit comments