Skip to content

Commit

Permalink
v2.56
Browse files Browse the repository at this point in the history
  • Loading branch information
zeevy committed May 24, 2020
1 parent 1158639 commit 4e878ca
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 22 deletions.
19 changes: 12 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ android {
applicationId "in.co.gorest.grblcontroller"
minSdkVersion 19
targetSdkVersion 29
versionCode 36
versionName "2.45"
versionCode 37
versionName "2.56"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
Expand All @@ -44,6 +44,11 @@ android {
dataBinding {
enabled = true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

allprojects {
Expand All @@ -56,8 +61,8 @@ allprojects {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.firebase:firebase-core:17.2.3'
implementation 'com.google.firebase:firebase-messaging:20.1.2'
implementation 'com.google.firebase:firebase-core:17.4.2'
implementation 'com.google.firebase:firebase-messaging:20.2.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
Expand All @@ -71,16 +76,16 @@ dependencies {
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.preference:preference:1.1.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.github.warkiz.widget:indicatorseekbar:2.1.2'
implementation 'com.github.felHR85:UsbSerial:6.1.0'
implementation 'com.nbsp:library:1.8'
implementation 'com.nbsp:materialfilepicker:1.9.1'
implementation 'com.squareup.retrofit2:retrofit:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
implementation 'com.github.satyan:sugar:1.5'

annotationProcessor 'androidx.databinding:databinding-compiler:3.6.1'
annotationProcessor 'androidx.databinding:databinding-compiler:3.6.3'

testImplementation 'junit:junit:4.13'
}
Expand Down
19 changes: 13 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@
android:largeHeap="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
android:requestLegacyExternalStorage="true"
tools:ignore="GoogleAppIndexingWarning"
tools:targetApi="q">
<activity
android:name=".SplashActivity"
android:resizeableActivity="false"
android:screenOrientation="portrait"
android:supportsPictureInPicture="false"
android:theme="@style/SplashTheme"
tools:targetApi="n">
tools:targetApi="n"
tools:ignore="LockedOrientationActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -50,15 +53,17 @@
android:screenOrientation="portrait"
android:supportsPictureInPicture="false"
android:theme="@style/AppTheme.NoActionBar"
tools:targetApi="n" />
tools:targetApi="n"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".UsbConnectionActivity"
android:label="@string/app_name"
android:resizeableActivity="false"
android:screenOrientation="portrait"
android:supportsPictureInPicture="false"
android:theme="@style/AppTheme.NoActionBar"
tools:targetApi="n" />
tools:targetApi="n"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".DeviceListActivity"
android:configChanges="orientation|keyboardHidden"
Expand All @@ -72,13 +77,15 @@
android:resizeableActivity="false"
android:screenOrientation="portrait"
android:supportsPictureInPicture="false"
tools:targetApi="n" />
tools:targetApi="n"
tools:ignore="LockedOrientationActivity" />
<activity
android:name=".AboutActivity"
android:resizeableActivity="false"
android:screenOrientation="portrait"
android:supportsPictureInPicture="false"
tools:targetApi="n" />
tools:targetApi="n"
tools:ignore="LockedOrientationActivity" />

<activity android:name=".NotificationArchiveActivity" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,9 @@ protected void applicationSetup(){
sharedPref.getBoolean(getString(R.string.preference_jogging_in_inches), false));
machineStatus.setVerboseOutput(sharedPref.getBoolean(getString(R.string.preference_console_verbose_mode), false));
machineStatus.setIgnoreError20(sharedPref.getBoolean(getString(R.string.preference_ignore_error_20), false));
machineStatus.setUsbBaudRate(Integer.valueOf(sharedPref.getString(getString(R.string.usb_serial_baud_rate), Constants.USB_BAUD_RATE)));
machineStatus.setUsbBaudRate(Integer.parseInt(sharedPref.getString(getString(R.string.usb_serial_baud_rate), Constants.USB_BAUD_RATE)));
machineStatus.setSingleStepMode(sharedPref.getBoolean(getString(R.string.preference_single_step_mode), false));
machineStatus.setCustomStartUpString(sharedPref.getString(getString(R.string.preference_start_up_string), ""));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
|| key.equals(getString(R.string.preference_single_step_mode))
|| key.equals(getString(R.string.usb_serial_baud_rate))
|| key.equals(getString(R.string.preference_keep_screen_on))
|| key.equals(getString(R.string.preference_update_pool_interval))){
|| key.equals(getString(R.string.preference_update_pool_interval))
|| key.equals(getString(R.string.preference_start_up_string))){
EventBus.getDefault().post(new UiToastEvent("Application restart required", true, true));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public class SplashActivity extends AppCompatActivity {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}



@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public class MachineStatusListener extends BaseObservable {
private int usbBaudRate = 115200;
private Boolean singleStepMode = false;

private String customStartUpString = "";

private static MachineStatusListener machineStatus = null;
public static MachineStatusListener getInstance(){
if(machineStatus == null) machineStatus = new MachineStatusListener();
Expand All @@ -86,6 +88,13 @@ private MachineStatusListener(){
this.parserState = new ParserState("G0 G54 G17 G21 G90 G94");
}

@Bindable
public String getCustomStartUpString(){ return this.customStartUpString; }
public void setCustomStartUpString(String message){
this.customStartUpString = message;
notifyPropertyChanged(BR.customStartUpString);
}

@Bindable
public Boolean getIgnoreError20(){ return this.ignoreError20; }
public void setIgnoreError20(Boolean ignoreError20){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,19 @@ protected boolean onSerialRead(String message){

MachineStatusListener.BuildInfo buildInfo = new MachineStatusListener.BuildInfo(versionDouble, versionLetter);

if (buildInfo.versionDouble == Constants.MIN_SUPPORTED_VERSION) {
if (buildInfo.versionDouble >= Constants.MIN_SUPPORTED_VERSION) {
machineStatus.setBuildInfo(buildInfo);
isVersionString = true;
} else {
String messageNotSupported = GrblController.getInstance().getString(R.string.text_grbl_unsupported, String.valueOf(Constants.MIN_SUPPORTED_VERSION));
EventBus.getDefault().post(new UiToastEvent(messageNotSupported));
EventBus.getDefault().post(new ConsoleMessageEvent(messageNotSupported));
}
}else if(GrblUtils.isSmoothieBoard(message)){
}else if(GrblUtils.isSmoothieBoard(message)) {
isVersionString = true;

}else if(machineStatus.getCustomStartUpString().length() > 0
&& message.toLowerCase().startsWith(machineStatus.getCustomStartUpString().toLowerCase())){
isVersionString = true;
}else{
EventBus.getDefault().post(new ConsoleMessageEvent(message));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ private void getFilePicker(){

new MaterialFilePicker()
.withActivity(getActivity())
.withCloseMenu(true)
.withRequestCode(Constants.FILE_PICKER_REQUEST_CODE)
.withHiddenFiles(false)
.withFilter(Pattern.compile(Constants.SUPPORTED_FILE_TYPES_STRING, Pattern.CASE_INSENSITIVE))
Expand All @@ -453,7 +454,7 @@ private void getFilePicker(){
private Boolean hasExternalStorageReadPermission(){
boolean hasPermission = true;
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if(Objects.requireNonNull(getActivity()).checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
if(requireActivity().checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
hasPermission = false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static Boolean isGrblVersionString(final String response) {
}

public static Boolean isSmoothieBoard(final String response){
return response.toLowerCase().startsWith("smoothie");
return response.toLowerCase().startsWith("smoothie") || response.toLowerCase().startsWith("carbide");
}

private final static String VERSION_DOUBLE_REGEX = "[0-9]*\\.[0-9]*";
Expand Down
32 changes: 32 additions & 0 deletions app/src/main/res/drawable/ic_settings_input_hdmi_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--
~ /*
~ * /**
~ * * Copyright (C) 2017 Grbl Controller Contributors
~ * *
~ * * This program is free software; you can redistribute it and/or modify
~ * * it under the terms of the GNU General Public License as published by
~ * * the Free Software Foundation; either version 2 of the License, or
~ * * (at your option) any later version.
~ * *
~ * * This program is distributed in the hope that it will be useful,
~ * * but WITHOUT ANY WARRANTY; without even the implied warranty of
~ * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ * * GNU General Public License for more details.
~ * *
~ * * You should have received a copy of the GNU General Public License along
~ * * with this program; if not, write to the Free Software Foundation, Inc.,
~ * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
~ * * <http://www.gnu.org/licenses/>
~ *
~ */
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M18,7V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v3H5v6l3,6v3h8v-3l3,-6V7h-1zM8,4h8v3h-2V5h-1v2h-2V5h-1v2H8V4z"/>
</vector>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<string name="app_name" translatable="false">Grbl Controller</string>
<string name="shared_preference_key" translatable="false">in.co.gorest.grblcontroller.f635f2e523d7c64f5b4ad9179b689433</string>
<string name="preference_auto_connect" translatable="false">auto_connect</string>
<string name="preference_start_up_string" translatable="false">start_up_string</string>
<string name="preference_console_verbose_mode" translatable="false">console_verbose_mode</string>
<string name="preference_jogging_step_size" translatable="false">jogging_step_size</string>
<string name="preference_jogging_step_size_z" translatable="false">jogging_step_size_z</string>
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/xml/application_pref.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

<Preference android:title="@string/text_application_settings"/>

<EditTextPreference
android:icon="@drawable/ic_settings_input_hdmi_black_24dp"
android:key="@string/preference_start_up_string"
android:title="Start up string"
android:summary="If you have custom firmware, enter start up string here"/>

<ListPreference
android:key="@string/preference_default_serial_connection_type"
android:icon="@drawable/ic_device_hub_black_24dp"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'io.fabric.tools:gradle:1.29.0'
}
Expand Down

0 comments on commit 4e878ca

Please sign in to comment.