Skip to content

Commit 9eec3d4

Browse files
committed
Preparing to add more scripting functionality
1 parent 0af76a9 commit 9eec3d4

File tree

9 files changed

+96
-6
lines changed

9 files changed

+96
-6
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* example-syntax2.sh */
2+
3+
Printf("Example Script V2:\n > Loops and slices\n")
4+
5+
// Iterate through a loop (subtract off two each time):
6+
$ctri = 10;
7+
while($ctri <= 0) {
8+
Printf("LOOP I = %02d\n", $ctri)
9+
$ctri--
10+
$ctri += -1
11+
}
12+
13+
// Examples of slices with arrays:
14+
Printf("TODO ...\n")
15+
16+
// Finally, conclude the script normally:
17+
Exit(0)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* string-handling.sh */
2+
3+
Printf("TODO ... Test the string handling functions ...\n")
4+
5+
6+
Exit(0)

app/src/main/java/com/maxieds/chameleonminilivedebugger/LiveLoggerActivity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,4 +945,9 @@ public void actionButtonScriptingGUIHandlePerformTaskClick(View view) {
945945
ScriptingGUIMain.scriptGUIHandlePerformTaskClick((Button) view, view.getTag().toString());
946946
}
947947

948+
public void copyButtonTagToClipboard(View btn) {
949+
String clipBoardText = ((Button) btn).getTag().toString();
950+
Utils.copyTextToClipboard(this, clipBoardText, true);
951+
}
952+
948953
}

app/src/main/java/com/maxieds/chameleonminilivedebugger/Utils.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ This program (The Chameleon Mini Live Debugger) is free software written by
1717

1818
package com.maxieds.chameleonminilivedebugger;
1919

20+
import android.content.ClipData;
21+
import android.content.ClipboardManager;
2022
import android.content.Context;
2123
import android.graphics.PorterDuff;
2224
import android.graphics.Typeface;
@@ -545,4 +547,14 @@ public static void dismissAndroidKeyboard(ChameleonMiniLiveDebuggerActivity acti
545547
}
546548
}
547549

550+
public static void copyTextToClipboard(ChameleonMiniLiveDebuggerActivity activityCtx, String textToCopy, boolean showToastStatus) {
551+
ClipboardManager clipboard = (ClipboardManager) activityCtx.getSystemService(Context.CLIPBOARD_SERVICE);
552+
ClipData clipData = ClipData.newPlainText("CMLD Find Scripts URL", textToCopy);
553+
clipboard.setPrimaryClip(clipData);
554+
if(showToastStatus) {
555+
String toastMsg = "Copied URL to Clipboard:\n" + textToCopy;
556+
Utils.displayToastMessage(activityCtx, toastMsg, Toast.LENGTH_SHORT);
557+
}
558+
}
559+
548560
}
354 Bytes
Loading

app/src/main/res/layout/apdu_search_item.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ https://github.com/maxieds/ChameleonMiniLiveDebugger
8585
android:textAllCaps="true"
8686
android:textSize="12.5sp"
8787
android:textStyle="normal"
88-
android:onClick="actionButtonAPDUCopyCmd"
8988
android:text="COPY" />
9089

9190
</RelativeLayout>

app/src/main/res/layout/scripting_tab_load_import.xml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,60 @@ https://github.com/maxieds/ChameleonMiniLiveDebugger
369369

370370
</GridLayout>
371371

372+
<View
373+
android:layout_width="match_parent"
374+
android:layout_height="2dp"
375+
android:background="?colorPrimaryDark" />
376+
377+
<View
378+
android:layout_width="match_parent"
379+
android:layout_height="2dp"
380+
android:background="?colorPrimaryDark" />
381+
382+
<TextView
383+
android:layout_width="fill_parent"
384+
android:layout_height="wrap_content"
385+
android:layout_gravity="center_vertical"
386+
android:layout_weight="1"
387+
android:background="?colorPrimaryDarkLog"
388+
android:drawableLeft="@drawable/locate_scripts24"
389+
android:drawablePadding="5dp"
390+
android:paddingLeft="10dp"
391+
android:gravity="center_vertical"
392+
android:singleLine="true"
393+
android:text="Find Sample Scripts:"
394+
android:textAllCaps="true"
395+
android:textSize="18sp"
396+
android:textStyle="bold|italic" />
397+
398+
<View
399+
android:layout_width="match_parent"
400+
android:layout_height="2dp"
401+
android:background="?colorPrimaryDark" />
402+
403+
<GridLayout
404+
android:layout_width="fill_parent"
405+
android:layout_height="wrap_content"
406+
android:layout_margin="1dp"
407+
android:background="?colorAccentLog"
408+
android:columnCount="1"
409+
android:padding="0dp">
410+
411+
<Button
412+
style="@style/GridButtonsNoWidth"
413+
android:layout_columnWeight="1.0"
414+
android:layout_weight="1.0"
415+
android:gravity="center_vertical|center_horizontal"
416+
android:layout_gravity="center_vertical|left"
417+
android:drawableLeft="@drawable/copy24"
418+
android:drawablePadding="8dp"
419+
android:paddingLeft="10dp"
420+
android:text="Copy link to sample scripts "
421+
android:tag="https://github.com/maxieds/ChameleonMiniLiveDebugger/tree/master/app/src/main/SampleScripts"
422+
android:onClick="copyButtonTagToClipboard" />
423+
424+
</GridLayout>
425+
372426
<View
373427
android:layout_width="match_parent"
374428
android:layout_height="2dp"

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ https://github.com/maxieds/ChameleonMiniLiveDebugger
3131
\nin the subtab are still under active development. They
3232
\nare not yet considered production ready. However,
3333
\ntesters and early adopters are welcome to try things
34-
\nout at any rate. A list of prospective test scripts
35-
\nis here:
36-
\nhttps://github.com/maxieds/ChameleonMiniLiveDebugger/tree/master/app/src/main/SampleScripts
37-
\n\nStay safe out there!
34+
\nout at any rate.
35+
\n\nF*ck Trump (#26), and stay safe out there!
3836
</string>
3937
<string name="appInitialUserGreetingMsgPaid">
4038
Thank you for your contribution in purchasing the paid

app/src/main/res/values/styles.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ https://github.com/maxieds/ChameleonMiniLiveDebugger
279279
<item name="android:background">?colorAccentLog</item>
280280
<item name="android:maxButtonHeight">8dp</item>
281281
<item name="android:maxHeight">40dp</item>
282-
<item name="android:layout_weight">0.29</item>
283282
<item name="android:textSize">11sp</item>
284283
<item name="android:textStyle">normal|bold</item>
285284
</style>

0 commit comments

Comments
 (0)