Tag: android-viewpager

getSupportFragmentManager doesn't compile on DialogFragment

How can I show this : public class TagsDialog extends DialogFragment { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = getActivity().getLayoutInflater(); builder.setView(inflater.inflate(R.layout.tags_dialog, null)); builder.setMessage(“This is a message”).setTitle(“TAGS”); return builder.create(); } } From inside my Fragment inside a ViewPager : public class MyFragment extends Fragment { @Override public View onCreateView(LayoutInflater […]

Controlling two ViewPager Together

I need to synchronize the two ViewPager together. The requirement is something like on scrolling the ViewPager-1 and the ViewPager-2 should also scroll by certain amount. The Image shown below will make you more clear with my question. You can also help me with some tutorials link. Thanks.

Best way to disable ViewPager paging

I’m developing an app which have a ViewPager as a menu. Each fragment has a bunch of child views which can be ListView, ScrollView, LinearLayout, etc… One of this fragments have a settings button which toggles a settings panel (LinearLayout wrapper) with a ScrollView and some LinearLayout (buttons) and SeekBar as childs. This settings panel […]

Collapsing ToolBar Layout with viewpager

I am using CollapsingBarLayout with viewpager and the fragments of viewpager are having listview, gridview. Here is my code: <?xml version=”1.0″ encoding=”utf-8″?> <android.support.design.widget.CoordinatorLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:tools=”http://schemas.android.com/tools” android:id=”@+id/main_content” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”com.bigsteptech.seandroidnativeapp.classes.modules.common.ViewGroupEvent”> <android.support.design.widget.AppBarLayout android:id=”@+id/appbar” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:theme=”@style/ThemeOverlay.AppCompat.Dark.ActionBar” android:fitsSystemWindows=”true”> <android.support.design.widget.CollapsingToolbarLayout android:id=”@+id/collapsing_toolbar” android:layout_width=”match_parent” android:layout_height=”match_parent” app:layout_scrollFlags=”scroll|exitUntilCollapsed” android:fitsSystemWindows=”true” app:contentScrim=”?attr/colorPrimary” app:expandedTitleMarginEnd=”64dp” app:expandedTitleMarginStart=”48dp” app:expandedTitleTextAppearance=”@style/TransparentText”> <FrameLayout android:id=”@+id/carouselLayout” android:layout_width=”match_parent” android:layout_height=”match_parent” app:layout_collapseMode=”parallax”> <ImageView android:id=”@+id/coverImage” android:layout_width=”match_parent” android:layout_height=”match_parent” […]

View Holder Pattern for ViewPager?

I have a ViewPager, and FragmentPagerAdpater and 3 Fragments to implement an tab swipe view. Is the ViewPager supposed to “remember” the 3 views after first time rendering? My problem is that after some time, the layouts of the 3 views are “forgotten”. That means I need to update them again and user will see […]

Fragments in ViewPager get recreated

I have a FragmentActivity with container, where I put Fragment with ViewPager. In ViewPager I have 3 Fragments: [MainActivity] [ViewPagerFragment] [Fragment1][Fragment2][Fragment3] When the user clicks a button on Fragment1/Fragment2/Fragment3, I replace the ViewPagerFragment with OtherFragment, so the hierarchy looks like this: [MainActivity] [OtherFragment] When I hit Back button, ViewPagerFragment gets recreated, as well as its […]

Get id of TextView in Fragment from FragmentActivity in ViewPager

I’m working with ViewPager with 3 Fragments and I want to change text of TextView in third page. In that page I have a Buttonthat when its pressed, go to SD images to select one. When done, returns to page and want to update TextView with path of that image. The problem is that when […]

adding Viewpager as a header to a listView

I’m trying to program an activity that show a viewpager with some images and listview below with some data .. but my problem is that I can scroll only the listview on the last part of the screen I wanted to make the viewpager scrollable with the listview so I thought about putting it as […]

Lifecycle of a replaced ViewPager and BackStack?

I’m really messed up with the android ViewPager’s lifecycle, and I’m starting to think that there something wrong in the structure of my app. So I would like a confirmation if I can do the following : I have an application showing some tabs. One of those tab is showing a ViewPager, in which there […]

Using android.app.Fragment with ViewPager in Android 3.0+

I am developing app with android:minSdkVersion=”11″. From what I know, ViewPager is implemented within Compatibility Library. I have succeed to make it work in my application by adding android-support-v4.jar library, but now I am obliged to use android.support.v4.app.FragmentActivity because I need getSupportFragmentManager() for FragmentPagerAdapter, instead of new android.app.Activity’s getFragmentManager(). Also I need to use android.support.v4.app.Fragment […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.