From 9eec3d4bd94b3b3bac6102abfc0f4516b3c19735 Mon Sep 17 00:00:00 2001 From: "Maxie D. Schmidt" Date: Thu, 29 Apr 2021 13:50:12 -0400 Subject: [PATCH] Preparing to add more scripting functionality --- app/src/main/SampleScripts/example-syntax2.sh | 17 ++++++ app/src/main/SampleScripts/string-handling.sh | 6 ++ .../LiveLoggerActivity.java | 5 ++ .../chameleonminilivedebugger/Utils.java | 12 ++++ .../main/res/drawable/locate_scripts24.webp | Bin 0 -> 354 bytes app/src/main/res/layout/apdu_search_item.xml | 1 - .../res/layout/scripting_tab_load_import.xml | 54 ++++++++++++++++++ app/src/main/res/values/strings.xml | 6 +- app/src/main/res/values/styles.xml | 1 - 9 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 app/src/main/res/drawable/locate_scripts24.webp diff --git a/app/src/main/SampleScripts/example-syntax2.sh b/app/src/main/SampleScripts/example-syntax2.sh index e69de29..1a29420 100644 --- a/app/src/main/SampleScripts/example-syntax2.sh +++ b/app/src/main/SampleScripts/example-syntax2.sh @@ -0,0 +1,17 @@ +/* example-syntax2.sh */ + +Printf("Example Script V2:\n > Loops and slices\n") + +// Iterate through a loop (subtract off two each time): +$ctri = 10; +while($ctri <= 0) { + Printf("LOOP I = %02d\n", $ctri) + $ctri-- + $ctri += -1 +} + +// Examples of slices with arrays: +Printf("TODO ...\n") + +// Finally, conclude the script normally: +Exit(0) diff --git a/app/src/main/SampleScripts/string-handling.sh b/app/src/main/SampleScripts/string-handling.sh index e69de29..40a1355 100644 --- a/app/src/main/SampleScripts/string-handling.sh +++ b/app/src/main/SampleScripts/string-handling.sh @@ -0,0 +1,6 @@ +/* string-handling.sh */ + +Printf("TODO ... Test the string handling functions ...\n") + + +Exit(0) diff --git a/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java b/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java index bb4e50a..1127f85 100644 --- a/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java +++ b/app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java @@ -945,4 +945,9 @@ public void actionButtonScriptingGUIHandlePerformTaskClick(View view) { ScriptingGUIMain.scriptGUIHandlePerformTaskClick((Button) view, view.getTag().toString()); } + public void copyButtonTagToClipboard(View btn) { + String clipBoardText = ((Button) btn).getTag().toString(); + Utils.copyTextToClipboard(this, clipBoardText, true); + } + } \ No newline at end of file diff --git a/app/src/main/java/com/maxieds/chameleonminilivedebugger/Utils.java b/app/src/main/java/com/maxieds/chameleonminilivedebugger/Utils.java index 956aff0..08bf150 100644 --- a/app/src/main/java/com/maxieds/chameleonminilivedebugger/Utils.java +++ b/app/src/main/java/com/maxieds/chameleonminilivedebugger/Utils.java @@ -17,6 +17,8 @@ This program (The Chameleon Mini Live Debugger) is free software written by package com.maxieds.chameleonminilivedebugger; +import android.content.ClipData; +import android.content.ClipboardManager; import android.content.Context; import android.graphics.PorterDuff; import android.graphics.Typeface; @@ -545,4 +547,14 @@ public static void dismissAndroidKeyboard(ChameleonMiniLiveDebuggerActivity acti } } + public static void copyTextToClipboard(ChameleonMiniLiveDebuggerActivity activityCtx, String textToCopy, boolean showToastStatus) { + ClipboardManager clipboard = (ClipboardManager) activityCtx.getSystemService(Context.CLIPBOARD_SERVICE); + ClipData clipData = ClipData.newPlainText("CMLD Find Scripts URL", textToCopy); + clipboard.setPrimaryClip(clipData); + if(showToastStatus) { + String toastMsg = "Copied URL to Clipboard:\n" + textToCopy; + Utils.displayToastMessage(activityCtx, toastMsg, Toast.LENGTH_SHORT); + } + } + } \ No newline at end of file diff --git a/app/src/main/res/drawable/locate_scripts24.webp b/app/src/main/res/drawable/locate_scripts24.webp new file mode 100644 index 0000000000000000000000000000000000000000..1855edec401db6eda657ab48308fee0c15d9faa2 GIT binary patch literal 354 zcmV-o0iFI*Nk&Fm0RRA3MM6+kP&il$0000G0000N000*N06|PpNDTo100IBvpp7I) zI@ip7PW%BshKR_6!FG4I;XKg;7T2t9+=a%^{bAMKXR0yJNN~%a5g`zX!cPX9jfdB5VFJl4|RS>>=1C;VSmEr`rNQjKs_zA z4ut5X%3x5^%Mim>IRodiRnp&maqIPO%iFJn;G<~5_YX{^ho7aGwB+B=>G36Rj}@E% z+?3i7Z4=~ykCVOlz15Z1yQ+HqmkcKdc8-(0nT>_H(YPoWEw=>6g?EY_Np_0TCmbAE zcc}e3IP!G$_ZA+x*Z2E$cE2y3B!M)E-hS7MYeDi{D506vjKol2#nqM@h=0I(7XX#fB{qo4r(_|F=^0Ia~J AApigX literal 0 HcmV?d00001 diff --git a/app/src/main/res/layout/apdu_search_item.xml b/app/src/main/res/layout/apdu_search_item.xml index 5ea8330..8fc74ec 100644 --- a/app/src/main/res/layout/apdu_search_item.xml +++ b/app/src/main/res/layout/apdu_search_item.xml @@ -85,7 +85,6 @@ https://github.com/maxieds/ChameleonMiniLiveDebugger android:textAllCaps="true" android:textSize="12.5sp" android:textStyle="normal" - android:onClick="actionButtonAPDUCopyCmd" android:text="COPY" /> diff --git a/app/src/main/res/layout/scripting_tab_load_import.xml b/app/src/main/res/layout/scripting_tab_load_import.xml index ae97fb7..92b7cab 100644 --- a/app/src/main/res/layout/scripting_tab_load_import.xml +++ b/app/src/main/res/layout/scripting_tab_load_import.xml @@ -369,6 +369,60 @@ https://github.com/maxieds/ChameleonMiniLiveDebugger + + + + + + + + + + +