android-viewpager

Divider not working for TitlePageIndicator with viewpagerindicator & actionbarsherlock

半世苍凉 提交于 2020-01-03 08:06:30
问题 I noticed with the latest version of ViewPagerIndicator, ICS style dividers are supported, I tried to follow the issue and solution, but no matter what I do I can't get the divider to show up on my options on the actionbar for the TitlePageIndicator. I added the IcsLayout as the container, put divider, showDividers, and other properties, but am still getting nothing. Here's my layout (oddly enough, if I switch the IcsLayout to the viewpager indicator one, the app crashes): <com

Viewpager pass bundles between fragments

我们两清 提交于 2020-01-03 04:18:33
问题 I have a custom Viewpager in which it disables the touch events. So I have buttons 'Next' and 'Back' that control the viewpager. My question is how to pass data or bundles between the fragments in the viewpager. Normally it would work but sense the fragments are created even though they are not shown. That's because of the viewpager slide effect, it has to make the fragments ahead and before for the effect to work. So that means I can't use bundles since the fragment is already created. This

How to add a tab to SlidingTabLayout?

落花浮王杯 提交于 2020-01-03 02:29:06
问题 I am using google's SlidingTabLayout in my view, but i want to add dynamically new tabs to it. I'm using this http://developer.android.com/samples/SlidingTabsBasic/src/com.example.android.common/view/SlidingTabLayout.html This is my code which initialize it: // Create the adapter that will return a fragment for each of the three // primary sections of the activity. mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); //this ^ is a FragmentStatePagerAdapter // Set up

Different sized tabs with TabLayout android

左心房为你撑大大i 提交于 2020-01-02 19:32:29
问题 Trying to recreate same top TabLayout as Instagram. Main tab: Side tabs: Have tried multiple things: app:tabMode="fixed" app:tabMode="scrollable" I managed to create this programmatically like so: View view1 = getLayoutInflater().inflate(R.layout.customtab, null); view1.findViewById(R.id.icon).setBackgroundResource(R.drawable.my1); tabLayout.addTab(tabLayout.newTab().setCustomView(view1)); View view2 = getLayoutInflater().inflate(R.layout.customtab, null); view2.findViewById(R.id.icon)

Don't restore ViewPager when Activity is restored

萝らか妹 提交于 2020-01-02 12:46:58
问题 The setup of my project is as follows Activity has Fragment and it has ViewPager with pages supplied by FragmentStatePagerAdapter . The data displayed by ViewPager is fetched from network. When Activity is destroyed and restored, it tries to restore the Fragment that was visible in ViewPager when the Activity was destroyed. But the Fragment inside the ViewPager tries to access data structures that are not fully initialized, as a result crash happens. I don't want the Fragment in ViewPager to

ViewPager scrolling issue in Android

坚强是说给别人听的谎言 提交于 2020-01-02 09:37:05
问题 I have a ViewPager with dynamic number of images in it. This ViewPager is added as a custom row to a table view. As this table view can have multiple dynamic custom rows, I have to add this table view in a scrollview for scrolling. Now my question is, when I am scrolling horizontally to View Pager, it's not exactly horizontal scrolling, it's mixed with some vertical scrolling as well. So when a vertical scrolling is detected the events are passed to the scroll view; which makes the ViewPager

Android and Google map inside fragment with other controls and viewpager

烈酒焚心 提交于 2020-01-02 08:11:22
问题 I'm new in android programming; I have that small app with 3 pages (fragments), swiping between them using pageradapter and viewpager; one of these pages contains checkbox [and other controls] and a map; my problem is that the program is crashing on start. Fragment_compass.java package com.ibdiab.emadaldien; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.google.android

Vertical 'Gridview with pages' or 'Viewpager'

北城余情 提交于 2020-01-02 08:06:32
问题 What I functionally need is a Vertical ViewPager with GridView . So every page of the ViewPager should have a GridView , but the ViewPager is horizontal. So there are two possibilities: Rotate the ViewPager with GridViews Create a GridView that shows the items in pages The GridView should show 0-20 when the user scrolls 20-40 etc etc. Does anyone have a solution for this? I have checked this link, but I cannot use it cause of legal reasons. 回答1: Sounds like what you really need is a vertical

Pass touch event from NestedScrollView to parent view's

荒凉一梦 提交于 2020-01-02 07:40:31
问题 I have a ViewPager below a NestedScrollView width some top padding, and clipToPadding(false) and transparent background (like as image). My ViewPager can't get touch event and doesn't work. How can I solve this problem? (I can't change my structure and can't move ViewPager to above of NestedScrollView or set TopMargin to NestedScrollView) NestedScrollView nestedScrollView = new NestedScrollView(getContext()); nestedScrollView.setFillViewport(true); nestedScrollView.setLayoutParams

ListView slowing down ViewPager swipe

陌路散爱 提交于 2020-01-02 07:37:24
问题 I have a ViewPager that contains ImageViews downloaded from the net and it slides just fine when my ListView (in another separate layout) is not initialized. But the problems start when my ListView is created. The ViewPager still "slides" but only slides about 1/4 of the way, lags, then loads the next ImageView correctly. All of the network and bitmap operations are done using AsyncTask. I've also used the RemoteImageCache API from Singly API which works pretty well. Any ideas as to why