android-viewpager

Updating fragments/views in viewpager with fragmentStatePagerAdapter

我怕爱的太早我们不能终老 提交于 2019-12-30 08:38:35
问题 Need some help with my problem of updating pages while using viewpager. I am using a simple viewpager with FragmentStatePagerAdapter. All I want to do is get access to the current fragment/view so as I can update some textviews in my fragment/view. I searched around in the forum and came to know few things - One of the ways to handle this is by setting tag in instantiateItem() call back of the adapter and retreive the view by findViewbyTag. I could not understand how to implement this and I

The method getChildFragmentManager() is undefined

僤鯓⒐⒋嵵緔 提交于 2019-12-30 08:30:51
问题 I have a SherlockFragmentActivity, this Activity have a SectionsPagerAdapter and a ViewPager. When I call the constructor of the SectionsPagerAdapter with getChildFragmentManager() method, it shows me this error message: The method getChildFragmentManager() is undefined for the type ViewPagerActivity This is my code: public class ViewPagerActivity extends SherlockFragmentActivity implements OnPageChangeListener, OnQueryTextListener{ private SectionsPagerAdapter sectionsPagerAdapter; private

2 ViewPager not scrolling in Android 2.3

霸气de小男生 提交于 2019-12-30 08:19:24
问题 I am using Navigation Drawer in my app, that contains some Fragments just like in the below picture. Every Fragment Contains another ViewPager that is an ImageSlider, and below that is a Listview and at the top I am using the SwipeRefreshLayout. My problem is the image slider works well on devices that has Android version 3.0 or higher but the swipe left or right doesn't works on devices 2.3 and lower, instead it invokes the Parent ViewPager's swipe that is it navigates the fragment. I am

Update a TextView in a ViewPager from another Fragment

你说的曾经没有我的故事 提交于 2019-12-30 07:50:08
问题 I am trying to update a TextView in a Fragment clicking on a button on another Fragment. Actually I implemented the callback function to the Activity and it does work, since the Logcat reports that the text in the TextView has been changed. The problem is the Textview shown in the first fragment is not updated to the new value! It's like the Fragment needs to be updated or something... Here's the ActionBarTabsPager activity code: import java.util.ArrayList; import android.app.Activity; import

Hide Tablayout Bar in android

时光怂恿深爱的人放手 提交于 2019-12-30 07:09:25
问题 I have a activity with toolbar , Tablayout , viewpager with fragments like that I want to implement toolbar material search on all the fragments like that but the problem is TAB Bar . I want to hide the tab bar(Call,Chat,Contact) on Search Open and unhide it when the search close How can I hide the tabbar ? I am using this library for material Search view implementation layout code is below <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android=

Android. Tablayout inside a tab of another tablayout

独自空忆成欢 提交于 2019-12-30 06:54:12
问题 Is it possible to have a tablayout inside a tab of another tablayout? I have created the following image for a better explanation. The slide movement desired is as it is described in the image. My main activity Xml <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support

Cover Flow feature using view pager android

最后都变了- 提交于 2019-12-30 06:48:29
问题 I have to implement cover flow feature in my app similar to mobikwik app cover flow and . I have already tried with Android CoverFlow widget library and few others. But nothing working as expected. How i can achieve this type of view using ViewPager? 回答1: I have created my class ZoomOutPageTransformer ,which is implementing PageTransformer and this set into the pager using setPageTransformer() method. Please check bellow ZoomOutPageTransformer.class - public class ZoomOutPageTransformer

Smooth scroll does not work in ViewPager (support library)

↘锁芯ラ 提交于 2019-12-30 06:07:10
问题 I am writing application that uses ViewPager to host Fragment s. When I change fragment programmatically the smooth scroll function does not work. I use ViewPager.setCurrentItem(int item, boolean smoothScroll)` method. Maybe anyone know a workaround this bug? Maybe with animations? EDIT: I am using support package. And the issue is that whether I use ViewPager.setCurrentItem(2, true) or ViewPager.setCurrentItem(2, false) the result is the same. The view switches really fast (not smoothly).

Smooth scroll does not work in ViewPager (support library)

梦想与她 提交于 2019-12-30 06:07:09
问题 I am writing application that uses ViewPager to host Fragment s. When I change fragment programmatically the smooth scroll function does not work. I use ViewPager.setCurrentItem(int item, boolean smoothScroll)` method. Maybe anyone know a workaround this bug? Maybe with animations? EDIT: I am using support package. And the issue is that whether I use ViewPager.setCurrentItem(2, true) or ViewPager.setCurrentItem(2, false) the result is the same. The view switches really fast (not smoothly).

Android: Showing Action Bar menu items depending on ViewPager

流过昼夜 提交于 2019-12-30 06:02:10
问题 I am having trouble getting the following piece of code to work out. I have a viewpager with 3 fragments, and I want a search icon to only show up on one. I started off trying to add the search function by the fragment, but the rendering of the menu item was slow when swiping to that page. I am now on the part to add the search icon to the activity, and then just hide or show depending on which viewpager page is active, but the following is not working: public class MyApp extends