Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-211
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-211
2022-211
Commits
2f5d63bf
Commit
2f5d63bf
authored
Oct 13, 2022
by
H.C.K. De Silva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
90% complete
parent
8258a1d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
main.py
main.py
+79
-0
No files found.
main.py
0 → 100644
View file @
2f5d63bf
#--[Start platform specific code]
"""This code to detect it's Android or not
if it's not android than app window size change in android phone size"""
from
kivy.utils
import
platform
if
platform
!=
'android'
:
from
kivy.config
import
Config
Config
.
set
(
"graphics"
,
"width"
,
360
)
Config
.
set
(
"graphics"
,
"height"
,
740
)
Config
.
set
(
'graphics'
,
'borderless'
,
'True'
)
#--[End platform specific code]
#
#--[Start Soft_Keyboard code ]Config
"""code for android keyboard. when in android keyboard show textbox
automatic go to top of keyboard so user can see when he type msg"""
from
kivy.core.window
import
Window
Window
.
keyboard_anim_args
=
{
"d"
:
.2
,
"t"
:
"linear"
}
Window
.
softinput_mode
=
"below_target"
#--[End Soft_Keyboard code ]
from
ProjectFiles.uix.baseclass.login
import
Login_Screen
from
ProjectFiles.uix.baseclass.root
import
Root
from
ProjectFiles.uix.baseclass.Paddy_Waste
import
Paddy_Waste_Screen
from
ProjectFiles.uix.baseclass.Rainfall
import
Rainfall_Screen
from
ProjectFiles.uix.baseclass.verification
import
Verification_Screen
from
main_imports
import
ImageLeftWidget
,
MDApp
,
TwoLineAvatarListItem
class
HamsterApp
(
MDApp
):
"""
Hamster App start from here this class is root of app.
in kivy (.kv) file when use app.method_name app is start from here
"""
def
__init__
(
self
,
**
kwargs
):
super
(
HamsterApp
,
self
)
.
__init__
(
**
kwargs
)
self
.
APP_NAME
=
"SMART FARMING"
self
.
COMPANY_NAME
=
"2022"
def
all_chats
(
self
):
# self.change_screen("profile")
twolineW
=
TwoLineAvatarListItem
(
text
=
f
"DIABETES IDENTIFICATION WITH ML"
,
secondary_text
=
"@username"
,
on_touch_up
=
self
.
chat_room
)
twolineW
.
add_widget
(
ImageLeftWidget
(
source
=
"assets//img//hamster_icon.png"
))
self
.
screen_manager
.
get_screen
(
"login"
)
.
ids
.
chat_tab
.
add_widget
(
twolineW
)
def
build
(
self
):
self
.
theme_cls
.
primary_palette
=
"LightGreen"
self
.
theme_cls
.
primary_hue
=
"500"
self
.
theme_cls
.
accent_palette
=
"LightGreen"
self
.
theme_cls
.
accent_hue
=
"500"
self
.
theme_cls
.
theme_style
=
"Light"
self
.
screen_manager
=
Root
()
self
.
screen_manager
.
add_widget
(
Login_Screen
())
self
.
screen_manager
.
add_widget
(
Paddy_Waste_Screen
())
self
.
screen_manager
.
add_widget
(
Rainfall_Screen
())
self
.
screen_manager
.
add_widget
(
Verification_Screen
())
return
self
.
screen_manager
def
on_start
(
self
):
self
.
screen_manager
.
change_screen
(
"Rainfall"
)
if
__name__
==
"__main__"
:
HamsterApp
()
.
run
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment