[iitcm] tweaks to fullscreen menu item

Use other icon for returning from fullscreen if shown as action. If shown in the action overflow, provide a chechbox to show current state.
This commit is contained in:
fkloft 2015-01-05 19:08:31 +01:00
parent fae1482498
commit 79569d36b0
8 changed files with 10 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -22,6 +22,7 @@
android:title="@string/menu_layer_chooser"/> android:title="@string/menu_layer_chooser"/>
<item <item
android:id="@+id/toggle_fullscreen" android:id="@+id/toggle_fullscreen"
android:checkable="true"
android:icon="@drawable/ic_action_full_screen" android:icon="@drawable/ic_action_full_screen"
android:orderInCategory="110" android:orderInCategory="110"
android:showAsAction="ifRoom" android:showAsAction="ifRoom"

View File

@ -205,7 +205,7 @@
</string-array> </string-array>
<string name="menu_reload">Reload IITC</string> <string name="menu_reload">Reload IITC</string>
<string name="menu_toggle_fullscreen">Toggle fullscreen</string> <string name="menu_toggle_fullscreen">Fullscreen</string>
<string name="menu_layer_chooser">Layer Chooser</string> <string name="menu_layer_chooser">Layer Chooser</string>
<string name="menu_locate">Get Location</string> <string name="menu_locate">Get Location</string>
<string name="menu_clear_cookies">Clear Cookies</string> <string name="menu_clear_cookies">Clear Cookies</string>

View File

@ -535,6 +535,13 @@ public class IITC_Mobile extends Activity
item.setVisible(true); item.setVisible(true);
break; break;
case R.id.toggle_fullscreen:
item.setChecked(mIitcWebView.isInFullscreen());
item.setIcon(mIitcWebView.isInFullscreen()
? R.drawable.ic_action_return_from_full_screen
: R.drawable.ic_action_full_screen);
break;
case R.id.locate: case R.id.locate:
item.setVisible(enabled && visible); item.setVisible(enabled && visible);
item.setEnabled(!mIsLoading); item.setEnabled(!mIsLoading);

View File

@ -221,6 +221,7 @@ public class IITC_WebView extends WebView {
loadUrl("javascript: $('#updatestatus').show();"); loadUrl("javascript: $('#updatestatus').show();");
} }
mIitc.getWindow().setAttributes(attrs); mIitc.getWindow().setAttributes(attrs);
mIitc.invalidateOptionsMenu();
} }
void updateFullscreenStatus() { void updateFullscreenStatus() {