diff options
author | Artur Dryomov <artur.dryomov@gmail.com> | 2013-07-02 17:20:08 +0300 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-07-25 18:01:49 +0100 |
commit | 69ea1e76d8d4fa071a4775e1b598748758c9b8f2 (patch) | |
tree | 9cf2899506501ce616c66417a45bbdfc1c942595 /android | |
parent | 615a900393729e7ee7d286b88dbe45634c803e8a (diff) |
Change the UI to a new look.
* Change action bar color to a more Impress- and Holo-consistent one.
* Clear used styles.
* Optimize manifest.
* Add computers lists activity with proper styling of tabs in landscape
and portrait modes.
Change-Id: Ie0a5ac15866b8cacdf44c39f7a2ca806e43421a4
Diffstat (limited to 'android')
30 files changed, 220 insertions, 134 deletions
diff --git a/android/sdremote/AndroidManifest.xml b/android/sdremote/AndroidManifest.xml index 8eaf63da1df2..f85e1dfb275b 100644 --- a/android/sdremote/AndroidManifest.xml +++ b/android/sdremote/AndroidManifest.xml @@ -1,67 +1,73 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="org.libreoffice.impressremote" - android:versionCode="8" - android:versionName="1.0.6+ Impress Remote" - android:installLocation="auto" > + package="org.libreoffice.impressremote" + android:versionCode="8" + android:versionName="1.0.6+ Impress Remote" + android:installLocation="auto"> - <uses-permission android:name="android.permission.INTERNET" /> - <uses-permission android:name="android.permission.BLUETOOTH" /> - <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> + <uses-permission android:name="android.permission.INTERNET"/> + <uses-permission android:name="android.permission.BLUETOOTH"/> + <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> <uses-sdk android:minSdkVersion="10" - android:targetSdkVersion="14" /> + android:targetSdkVersion="14"/> <application + android:label="@string/application_name" android:icon="@drawable/ic_launcher" - android:label="@string/app_name" - android:theme="@style/Theme.ImpressRemote" - android:title="@string/app_name" > + android:logo="@drawable/ic_logo" + android:theme="@style/Theme.ImpressRemote"> + <activity - android:name=".SelectorActivity" - android:label="@string/selector_choose_a_computer" - android:logo="@drawable/actionbar_icon_computer" - android:title="@string/app_name" - android:uiOptions="splitActionBarWhenNarrow" > - <intent-filter android:label="@string/app_name" > - <action android:name="android.intent.action.MAIN" /> + android:name=".ComputersActivity" + android:label="@string/title_computers" + android:theme="@style/Theme.ImpressRemote.Computers"> - <category android:name="android.intent.category.LAUNCHER" /> + <intent-filter android:label="@string/application_name"> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> + </activity> + <activity - android:name=".PairingActivity" - android:icon="@drawable/actionbar_icon_computer" - android:logo="@drawable/actionbar_icon_computer" - android:noHistory="true" > + android:name=".SelectorActivity" + android:label="@string/selector_choose_a_computer" + android:uiOptions="splitActionBarWhenNarrow"> </activity> - <service - android:name=".communication.CommunicationService" - android:label="@string/startpresentation_title" - android:logo="@drawable/actionbar_icon_computer" > - </service> + <activity + android:name=".PairingActivity" + android:noHistory="true"> + </activity> <activity android:name=".StartPresentationActivity" - android:logo="@drawable/actionbar_icon_computer" - android:label="@string/startpresentation_title" > + android:label="@string/startpresentation_title"> </activity> + <activity android:name=".PresentationActivity" - android:label="@string/title_activity_presentation" > + android:label="@string/title_activity_presentation"> </activity> + <activity android:name=".SettingsActivity" android:icon="@drawable/icon_options" - android:label="@string/options" > + android:label="@string/options"> </activity> + <activity android:name=".communication.ReconnectionActivity" - android:logo="@drawable/actionbar_icon_computer" - android:label="@string/reconnect" > + android:label="@string/reconnect"> </activity> + + <service + android:name=".communication.CommunicationService" + android:label="@string/startpresentation_title"> + </service> + </application> </manifest> diff --git a/android/sdremote/res/drawable-hdpi/actionbar_tab_selected.9.png b/android/sdremote/res/drawable-hdpi/actionbar_tab_selected.9.png Binary files differnew file mode 100755 index 000000000000..54eb3efb224c --- /dev/null +++ b/android/sdremote/res/drawable-hdpi/actionbar_tab_selected.9.png diff --git a/android/sdremote/res/drawable-hdpi/actionbar_tab_selected_pressed.9.png b/android/sdremote/res/drawable-hdpi/actionbar_tab_selected_pressed.9.png Binary files differnew file mode 100755 index 000000000000..5ceac2d4821b --- /dev/null +++ b/android/sdremote/res/drawable-hdpi/actionbar_tab_selected_pressed.9.png diff --git a/android/sdremote/res/drawable-hdpi/actionbar_tab_unselected.9.png b/android/sdremote/res/drawable-hdpi/actionbar_tab_unselected.9.png Binary files differnew file mode 100755 index 000000000000..d2b0076c83b1 --- /dev/null +++ b/android/sdremote/res/drawable-hdpi/actionbar_tab_unselected.9.png diff --git a/android/sdremote/res/drawable-land-hdpi/actionbar_tab_selected.9.png b/android/sdremote/res/drawable-land-hdpi/actionbar_tab_selected.9.png Binary files differnew file mode 100755 index 000000000000..c572c3406702 --- /dev/null +++ b/android/sdremote/res/drawable-land-hdpi/actionbar_tab_selected.9.png diff --git a/android/sdremote/res/drawable-land-hdpi/actionbar_tab_selected_pressed.9.png b/android/sdremote/res/drawable-land-hdpi/actionbar_tab_selected_pressed.9.png Binary files differnew file mode 100755 index 000000000000..20d9d691045f --- /dev/null +++ b/android/sdremote/res/drawable-land-hdpi/actionbar_tab_selected_pressed.9.png diff --git a/android/sdremote/res/drawable-land-hdpi/actionbar_tab_unselected.9.png b/android/sdremote/res/drawable-land-hdpi/actionbar_tab_unselected.9.png Binary files differnew file mode 100755 index 000000000000..b3e51d81df67 --- /dev/null +++ b/android/sdremote/res/drawable-land-hdpi/actionbar_tab_unselected.9.png diff --git a/android/sdremote/res/drawable-land-mdpi/actionbar_tab_selected.9.png b/android/sdremote/res/drawable-land-mdpi/actionbar_tab_selected.9.png Binary files differnew file mode 100755 index 000000000000..b9b5da388952 --- /dev/null +++ b/android/sdremote/res/drawable-land-mdpi/actionbar_tab_selected.9.png diff --git a/android/sdremote/res/drawable-land-mdpi/actionbar_tab_selected_pressed.9.png b/android/sdremote/res/drawable-land-mdpi/actionbar_tab_selected_pressed.9.png Binary files differnew file mode 100755 index 000000000000..9a63265f5e3f --- /dev/null +++ b/android/sdremote/res/drawable-land-mdpi/actionbar_tab_selected_pressed.9.png diff --git a/android/sdremote/res/drawable-land-mdpi/actionbar_tab_unselected.9.png b/android/sdremote/res/drawable-land-mdpi/actionbar_tab_unselected.9.png Binary files differnew file mode 100755 index 000000000000..06fbcbbd8537 --- /dev/null +++ b/android/sdremote/res/drawable-land-mdpi/actionbar_tab_unselected.9.png diff --git a/android/sdremote/res/drawable-land-xhdpi/actionbar_tab_selected.9.png b/android/sdremote/res/drawable-land-xhdpi/actionbar_tab_selected.9.png Binary files differnew file mode 100755 index 000000000000..f3aac1a0ed8c --- /dev/null +++ b/android/sdremote/res/drawable-land-xhdpi/actionbar_tab_selected.9.png diff --git a/android/sdremote/res/drawable-land-xhdpi/actionbar_tab_selected_pressed.9.png b/android/sdremote/res/drawable-land-xhdpi/actionbar_tab_selected_pressed.9.png Binary files differnew file mode 100755 index 000000000000..f2331fa543f8 --- /dev/null +++ b/android/sdremote/res/drawable-land-xhdpi/actionbar_tab_selected_pressed.9.png diff --git a/android/sdremote/res/drawable-land-xhdpi/actionbar_tab_unselected.9.png b/android/sdremote/res/drawable-land-xhdpi/actionbar_tab_unselected.9.png Binary files differnew file mode 100755 index 000000000000..06741ee2c630 --- /dev/null +++ b/android/sdremote/res/drawable-land-xhdpi/actionbar_tab_unselected.9.png diff --git a/android/sdremote/res/drawable-mdpi/actionbar_tab_selected.9.png b/android/sdremote/res/drawable-mdpi/actionbar_tab_selected.9.png Binary files differnew file mode 100755 index 000000000000..612258e42018 --- /dev/null +++ b/android/sdremote/res/drawable-mdpi/actionbar_tab_selected.9.png diff --git a/android/sdremote/res/drawable-mdpi/actionbar_tab_selected_pressed.9.png b/android/sdremote/res/drawable-mdpi/actionbar_tab_selected_pressed.9.png Binary files differnew file mode 100755 index 000000000000..524ee6bc4097 --- /dev/null +++ b/android/sdremote/res/drawable-mdpi/actionbar_tab_selected_pressed.9.png diff --git a/android/sdremote/res/drawable-mdpi/actionbar_tab_unselected.9.png b/android/sdremote/res/drawable-mdpi/actionbar_tab_unselected.9.png Binary files differnew file mode 100755 index 000000000000..f4335809fca6 --- /dev/null +++ b/android/sdremote/res/drawable-mdpi/actionbar_tab_unselected.9.png diff --git a/android/sdremote/res/drawable-xhdpi/actionbar_tab_selected.9.png b/android/sdremote/res/drawable-xhdpi/actionbar_tab_selected.9.png Binary files differnew file mode 100755 index 000000000000..3a10d7d10010 --- /dev/null +++ b/android/sdremote/res/drawable-xhdpi/actionbar_tab_selected.9.png diff --git a/android/sdremote/res/drawable-xhdpi/actionbar_tab_selected_pressed.9.png b/android/sdremote/res/drawable-xhdpi/actionbar_tab_selected_pressed.9.png Binary files differnew file mode 100755 index 000000000000..e38ad0f1d911 --- /dev/null +++ b/android/sdremote/res/drawable-xhdpi/actionbar_tab_selected_pressed.9.png diff --git a/android/sdremote/res/drawable-xhdpi/actionbar_tab_unselected.9.png b/android/sdremote/res/drawable-xhdpi/actionbar_tab_unselected.9.png Binary files differnew file mode 100755 index 000000000000..505f7eaba1a2 --- /dev/null +++ b/android/sdremote/res/drawable-xhdpi/actionbar_tab_unselected.9.png diff --git a/android/sdremote/res/drawable/actionbar_tab.xml b/android/sdremote/res/drawable/actionbar_tab.xml new file mode 100644 index 000000000000..db9ef14daf70 --- /dev/null +++ b/android/sdremote/res/drawable/actionbar_tab.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + + <item + android:state_focused="false" + android:state_selected="false" + android:state_pressed="false" + android:drawable="@drawable/actionbar_tab_unselected"/> + + <item + android:state_focused="false" + android:state_selected="true" + android:state_pressed="false" + android:drawable="@drawable/actionbar_tab_selected"/> + + <item + android:state_selected="false" + android:state_pressed="true" + android:drawable="@drawable/actionbar_tab_selected_pressed"/> + + <item + android:state_selected="true" + android:state_pressed="true" + android:drawable="@drawable/actionbar_tab_selected_pressed"/> + +</selector>
\ No newline at end of file diff --git a/android/sdremote/res/drawable/actionbar_icon_computer.png b/android/sdremote/res/drawable/ic_logo.png Binary files differindex ce764710b1ea..ce764710b1ea 100644 --- a/android/sdremote/res/drawable/actionbar_icon_computer.png +++ b/android/sdremote/res/drawable/ic_logo.png diff --git a/android/sdremote/res/layout/dialog_about.xml b/android/sdremote/res/layout/dialog_about.xml index 6ec3c4e0e4ec..74f4474b6ca6 100644 --- a/android/sdremote/res/layout/dialog_about.xml +++ b/android/sdremote/res/layout/dialog_about.xml @@ -29,7 +29,7 @@ android:layout_gravity="center_horizontal" android:layout_margin="10dip" android:gravity="center_horizontal" - android:text="@string/app_name" + android:text="@string/application_name" android:textAppearance="?android:attr/textAppearanceLarge" /> <TextView diff --git a/android/sdremote/res/values-v10/styles.xml b/android/sdremote/res/values-v10/styles.xml deleted file mode 100644 index c43c00d9a638..000000000000 --- a/android/sdremote/res/values-v10/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android"> - - <style name="Theme.ImpressRemote.Dialog" parent="@android:style/Theme.Dialog"> - <item name="android:windowBackground">@color/light_grey</item> - <item name="android:topDark">@color/grey</item> - <item name="android:topBright">@color/grey</item> - <item name="android:centerDark">@color/light_grey</item> - <item name="android:bottomDark">@color/light_grey</item> - <item name="android:fullBright">@color/light_grey</item> - <item name="android:centerBright">@color/light_grey</item> - <item name="android:bottomBright">@color/light_grey</item> - <item name="android:bottomMedium">@color/light_grey</item> - <item name="android:centerMedium">@color/light_grey</item> - <item name="android:textColor">@color/grey</item> - </style> - -</resources>
\ No newline at end of file diff --git a/android/sdremote/res/values/colors.xml b/android/sdremote/res/values/colors.xml new file mode 100644 index 000000000000..5cbe66a6b3ed --- /dev/null +++ b/android/sdremote/res/values/colors.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <color name="background_action_bar">#e46f1f</color> + + <color name="orange">#EE4400</color> + <color name="grey">#303030</color> + <color name="white">#FFFFFF</color> + <color name="black">#000000</color> + <color name="light_grey">#E8E9E8</color> + <color name="medium_grey">#C1C2C1</color> + <color name="text_grey">#5E5F5F</color> + + <color name="thumbnail_border">#B4B4B4</color> + <color name="thumbnail_border_selected">#EE4400</color> + +</resources>
\ No newline at end of file diff --git a/android/sdremote/res/values/strings.xml b/android/sdremote/res/values/strings.xml index 816deae1f9ba..981b6f1a8a69 100644 --- a/android/sdremote/res/values/strings.xml +++ b/android/sdremote/res/values/strings.xml @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <string name="app_name">Impress Remote</string> <string name="menu_settings">Settings</string> <string name="title_activity_presentation">PresentationActivity</string> <string name="presentation_ui_resizehandle">Handle to resize view.</string> @@ -63,4 +62,11 @@ <item >45:00</item> </string-array> <string name="wrong_time_format">You have entered wrong time format</string> + + <string name="application_name">Impress Remote</string> + + <string name="title_computers">Computers</string> + <string name="title_bluetooth" translatable="false">Bluetooth</string> + <string name="title_wifi" translatable="false">WiFi</string> + </resources> diff --git a/android/sdremote/res/values/styles.xml b/android/sdremote/res/values/styles.xml deleted file mode 100644 index 80a4b4ae73ef..000000000000 --- a/android/sdremote/res/values/styles.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources xmlns:android="http://schemas.android.com/apk/res/android"> - - <color name="orange">#EE4400</color> - <color name="grey">#303030</color> - <color name="white">#FFFFFF</color> - <color name="black">#000000</color> - <color name="light_grey">#E8E9E8</color> - <color name="medium_grey">#C1C2C1</color> - <color name="text_grey">#5E5F5F</color> - - <integer name="thumbnail_border_width">3</integer> - - <color name="thumbnail_border">#B4B4B4</color> - <color name="thumbnail_border_selected">#EE4400</color> - - <style name="Theme.ImpressRemote.ActionBar.Title" parent="android:style/Widget.Holo.Light.ActionBar"> - <item name="android:textColor">@color/white</item> - <item name="android:textSize">18dp</item> - </style> - - <style name="Theme.ImpressRemote.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse"> - <item name="android:background">@color/orange</item> - <item name="background">@color/orange</item> - <item name="android:titleTextStyle">@style/Theme.ImpressRemote.ActionBar.Title</item> - <item name="titleTextStyle">@style/Theme.ImpressRemote.ActionBar.Title</item> - <item name="backgroundSplit">@color/text_grey</item> - <item name="android:backgroundSplit">@color/text_grey</item> - </style> - - <style name="Theme.ImpressRemote.ActionBarWidget" parent="android:style/Widget.Holo.Light"> - <item name="android:background">@color/orange</item> - <item name="android:textColor">@color/white</item> - <item name="android:textSize">22dp</item> - </style> - - <style name="Theme.ImpressRemote.ActionBarMenu" parent="android:style/Widget.Holo.Light.ListPopupWindow"> - <item name="android:background">@color/grey</item> - <!-- <item name="android:popupBackground">@color/black</item> --> - </style> - - <style name="Theme.ImpressRemote.ActionBarMenuItem" parent="Widget.Sherlock.Light.Spinner.DropDown.ActionBar"> - <item name="android:background">@color/grey</item> - <item name="android:textColor">@color/white</item> - <item name="android:textSize">16dp</item> - </style> - - <style name="Theme.ImpressRemote.Dialog" parent="@android:style/Theme.Dialog"> - <item name="android:windowBackground">@color/light_grey</item> - <item name="android:fullDark">@color/light_grey</item> - <item name="android:topDark">@color/light_grey</item> - <item name="android:centerDark">@color/light_grey</item> - <item name="android:bottomDark">@color/light_grey</item> - <item name="android:fullBright">@color/light_grey</item> - <item name="android:centerBright">@color/light_grey</item> - <item name="android:bottomBright">@color/light_grey</item> - <item name="android:bottomMedium">@color/light_grey</item> - <item name="android:centerMedium">@color/light_grey</item> - <item name="android:textColor">@color/grey</item> - </style> - - <style name="Theme.ImpressRemote.Dialog.Title" parent="@android:style/Theme.Dialog"> - <item name="android:textColor">@color/grey</item> - </style> - - <style name="Theme.ImpressRemote" parent="Theme.Sherlock.Light.DarkActionBar"> - <item name="android:actionBarStyle">@style/Theme.ImpressRemote.ActionBar</item> - <item name="actionBarStyle">@style/Theme.ImpressRemote.ActionBar</item> - <item name="android:popupMenuStyle">@style/Theme.ImpressRemote.ActionBarMenu</item> - <item name="android:dropDownListViewStyle">@style/Theme.ImpressRemote.ActionBarMenuItem</item> - <item name="android:textAppearanceLargePopupMenu">@style/Theme.ImpressRemote.ActionBarMenuItem</item> <!-- <item name="android:actionBarWidgetTheme">@style/Theme.ImpressRemote.ActionBarWidget</item> --> - <item name="android:actionDropDownStyle">@style/Theme.ImpressRemote.ActionBarMenu</item> - <item name="android:windowBackground">@color/light_grey</item> - <item name="android:homeAsUpIndicator">@drawable/up_indicator_white</item> - <item name="android:textColor">@color/text_grey</item> - <item name="android:alertDialogStyle">@style/Theme.ImpressRemote.Dialog</item> - - </style> - -</resources>
\ No newline at end of file diff --git a/android/sdremote/res/values/themes.xml b/android/sdremote/res/values/themes.xml new file mode 100644 index 000000000000..d53ae532c1a0 --- /dev/null +++ b/android/sdremote/res/values/themes.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources xmlns:android="http://schemas.android.com/apk/res/android"> + + <integer name="thumbnail_border_width">3</integer> + + <style name="Theme.ImpressRemote" parent="Theme.Sherlock.Light.DarkActionBar"> + <item name="android:actionBarStyle">@style/Theme.ImpressRemote.ActionBar</item> + <item name="actionBarStyle">@style/Theme.ImpressRemote.ActionBar</item> + + <item name="android:actionBarTabStyle">@style/Theme.ImpressRemote.ActionBar.Tab</item> + <item name="actionBarTabStyle">@style/Theme.ImpressRemote.ActionBar.Tab</item> + </style> + + <style name="Theme.ImpressRemote.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse"> + <item name="android:background">@color/background_action_bar</item> + <item name="background">@color/background_action_bar</item> + </style> + + <style name="Theme.ImpressRemote.ActionBar.Tab" parent="Widget.Sherlock.Light.ActionBar.TabView.Inverse"> + <item name="android:background">@drawable/actionbar_tab</item> + <item name="background">@drawable/actionbar_tab</item> + </style> + + <style name="Theme.ImpressRemote.Computers" parent="Theme.ImpressRemote"> + <item name="android:actionBarStyle">@style/Theme.ImpressRemote.Computers.ActionBar</item> + <item name="actionBarStyle">@style/Theme.ImpressRemote.Computers.ActionBar</item> + </style> + + <style name="Theme.ImpressRemote.Computers.ActionBar" parent="Theme.ImpressRemote.ActionBar"> + <item name="android:navigationMode">tabMode</item> + <item name="navigationMode">tabMode</item> + </style> + + <style name="Theme.ImpressRemote.ActionBarWidget" parent="android:style/Widget.Holo.Light"> + <item name="android:background">@color/orange</item> + <item name="android:textColor">@color/white</item> + <item name="android:textSize">22dp</item> + </style> + +</resources>
\ No newline at end of file diff --git a/android/sdremote/src/org/libreoffice/impressremote/ActionBarTabListener.java b/android/sdremote/src/org/libreoffice/impressremote/ActionBarTabListener.java new file mode 100644 index 000000000000..0271dce74c6c --- /dev/null +++ b/android/sdremote/src/org/libreoffice/impressremote/ActionBarTabListener.java @@ -0,0 +1,36 @@ +package org.libreoffice.impressremote; + +import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentTransaction; + +import com.actionbarsherlock.app.ActionBar; + +public class ActionBarTabListener implements ActionBar.TabListener { + private final Fragment mTabFragment; + + public ActionBarTabListener(Fragment aTabFragment) { + mTabFragment = aTabFragment; + } + + @Override + public void onTabSelected(ActionBar.Tab aTab, FragmentTransaction aFragmentTransaction) { + if (mTabFragment.isDetached()) { + aFragmentTransaction.attach(mTabFragment); + } + + aFragmentTransaction.replace(android.R.id.content, mTabFragment); + } + + @Override + public void onTabUnselected(ActionBar.Tab aTab, FragmentTransaction aFragmentTransaction) { + if (mTabFragment.isDetached()) { + return; + } + + aFragmentTransaction.detach(mTabFragment); + } + + @Override + public void onTabReselected(ActionBar.Tab aTab, FragmentTransaction aFragmentTransaction) { + } +} diff --git a/android/sdremote/src/org/libreoffice/impressremote/ComputersActivity.java b/android/sdremote/src/org/libreoffice/impressremote/ComputersActivity.java new file mode 100644 index 000000000000..3b601879c5db --- /dev/null +++ b/android/sdremote/src/org/libreoffice/impressremote/ComputersActivity.java @@ -0,0 +1,44 @@ +package org.libreoffice.impressremote; + +import android.os.Bundle; +import android.support.v4.app.Fragment; + +import com.actionbarsherlock.app.ActionBar; +import com.actionbarsherlock.app.SherlockFragmentActivity; + +public class ComputersActivity extends SherlockFragmentActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setUpTabs(); + } + + private void setUpTabs() { + ActionBar aActionBar = getSupportActionBar(); + + aActionBar.addTab(buildBluetoothServersTab()); + aActionBar.addTab(buildWiFiServersTab()); + } + + private ActionBar.Tab buildBluetoothServersTab() { + ComputersFragment aFragment = ComputersFragment.newInstance(); + + return buildActionBarTab(aFragment, R.string.title_bluetooth); + } + + private ActionBar.Tab buildActionBarTab(Fragment aFragment, int aTitleResourceId) { + ActionBar.Tab aTab = getSupportActionBar().newTab(); + + aTab.setTabListener(new ActionBarTabListener(aFragment)); + aTab.setText(aTitleResourceId); + + return aTab; + } + + private ActionBar.Tab buildWiFiServersTab() { + ComputersFragment aFragment = ComputersFragment.newInstance(); + + return buildActionBarTab(aFragment, R.string.title_wifi); + } +} diff --git a/android/sdremote/src/org/libreoffice/impressremote/ComputersFragment.java b/android/sdremote/src/org/libreoffice/impressremote/ComputersFragment.java new file mode 100644 index 000000000000..e411aa7d2f42 --- /dev/null +++ b/android/sdremote/src/org/libreoffice/impressremote/ComputersFragment.java @@ -0,0 +1,9 @@ +package org.libreoffice.impressremote; + +import com.actionbarsherlock.app.SherlockListFragment; + +public class ComputersFragment extends SherlockListFragment { + public static ComputersFragment newInstance() { + return new ComputersFragment(); + } +} |