Skip to content

Commit 8c7f700

Browse files
author
surbhi
committed
improve quality
1 parent 6b481fc commit 8c7f700

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

src/bitmessagekivy/baseclass/common.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@
4343
},
4444
}
4545

46+
DIALOG_WIDTH_ANDROID = 0.8
47+
DIALOG_WIDTH_OTHER = 0.55
48+
DIALOG_HEIGHT = 0.25
49+
LONG_PRESS_DURATION = 1
50+
DELETE_DELAY = 4
51+
4652

4753
def load_image_path():
4854
"""Return the path of kivy images"""

src/bitmessagekivy/baseclass/maildetail.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,24 @@
99
import os
1010
from datetime import datetime
1111

12-
from kivy.core.clipboard import Clipboard
12+
from kivy.app import App
1313
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
1615
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
1918
from kivymd.uix.button import MDFlatButton, MDIconButton
2019
from kivymd.uix.dialog import MDDialog
21-
from kivymd.uix.list import OneLineListItem, IRightBodyTouch
20+
from kivymd.uix.list import IRightBodyTouch, OneLineListItem
2221

2322
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)
2626
from pybitmessage.bitmessagekivy.baseclass.popup import SenderDetailPopup
2727
from pybitmessage.bitmessagekivy.get_platform import platform
2828
from pybitmessage.helper_sql import sqlQuery
2929

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-
3730

3831
class OneLineListTitle(OneLineListItem):
3932
"""OneLineListTitle class for Kivy UI."""
@@ -58,7 +51,7 @@ def on_long_press(self, *args):
5851
def copy_message_title(self, title_text):
5952
"""Display dialog box with options to copy the message title."""
6053
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
6255
self.dialog_box = MDDialog(
6356
text=title_text,
6457
size_hint=(width, DIALOG_HEIGHT),

0 commit comments

Comments
 (0)