Skip to content

Commit 4ef90b9

Browse files
committed
Update builtin scripts and projects
1 parent 7be0476 commit 4ef90b9

File tree

8 files changed

+40
-33
lines changed

8 files changed

+40
-33
lines changed

qpython/src/main/java/org/qpython/qpy/main/activity/HomeMainActivity.java

+39-32
Original file line numberDiff line numberDiff line change
@@ -277,33 +277,33 @@ private void handleNotification() {
277277
}
278278
}
279279

280-
private void initCourseListener() {
281-
App.getService().getCourseAd().subscribeOn(Schedulers.io())
282-
.observeOn(AndroidSchedulers.mainThread())
283-
.subscribe(new MySubscriber<CourseAdModel>() {
284-
@Override
285-
public void onNext(CourseAdModel o) {
286-
super.onNext(o);
287-
if ("0".equals(o.getQpy().getCourse_open())) {
288-
// open web
289-
binding.llCourse.setOnClickListener(v ->
290-
QWebViewActivity.start(HomeMainActivity.this, getString(R.string.course), URL_COURSE));
291-
} else {
292-
// open with native
293-
binding.llCourse.setOnClickListener(v -> {
294-
CourseActivity.start(HomeMainActivity.this);
295-
sendEvent(getString(R.string.event_course));
296-
});
297-
}
298-
}
299-
300-
@Override
301-
public void onError(Throwable e) {
302-
binding.llCourse.setOnClickListener(v ->
303-
QWebViewActivity.start(HomeMainActivity.this, getString(R.string.course), URL_COURSE));
304-
}
305-
});
306-
}
280+
// private void initCourseListener() {
281+
// App.getService().getCourseAd().subscribeOn(Schedulers.io())
282+
// .observeOn(AndroidSchedulers.mainThread())
283+
// .subscribe(new MySubscriber<CourseAdModel>() {
284+
// @Override
285+
// public void onNext(CourseAdModel o) {
286+
// super.onNext(o);
287+
// if ("0".equals(o.getQpy().getCourse_open())) {
288+
// // open web
289+
// binding.llCourse.setOnClickListener(v ->
290+
// QWebViewActivity.start(HomeMainActivity.this, getString(R.string.course), URL_COURSE));
291+
// } else {
292+
// // open with native
293+
// binding.llCourse.setOnClickListener(v -> {
294+
// CourseActivity.start(HomeMainActivity.this);
295+
// sendEvent(getString(R.string.event_course));
296+
// });
297+
// }
298+
// }
299+
//
300+
// @Override
301+
// public void onError(Throwable e) {
302+
// binding.llCourse.setOnClickListener(v ->
303+
// QWebViewActivity.start(HomeMainActivity.this, getString(R.string.course), URL_COURSE));
304+
// }
305+
// });
306+
// }
307307

308308
@Override
309309
protected void onPause() {
@@ -397,12 +397,19 @@ public void extractRes() {
397397
content = getResources().openRawResource(t[i].getInt(a));
398398
content.reset();
399399

400-
if (sFileName.equals("samplewebapp.zip")) {
401-
Utils.createDirectoryOnExternalStorage("qpython/projects/webappsample");
402-
Utils.unzip(content, Environment.getExternalStorageDirectory().getAbsolutePath() + "/qpython/projects/webappsample/", true);
400+
if (sFileName.equals("projects2.zip")) {
401+
Utils.createDirectoryOnExternalStorage("qpython/projects/");
402+
Utils.unzip(content, Environment.getExternalStorageDirectory().getAbsolutePath() + "/qpython/projects/", false);
403+
404+
} else if (sFileName.equals("scripts2.zip")) {
405+
Utils.unzip(content, Environment.getExternalStorageDirectory().getAbsolutePath() + "/qpython/scripts/", false);
406+
407+
} else if (sFileName.equals("projects3.zip")) {
408+
Utils.createDirectoryOnExternalStorage("qpython/projects3/");
409+
Utils.unzip(content, Environment.getExternalStorageDirectory().getAbsolutePath() + "/qpython/projects3/", false);
403410

404-
} else if (sFileName.equals("scripts.zip")) {
405-
Utils.unzip(content, Environment.getExternalStorageDirectory().getAbsolutePath() + "/qpython/scripts/", true);
411+
} else if (sFileName.equals("scripts3.zip")) {
412+
Utils.unzip(content, Environment.getExternalStorageDirectory().getAbsolutePath() + "/qpython/scripts3/", false);
406413
}
407414

408415
} catch (Exception e) {

qpython/src/main/java/org/qpython/qpy/main/fragment/SettingFragment.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ private boolean isQPycRelease(boolean ispy2compatible) {
960960
}
961961
return isRelease;
962962
}
963-
963+
964964
private void removeQPyc2Core() {
965965
Log.d(TAG, "removeQPyc2Core");
966966
String files = getActivity().getFilesDir().getAbsolutePath();
370 KB
Binary file not shown.
190 KB
Binary file not shown.
-1.03 KB
Binary file not shown.

qpython/src/main/res/raw/scripts.zip

-2.83 KB
Binary file not shown.

qpython/src/main/res/raw/scripts2.zip

6.09 KB
Binary file not shown.

qpython/src/main/res/raw/scripts3.zip

6.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)