Fix copy/paste and add new print icons.

- Fix: Bad text characters when copy/paste the stack.
- Improve the print icons.
This commit is contained in:
dgis 2019-06-21 08:30:39 +02:00
parent e3057ff772
commit a527aa1fd4
9 changed files with 42 additions and 9 deletions

View file

@ -61,6 +61,7 @@ CHANGES
Version 1.5 (2019-06-xx)
- Fix: Selecting an empty KML folder prevent to select the default embedded KML folder (Github Fix: #5)!
- Fix: Bad text characters when copy/paste the stack.
Version 1.4 (2019-06-08)

View file

@ -214,9 +214,14 @@ void clipboardCopyText(const TCHAR * text) {
jclass mainActivityClass = (*jniEnv)->GetObjectClass(jniEnv, mainActivity);
if(mainActivityClass) {
jmethodID midStr = (*jniEnv)->GetMethodID(jniEnv, mainActivityClass, "clipboardCopyText", "(Ljava/lang/String;)V");
jstring messageUTF = (*jniEnv)->NewStringUTF(jniEnv, text);
jint length = _tcslen(text);
unsigned short * utf16String = malloc(2 * (length + 1));
for (int i = 0; i <= length; ++i)
utf16String[i] = ((unsigned char *)text)[i];
jstring messageUTF = (*jniEnv)->NewString(jniEnv, utf16String, length);
(*jniEnv)->CallVoidMethod(jniEnv, mainActivity, midStr, messageUTF);
(*jniEnv)->DeleteLocalRef(jniEnv, mainActivityClass);
free(utf16String);
}
}
}
@ -229,10 +234,12 @@ const TCHAR * clipboardPasteText() {
jobject result = (*jniEnv)->CallObjectMethod(jniEnv, mainActivity, midStr);
(*jniEnv)->DeleteLocalRef(jniEnv, mainActivityClass);
if(result) {
const char *strReturn = (*jniEnv)->GetStringUTFChars(jniEnv, result, 0);
size_t length = _tcslen(strReturn);
const jchar *strReturn = (*jniEnv)->GetStringChars(jniEnv, result, 0);
jsize length = (*jniEnv)->GetStringLength(jniEnv, result);
TCHAR * pasteText = (TCHAR *) GlobalAlloc(0, length + 2);
_tcscpy(pasteText, strReturn);
for (int i = 0; i <= length; ++i)
pasteText[i] = strReturn[i] & 0xFF;
pasteText[length] = 0;
(*jniEnv)->ReleaseStringUTFChars(jniEnv, result, strReturn);
return pasteText;
}

View file

@ -0,0 +1,9 @@
<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="#FFFFFFFF"
android:pathData="M6,2c-1.1,0 -1.99,0.9 -1.99,2L4,20c0,1.1 0.89,2 1.99,2L18,22c1.1,0 2,-0.9 2,-2L20,8l-6,-6L6,2zM13,9L13,3.5L18.5,9L13,9z"/>
</vector>

View file

@ -5,8 +5,8 @@
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="m 15,11 -4,5 h 12 l -3,-4 -2.03,2.71 z m 7,-1.4264 c 0,-0.83 -0.67,-1.5 -1.5,-1.5 -0.83,0 -1.5,0.67 -1.5,1.5 0,0.83 0.67,1.5 1.5,1.5 0.83,0 1.5,-0.67 1.5,-1.5 z"/>
android:pathData="m 16,9.5 -4,5 h 12 l -3,-4 -2.03,2.71 z m 7,-1.4264 c 0,-0.83 -0.67,-1.5 -1.5,-1.5 -0.83,0 -1.5,0.67 -1.5,1.5 0,0.83 0.67,1.5 1.5,1.5 0.83,0 1.5,-0.67 1.5,-1.5 z"/>
<path
android:fillColor="#FFFFFFFF"
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z" />
android:pathData="m 14.492087,15.116493 c -0.582265,0 -1.10324,0.229842 -1.501632,0.589928 L 7.5278825,12.526943 c 0.038307,-0.176212 0.068952,-0.352424 0.068952,-0.536297 0,-0.183874 -0.030646,-0.360086 -0.068952,-0.536298 L 12.929164,8.3055162 c 0.413715,0.3830696 0.957674,0.6205727 1.562923,0.6205727 1.271791,0 2.298418,-1.0266265 2.298418,-2.2984175 0,-1.271791 -1.026627,-2.2984175 -2.298418,-2.2984175 -1.271791,0 -2.298417,1.0266265 -2.298417,2.2984175 0,0.1838734 0.03065,0.3600854 0.06895,0.5362974 L 6.8613414,10.312801 C 6.4476262,9.9297312 5.9036674,9.6922281 5.2984175,9.6922281 4.0266265,9.6922281 3,10.718855 3,11.990646 c 0,1.271791 1.0266265,2.298417 2.2984175,2.298417 0.6052499,0 1.1492087,-0.237503 1.5629239,-0.620573 l 5.4549106,3.187139 c -0.03831,0.160889 -0.06129,0.32944 -0.06129,0.497991 0,1.233484 1.003642,2.237126 2.237126,2.237126 1.233484,0 2.237127,-1.003642 2.237127,-2.237126 0,-1.233484 -1.003643,-2.237127 -2.237127,-2.237127 z" />
</vector>

View file

@ -5,8 +5,8 @@
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="m 23,15 h -8 v -2 h 8 z m 0,-4 h -8 v -2 h 8 z"/>
android:pathData="m 21.739513,11.299304 h -9.716906 v 1.143165 h 9.716906 z m 0,-2.2863306 h -9.716906 v 1.1431656 h 9.716906 z M 12.022607,14.7288 h 7.430575 v -1.143165 h -7.430575 z"/>
<path
android:fillColor="#FFFFFFFF"
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z" />
android:pathData="m 14.492087,15.116493 c -0.582265,0 -1.10324,0.229842 -1.501632,0.589928 L 7.5278825,12.526943 c 0.038307,-0.176212 0.068952,-0.352424 0.068952,-0.536297 0,-0.183874 -0.030646,-0.360086 -0.068952,-0.536298 L 12.929164,8.3055162 c 0.413715,0.3830696 0.957674,0.6205727 1.562923,0.6205727 1.271791,0 2.298418,-1.0266265 2.298418,-2.2984175 0,-1.271791 -1.026627,-2.2984175 -2.298418,-2.2984175 -1.271791,0 -2.298417,1.0266265 -2.298417,2.2984175 0,0.1838734 0.03065,0.3600854 0.06895,0.5362974 L 6.8613414,10.312801 C 6.4476262,9.9297312 5.9036674,9.6922281 5.2984175,9.6922281 4.0266265,9.6922281 3,10.718855 3,11.990646 c 0,1.271791 1.0266265,2.298417 2.2984175,2.298417 0.6052499,0 1.1492087,-0.237503 1.5629239,-0.620573 l 5.4549106,3.187139 c -0.03831,0.160889 -0.06129,0.32944 -0.06129,0.497991 0,1.233484 1.003642,2.237126 2.237126,2.237126 1.233484,0 2.237127,-1.003642 2.237127,-2.237126 0,-1.233484 -1.003643,-2.237127 -2.237127,-2.237127 z" />
</vector>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<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="M19,8L5,8c-1.66,0 -3,1.34 -3,3v6h4v4h12v-4h4v-6c0,-1.66 -1.34,-3 -3,-3zM16,19L8,19v-5h8v5zM19,12c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1 1,0.45 1,1 -0.45,1 -1,1zM18,3L6,3v4h12L18,3z"/>
</vector>

View file

@ -90,7 +90,7 @@
android:title="@string/nav_change_kml_script" />
<item
android:id="@+id/nav_show_printer"
android:icon="@drawable/ic_wallpaper_black_24dp"
android:icon="@drawable/ic_print_black_24dp"
android:title="@string/nav_show_printer" />
</menu>
</item>

View file

@ -12,4 +12,9 @@
android:icon="@drawable/ic_menu_share_graphic"
android:title="@string/menu_printer_simulator_share_graphic"
app:showAsAction="ifRoom|withText" />
<item
android:id="@+id/menu_printer_simulator_change_paper"
android:icon="@drawable/ic_insert_drive_file_white_24dp"
android:title="@string/menu_printer_simulator_change_paper" />
</menu>

View file

@ -56,6 +56,7 @@
<string name="tab_printer_graphical">Graphic</string>
<string name="menu_printer_simulator_share_text">Share Text</string>
<string name="menu_printer_simulator_share_graphic">Share Graphic</string>
<string name="menu_printer_simulator_change_paper">Change Paper (Erase)</string>
<string name="create_ram_card_title">Create RAM Card</string>
<string name="message_open_security">Permission Denied</string>