Skip to content

Commit

Permalink
Ajuste na geração do app
Browse files Browse the repository at this point in the history
  • Loading branch information
CoutinhoElias committed Sep 10, 2020
1 parent 04efb7f commit 500fac7
Show file tree
Hide file tree
Showing 36,766 changed files with 11,723,223 additions and 10 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
21 changes: 21 additions & 0 deletions .buildozer/android/app/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 FranciscoCarbonell

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Binary file added .buildozer/android/app/alter-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .buildozer/android/app/alter-splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .buildozer/android/app/company.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .buildozer/android/app/guerreiros.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions .buildozer/android/app/importar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import xmltodict

handle = open("13190402419765001915650020000589401000589409.xml","r")

content = handle.read()

#print(content)
d = xmltodict.parse(content)

print('-----------------------------ID NFE-----------------------------')
print(d['nfeProc']['NFe']['infNFe']['ide']['natOp'])
print(d['nfeProc']['NFe']['infNFe']['ide']['cNF'])
print(d['nfeProc']['NFe']['infNFe']['ide']['nNF'])
print(d['nfeProc']['NFe']['infNFe']['ide']['dhEmi'])

print('-----------------------------EMITENTE DA NFE-----------------------------')
print(d['nfeProc']['NFe']['infNFe']['emit']['CNPJ'])
print(d['nfeProc']['NFe']['infNFe']['emit']['xNome'])
print(d['nfeProc']['NFe']['infNFe']['emit']['xFant'])
Binary file added .buildozer/android/app/importar.pyc
Binary file not shown.
70 changes: 70 additions & 0 deletions .buildozer/android/app/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
from kivy.lang import Builder
from kivymd.app import MDApp
from kivy.factory import Factory
from menu import ItemWidget


Builder.load_string(
'''
#: import LoginScreen screens.login
#: import HomeScreen screens.home
#: import InfoScreen screens.info
#: import ContentDrawer menu
<RootWidget@Screen>:
NavigationLayout:
ScreenManager:
id: screen_manager
LoginScreen:
id: login_screen
name: 'login'
HomeScreen:
id: home_screen
name: 'home'
InfoScreen:
id: information_screen
name: 'information'
MDNavigationDrawer:
id: nav_drawer
ContentDrawer:
id: content_drawer
'''
)

class ExampleApp(MDApp):

@property
def nav_drawer(self):
app = self.get_running_app()
return app.root.ids.nav_drawer

def switch_to(self, screen_name):
app = self.get_running_app()
app.root.screen_manager.current = screen_name


def on_start(self):
items = {
"home": {
"text": "Home",
"screen": "home"},
"information": {
"text":"Informações",
"screen": "information"},
"close": {
"text": "Fechar",
"screen": ""}
}

for icon, data in items.items():
item = ItemWidget(text=data['text'], screen=data['screen'], icon=icon)
self.root.ids.content_drawer.ids.scroll_list.add_widget(
item
)
def build(self):
return Factory.RootWidget()

if __name__ == '__main__':
ExampleApp().run()
Binary file added .buildozer/android/app/main.pyc
Binary file not shown.
Binary file added .buildozer/android/app/menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions .buildozer/android/app/menu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
from kivymd.uix.list import OneLineAvatarIconListItem, MDList
from kivymd.theming import ThemableBehavior
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import StringProperty
from kivy.lang import Builder
from kivy.app import App

Builder.load_string(
'''
<ItemWidget>:
theme_text_color: "Custom"
text_color: app.theme_cls.text_color
IconLeftWidget:
theme_text_color: "Custom"
text_color: root.text_color
icon: root.icon
<ContentDrawer>:
orientation: "vertical"
FloatLayout:
size_hint_y: None
height: "200dp"
BoxLayout:
id: box_image
x: root.x
pos_hint: {"top": 1}
FitImage:
source: "menu.png"
MDLabel:
text: "Header Text"
size_hint_y: None
height: self.texture_size[1]
x: root.x + 10
y: root.height - box_image.height + dp(10)
ScrollView:
ScrollList:
id: scroll_list
'''
)


class ScrollList(ThemableBehavior, MDList):
def set_item_selected(self, instance):
for item in self.children:
if item.text_color == self.theme_cls.primary_color:
item.text_color = self.theme_cls.text_color
break
instance.text_color = self.theme_cls.primary_color


