diff --git a/res/layout/activity_account_settings.xml b/res/layout/activity_account_settings.xml index 5e34536a24f06b8c2435abc2e7ffee7d056271dc..e53d1a7f9b13b4397f69ec692a858f1f219c37e1 100644 --- a/res/layout/activity_account_settings.xml +++ b/res/layout/activity_account_settings.xml @@ -18,7 +18,7 @@ android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="match_parent" - android:paddingTop="?android:attr/actionBarSize" /> + android:layout_below="@+id/pager_sliding_strip" /> <FrameLayout android:id="@+id/hidden_container" diff --git a/src/org/sflphone/adapters/SectionsPagerAdapter.java b/src/org/sflphone/adapters/SectionsPagerAdapter.java index ae5c636fd08d17bfe32ecff6e15871c9e06f8b2e..4fea902371484528cddb534b60096866a09f75fe 100644 --- a/src/org/sflphone/adapters/SectionsPagerAdapter.java +++ b/src/org/sflphone/adapters/SectionsPagerAdapter.java @@ -12,12 +12,8 @@ import org.sflphone.views.PagerSlidingTabStrip; import android.app.Fragment; import android.app.FragmentManager; import android.content.Context; -import android.graphics.drawable.Drawable; import android.os.RemoteException; import android.support.v13.app.FragmentStatePagerAdapter; -import android.text.Spannable; -import android.text.SpannableStringBuilder; -import android.text.style.ImageSpan; import android.util.Log; diff --git a/src/org/sflphone/client/AccountEditionActivity.java b/src/org/sflphone/client/AccountEditionActivity.java index 49bceb5117c065f8a3ebe2611cd99af64eff09c7..ce42e26bc51e0be9243b1e2ebef5fc9187902f7f 100644 --- a/src/org/sflphone/client/AccountEditionActivity.java +++ b/src/org/sflphone/client/AccountEditionActivity.java @@ -49,13 +49,10 @@ import org.sflphone.service.ISipService; import org.sflphone.service.SipService; import org.sflphone.views.PagerSlidingTabStrip; -import android.app.ActionBar.Tab; -import android.app.ActionBar.TabListener; import android.app.Activity; import android.app.AlertDialog; import android.app.Fragment; import android.app.FragmentManager; -import android.app.FragmentTransaction; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; @@ -70,18 +67,28 @@ import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; -import android.widget.Toast; -public class AccountEditionActivity extends Activity implements TabListener, GeneralAccountFragment.Callbacks, AudioManagementFragment.Callbacks, +public class AccountEditionActivity extends Activity implements GeneralAccountFragment.Callbacks, AudioManagementFragment.Callbacks, AdvancedAccountFragment.Callbacks, SecurityAccountFragment.Callbacks, NestedSettingsFragment.Callbacks { private static final String TAG = AccountEditionActivity.class.getSimpleName(); public static final String KEY_MODE = "mode"; private boolean mBound = false; private ISipService service; - private Account acc_selected; + private ViewPager mViewPager; + + private NestedSettingsFragment toDisplay; + + private Observer mAccountObserver = new Observer() { + + @Override + public void update(Observable observable, Object data) { + processAccount(); + } + }; + PreferencesPagerAdapter mPreferencesPagerAdapter; private ServiceConnection mConnection = new ServiceConnection() { @@ -100,6 +107,8 @@ public class AccountEditionActivity extends Activity implements TabListener, Gen fragments.add(new SecurityAccountFragment()); } + mViewPager = (ViewPager) findViewById(R.id.pager); + mPreferencesPagerAdapter = new PreferencesPagerAdapter(AccountEditionActivity.this, getFragmentManager(), fragments); mViewPager.setAdapter(mPreferencesPagerAdapter); mViewPager.setOffscreenPageLimit(3); @@ -116,21 +125,6 @@ public class AccountEditionActivity extends Activity implements TabListener, Gen } }; - private ViewPager mViewPager; - - private NestedSettingsFragment toDisplay; - - private Observer mAccountObserver = new Observer() { - - @Override - public void update(Observable observable, Object data) { - processAccount(); - } - }; - - // private ArrayList<String> requiredFields = null; - // EditionFragment mEditionFragment; - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -138,13 +132,6 @@ public class AccountEditionActivity extends Activity implements TabListener, Gen setContentView(R.layout.activity_account_settings); getActionBar().setDisplayHomeAsUpEnabled(true); - mViewPager = (ViewPager) findViewById(R.id.pager); - mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { - @Override - public void onPageSelected(int position) { - getActionBar().setSelectedNavigationItem(position); - } - }); acc_selected = getIntent().getExtras().getParcelable("account"); @@ -322,24 +309,6 @@ public class AccountEditionActivity extends Activity implements TabListener, Gen } } - @Override - public void onTabReselected(Tab arg0, FragmentTransaction arg1) { - // TODO Stub de la méthode généré automatiquement - - } - - @Override - public void onTabSelected(Tab tab, FragmentTransaction ft) { - mViewPager.setCurrentItem(tab.getPosition()); - - } - - @Override - public void onTabUnselected(Tab tab, FragmentTransaction ft) { - // TODO Stub de la méthode généré automatiquement - - } - @Override public ISipService getService() { return service; diff --git a/src/org/sflphone/client/HomeActivity.java b/src/org/sflphone/client/HomeActivity.java index 9782a49a96e403a26bbf4d6a47a5da4a011c77c6..8e9833b46cfa4fb00652bb4b224ebff859ba6e9f 100644 --- a/src/org/sflphone/client/HomeActivity.java +++ b/src/org/sflphone/client/HomeActivity.java @@ -348,20 +348,14 @@ public class HomeActivity extends Activity implements DialingFragment.Callbacks, getFragmentManager().beginTransaction().replace(R.id.left_drawer, fMenu).commit(); mSectionsPagerAdapter = new SectionsPagerAdapter(HomeActivity.this, getFragmentManager()); - // initialiseTabHost(null); mViewPager.setOffscreenPageLimit(2); mViewPager.setAdapter(mSectionsPagerAdapter); mViewPager.setCurrentItem(1); final PagerSlidingTabStrip strip = PagerSlidingTabStrip.class.cast(findViewById(R.id.pts_main)); - // strip.setBackgroundColor(getResources().getColor(R.color.sfl_blue_0)); strip.setViewPager(mViewPager); - - // mTabHost.setCurrentTab(1); service.destroyNotification(); - // mAdapter = new AccountSelectionAdapter(SFLPhoneHomeActivity.this, service, new ArrayList<Account>()); - // spinnerAccounts.setAdapter(mAdapter); } catch (RemoteException e) { Log.e(TAG, e.toString()); } @@ -620,7 +614,7 @@ public class HomeActivity extends Activity implements DialingFragment.Callbacks, startActivityForResult(intent, REQUEST_CODE_CALL); } - private class ZoomOutPageTransformer implements ViewPager.PageTransformer { + public class ZoomOutPageTransformer implements ViewPager.PageTransformer { private static final float MIN_ALPHA = .6f; // private final float scalingStart; diff --git a/src/org/sflphone/views/PagerSlidingTabStrip.java b/src/org/sflphone/views/PagerSlidingTabStrip.java index 8fb94bc8fefb526c897a9215cbf43b3fa6d5c870..331070e9b2010b48264bfe1068dd2176407fd2ae 100644 --- a/src/org/sflphone/views/PagerSlidingTabStrip.java +++ b/src/org/sflphone/views/PagerSlidingTabStrip.java @@ -236,6 +236,7 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { tab.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { + pager.setCurrentItem(position); } });