summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorArtur Dryomov <artur.dryomov@gmail.com>2013-10-19 03:45:59 +0300
committerArtur Dryomov <artur.dryomov@gmail.com>2013-10-25 15:39:39 +0300
commit2e605fcb12556dd65b0e5e4a0eac25b71182eb7b (patch)
treef5abe53281053be0601b036158bf38eeb7d50392 /android
parentafabf78f5fb3ed2e24d1d8aeb7f9310141f1e8f5 (diff)
Fix some comments and tabs positions.
Change-Id: I6678d8142f7cbe2446b178174ffb36d446aeda11
Diffstat (limited to 'android')
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java26
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersPagerAdapter.java8
2 files changed, 14 insertions, 20 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java
index 7ccd18ef7896..043965aa5e32 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/activity/ComputersActivity.java
@@ -29,14 +29,6 @@ import org.libreoffice.impressremote.util.Preferences;
import org.libreoffice.impressremote.util.SavedStates;
public class ComputersActivity extends SherlockFragmentActivity implements ActionBar.TabListener, ViewPager.OnPageChangeListener {
- private static final class TabsIndices {
- private TabsIndices() {
- }
-
- public static final int BLUETOOTH = 0;
- public static final int WIFI = 1;
- }
-
private boolean mBluetoothWasEnabled;
@Override
@@ -52,9 +44,9 @@ public class ComputersActivity extends SherlockFragmentActivity implements Actio
private void saveBluetoothState(Bundle aSavedInstanceState) {
// In more ideal world this work should be done at the service.
- // Unfortunately service cannot save or restore its state
- // but enabling or disabling Bluetooth is quite a long operation,
- // so we have more chances to manage state right at the activity.
+ // Unfortunately service cannot save or restore its state.
+ // On other hand we should remember Bluetooth state exactly
+ // after the app’s start and pass it during recreation cycle.
if (!BluetoothOperator.isAvailable()) {
return;
@@ -78,7 +70,7 @@ public class ComputersActivity extends SherlockFragmentActivity implements Actio
private void setUpTitle() {
// Looks hacky but it seems to be the best way to set activity’s title
// different to application’s label. The other way is setting title
- // to intents filter but it shows wrong label for recent apps screen.
+ // to intents filter but it shows wrong label for recent apps screen then.
ActionBar aActionBar = getSupportActionBar();
@@ -111,8 +103,10 @@ public class ComputersActivity extends SherlockFragmentActivity implements Actio
private void setUpTabs() {
ActionBar aActionBar = getSupportActionBar();
- aActionBar.addTab(buildActionBarTab(R.string.title_bluetooth), TabsIndices.BLUETOOTH);
- aActionBar.addTab(buildActionBarTab(R.string.title_wifi), TabsIndices.WIFI);
+ aActionBar.addTab(buildActionBarTab(
+ R.string.title_bluetooth), ComputersPagerAdapter.PagesIndices.BLUETOOTH);
+ aActionBar.addTab(buildActionBarTab(
+ R.string.title_wifi), ComputersPagerAdapter.PagesIndices.WIFI);
}
private ActionBar.Tab buildActionBarTab(int aTitleResourceId) {
@@ -203,11 +197,11 @@ public class ComputersActivity extends SherlockFragmentActivity implements Actio
MenuItem aComputerAddingMenuItem = aMenu.findItem(R.id.menu_add_computer);
switch (getSupportActionBar().getSelectedNavigationIndex()) {
- case TabsIndices.BLUETOOTH:
+ case ComputersPagerAdapter.PagesIndices.BLUETOOTH:
aComputerAddingMenuItem.setVisible(false);
break;
- case TabsIndices.WIFI:
+ case ComputersPagerAdapter.PagesIndices.WIFI:
aComputerAddingMenuItem.setVisible(true);
default:
diff --git a/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersPagerAdapter.java b/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersPagerAdapter.java
index 4a15ab349347..f06a7f1ddeda 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersPagerAdapter.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/adapter/ComputersPagerAdapter.java
@@ -17,8 +17,8 @@ import org.libreoffice.impressremote.fragment.ComputersFragment;
public class ComputersPagerAdapter extends FragmentPagerAdapter {
private static final int PAGER_SIZE = 2;
- private static final class PagerPositions {
- private PagerPositions() {
+ public static final class PagesIndices {
+ private PagesIndices() {
}
public static final int BLUETOOTH = 0;
@@ -32,10 +32,10 @@ public class ComputersPagerAdapter extends FragmentPagerAdapter {
@Override
public Fragment getItem(int aPosition) {
switch (aPosition) {
- case PagerPositions.BLUETOOTH:
+ case PagesIndices.BLUETOOTH:
return ComputersFragment.newInstance(ComputersFragment.Type.BLUETOOTH);
- case PagerPositions.WIFI:
+ case PagesIndices.WIFI:
return ComputersFragment.newInstance(ComputersFragment.Type.WIFI);
default: