Skip to content

Commit 8165270

Browse files
committed
Integrate Python 3 and Python 2 at the same time
1 parent 1c28ddc commit 8165270

File tree

21 files changed

+174
-79
lines changed

21 files changed

+174
-79
lines changed

qbaselib

qpython/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ android {
1414
defaultConfig {
1515
minSdkVersion rootProject.ext.minSdkVersion
1616
targetSdkVersion rootProject.ext.targetSdkVersion
17-
versionCode 291
18-
versionName "2.6.0"
17+
versionCode 300
18+
versionName "3.0.0"
1919
multiDexEnabled true
2020
vectorDrawables.useSupportLibrary = true
2121

qpython/src/google/AndroidManifest.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
2626
<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
2727

28-
2928
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
3029
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
3130

@@ -68,16 +67,6 @@
6867
android:name=".main.activity.SignInActivity"
6968
android:launchMode="singleTask"/>
7069

71-
<activity
72-
android:name="org.renpy.android.PythonActivity"
73-
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale|uiMode"
74-
android:launchMode="singleTask"
75-
android:process=":python"
76-
android:screenOrientation="user"
77-
android:theme="@style/AppTheme"
78-
android:windowSoftInputMode="stateAlwaysHidden">
79-
</activity>
80-
8170
<activity
8271
android:name="org.qpython.qpylib.MPyApi"
8372
android:exported="true"
@@ -206,8 +195,6 @@
206195
<activity
207196
android:name=".main.activity.AboutActivity"/>
208197

209-
<activity android:name=".texteditor.OAboutActivity"/>
210-
211198
<activity
212199
android:name=".main.activity.AppListActivity"
213200
android:exported="true"
@@ -354,9 +341,7 @@
354341
</intent-filter>
355342
</service>
356343

357-
<activity android:name=".main.activity.CourseCrowdfundingActivity"/>
358344
<activity android:name=".main.activity.CourseIndexFundingActivity"/>
359-
<activity android:name=".main.activity.CourseFreeActivity"/>
360345
<activity android:name=".main.activity.FundingPurchaseActivity"/>
361346
<activity
362347
android:name=".main.activity.NotebookActivity"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
33
<string name="sign_in_with_google">使用谷歌登录</string>
4-
<string name="app_name">QPython</string>
4+
<string name="app_name">QPython 3P</string>
55
</resources>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="ExtraTranslation">
22
<string name="sign_in_with_google">Sign in with Google</string>
3-
<string name="app_name">QPython</string>
3+
<string name="app_name">QPython 3P2</string>
44
</resources>

qpython/src/main/AndroidManifest.xml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
<uses-permission android:name="android.permission.FLASHLIGHT"/>
1919
<uses-permission android:name="android.permission.VIBRATE"/>
2020
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT"/>
21-
22-
<!--uses-permission android:name="android.permission.SET_DEBUG_APP"/>
23-
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
24-
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/-->
21+
<uses-permission android:name="com.android.vending.BILLING"/>
2522

2623
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
2724
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
@@ -31,13 +28,10 @@
3128
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
3229
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
3330

34-
<!--uses-permission android:name="android.permission.READ_MEDIA_STORAGE"/>
35-
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE"/-->
36-
3731
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
3832
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
39-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
4033

34+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
4135
<uses-permission android:name="android.permission.BLUETOOTH" />
4236
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
4337
<uses-permission android:name="android.permission.NFC" />

qpython/src/main/assets/QPy_KivyApp

Lines changed: 0 additions & 13 deletions
This file was deleted.

qpython/src/main/assets/QPy_QuietApp

Lines changed: 0 additions & 9 deletions
This file was deleted.

qpython/src/main/assets/QPy_SL4AApp

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#qpy:quiet
2+
#-*-coding:utf8;-*-
3+
"""
4+
This is a sample project which use SL4A UI Framework,
5+
There is another Sample project: https://github.com/qpython-android/qpy-calcount
6+
"""
7+
import qpy
8+
import androidhelper
9+
import urllib.request as ur
10+
from qsl4ahelper.fullscreenwrapper2 import *
11+
12+
droid = androidhelper.Android()
13+
14+
class MainScreen(Layout):
15+
def __init__(self):
16+
super(MainScreen,self).__init__(str("""<?xml version="1.0" encoding="utf-8"?>
17+
<LinearLayout
18+
android:layout_width="fill_parent"
19+
android:layout_height="fill_parent"
20+
android:background="#ff0E4200"
21+
android:orientation="vertical"
22+
xmlns:android="http://schemas.android.com/apk/res/android">
23+
<ImageView
24+
android:id="@+id/logo"
25+
android:layout_width="fill_parent"
26+
android:layout_height="0px"
27+
android:layout_weight="10"
28+
/>
29+
<LinearLayout
30+
android:layout_width="fill_parent"
31+
android:layout_height="0px"
32+
android:orientation="horizontal"
33+
android:layout_weight="20">
34+
35+
<TextView
36+
android:layout_width="fill_parent"
37+
android:layout_height="fill_parent"
38+
android:textSize="8dp"
39+
android:text="Hello, QPython"
40+
android:textColor="#ffffffff"
41+
android:layout_weight="1"
42+
android:gravity="center"
43+
/>
44+
</LinearLayout>
45+
46+
<ListView
47+
android:id="@+id/data_list"
48+
android:layout_width="fill_parent"
49+
android:layout_height="0px"
50+
android:layout_weight="55"/>
51+
52+
<LinearLayout
53+
android:layout_width="fill_parent"
54+
android:layout_height="0px"
55+
android:orientation="horizontal"
56+
android:layout_weight="8">
57+
<Button
58+
android:layout_width="fill_parent"
59+
android:layout_height="fill_parent"
60+
android:text="Load"
61+
android:id="@+id/but_load"
62+
android:textSize="8dp"
63+
android:background="#ffEFC802"
64+
android:textColor="#ffffffff"
65+
android:layout_weight="1"
66+
android:gravity="center"/>
67+
<Button
68+
android:layout_width="fill_parent"
69+
android:layout_height="fill_parent"
70+
android:text="Exit"
71+
android:id="@+id/but_exit"
72+
android:textSize="8dp"
73+
android:background="#ff06AF00"
74+
android:textColor="#ffffffff"
75+
android:layout_weight="1"
76+
android:gravity="center"/>
77+
</LinearLayout>
78+
</LinearLayout>
79+
"""),"SL4AApp")
80+
81+
def on_show(self):
82+
self.views.but_exit.add_event(click_EventHandler(self.views.but_exit, self.exit))
83+
self.views.but_load.add_event(click_EventHandler(self.views.but_load, self.load))
84+
85+
pass
86+
87+
def on_close(self):
88+
pass
89+
90+
def load(self, view, dummy):
91+
droid = FullScreenWrapper2App.get_android_instance()
92+
droid.makeToast("Load")
93+
94+
saved_logo = qpy.tmp+"/qpy.logo"
95+
ur.urlretrieve("https://www.qpython.org/static/img_logo.png", saved_logo)
96+
self.views.logo.src = "file://"+saved_logo
97+
98+
def exit(self, view, dummy):
99+
droid = FullScreenWrapper2App.get_android_instance()
100+
droid.makeToast("Exit")
101+
FullScreenWrapper2App.close_layout()
102+
103+
if __name__ == '__main__':
104+
FullScreenWrapper2App.initialize(droid)
105+
FullScreenWrapper2App.show_layout(MainScreen())
106+
FullScreenWrapper2App.eventloop()

0 commit comments

Comments
 (0)