class ItemWidget(OneLineAvatarIconListItem):
icon = StringProperty()
screen = StringProperty()

def on_release(self):
self.parent.set_item_selected(self)
app = App.get_running_app()
if self.screen:
app.root.ids.screen_manager.current = self.screen
app.root.ids.nav_drawer.set_state()

class ContentDrawer(BoxLayout):
pass
Binary file added .buildozer/android/app/menu.pyc
Binary file not shown.
97 changes: 97 additions & 0 deletions .buildozer/android/app/screens/home.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
from kivymd.app import MDApp
from kivy.lang import Builder
from kivy.uix.screenmanager import Screen
from kivymd.uix.list import MDList, TwoLineIconListItem
from kivy.properties import StringProperty


Builder.load_string(
'''
<IconItemWidget>:
IconLeftWidget:
icon:root.icon
<HomeScreen>:
BoxLayout:
orientation: 'vertical'
MDToolbar:
id: toolbar
title: "Aplicação de exemplo"
elevation: 10
left_action_items: [["menu", lambda x: app.nav_drawer.set_state('toggle')]]
BoxLayout:
orientation: 'vertical'
BoxLayout:
size_hint_y:.3
Image:
source: 'company.png'
keep_ratio: False
allow_stretch: True
BoxLayout:
ScrollView:
MDList:
size_hint_y: None
height: dp(100)
id: list_items
'''
)


class IconItemWidget(TwoLineIconListItem):
name = StringProperty()

def __init__(self, text, secondary, icon, name):
self.text = text
self.icon = icon
self.secondary_text = secondary
self.name = name
super().__init__()


class HomeScreen(Screen):

def on_enter(self):
items = {
"email": {
"text": "Email",
"secondary": "[email protected]",
"name": 'email_screen'
},
"facebook": {
"text": "Home",
"secondary": "link to facebook",
"name": 'facebook_screen'
},
"twitter": {
"text": "Twitter",
"secondary": "link to Twitter",
"name": "twitter_screen"
},
"git": {
"text": "Git",
"secondary": "link to Git",
"name": "git_screen"
},
"lock": {
"text": "Git",
"secondary": "link to Git",
"name": "git_screen"
},
"clock": {
"text": "Git",
"secondary": "link to Git",
"name": "git_screen"
}

}
app = MDApp.get_running_app()
list_items = app.root.ids.home_screen.ids.list_items
for icon, data in items.items():
item = IconItemWidget(
text=data['text'],
secondary=data['secondary'],
icon=icon,
name=data['name']
)
list_items.add_widget(item)
Binary file added .buildozer/android/app/screens/home.pyc
Binary file not shown.
54 changes: 54 additions & 0 deletions .buildozer/android/app/screens/info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

from kivymd.app import MDApp
from kivy.lang import Builder
from kivy.uix.screenmanager import Screen
from kivymd.uix.list import MDList, ThreeLineIconListItem
from kivy.properties import StringProperty

import requests
import json

Builder.load_string('''
<InfoScreen>:
BoxLayout:
orientation: 'vertical'
MDToolbar:
id: toolbar
pos_hint: {"top": 1}
title: "Aplicação de exemplo"
elevation: 10
left_action_items: [["menu", lambda x: app.nav_drawer.set_state('toggle')]]
BoxLayout:
ScrollView:
MDList:
id: list_states
Widget:
''')


class InfoScreen(Screen):

def on_enter(self):
url = 'https://covid19-brazil-api.now.sh/api/report/v1'

response = requests.get(url)
status_code = response.status_code
content_json = response.json()
#print(json.dumps(content_json['data'], indent=4))

i=0
app = MDApp.get_running_app()
print(app.root.ids, '<<<<<========')
list_states = app.root.ids.information_screen.ids.list_states

for state in content_json['data']:
items = ThreeLineIconListItem(text=content_json['data'][i]['state'],
secondary_text='Casos de COVID-19: ' + str(content_json['data'][i]['cases']),
tertiary_text='Casos suspeitos: ' + str(content_json['data'][i]['suspects']))
list_states.add_widget(items)

i+=1
pass

Binary file added .buildozer/android/app/screens/info.pyc
Binary file not shown.
Loading

0 comments on commit 500fac7

Please sign in to comment.