mirror of
https://github.com/liberatedsystems/Sideband_CE.git
synced 2024-09-03 04:13:27 +02:00
Added object details view
This commit is contained in:
parent
3025ea7a5b
commit
cb572dd4f0
40
sbapp/ui/objectdetails.py
Normal file
40
sbapp/ui/objectdetails.py
Normal file
@ -0,0 +1,40 @@
|
||||
import time
|
||||
import RNS
|
||||
|
||||
from kivy.metrics import dp,sp
|
||||
from kivy.uix.label import MDLabel
|
||||
from kivy.lang.builder import Builder
|
||||
|
||||
if RNS.vendor.platformutils.get_platform() == "android":
|
||||
from ui.helpers import ts_format
|
||||
else:
|
||||
from .helpers import ts_format
|
||||
|
||||
class ObjectDetails():
|
||||
def __init__(self, app, object_hash = None):
|
||||
self.app = app
|
||||
self.widget = None
|
||||
self.object_hash = object_hash
|
||||
|
||||
def reload(self):
|
||||
self.clear_widget()
|
||||
self.update()
|
||||
|
||||
def clear_widget(self):
|
||||
pass
|
||||
|
||||
def update(self):
|
||||
us = time.time()
|
||||
self.update_widget()
|
||||
RNS.log("Updated object details in "+RNS.prettytime(time.time()-us), RNS.LOG_DEBUG)
|
||||
|
||||
def update_widget(self):
|
||||
if self.widget == None:
|
||||
self.widget = MDLabel(text=RNS.prettyhexrep(self.object_hash))
|
||||
|
||||
def get_widget(self):
|
||||
return self.widget
|
||||
|
||||
Builder.load_string("""
|
||||
|
||||
""")
|
Loading…
Reference in New Issue
Block a user