-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtodo.todo
135 lines (102 loc) · 5 KB
/
todo.todo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
Use Plyer to query open pictures in other apps
add audio icon and find a way to extract audio covers
resize assets/icon/file.png with a photo editor
add a section to show server logs in desktop version like how it is when installing desktop apps
[done]watch youtube video for custom spinner
[done]Use sp for bottomnav height not percentage and add infos/deatails bar no files,no folders,size
[done]get permission to manage all files like pydroid3 app
[done]Create Two branchs First for (Linux|Macos|Windows) second for Android
Well struted
def get_storage_permissions():
base_permissions = [
Permission.POST_NOTIFICATIONS,
Permission.READ_EXTERNAL_STORAGE,
Permission.WRITE_EXTERNAL_STORAGE
]
# For Android 11+ (API 30+), use ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION
try:
from android import api_version
if api_version >= 30:
from android.content import Intent, Settings
intent = Intent()
intent.setAction(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION)
mActivity.startActivity(intent)
except Exception as e:
print(f"Failed to request all files access: {e}")
return base_permissions
permissions = get_storage_permissions()
request_permissions(permissions)
worked
def request_all_files_permission():
try:
from android import api_version
print('Verse---|',api_version)
if api_version >= 30:
from jnius import autoclass
Environment = autoclass('android.os.Environment')
Intent = autoclass('android.content.Intent')
Settings = autoclass('android.provider.Settings')
Uri = autoclass('android.net.Uri')
if not Environment.isExternalStorageManager():
intent = Intent()
intent.setAction(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION)
mActivity.startActivity(intent)
else:
# For older Android versions
permissions = [
Permission.READ_EXTERNAL_STORAGE,
Permission.WRITE_EXTERNAL_STORAGE
]
request_permissions(permissions)
except Exception as e:
print(f"Failed to request storage permission: {e}")
request_all_files_permission()
class SettingsScreen(MDScreen):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.name='settings'
self.layout=MDBoxLayout(
# md_bg_color=[1,0,0,1],
# adaptive_height=True,
size_hint=[1,.1],
pos_hint={'top':1}
)
self.layout.orientation='vertical'
self.layout.spacing=sp(10)
self.filechooser=None
self.header=Header(
# size_hint=[1,None],height=sp(50),
size_hint=[1,1],
text="Settings",text_halign='left')
self.content=MDBoxLayout(orientation='vertical',
# size_hint=[1,1],
# md_bg_color=[1,0,0,1],
adaptive_height=True,
spacing=sp(20),
padding=[sp(10),0],
pos_hint={'top':.86}
)
self.portInput=MDTextField(theme_text_color= "Custom",text_color_focus=[.9,.9,1,1],text_color_normal=[1,1,1,1],pos_hint={'center_x':.5},size_hint=[.8,None],height=dp(80))
verifyBtn=MDButton(
theme_height= "Custom", theme_width= "Custom",
on_release=lambda x: self.setIP(self.portInput.text),
# on_release=lambda x: Snackbar(confirm_txt='Ok'),
pos_hint={'center_x':.5},size_hint=[None,None],size=[sp(120),dp(50)],radius=0)
verifyBtn.add_widget(MDButtonText(text='Verify Code',pos_hint= {"center_x": .5, "center_y": .5}))
self.layout.add_widget(self.header)
# TODO Get PC name when connection verifed and display connected to ...
self.my_switch=MySwitch(text='Show hidden files')
self.my_switch.checkbox_.bind(active=self.on_checkbox_active)
self.content.add_widget(self.my_switch)
self.content.add_widget(self.portInput)
self.content.add_widget(verifyBtn)
# btn=MDButton(size_hint=[None,None],size=[100,50])
btn1=MDButton(size_hint=[None,None],size=[100,50])
self.img=AsyncImage(source='assets/icons/video.png',nocache=False,mipmap=True,size_hint=[1,None],height=sp(200),pos_hint= {"center_x": .5, "center_y": .7})
self.content.add_widget(self.img)
# btn.on_release=self.test
btn1.on_release=self.testx
# self.content.add_widget(btn)
self.content.add_widget(btn1)
self.add_widget(self.layout)
self.add_widget(self.content)