diff options
author | Artur Dryomov <artur.dryomov@gmail.com> | 2013-09-05 01:30:59 +0300 |
---|---|---|
committer | Artur Dryomov <artur.dryomov@gmail.com> | 2013-09-07 11:55:52 +0300 |
commit | 275aeab07405b3a07ead39b20ccbc65f4f842c03 (patch) | |
tree | d1a8b74b6733741c2134382aa3a180e234cd1001 /android | |
parent | 98f08e463d2ddb80441493a6d7529b015025eebb (diff) |
Add a requirements screen.
Change-Id: Ie3821f4c21853e9c89065a964d069bfde80e81d8
Diffstat (limited to 'android')
10 files changed, 158 insertions, 10 deletions
diff --git a/android/sdremote/AndroidManifest.xml b/android/sdremote/AndroidManifest.xml index 7b80b6644d74..6d7064d87a5b 100644 --- a/android/sdremote/AndroidManifest.xml +++ b/android/sdremote/AndroidManifest.xml @@ -59,6 +59,11 @@ </activity> <activity + android:name=".activity.RequirementsActivity" + android:label="@string/title_requirements"> + </activity> + + <activity android:name=".activity.LicensesActivity" android:label="@string/title_licenses"> </activity> diff --git a/android/sdremote/res/layout/activity_requirements.xml b/android/sdremote/res/layout/activity_requirements.xml new file mode 100644 index 000000000000..138ea563321b --- /dev/null +++ b/android/sdremote/res/layout/activity_requirements.xml @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="utf-8"?> +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <LinearLayout + android:orientation="vertical" + android:padding="@dimen/padding_help" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <TextView + style="@style/SectionHeader" + android:text="@string/title_generic"/> + + <TextView + style="@style/SectionItem" + android:text="@string/requirements_libreoffice_version"/> + + <TextView + style="@style/SectionItem" + android:text="@string/requirements_libreoffice_general_enabled"/> + + <TextView + style="@style/SectionHeader" + android:text="@string/title_wifi"/> + + <TextView + style="@style/SectionItem" + android:text="@string/requirements_network_connection"/> + + <TextView + style="@style/SectionItem" + android:text="@string/requirements_libreoffice_experimental_enabled"/> + + <TextView + style="@style/SectionItem" + android:text="@string/requirements_network_ports"/> + + <TextView + style="@style/SectionHeader" + android:text="@string/title_bluetooth"/> + + <TextView + style="@style/SectionItem" + android:text="@string/requirements_bluetooth_connection"/> + + </LinearLayout> + +</ScrollView>
\ No newline at end of file diff --git a/android/sdremote/res/layout/fragment_slides_pager.xml b/android/sdremote/res/layout/fragment_slides_pager.xml index e51518dfda44..18308a22b894 100644 --- a/android/sdremote/res/layout/fragment_slides_pager.xml +++ b/android/sdremote/res/layout/fragment_slides_pager.xml @@ -35,17 +35,9 @@ android:layout_height="match_parent"> <TextView + style="@style/SectionHeader" android:text="@string/header_notes" - android:textAllCaps="true" - android:textStyle="bold" - android:textColor="@color/background_header" - android:drawableBottom="@drawable/underline_header" - android:drawablePadding="@dimen/padding_header_underline" - android:paddingLeft="@dimen/padding_header" - android:paddingTop="@dimen/padding_header" - android:gravity="left" - android:layout_width="fill_parent" - android:layout_height="wrap_content"/> + android:paddingTop="@dimen/padding_header"/> <ScrollView android:layout_width="wrap_content" diff --git a/android/sdremote/res/menu/menu_action_bar_computers.xml b/android/sdremote/res/menu/menu_action_bar_computers.xml index f99df2122f70..f78bed916681 100644 --- a/android/sdremote/res/menu/menu_action_bar_computers.xml +++ b/android/sdremote/res/menu/menu_action_bar_computers.xml @@ -13,6 +13,11 @@ android:showAsAction="never"/> <item + android:id="@+id/menu_requirements" + android:title="@string/menu_requirements" + android:showAsAction="never"/> + + <item android:id="@+id/menu_licenses" android:title="@string/menu_licenses" android:showAsAction="never"/> diff --git a/android/sdremote/res/values/dimens.xml b/android/sdremote/res/values/dimens.xml index a5f944707e37..00054a38185d 100644 --- a/android/sdremote/res/values/dimens.xml +++ b/android/sdremote/res/values/dimens.xml @@ -12,6 +12,8 @@ <dimen name="padding_header_underline">4dp</dimen> <dimen name="padding_header">8dp</dimen> <dimen name="padding_slide_notes">8dp</dimen> + <dimen name="padding_help">16dp</dimen> + <dimen name="padding_section_item">8dp</dimen> <dimen name="padding_horizontal_list_item">8dp</dimen> <dimen name="padding_horizontal_connection_layout">40dp</dimen> diff --git a/android/sdremote/res/values/strings.xml b/android/sdremote/res/values/strings.xml index f810f0ece5d1..c4e5a73486a2 100644 --- a/android/sdremote/res/values/strings.xml +++ b/android/sdremote/res/values/strings.xml @@ -4,10 +4,12 @@ <string name="application_name">Impress Remote</string> <string name="title_computers">Computers</string> + <string name="title_generic">Generic</string> <string name="title_bluetooth" translatable="false">Bluetooth</string> <string name="title_wifi" translatable="false">WiFi</string> <string name="title_licenses">Open source licenses</string> <string name="title_settings">Settings</string> + <string name="title_requirements">Requirements</string> <string name="title_connection">Connection</string> <string name="title_creation">Creation</string> <string name="title_slide_show">Slide Show</string> @@ -15,6 +17,7 @@ <string name="menu_licenses">Open source licenses</string> <string name="menu_settings">Settings</string> + <string name="menu_requirements">Requirements</string> <string name="menu_reconnect">Reconnect</string> <string name="menu_add_computer">Add computer</string> <string name="menu_remove_computer">Remove</string> @@ -55,4 +58,11 @@ <string name="preferences_keep_screen_on_title">Screen on</string> <string name="preferences_keep_screen_on_summary">Keep screen on while presenting</string> + <string name="requirements_libreoffice_version">LibreOffice version 4.0.3 or higher running on a computer.</string> + <string name="requirements_libreoffice_general_enabled">Impress Remote enabled at “Tools → Options → LibreOffice Impress → General” in LibreOffice Impress.</string> + <string name="requirements_libreoffice_experimental_enabled">Experimental features enabled at “Tools → Options → LibreOffice → Advanced” in LibreOffice Impress.</string> + <string name="requirements_network_connection">The Android device and a computer connected to the same network.</string> + <string name="requirements_network_ports">If you have a firewall make sure ports 1598 and 1599 are opened.</string> + <string name="requirements_bluetooth_connection">A computer with enabled Bluetooth.</string> + </resources> diff --git a/android/sdremote/res/values/styles.xml b/android/sdremote/res/values/styles.xml new file mode 100644 index 000000000000..62aad2b69e3d --- /dev/null +++ b/android/sdremote/res/values/styles.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <style name="SectionHeader"> + <item name="android:textAllCaps">true</item> + <item name="android:textStyle">bold</item> + <item name="android:textColor">@color/background_header</item> + <item name="android:drawableBottom">@drawable/underline_header</item> + <item name="android:drawablePadding">@dimen/padding_header_underline</item> + <item name="android:paddingLeft">@dimen/padding_header</item> + <item name="android:paddingRight">@dimen/padding_header</item> + <item name="android:paddingTop">@dimen/padding_header</item> + <item name="android:layout_width">fill_parent</item> + <item name="android:layout_height">wrap_content</item> + </style> + + <style name="SectionItem"> + <item name="android:padding">@dimen/padding_section_item</item> + <item name="android:layout_width">fill_parent</item> + <item name="android:layout_height">wrap_content</item> + </style> + +</resources>
\ No newline at end of file diff --git a/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java index da4652a9317a..bb82024ce5a8 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java +++ b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java @@ -191,6 +191,10 @@ public class ComputersActivity extends SherlockFragmentActivity implements Actio callSettingsActivity(); return true; + case R.id.menu_requirements: + callRequirementsActivity(); + return true; + case R.id.menu_licenses: callLicensesActivity(); return true; @@ -205,6 +209,11 @@ public class ComputersActivity extends SherlockFragmentActivity implements Actio startActivity(aIntent); } + private void callRequirementsActivity() { + Intent aIntent = Intents.buildRequirementsIntent(this); + startActivity(aIntent); + } + private void callLicensesActivity() { Intent aIntent = Intents.buildLicensesIntent(this); startActivity(aIntent); diff --git a/android/sdremote/src/org/libreoffice/impressremote/activity/RequirementsActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/RequirementsActivity.java new file mode 100644 index 000000000000..b99023d558a4 --- /dev/null +++ b/android/sdremote/src/org/libreoffice/impressremote/activity/RequirementsActivity.java @@ -0,0 +1,47 @@ +/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package org.libreoffice.impressremote.activity; + +import android.os.Bundle; + +import com.actionbarsherlock.app.SherlockActivity; +import com.actionbarsherlock.view.MenuItem; +import org.libreoffice.impressremote.R; + +public class RequirementsActivity extends SherlockActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_requirements); + + setUpHomeButton(); + } + + private void setUpHomeButton() { + getSupportActionBar().setHomeButtonEnabled(true); + } + + @Override + public boolean onOptionsItemSelected(MenuItem aMenuItem) { + switch (aMenuItem.getItemId()) { + case android.R.id.home: + navigateUp(); + return true; + + default: + return super.onOptionsItemSelected(aMenuItem); + } + } + + private void navigateUp() { + finish(); + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/android/sdremote/src/org/libreoffice/impressremote/util/Intents.java b/android/sdremote/src/org/libreoffice/impressremote/util/Intents.java index cdcec9ae5c66..20c56fb7073f 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/util/Intents.java +++ b/android/sdremote/src/org/libreoffice/impressremote/util/Intents.java @@ -14,6 +14,7 @@ import android.content.Intent; import org.libreoffice.impressremote.activity.ComputerConnectionActivity; import org.libreoffice.impressremote.activity.ComputerCreationActivity; import org.libreoffice.impressremote.activity.LicensesActivity; +import org.libreoffice.impressremote.activity.RequirementsActivity; import org.libreoffice.impressremote.activity.SettingsActivity; import org.libreoffice.impressremote.activity.SlideShowActivity; import org.libreoffice.impressremote.communication.CommunicationService; @@ -144,6 +145,10 @@ public final class Intents { return new Intent(aContext, SettingsActivity.class); } + public static Intent buildRequirementsIntent(Context aContext) { + return new Intent(aContext, RequirementsActivity.class); + } + public static Intent buildLicensesIntent(Context aContext) { return new Intent(aContext, LicensesActivity.class); } |