[mobile] ability to clear the log (and always show debug in menu)
This commit is contained in:
parent
546ed4e98f
commit
ad07f8685c
BIN
mobile/res/drawable-hdpi/ic_action_discard.png
Normal file
BIN
mobile/res/drawable-hdpi/ic_action_discard.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 450 B |
BIN
mobile/res/drawable-mdpi/ic_action_discard.png
Normal file
BIN
mobile/res/drawable-mdpi/ic_action_discard.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 324 B |
BIN
mobile/res/drawable-xhdpi/ic_action_discard.png
Normal file
BIN
mobile/res/drawable-xhdpi/ic_action_discard.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 543 B |
BIN
mobile/res/drawable-xxhdpi/ic_action_discard.png
Normal file
BIN
mobile/res/drawable-xxhdpi/ic_action_discard.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 765 B |
@ -49,6 +49,16 @@
|
|||||||
android:onClick="onToggleMapVisibility"
|
android:onClick="onToggleMapVisibility"
|
||||||
android:src="@drawable/ic_action_map"/>
|
android:src="@drawable/ic_action_map"/>
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/btnClearLog"
|
||||||
|
android:layout_width="@dimen/button_size"
|
||||||
|
android:layout_height="@dimen/button_size"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:contentDescription="@string/clear_log"
|
||||||
|
android:onClick="onClearLog"
|
||||||
|
android:src="@drawable/ic_action_discard"/>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/editCommand"
|
android:id="@+id/editCommand"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
<string name="app_name">IITC Mobile</string>
|
<string name="app_name">IITC Mobile</string>
|
||||||
<string name="toggle_map">Toggle map visibility</string>
|
<string name="toggle_map">Toggle map visibility</string>
|
||||||
|
<string name="clear_log">Clear log</string>
|
||||||
<string name="debug_run">Run</string>
|
<string name="debug_run">Run</string>
|
||||||
<string name="activity_settings">IITC Mobile Settings</string>
|
<string name="activity_settings">IITC Mobile Settings</string>
|
||||||
<string name="activity_plugins">IITC Plugins</string>
|
<string name="activity_plugins">IITC Plugins</string>
|
||||||
|
@ -142,7 +142,8 @@ public class IITC_Mobile extends Activity
|
|||||||
|
|
||||||
// enable/disable advance menu
|
// enable/disable advance menu
|
||||||
final String[] menuDefaults = getResources().getStringArray(R.array.pref_android_menu_default);
|
final String[] menuDefaults = getResources().getStringArray(R.array.pref_android_menu_default);
|
||||||
mAdvancedMenu = mSharedPrefs.getStringSet("pref_android_menu", new HashSet<String>(Arrays.asList(menuDefaults)));
|
mAdvancedMenu = mSharedPrefs
|
||||||
|
.getStringSet("pref_android_menu", new HashSet<String>(Arrays.asList(menuDefaults)));
|
||||||
|
|
||||||
mPersistentZoom = mSharedPrefs.getBoolean("pref_persistent_zoom", false);
|
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")) {
|
} else if (key.equals("pref_fake_user_agent")) {
|
||||||
mIitcWebView.setUserAgent();
|
mIitcWebView.setUserAgent();
|
||||||
} else if (key.equals("pref_last_plugin_update")) {
|
} 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);
|
if (forceUpdate == 0) mFileManager.updatePlugins(true);
|
||||||
return;
|
return;
|
||||||
} else if (key.equals("pref_update_plugins_interval")) {
|
} else if (key.equals("pref_update_plugins_interval")) {
|
||||||
@ -539,7 +540,7 @@ public class IITC_Mobile extends Activity
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.menu_debug:
|
case R.id.menu_debug:
|
||||||
item.setVisible(enabled && visible);
|
item.setVisible(enabled);
|
||||||
item.setChecked(mDebugging);
|
item.setChecked(mDebugging);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -802,6 +803,14 @@ public class IITC_Mobile extends Activity
|
|||||||
updateViews();
|
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() {
|
private void deleteUpdateFile() {
|
||||||
final File file = new File(getExternalFilesDir(null).toString() + "/iitcUpdate.apk");
|
final File file = new File(getExternalFilesDir(null).toString() + "/iitcUpdate.apk");
|
||||||
if (file != null) file.delete();
|
if (file != null) file.delete();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user