Просмотр исходного кода

app: android fix invisible number input bug

darkfi 11 месяцев назад
Родитель
Сommit
fd7c900f2d
2 измененных файлов с 9 добавлено и 7 удалено
  1. 4 2
      bin/app/java/autosuggest/CustomInputConnection.java
  2. 5 5
      bin/app/src/gfx/mod.rs

+ 4 - 2
bin/app/java/autosuggest/CustomInputConnection.java

@@ -266,8 +266,10 @@ public class CustomInputConnection extends BaseInputConnection {
                         selectionStart = selectionEnd;
                         selectionStart = selectionEnd;
                         selectionEnd = temp;
                         selectionEnd = temp;
                     }
                     }
-                    editable.replace(selectionStart, selectionEnd,
-                            Character.toString((char)unicodeChar));
+
+                    String inputChar = Character.toString((char)unicodeChar);
+                    editable.replace(selectionStart, selectionEnd, inputChar);
+                    onCompose(id, inputChar, selectionStart, true);
                 }
                 }
             }
             }
         }
         }

+ 5 - 5
bin/app/src/gfx/mod.rs

@@ -953,8 +953,8 @@ impl Stage {
             }
             }
             GraphicsMethod::DeleteBuffer((gbuff_id, _, _)) => self.method_delete_buffer(*gbuff_id),
             GraphicsMethod::DeleteBuffer((gbuff_id, _, _)) => self.method_delete_buffer(*gbuff_id),
             GraphicsMethod::ReplaceDrawCalls { batch_id, timest, dcs } => {
             GraphicsMethod::ReplaceDrawCalls { batch_id, timest, dcs } => {
-                let debug_strs: Vec<_> = dcs.iter().map(|(_, dc)| dc.debug_str).collect();
-                t!("Commit dc to {batch_id}: {debug_strs:?}");
+                //let debug_strs: Vec<_> = dcs.iter().map(|(_, dc)| dc.debug_str).collect();
+                //t!("Commit dc to {batch_id}: {debug_strs:?}");
                 let batch = self.batches.get_mut(batch_id).unwrap();
                 let batch = self.batches.get_mut(batch_id).unwrap();
                 let dcs = std::mem::take(dcs);
                 let dcs = std::mem::take(dcs);
                 batch.push(GraphicsMethod::ReplaceDrawCalls {
                 batch.push(GraphicsMethod::ReplaceDrawCalls {
@@ -967,8 +967,8 @@ impl Stage {
                 }
                 }
                 Ok(())
                 Ok(())
             }
             }
-            GraphicsMethod::StartBatch((batch_id, debug_str)) => {
-                t!("Start batch {batch_id}: {debug_str:?}");
+            GraphicsMethod::StartBatch((batch_id, _debug_str)) => {
+                //t!("Start batch {batch_id}: {debug_str:?}");
                 if !self.batches.insert(*batch_id, vec![]).is_none() {
                 if !self.batches.insert(*batch_id, vec![]).is_none() {
                     panic!("Batch {batch_id} already open!")
                     panic!("Batch {batch_id} already open!")
                 }
                 }
@@ -978,7 +978,7 @@ impl Stage {
                 Ok(())
                 Ok(())
             }
             }
             GraphicsMethod::EndBatch(batch_id) => {
             GraphicsMethod::EndBatch(batch_id) => {
-                t!("End batch {batch_id}");
+                //t!("End batch {batch_id}");
                 let batch = self.batches.remove(batch_id).unwrap();
                 let batch = self.batches.remove(batch_id).unwrap();
                 for mut method in batch {
                 for mut method in batch {
                     let res = match &mut method {
                     let res = match &mut method {