From ad07f8685c013f10443231cf6a3a085c3be4e930 Mon Sep 17 00:00:00 2001 From: fkloft Date: Wed, 13 Aug 2014 10:56:53 +0200 Subject: [PATCH] [mobile] ability to clear the log (and always show debug in menu) --- mobile/res/drawable-hdpi/ic_action_discard.png | Bin 0 -> 450 bytes mobile/res/drawable-mdpi/ic_action_discard.png | Bin 0 -> 324 bytes mobile/res/drawable-xhdpi/ic_action_discard.png | Bin 0 -> 543 bytes mobile/res/drawable-xxhdpi/ic_action_discard.png | Bin 0 -> 765 bytes mobile/res/layout/activity_main.xml | 10 ++++++++++ mobile/res/values/strings.xml | 1 + .../src/com/cradle/iitc_mobile/IITC_Mobile.java | 15 ++++++++++++--- 7 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 mobile/res/drawable-hdpi/ic_action_discard.png create mode 100644 mobile/res/drawable-mdpi/ic_action_discard.png create mode 100644 mobile/res/drawable-xhdpi/ic_action_discard.png create mode 100644 mobile/res/drawable-xxhdpi/ic_action_discard.png diff --git a/mobile/res/drawable-hdpi/ic_action_discard.png b/mobile/res/drawable-hdpi/ic_action_discard.png new file mode 100644 index 0000000000000000000000000000000000000000..703b31f8027859b5810937a5c2da2b97428c68ed GIT binary patch literal 450 zcmV;z0X_bSP)3kAs1qih2LP}sp1f-fdKLlLI zKM9>014mq!#s;4VM$Y&&F`b*7>b5h szZOL!<(tn#I`>~o3WY)u2Oa_p0K4L5a@AHer~m)}07*qoM6N<$g3So4vj6}9 literal 0 HcmV?d00001 diff --git a/mobile/res/drawable-mdpi/ic_action_discard.png b/mobile/res/drawable-mdpi/ic_action_discard.png new file mode 100644 index 0000000000000000000000000000000000000000..248fb09cd0c918955323e790c4c3250997c99819 GIT binary patch literal 324 zcmV-K0lWT*P)F4>9Waur;s5{tYCy^X zhxBqrM#j&in8!kfqlTV4U*;DIaLCs{^ql z0WHsg_$Cma1>!A)(gZOM*bk(5$qgl-0~{%h0$vJ2n3o!9;4B3WI7^js0GjvF(|{Bb z8x-%)(9-}g_-|3Av;sQ7msWa+4S_QxMhCc{0)~JIwF@F+YS#r!3b z00013D4d29@BNw{`GK#!IOpow6F|uq^msku)shH!j2+*Z;nkUHI5}5Nsv{e#>K)mw zWRtU)n_#)>@#_cBs7qLY32z9U;|@$3;jm;{jsQ;j zp6rI~B688%utk!+Ns!?Ll3&qdHPOu25DA;93HY2;$~t%TUxm;jx4~Hw&`ubCYk`0V zvh4)PZ`rpE9l!!7Y=gx>1Bl9Kwu(=Ro%!Q1k&?5z%YNvC;tx_dEbp+-cN*UX0D)>h zam8c%$%8L*XMuqr3QKp#{VH+7>)R!ed)c?rsRAe_0kcqm5JDh8o&Zfn*jgl@Q6!*2 z3xEI+fFXz>h!y|=AYiFOu(L>j<`AsW0w4ecm?NN5jN9H2)ckZU=?g6Y0%TDt#9Ue? z;5mtV)2m`1a`Plcl-~Pr;qf~8{#hzj^$!|;@8SbB_Il;ZkNr>5;($tj-3}YOSP1|C h00000oPfOm0|4WXd=hHbFpB^H002ovPDHLkV1n%A=T`s# literal 0 HcmV?d00001 diff --git a/mobile/res/drawable-xxhdpi/ic_action_discard.png b/mobile/res/drawable-xxhdpi/ic_action_discard.png new file mode 100644 index 0000000000000000000000000000000000000000..cb1260a4c68d931cb7dbe80341355c1c2438bd9a GIT binary patch literal 765 zcmVB@;q-4;5x(4O!H>0yB=;Q#$Or{N(AUGz{)g5kGI?# z0Ui;cy8yf1A2iSJH9qSNVK6MWk@WNE$FKPPm!9GW0ys07&Oy|;u&rsHVtBArT~HHC zM~MLlKoE`wo1jfnaX)JE0LQR}ZHEY;62vPjko?@3z+R0`0AuXd&~nXs&UpVLjI^ci zb)(#);R`#m=gPf;Okvl)){b&dBmPyvNdL>5u^jr1@FBn|LgSxAFaj)M7hsn~%+QN? z5SCnD_MqUX_q3lzIRUqUyQSYOzoS|3Nn;1rPIntuS0KF(Y`Tjdgihw_RYC8nqAi+ zTT*J~TL7cSxRi~#o~>(9=k9FZHp#|-vxT{K<{@qE(^osOW$MhvPO-)3F1nBcTuOra zPJp_6PeuR@_!NM}xWM=ppp3vKWy%5o0w4e&06~}_%o~6U0t7$+1n~U#st9aSr7S=U zr&pSk1pov<03ZmDGze=hoD`~$xFBKx0>H=w(0pKHKL!CbZ + + IITC Mobile Toggle map visibility + Clear log Run IITC Mobile Settings IITC Plugins diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java index d78d6895..c5ab2e8e 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java @@ -142,7 +142,8 @@ public class IITC_Mobile extends Activity // enable/disable advance menu final String[] menuDefaults = getResources().getStringArray(R.array.pref_android_menu_default); - mAdvancedMenu = mSharedPrefs.getStringSet("pref_android_menu", new HashSet(Arrays.asList(menuDefaults))); + mAdvancedMenu = mSharedPrefs + .getStringSet("pref_android_menu", new HashSet(Arrays.asList(menuDefaults))); mPersistentZoom = mSharedPrefs.getBoolean("pref_persistent_zoom", false); @@ -201,7 +202,7 @@ public class IITC_Mobile extends Activity } else if (key.equals("pref_fake_user_agent")) { mIitcWebView.setUserAgent(); } else if (key.equals("pref_last_plugin_update")) { - Long forceUpdate = sharedPreferences.getLong("pref_last_plugin_update", 0); + final Long forceUpdate = sharedPreferences.getLong("pref_last_plugin_update", 0); if (forceUpdate == 0) mFileManager.updatePlugins(true); return; } else if (key.equals("pref_update_plugins_interval")) { @@ -539,7 +540,7 @@ public class IITC_Mobile extends Activity break; case R.id.menu_debug: - item.setVisible(enabled && visible); + item.setVisible(enabled); item.setChecked(mDebugging); break; @@ -802,6 +803,14 @@ public class IITC_Mobile extends Activity updateViews(); } + /** + * onClick handler for R.id.btnClearLog, assigned in activity_main.xml + */ + public void onClearLog(final View v) + { + ((IITC_LogAdapter) mLvDebug.getAdapter()).clear(); + } + private void deleteUpdateFile() { final File file = new File(getExternalFilesDir(null).toString() + "/iitcUpdate.apk"); if (file != null) file.delete();