android-viewpager

video & image viewPager

耗尽温柔 提交于 2019-12-23 02:22:40
问题 I have a problem in my code can anyone help me? I need to make app play story like Messenger app I want to display a list of images and videos in viewpager automatically or manually I do it but I faced some problem First: when page of image is view and the next page play video the sound of video is playing when view the image because the pager load the next fragment i used mViewPager.setOffscreenPageLimit(0); but i didn't do any thing Second one: when I move manually from video to image the

Image viewpager swiping

心已入冬 提交于 2019-12-23 02:21:23
问题 I have a problem with swiping images horizontally in view pager. I'm using Universal Image Loader for displaying images. View pager is positioned under the textview that represents title of the story and on top of other textview that represents story. The problem is that swiping isn't working exactly how it should be. Every time I try to swipe to right or left, the image swiping is interrupted by scrolling of the whole layout. To be more specific, layout of my activity is scrollable

Non stop auto scroll of viewpager in android

拟墨画扇 提交于 2019-12-23 02:19:12
问题 I have used timer to auto swipe the viewpager. But after reaching the last page the timer stops. How to make it to continue again from the first page? final Handler mHandler = new Handler(); final Runnable mUpdateResults = new Runnable() { public void run() { pager.setCurrentItem(page++); } }; int delay = 1000; // delay for 1 sec. int period = 4000; // repeat every 4 sec. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { mHandler.post(mUpdateResults);

Custom viewpager tabs with custom view, multiple fragment and layouts

拥有回忆 提交于 2019-12-23 02:07:08
问题 I want to make a viewpager which is just like latest facebook application. and the problem is with tabs. however i tried to make it, but i need icons with text in tabs and multiple fragments and layouts associated with it. two issue occurred when i tried to develop. 1. I compromised with my UI, and tried putting static icons in it, but they don't change on selection and they don't even have badge like in facebook application. 2. when i put that code in my application which i have developed in

How to implement Firebase with ViewPager?

无人久伴 提交于 2019-12-23 01:54:23
问题 What is the best way to use firebase with ViewPager. Expected Output How can I use ViewPager with Firebase such that it notifies the firebase for the position and gets and attaches the data accordingly? Person.java public class Person { private String name; private String email; private String hobby; public Person(){ } public Person(String name , String email , String hobby){ this.name= name; this.email = email; this.hobby = hobby; } public void setName(String name) { this.name = name; }

Layout Jitter when Toolbar hides while scrolling RecyclerView

限于喜欢 提交于 2019-12-23 01:41:47
问题 Hi , I have a layout with Toolbar, PageSlidingTab and ViewPager. Inside ViewPager there is a fragment with RecyclerView. I want to hide the Toolbar as i scroll the RecyclerView. I have achieved it by adding the following code : toolbar = ((MyActivity)getActivity()).getToolbar(); mRecyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() { int toolbarMarginOffset = 0; private int dp(int inPixels){ return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, inPixels,

Layout Jitter when Toolbar hides while scrolling RecyclerView

僤鯓⒐⒋嵵緔 提交于 2019-12-23 01:41:35
问题 Hi , I have a layout with Toolbar, PageSlidingTab and ViewPager. Inside ViewPager there is a fragment with RecyclerView. I want to hide the Toolbar as i scroll the RecyclerView. I have achieved it by adding the following code : toolbar = ((MyActivity)getActivity()).getToolbar(); mRecyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() { int toolbarMarginOffset = 0; private int dp(int inPixels){ return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, inPixels,

detect when user swipes the viewpager from edge of a page

北战南征 提交于 2019-12-23 01:17:06
问题 I am sure that there are some posts about it, and I skimmed through them before, but now I cannot find them. I want to detect the action when the user swipes the viewpager from edge of a page (such as left edge). I want to do some special handling for this kind of swipe, such as showing menu. Is there any ViewPager built-in(?) support for it? I vaguely remembered it is. Otherwise, I have to implement my own logic to detect those action. Can anyone point me some info? 回答1: I think, you should

ViewPager and YouTubePlayer

≯℡__Kan透↙ 提交于 2019-12-23 01:13:59
问题 In my actvity I have a viewPager with for example 3 pages. In all of theses pages, I have a YouTubePlayer with a different id video. The problem is that all the YouTubePlayer component has the same video at the same time. Concretely : When the first page is displayed, the YouTubePlayer show the first video, so all seems to be ok. When I try to scroll to the 2nd page, I can see that the 2nd YouTubePlayer show the same video. When the 2nd page is completely displayed (After scrolling), behind

How can I use a PreferenceFragment with a ViewPager?

给你一囗甜甜゛ 提交于 2019-12-23 01:07:58
问题 I cannot figure out how to get PreferenceFragment to work correctly. I have a ViewPager hooked up to a FragmentPagerAdapter, with two Fragments that the user can swipe between. I am trying to get the "Settings" menu working, using a PreferenceFragment, but I am unsure what I'm doing wrong. When I tap Settings the view is changed to a blank white screen. My SettingsFragment class: public class SettingsFragment extends PreferenceFragment{ @Override public void onCreate(Bundle savedInstanceState