2

I want to slide between fragments - not the whole screen , only part of it.

enter image description here
I saw SlidingPaneLayout but it didnt quite do what I wanted.

fofo
  • 69
  • 1
  • 9

2 Answers2

2

Use ViewPager to slide Fragments. Click here for tutorial.

Malwinder Singh
  • 6,644
  • 14
  • 65
  • 103
  • can i use ViewPager inside another fragment? – fofo Jun 06 '15 at 12:56
  • Yes, ViewPager can be used inside fragment.It is perfectly possible to put a ViewPager inside a Fragment, so long as the contents of the ViewPager do not themselves contain fragments. Since the concrete implementations of PagerAdapter supplied by the Android Support package use fragments, you have to roll your own fragment-less PagerAdapter to put the ViewPager in a fragment. – Malwinder Singh Jun 06 '15 at 12:58
0

If you want to place you slider in specific position, simply adjust ViewPager:

    <android.support.v4.view.ViewPager
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/pager"
    android:layout_width="100sp"
    android:layout_height="100sp" />
YasiuMaster
  • 299
  • 2
  • 5
  • 15