Skip to content

Commit

Permalink
fix: vkeyboard_offset not inited at the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
brvier committed Sep 2, 2023
1 parent 2727406 commit 9f09fb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
7 changes: 7 additions & 0 deletions src/main.kv
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,13 @@ ScreenManager:
Label:
text: "{:%H:%M}".format(app.picker_datetime)
opacity: 1 if append_event.state == "down" else 0
height: dp(100)
font_size: sp(24)
size_hint: (1,1)
color: app.theme['primary']
Label:
text: "{:.2f}".format(app.picker_expense)
opacity: 1 if append_expense.state == "down" else 0
height: dp(100)
font_size: sp(24)
size_hint: (1,1)
Expand Down
23 changes: 1 addition & 22 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@

kivy.require("2.0.0")
Window.softinput_mode = ""
vkeyboard_offset = 0

EVENT_RE = re.compile(
r"^([\d]{4}-[\d]{2}-[\d]{2})\s([\d]{2}:[\d]{2})?\s?([\d]{2}:[\d]{2})?\s?(.*)$",
re.ASCII,
Expand Down Expand Up @@ -102,6 +100,7 @@ class MOrgApp(App):
keyboard_height = NumericProperty(0)

picker_datetime = ObjectProperty(datetime.datetime.now())
picker_expense = NumericProperty()
notes_cache = ListProperty([])
filtered_notes = ListProperty([])

Expand All @@ -118,15 +117,10 @@ class MOrgApp(App):
notes = {}

def key_input(self, window, key, scancode, codepoint, modifier):
# key == 27 means it is waiting for
# back button tobe pressed
if key == 27:
# checking if we are at mainscreen or not
if self.root.current == "main":
# return True means do nothing
return False
else:
# self.root.transition.direction = "right"
self.root.current = "main"
self.load()
return True
Expand Down Expand Up @@ -168,7 +162,6 @@ def __init__later__(self, dt, **kv):
Permission.WRITE_EXTERNAL_STORAGE,
]
)
# app_folder = os.path.dirname(os.path.abspath(__file__))
Clock.schedule_once(self.load, 0)

except Exception as err:
Expand All @@ -177,21 +170,7 @@ def __init__later__(self, dt, **kv):
else:
Clock.schedule_once(self.load, 0)

# Horrible workarround on android where sometime py intepreter return FileNotFoundError
# reason or maybe permission not yet ack
# while True:
# try:
# self.load()
# break
# except FileNotFoundError as err:
# print("INIT LATER {}".format(err))
# time.sleep(0.1)
# raise err
# continue

def __go_to_line__(self, lineno, dts=None):
# col, row = self.noteView.ids.w_textinput.get_cursor_from_index(idx)
# print("__go_to_line__", idx, col, row)
print(lineno)
if lineno is None:
return
Expand Down

0 comments on commit 9f09fb4

Please sign in to comment.