android-viewpager

Synchronize all the ListView in a ViewPager

寵の児 提交于 2019-12-17 22:25:51
问题 In my application I have a ViewPager with each one a custom ListView in it linked toghether like row in a table. The problem is that when I scroll a ListView in the first page and then I scroll the ViewPager the ListView of the first page and the ListView of the second page are misaligned. The listView must be aligned because in the first one i have a TextView with a description and then 4 coloumns with datas and in the next ListViews 6 coloumns without the description so if they are

Action items from Viewpager initial fragment not being displayed

左心房为你撑大大i 提交于 2019-12-17 21:48:52
问题 In the application I am developing I am using a ViewPager with fragments and each fragment constructs its own menu independently of all of the other fragments in the ViewPager. The issue is that sometimes the fragments that are initialised by the ViewPager by default (i.e in it's initial state) are not having their items populated into the action items menu. What's worse is that this issue only occurs intermittently. If I swipe through the ViewPager enough so that the fragments are forced to

View pager first and second fragment data is not updating when data changed in android?

别来无恙 提交于 2019-12-17 21:38:03
问题 i am using view pager (dynamic) for showing data from service. It is working fine but whenever i called the service again, the data in the view pager need to refresh and updating with new data (from service). All the fragments in view pager are refreshing with new data but first two fragment of view pager are not updating with new data, those two fragments (first and second) are showing with previous data only. please any one help me. my code: RechargeplansActivity.java: public class

ViewPager and OnItemClickListener in ListView

☆樱花仙子☆ 提交于 2019-12-17 19:42:06
问题 I'm working on creating a swipe-to-dismiss list view adapter. My basic methodology is to wrap the list item's view as the second view in a ViewPager and provide the necessary callbacks in the item change listener of the ViewPager. Through much pain I've got the View recycler working as intended, as well as ViewHolder and ViewBinder patterns implemented. I even managed to keep the ListView from taking over the touch events while the ViewPager is being scrolled without having to make a custom

Get id of TextView in Fragment from FragmentActivity in ViewPager

百般思念 提交于 2019-12-17 19:22:15
问题 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 Button that 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 I try to access that TextView from FragmentActivity it is null. Here is my code SherlockFragmentActivity: public class TabsFacturasActivity extends SherlockFragmentActivity { protected MyApplication myApplication

How to customise the CirclePageIndicator?

…衆ロ難τιáo~ 提交于 2019-12-17 19:12:52
问题 I am using ViewPager and PagerAdapter to get a slideshow of XML s in android app. I am using CirclePageIndicator to number the page. How can I customise the color of the circle corresponding to current page ? 回答1: On your CirclePageIndicator object call setPageColor(Color.RED) to set the default fill colour of the circle to red. Call setFillColor(Color.BLACK) to set the fill colour of the selected circle to black. Call setStrokeColor(Color.WHITE) to set the stroke or the circle's border

How to use swipe gesture in a view pager's page with android?

杀马特。学长 韩版系。学妹 提交于 2019-12-17 18:55:06
问题 I need to take a view pager in an application which consist of three pages. I am new to android view pager. I have one view named TestSwipingView in second half of the screen and another view for the top half of the screen. How do I configure only TestSwipingView as swipe-able? 回答1: This is how I implemented it. It may give you some idea too. Step 1 : In my main activity, I have made my page adapter and called it in onCreate(). public class SomeActivity extends FragmentActivity { WebView

One side ViewPager swiping only

久未见 提交于 2019-12-17 18:47:45
问题 I have a ViewPager in my application and I would like to disable/allow swipe to right side in any time. Every view in the viewpager contains ListView. How can I do that? I am trying to do that in this way: private int oldX; private int deltaX = 0; @Override public boolean onTouch(View view, MotionEvent motionEvent) { if (motionEvent.getAction() == MotionEvent.ACTION_MOVE || motionEvent.getAction() == MotionEvent.ACTION_DOWN) { int newX = (int) motionEvent.getX(); deltaX = oldX - newX; oldX =

HorizontalScrollView or Carrousel?

为君一笑 提交于 2019-12-17 18:33:39
问题 I want to create a HorizontalScrollView , but with some "effects" in it, like this example, or this other example. The thing is that I don't know how many items I'll have to use; I get the ImageView from an API so it should be dynamic. How can I make that effect that if it's selected it becomes bigger with the TextView below? The closest example I found on SO is here. That's exactly what I need, but I've tested the answer given and it doesn't work for me ... but the image from the question is

Send values from ViewPager Activity to a Fragment by bundle

隐身守侯 提交于 2019-12-17 18:29:17
问题 I have an ViewPager Activity that call the fragment that represent the slide layout. What i need is pass values from activity to fragment by bundle. How i can do this? I try pass a int 2 in onCreate() but not work and i Activity: @Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_screen_slide); Intent intent = new Intent(this,ScreenSlidePageFragment.class); Bundle bundle = new Bundle(); bundle.putInt("SIDE",2);