CryptoWatch -Kivy 1 .13 Kivy 2 .0 .0 Kivy -Garden 0 .1 .4 kivy -garden.wordcloud 1 .0 .0 kivymd 0 .104 .2 .dev0
Quick Review
├── bin
│ └── KarobbenTB-1.3-armeabi-v7a-debug.apk
├── buildozer.spec
├── favicon.ico
├── font
│ ├── FangZhengHeiTiFanTi-1.ttf
│ ├── HuaKangXinZhuanTi-1.ttc
│ ├── HuaKangXinZhuanTi-1.ttf
│ └── JingDianFanJiaoZhuan-1.ttf
├── Layout
│ ├── filechooser.kv
│ ├── Navigation_Draw.kv
│ ├── Navigation_Tabs.kv
│ └── Seq.kv
├── lib
│ └── bio_seq.py
├── libWidget
│ ├── filechooser.py
│ └── Seq.py
├── logo.png
└── main.py
Filechooser
My another post about Filechooser: Karobben
Document: kivy.org
touch libWidget filechooser.py
main.py + from libWidget.filechooser import ConfirmPopupclass MainApp (MDApp ): + ConfirmPopup = ConfirmPopup() + def change_text (self, Files ): + self.Button_test.text = Files[0 ] + print(str (Files))def build (self ): screen = Screen() + screen.change_text = self.change_textdef on_start (self ): + self.Button_test = MDRectangleFlatButton( + text="Hello, World" , + pos_hint={"center_x" : 0.5 , "center_y" : 0.5 }, + on_release = self.ConfirmPopup.popup_func) + Tab1.add_widget(self.Button_test)
filechooser.py from kivy.app import Appfrom kivy.uix.anchorlayout import AnchorLayoutfrom kivy.uix.boxlayout import BoxLayoutfrom kivy.uix.popup import Popupfrom kivy.lang import Builderclass ConfirmPopup (BoxLayout ): def __init__ (self, **kwargs ): Builder.unload_file("./Layout/filechooser.kv" ) Builder.load_file("./Layout/filechooser.kv" ) self.register_event_type('on_answer' ) self.register_event_type('on_cancel' ) super (ConfirmPopup, self).__init__(**kwargs) self.total_images = 0 def on_answer (self, filename, MainPage ): self.total_images = filename if len (filename) >0 : MainPage.change_text(self.total_images) else : MainPage.change_text("Please Select a File" ) def on_cancel (self, filename, MainPage ): pass def popup_func (self, *args ): content = ConfirmPopup() content.bind(on_answer = self._on_answer) content.bind(on_cancel = self._on_answer) self.popup = Popup(title="Select .zip file" , content=content, size_hint=(None , None ), size=(500 , 500 ), auto_dismiss=True ) self.popup.open () def _on_answer (self, instance, answer, obj ): self.popup.dismiss() def dismiss (self ): self.popup.dismiss()
#: kivy 1.10.0 <ConfirmPopup>: BoxLayout: orientation: 'vertical' FileChooserIconView: id: filechooser #filters: ['*.zip'] GridLayout: cols: 2 size_hint: 1,0.2 Button: text: 'OK' on_release: root.dispatch('on_answer', filechooser.selection, app.root) size_hint: 1,0.2 Button: id: cancel text: 'Cancel' on_release: root.dispatch('on_cancel', filechooser.selection, app.root) size_hint: 1,0.2
main.py from kivy.app import Appfrom kivy.uix.floatlayout import FloatLayoutfrom kivy.factory import Factoryfrom kivy.properties import ObjectPropertyfrom kivy.uix.popup import Popupfrom kivy.utils import platformfrom kivy.uix.screenmanager import Screenfrom kivymd.uix.button import MDRectangleFlatButtonfrom kivy.lang import Builderfrom kivymd.app import MDAppimport osfrom kivy.uix.anchorlayout import AnchorLayoutfrom kivy.uix.boxlayout import BoxLayoutfrom kivy.uix.popup import Popupfrom kivy.lang import Builderfrom filechooser import ConfirmPopupclass MainPage (AnchorLayout ): ConfirmPopup = ConfirmPopup() def __init__ (self, **kwargs ): super (MainPage, self).__init__(**kwargs) def change_text (self, Files ): self.the_time.text = str (Files) print(str (Files))class Main (App ): def build (self ): Builder.load_file("main.kv" ) return MainPage()if __name__ == "__main__" : Main().run()
Change the style of the Filechooser
Background color: @ Nykakin
canvas.before: Color: rgb: 1 , 1 , 1 Rectangle: pos: self.pos size: self.size
Else
newbie programmerz; 2019; Changing the icon of Kivy FileChooserIconView; StackOverflow
Cube_tbh; 2015; How to allow user to choose file as background image in kivy?
GitHub Repository: Karobben Toolbox
Android Release: Karobben Toolbox