Skip to content

Commit

Permalink
Merge pull request #83 from victordiaz/develop
Browse files Browse the repository at this point in the history
Version 1.3.1
  • Loading branch information
victordiaz authored Oct 5, 2020
2 parents 9474d9b + a340089 commit a9d08e5
Show file tree
Hide file tree
Showing 15 changed files with 133 additions and 243 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ buildscript {
}

project.ext {
versionCode = 132
versionName = "1.3.0"
versionCode = 133
versionName = "1.3.1"
compileSdkVersion = 29
targetSdkVersion = 29
minSdkVersion = 16
Expand Down
5 changes: 5 additions & 0 deletions phonk_app/src/main/assets/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.3.1
- Http request is refactored to be more flexible supporting headers, methods, etc
- MQTT shows more descriptive errors
- Renamed createHttpServer method

1.3.0
- WebEditor fixes when previewing a file
- added onPress and onLongPress callbacks in buttons
Expand Down
2 changes: 2 additions & 0 deletions phonk_app/src/main/java/io/phonk/LauncherActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import io.phonk.gui.AboutActivity;
import io.phonk.gui.UpdateActivity;
import io.phonk.runner.base.utils.MLog;

public class LauncherActivity extends Activity {

Expand All @@ -44,6 +45,7 @@ public void onCreate(Bundle savedInstanceState) {
// or the app it self
SharedPreferences userDetails = getSharedPreferences("io.phonk", MODE_PRIVATE);
boolean firstLaunch = userDetails.getBoolean(getResources().getString(R.string.pref_is_first_launch), true);
// firstLaunch = true;

// uncomment to reset (true) first launch
// userDetails.edit().putBoolean(getResources().getString(R.string.pref_is_first_launch), true).commit();
Expand Down
3 changes: 3 additions & 0 deletions phonk_app/src/main/java/io/phonk/WelcomeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Environment;
import android.view.MenuItem;
import android.view.View;
import android.view.animation.AnimationUtils;
Expand Down Expand Up @@ -84,6 +85,8 @@ public void onCreate(Bundle savedInstanceState) {
mNextStepButton.setOnClickListener(v -> goToStep(mNextStep));
mLoading = findViewById(R.id.loading);

// MLog.d(TAG, "folder" + this.getFilesDir() + " ");

goToStep(STEP_WELCOME);
}

Expand Down
8 changes: 4 additions & 4 deletions phonk_app/src/main/java/io/phonk/appinterpreter/Network.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class Network {
public void checkVersion() {
//check if new version is available
if (mAppRunner.pNetwork.isNetworkAvailable() && (boolean) UserPreferences.getInstance().get("notify_new_version")) {
/*
mAppRunner.pNetwork.httpGet("http://www.phonk.app/downloads/list_latest.php", data -> {
//console.log(event + " " + data);
String[] splitted = ((String) data.get("response")).split(":");
Expand All @@ -45,20 +46,19 @@ public void checkVersion() {
if (versionCode > mAppRunner.pPhonk.versionCode()) {
// TODO enable this
/*
mAppRunner.pUi.popupInfo("New version available", "The new version " + versionName + " is available in the Protocoder.org website. Do you want to get it?", "Yes!", "Later", new PUI.popupCB() {
mAppRunner.pUi.popupInfo("New version available", "The new version " + versionName + " is available in the phonk.app website. Do you want to get it?", "Yes!", "Later", new PUI.popupCB() {
@Override
public void event(boolean b) {
if (b) {
mAppRunner.pDevice.openWebApp("http://www.protocoder.org#download");
mAppRunner.pDevice.openWebApp("http://www.phonk.app");
}
}
});
*/
} else {
// console.log("updated");
}
});
*/
}
}
}
2 changes: 1 addition & 1 deletion phonk_apprunner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ dependencies {

//
api 'org.greenrobot:eventbus:3.2.0'
api 'org.mozilla:rhino:1.7.12'
api 'org.mozilla:rhino:1.7.13'

// network
api group: 'org.java-websocket', name: 'Java-WebSocket', version: '1.3.4'
Expand Down
5 changes: 2 additions & 3 deletions phonk_apprunner/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@
android:windowSoftInputMode="stateUnchanged"
android:theme="@style/PhonkAppRunnerTheme"
android:label="@string/runner_name"
android:launchMode="standard" >
android:launchMode="standard">

<intent-filter>

<action android:name="io.phonk.runner.AppRunnerActivity" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
Expand All @@ -111,7 +110,7 @@

<service
android:name="io.phonk.runner.AppRunnerLauncherService"
android:label="AppRunnerServiceLauncher" >
android:label="AppRunnerLauncherService" >
</service>

<service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ protected void onCreate(Bundle savedInstanceState) {
AppRunnerSettings.SERVER_PORT = intent.getIntExtra(Project.SERVER_PORT, 0);
Project p = new Project(folder, name);

// MLog.d(TAG, "launching " + folder + " " + name);

// settings
scriptSettings = AppRunnerHelper.readProjectProperties(getApplicationContext(), p);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import androidx.fragment.app.Fragment;

Expand Down Expand Up @@ -102,14 +103,18 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

MLog.d(TAG, "bundle " + bundle);

if (bundle != null) {
folder = bundle.getString(Project.FOLDER, "");
name = bundle.getString(Project.NAME, "");
// String settings = bundle.getString(Project.SETTINGS, "");

mAppRunner.loadProject(folder, name);
// if there is not intent data we close the activity
if (bundle == null) {
Toast.makeText(getContext(), "No project to load", Toast.LENGTH_LONG).show();
getActivity().finish();
}

folder = bundle.getString(Project.FOLDER, "");
name = bundle.getString(Project.NAME, "");
// String settings = bundle.getString(Project.SETTINGS, "");

mAppRunner.loadProject(folder, name);

mAppRunner.mIntentPrefixScript = bundle.getString(Project.PREFIX, "");
mAppRunner.mIntentCode = bundle.getString(Project.INTENTCODE, "");
mAppRunner.mIntentPostfixScript = bundle.getString(Project.POSTFIX, "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public void onReceive(Context context, Intent intent) {

}

@PhonkMethod
public Bundle getIntentData() {
return intentData;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public PConsole error(Object outputs) {
}

public PConsole p_error(int type, Object outputs) {
MLog.d("qq", "" + type);
// MLog.d("qq", "" + type);

switch (type) {
case AppRunnerInterpreter.RESULT_ERROR:
Expand Down
Loading

0 comments on commit a9d08e5

Please sign in to comment.