9
9
import os
10
10
from datetime import datetime
11
11
12
- from kivy .core . clipboard import Clipboard
12
+ from kivy .app import App
13
13
from kivy .clock import Clock
14
- from kivy .properties import StringProperty , NumericProperty
15
- from kivy .uix .screenmanager import Screen
14
+ from kivy .core .clipboard import Clipboard
16
15
from kivy .factory import Factory
17
- from kivy .app import App
18
-
16
+ from kivy .properties import NumericProperty , StringProperty
17
+ from kivy . uix . screenmanager import Screen
19
18
from kivymd .uix .button import MDFlatButton , MDIconButton
20
19
from kivymd .uix .dialog import MDDialog
21
- from kivymd .uix .list import OneLineListItem , IRightBodyTouch
20
+ from kivymd .uix .list import IRightBodyTouch , OneLineListItem
22
21
23
22
from pybitmessage .bitmessagekivy .baseclass .common import (
24
- toast , avatar_image_first_letter , show_time_history , kivy_state_variables
25
- )
23
+ avatar_image_first_letter , kivy_state_variables , show_time_history , toast ,
24
+ DIALOG_WIDTH_ANDROID , DIALOG_WIDTH_OTHER , DIALOG_HEIGHT , LONG_PRESS_DURATION ,
25
+ DELETE_DELAY )
26
26
from pybitmessage .bitmessagekivy .baseclass .popup import SenderDetailPopup
27
27
from pybitmessage .bitmessagekivy .get_platform import platform
28
28
from pybitmessage .helper_sql import sqlQuery
29
29
30
- # Define constants for magic numbers
31
- ANDROID_WIDTH = 0.8
32
- OTHER_WIDTH = 0.55
33
- DIALOG_HEIGHT = 0.25
34
- LONG_PRESS_DURATION = 1
35
- DELETE_DELAY = 4
36
-
37
30
38
31
class OneLineListTitle (OneLineListItem ):
39
32
"""OneLineListTitle class for Kivy UI."""
@@ -58,7 +51,7 @@ def on_long_press(self, *args):
58
51
def copy_message_title (self , title_text ):
59
52
"""Display dialog box with options to copy the message title."""
60
53
self .title_text = title_text
61
- width = ANDROID_WIDTH if platform == 'android' else OTHER_WIDTH
54
+ width = DIALOG_WIDTH_ANDROID if platform == 'android' else DIALOG_WIDTH_OTHER
62
55
self .dialog_box = MDDialog (
63
56
text = title_text ,
64
57
size_hint = (width , DIALOG_HEIGHT ),
0 commit comments