diff --git a/src/bitmessagekivy/baseclass/scan_screen.py b/src/bitmessagekivy/baseclass/scan_screen.py index cc90be91..ef879baa 100644 --- a/src/bitmessagekivy/baseclass/scan_screen.py +++ b/src/bitmessagekivy/baseclass/scan_screen.py @@ -60,6 +60,8 @@ class ScanScreen(Screen): else: print("Camera is not available!") self.camera_avaialbe = False + else: + self.camera_avaialbe = True def get_screen(self, screen_name, instance=None): """This method is used for getting previous screen name""" @@ -74,7 +76,8 @@ class ScanScreen(Screen): """ if not self.children: tmp = Builder.load_file( - os.path.join(os.path.dirname(__file__), "kv/{}.kv").format("scanner") + os.path.join( + os.path.dirname(os.path.dirname(__file__)), "kv/{}.kv").format("scanner") ) self.add_widget(tmp) if platform == "android": diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index 07539379..5096f2f5 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -58,11 +58,11 @@ import ast from bitmessagekivy.baseclass.common import toast +from kivy_garden.zbarcam import ZBarCam +from pyzbar.pyzbar import ZBarSymbol + if platform != "android": from kivy.config import Config - from kivy_garden.zbarcam import ZBarCam - from pyzbar.pyzbar import ZBarSymbol - Config.set("input", "mouse", "mouse, multitouch_on_demand") elif platform == "android": from jnius import autoclass, cast @@ -944,10 +944,10 @@ class NavigateApp(MDApp): print("Purchasing {} through {}".format(self.product_id, method_name)) def _after_scan(self, text): - if platform == 'android': - text = cast(CharSequence, String(text)) - show_toast(text, Toast.LENGTH_SHORT) - elif self.root.ids.sc23.previous_open_screen == 'composer': + # if platform == 'android': + # toast_txt = cast(CharSequence, String(text)) + # show_toast(toast_txt, Toast.LENGTH_SHORT) + if self.root.ids.sc23.previous_open_screen == 'composer': self.root.ids.sc3.children[1].ids.txt_input.text = text self.root.ids.scr_mngr.current = 'create' elif self.root.ids.sc23.previous_open_screen: diff --git a/src/buildozer.spec b/src/buildozer.spec index 2d4d34fd..797915ad 100644 --- a/src/buildozer.spec +++ b/src/buildozer.spec @@ -46,10 +46,9 @@ requirements = libiconv, libzbar, pillow, + pyzbar, bitmsghash, - #git+https://github.com/navjotcis/KivyMD#egg=kivymd, git+https://github.com/kivymd/KivyMD#egg=kivymd, - #kivymd, qrcode, msgpack @@ -100,7 +99,7 @@ fullscreen = 0 #android.presplash_color = #FFFFFF # (list) Permissions -android.permissions = INTERNET, WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE +android.permissions = INTERNET, WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE, CAMERA # (int) Target Android API, should be as high as possible. android.api = 29 diff --git a/src/kivy_garden/xcamera/xcamera.kv b/src/kivy_garden/xcamera/xcamera.kv index 966e702c..1efc6895 100644 --- a/src/kivy_garden/xcamera/xcamera.kv +++ b/src/kivy_garden/xcamera/xcamera.kv @@ -24,7 +24,7 @@ icon_size: dp(70) id: camera - resolution: 640, 480 #1920, 1080 # # + # resolution: 640, 480 #1920, 1080 # # allow_stretch: True # Shoot button diff --git a/src/kivy_garden/zbarcam/zbarcam.kv b/src/kivy_garden/zbarcam/zbarcam.kv index 2a077ffe..5b123be4 100644 --- a/src/kivy_garden/zbarcam/zbarcam.kv +++ b/src/kivy_garden/zbarcam/zbarcam.kv @@ -8,7 +8,7 @@ XCamera: id: xcamera play: True - resolution: root.resolution + # resolution: root.resolution allow_stretch: True keep_ratio: True center: self.size and proxy.center