Skip to content

Commit 7992493

Browse files
WallaceSitWallaceSit
authored andcommitted
v2.7.0
v2.6.4 • Revise the name of some code as per the revised programmer guide V6.0 • Library: revise the public setting of some classes/variables/methods as per the revise programmer guide V6.0 • Library: add “-2 TH” country setting v2.6.3A • Library: improve “for some value, big difference between read RSSI threshold and written threshold in Filters – RSSI-Filters page” problem. v2.6.3 • Avoid blinking of Ton/Toff debug display of the status of trigger key v2.6.2 • Correct exceptional case when barcode is selected in Barcode Inventory page • Correct exceptional case when entering Read/Write page after barcode is selected in Barcode Inventory page v2.6.1 • Avoid checking Rfid module failure in Setting->Administration page, whose parameter setting is not related to Rfid module • Show “Permissions are not granted. Please allow them in system setting” toast only if request permission is denied, which avoids Toast and RequestPermisson dialog overlapped • No permission request for storage if android version is 10+, which avoids Toast and requestPermission dialog overlapped in some extent • Relocate some codes. • Library: set default auto trigger reporting interval as 1 instead of 0 • Library: make sure A008 is sent for the first installation • Library: Correct missing model number with only country code, which is present for the first time in Setting->Administration page • Library: Remove some unused codes.
1 parent 3f377b1 commit 7992493

23 files changed

+89
-84
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ android {
66
applicationId "com.csl.cs108ademoapp"
77
minSdkVersion 19
88
targetSdkVersion 31
9-
versionCode 37
10-
versionName "2.6.0"
9+
versionCode 38
10+
versionName "2.7.0"
1111
}
1212
}
1313

-246 KB
Binary file not shown.
245 KB
Binary file not shown.
-2.8 MB
Binary file not shown.
-2.41 MB
Binary file not shown.
2.8 MB
Binary file not shown.
2.41 MB
Binary file not shown.

app/src/main/java/com/csl/cs108ademoapp/InventoryBarcodeTask.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected void onPreExecute() {
4747
taskCancelReason = TaskCancelRReason.NULL;
4848
if (barcodeYieldView != null) barcodeYieldView.setText("");
4949

50-
MainActivity.mCs108Library4a.barcodeInvventory(true);
50+
MainActivity.mCs108Library4a.barcodeInventory(true);
5151
if (DEBUG) MainActivity.mCs108Library4a.appendToLog("InventoryBarcodeFragment.InventoryRfidTask.onPreExecute()");
5252
if (MainActivity.mCs108Library4a.getInventoryVibrate() && bUseVibrateMode0 == false) MainActivity.mCs108Library4a.setVibrateOn(3);
5353
}
@@ -253,7 +253,7 @@ public InventoryBarcodeTask(ArrayList<ReaderDevice> tagsList, ReaderListAdapter
253253

254254
void DeviceConnectTask4InventoryEnding(TaskCancelRReason taskCancelRReason) {
255255
if (readerListAdapter != null) readerListAdapter.notifyDataSetChanged();
256-
MainActivity.mCs108Library4a.barcodeInvventory(false);
256+
MainActivity.mCs108Library4a.barcodeInventory(false);
257257
if (DEBUG) MainActivity.mCs108Library4a.appendToLog("DeviceConnectTask4InventoryEnding(): sent setBarcodeOn(false)");
258258
if (taskCancelReason == null) {
259259
new Handler().postDelayed(new Runnable() {

app/src/main/java/com/csl/cs108ademoapp/MainActivity.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import android.os.Bundle;
1414
import androidx.appcompat.app.AppCompatActivity;
1515
import android.util.Log;
16+
import android.view.Gravity;
1617
import android.view.View;
1718
import android.widget.AdapterView;
1819
import android.widget.ListView;
@@ -260,7 +261,18 @@ public void onBackPressed() {
260261
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
261262
MainActivity.mCs108Library4a.appendToLog("permissionRequesting: requestCode = " + requestCode + ", permissions is " + (permissions == null ? "null" : "valid") + ", grantResults is " + (grantResults == null ? "null" : "valid") );
262263
MainActivity.mCs108Library4a.appendToLog("permissionRequesting: permissions[" + permissions.length + "] = " + (permissions != null && permissions.length > 0 ? permissions[0] : ""));
263-
MainActivity.mCs108Library4a.appendToLog("permissionRequesting: grantResults[" + grantResults.length + "] = " + (grantResults != null && grantResults.length > 0 ? grantResults[0] : "") );
264+
if (grantResults != null && grantResults.length != 0) {
265+
boolean bNegative = false;
266+
for (int i = 0; i < grantResults.length; i++) {
267+
if (grantResults[i] < 0) bNegative = true;
268+
mCs108Library4a.appendToLog("permissionRequesting: grantResults[" + i + "] = " + grantResults[i] );
269+
}
270+
if (bNegative) {
271+
Toast toast = Toast.makeText(this, R.string.toast_permission_not_granted, Toast.LENGTH_SHORT);
272+
if (false) toast.setGravity(Gravity.TOP | Gravity.RIGHT, 100, 200);
273+
toast.show();
274+
}
275+
}
264276
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
265277
permissionRequesting = false;
266278
}

app/src/main/java/com/csl/cs108ademoapp/SaveList2ExternalTask.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,14 +374,14 @@ public String save2File(String messageStr, boolean requestPermission) {
374374
String resultDisplay = "";
375375
if (MainActivity.mCs108Library4a.getSaveFileEnable() == false) return "No saving file as it is disabled";
376376
boolean writeExtPermission = true;
377-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
377+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
378378
if (mContext.checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
379379
mCs108Library4a.appendToLog("WRITE_EXTERNAL_STORAGE Permission is required !!!");
380380
writeExtPermission = false;
381381
if (requestPermission) {
382382
mCs108Library4a.appendToLog("requestPermissions WRITE_EXTERNAL_STORAGE 1");
383383
MainActivity.permissionRequesting = true; requestPermissions((Activity) mContext, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
384-
Toast.makeText(mContext, com.csl.cs108library4a.R.string.toast_permission_not_granted, Toast.LENGTH_SHORT).show();
384+
if (false) Toast.makeText(mContext, com.csl.cs108library4a.R.string.toast_permission_not_granted, Toast.LENGTH_SHORT).show();
385385
return null;
386386
}
387387
} else mCs108Library4a.appendToLog("WRITE_EXTERNAL_STORAGE Permission is GRANTED !!!");

0 commit comments

Comments
 (0)