Skip to content

Commit 5f01189

Browse files
Wifi app: improve different screensize handling
1 parent 084838a commit 5f01189

File tree

1 file changed

+4
-4
lines changed
  • internal_filesystem/builtin/apps/com.micropythonos.wifi/assets

1 file changed

+4
-4
lines changed

internal_filesystem/builtin/apps/com.micropythonos.wifi/assets/wifi.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ def onCreate(self):
250250
label.align(lv.ALIGN.TOP_MID,0,5)
251251
print("PasswordPage: Creating password textarea")
252252
self.password_ta=lv.textarea(password_page)
253-
self.password_ta.set_size(200,30)
253+
self.password_ta.set_width(lv.pct(90))
254254
self.password_ta.set_one_line(True)
255-
self.password_ta.align_to(label, lv.ALIGN.OUT_BOTTOM_MID, 5, 0)
255+
self.password_ta.align_to(label, lv.ALIGN.OUT_BOTTOM_MID, 0, 0)
256256
self.password_ta.add_event_cb(lambda *args: self.show_keyboard(), lv.EVENT.CLICKED, None)
257257
print("PasswordPage: Creating Connect button")
258258
self.connect_button=lv.button(password_page)
@@ -313,12 +313,12 @@ def show_keyboard(self):
313313
mpos.ui.anim.smooth_show(self.keyboard)
314314
focusgroup = lv.group_get_default()
315315
if focusgroup:
316-
focusgroup.focus_next() # move the focus to the keypad to save the user a "next" button press (optional but nice)
316+
focusgroup.focus_next() # move the focus to the keyboard to save the user a "next" button press (optional but nice)
317317

318318
def hide_keyboard(self):
319+
mpos.ui.anim.smooth_hide(self.keyboard)
319320
self.connect_button.remove_flag(lv.obj.FLAG.HIDDEN)
320321
self.cancel_button.remove_flag(lv.obj.FLAG.HIDDEN)
321-
mpos.ui.anim.smooth_hide(self.keyboard)
322322

323323
def handle_keyboard_events(self, event):
324324
target_obj=event.get_target_obj() # keyboard

0 commit comments

Comments
 (0)