1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2025-01-10 20:15:54 +00:00

Renamed FoldersFragment.

This commit is contained in:
George Venios 2015-09-07 01:28:16 +01:00
parent 7f9e773eaa
commit f566be4436
3 changed files with 10 additions and 11 deletions

View file

@ -1,11 +1,10 @@
package com.nutomic.syncthingandroid.test.activities; package com.nutomic.syncthingandroid.test.activities;
import android.test.ActivityInstrumentationTestCase2; import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.SmallTest;
import com.nutomic.syncthingandroid.activities.MainActivity; import com.nutomic.syncthingandroid.activities.MainActivity;
import com.nutomic.syncthingandroid.fragments.DevicesFragment; import com.nutomic.syncthingandroid.fragments.DevicesFragment;
import com.nutomic.syncthingandroid.fragments.FoldersFragment; import com.nutomic.syncthingandroid.fragments.FolderListFragment;
import com.nutomic.syncthingandroid.syncthing.SyncthingServiceBinder; import com.nutomic.syncthingandroid.syncthing.SyncthingServiceBinder;
import com.nutomic.syncthingandroid.test.MockSyncthingService; import com.nutomic.syncthingandroid.test.MockSyncthingService;
@ -20,7 +19,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
public void testOnServiceConnected() { public void testOnServiceConnected() {
getActivity().onServiceConnected(null, new SyncthingServiceBinder(mService)); getActivity().onServiceConnected(null, new SyncthingServiceBinder(mService));
assertTrue(mService.containsListenerInstance(MainActivity.class)); assertTrue(mService.containsListenerInstance(MainActivity.class));
assertTrue(mService.containsListenerInstance(FoldersFragment.class)); assertTrue(mService.containsListenerInstance(FolderListFragment.class));
assertTrue(mService.containsListenerInstance(DevicesFragment.class)); assertTrue(mService.containsListenerInstance(DevicesFragment.class));
} }

View file

@ -35,7 +35,7 @@ import android.widget.TextView;
import com.nutomic.syncthingandroid.R; import com.nutomic.syncthingandroid.R;
import com.nutomic.syncthingandroid.fragments.DevicesFragment; import com.nutomic.syncthingandroid.fragments.DevicesFragment;
import com.nutomic.syncthingandroid.fragments.DrawerFragment; import com.nutomic.syncthingandroid.fragments.DrawerFragment;
import com.nutomic.syncthingandroid.fragments.FoldersFragment; import com.nutomic.syncthingandroid.fragments.FolderListFragment;
import com.nutomic.syncthingandroid.syncthing.RestApi; import com.nutomic.syncthingandroid.syncthing.RestApi;
import com.nutomic.syncthingandroid.syncthing.SyncthingService; import com.nutomic.syncthingandroid.syncthing.SyncthingService;
@ -44,7 +44,7 @@ import java.util.Date;
import static java.lang.Math.min; import static java.lang.Math.min;
/** /**
* Shows {@link com.nutomic.syncthingandroid.fragments.FoldersFragment} and * Shows {@link FolderListFragment} and
* {@link com.nutomic.syncthingandroid.fragments.DevicesFragment} in different tabs, and * {@link com.nutomic.syncthingandroid.fragments.DevicesFragment} in different tabs, and
* {@link com.nutomic.syncthingandroid.fragments.DrawerFragment} in the navigation drawer. * {@link com.nutomic.syncthingandroid.fragments.DrawerFragment} in the navigation drawer.
*/ */
@ -187,7 +187,7 @@ public class MainActivity extends SyncthingActivity
} }
}; };
private FoldersFragment mFolderFragment; private FolderListFragment mFolderFragment;
private DevicesFragment mDevicesFragment; private DevicesFragment mDevicesFragment;
@ -216,15 +216,15 @@ public class MainActivity extends SyncthingActivity
if (savedInstanceState != null) { if (savedInstanceState != null) {
FragmentManager fm = getSupportFragmentManager(); FragmentManager fm = getSupportFragmentManager();
mFolderFragment = (FoldersFragment) fm.getFragment( mFolderFragment = (FolderListFragment) fm.getFragment(
savedInstanceState, FoldersFragment.class.getName()); savedInstanceState, FolderListFragment.class.getName());
mDevicesFragment = (DevicesFragment) fm.getFragment( mDevicesFragment = (DevicesFragment) fm.getFragment(
savedInstanceState, DevicesFragment.class.getName()); savedInstanceState, DevicesFragment.class.getName());
mDrawerFragment = (DrawerFragment) fm.getFragment( mDrawerFragment = (DrawerFragment) fm.getFragment(
savedInstanceState, DrawerFragment.class.getName()); savedInstanceState, DrawerFragment.class.getName());
mViewPager.setCurrentItem(savedInstanceState.getInt("currentTab")); mViewPager.setCurrentItem(savedInstanceState.getInt("currentTab"));
} else { } else {
mFolderFragment = new FoldersFragment(); mFolderFragment = new FolderListFragment();
mDevicesFragment = new DevicesFragment(); mDevicesFragment = new DevicesFragment();
mDrawerFragment = new DrawerFragment(); mDrawerFragment = new DrawerFragment();
} }
@ -269,7 +269,7 @@ public class MainActivity extends SyncthingActivity
// Avoid crash if called during startup. // Avoid crash if called during startup.
if (mFolderFragment != null && mDevicesFragment != null && mDrawerFragment != null) { if (mFolderFragment != null && mDevicesFragment != null && mDrawerFragment != null) {
FragmentManager fm = getSupportFragmentManager(); FragmentManager fm = getSupportFragmentManager();
fm.putFragment(outState, FoldersFragment.class.getName(), mFolderFragment); fm.putFragment(outState, FolderListFragment.class.getName(), mFolderFragment);
fm.putFragment(outState, DevicesFragment.class.getName(), mDevicesFragment); fm.putFragment(outState, DevicesFragment.class.getName(), mDevicesFragment);
fm.putFragment(outState, DrawerFragment.class.getName(), mDrawerFragment); fm.putFragment(outState, DrawerFragment.class.getName(), mDrawerFragment);
outState.putInt("currentTab", mViewPager.getCurrentItem()); outState.putInt("currentTab", mViewPager.getCurrentItem());

View file

@ -23,7 +23,7 @@ import java.util.TimerTask;
/** /**
* Displays a list of all existing folders. * Displays a list of all existing folders.
*/ */
public class FoldersFragment extends ListFragment implements SyncthingService.OnApiChangeListener, public class FolderListFragment extends ListFragment implements SyncthingService.OnApiChangeListener,
AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener { AdapterView.OnItemClickListener, AdapterView.OnItemLongClickListener {
private FoldersAdapter mAdapter; private FoldersAdapter mAdapter;