viewpager

ABS + ViewPager + manage orientation change

匿名 (未验证) 提交于 2019-12-03 02:35:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am currently trying to implement an application with several Tabs and i must use also ViewPager. The difficulty i'm facing is to manage screen orientation changes... Let me explain more in detail.. In portrait there is a player full screen (1fragment), in lanscape i want it to change to a list at the left and a player at the right (2fragment) For now viewPager is blocking me, i've search through the internet and found nothing for this issu with abs + viewpager. I think the problem can be related to the adapter. For now it takes a "Class"

Click on Viewpager Xamarin Android

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am new to Xamarin Android Development.I have created Image slider using ViewPager .Now I want click on image of that ViewPager.How can I implement that ? I have tried this but not worked: { viewpage = mview.FindViewById<ViewPager> (Resource.Id.viewpager); viewpage.Adapter = new itemadapter (ChildFragmentManager); viewpage.Click += Viewpage_Click; } public void Viewpage_Click (object sender, EventArgs e) { ViewModel.DetailViewCommand.Execute (); } 回答1: Just implement onclick listener for imageview in viewpager's adapter if you have only

How to change Viewpager tab colour dynamically?

匿名 (未验证) 提交于 2019-12-03 02:33:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How to change colour of Tabs like this? When I click/swipe to green or any other tab, the tab colour should change to that appropriate colour and rest of other tabs colour should change to black. How can I do this? Im using Viewpager. I tried this code inside onpagelistener: if(position == 0) { viewpager.getChildAt(position).setBackgroundColour(getResources().getcolor(R.color.red); } else if(position == 1) { viewpager.getChildAt(position).setBackgroundColour(getResources().getcolor(R.color.green); } But above code has no effect. And Im using

Variable is accessed within inner class. Needs to be declared final

匿名 (未验证) 提交于 2019-12-03 02:28:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So the title says it all. I'm getting a compilation error inside of my onClick . Here's the code. public class fieldsActivity extends Activity { Button addSiteButton; Button cancelButton; Button signInButton; /** * Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // to create a custom title bar for activity window requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.fields); // use custom layout title bar getWindow()

Android Studio Can&#039;t resolve fragmentActivity and ViewPager imports

匿名 (未验证) 提交于 2019-12-03 02:27:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I follow the tutorial of developing swipe-able tabs. When I import: import android.support.v4.app.FragmentActivity; import android.support.v4.view.ViewPager; Android Studio shows me cannot resolve the symbol "ViewPager" and "FragmentActivity". How to solve this? thanks. Below is the entire code of my project. import android.app.ActionBar; import android.app.ActionBar.Tab; import android.app.FragmentTransaction; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.view.ViewPager; public class

View Pager Crash Null Pointer Exception due to navigating back to the old fragment - Android

匿名 (未验证) 提交于 2019-12-03 02:27:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using view pager for navigating between pages. I am using FragmentStatePagerAdapter. I can swipe in one direction with out any problems. But if i swipe back to the older one. Its getting crash. I am getting null pointer exception. 03-12 10:20:34.273: E/AndroidRuntime(29035): Process: com.titlesource.notarymobile, PID: 29035 03-12 10:20:34.273: E/AndroidRuntime(29035): java.lang.NullPointerException 03-12 10:20:34.273: E/AndroidRuntime(29035): at android.support.v4.app.Fragment.instantiate(Fragment.java:399) 03-12 10:20:34.273: E

Android: velocity-based ViewPager scrolling

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The way the ViewPager scrolls right now is by one item per gesture. It treats flinging gesture the same way no matter if it's full screen fast fling or slow dragging; at the end page advances one step only. Is there any projects perhaps or examples that would add velocity-based flinging that scrolls multiple items based on velocity of the existing fling (if it still in progress) and scrolls further if the flinging gesture is wide and fast? And if there's none where to start with something like this? P.S. The bounty is offered. Please no

Attempt to invoke virtual method &#039;void android.support.v4.view.ViewPager.setAdapter(android.support.v4.view.PagerAdapter)&#039; on a null object reference

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to implement sliding tab layout using android material design. But it gives me NullPointerException . Here is my code so far: MainActivity.java public class MainActivity extends ActionBarActivity { private Toolbar toolbar; private ViewPager pager; private SlidingTabLayout nLayout; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_appbar); toolbar = (Toolbar) findViewById(R.id.app_bar); setSupportActionBar(toolbar); getSupportActionBar()

ViewPager inside ListView row prevents onItemClick to be fired

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a ViewPager inside every row of a ListView. It works fine, it changes the views inside it when the user use the swipe gesture, but it prevents the ListView's onItemClick method to be called. I know that the ViewPager is the culprit because when I hide it, the onItemClick is called, so this is what I am trying: I have created a ViewGroup to be the row (RowView). This ViewGroup has onInterceptTouchEvent overriden to avoid the ViewPager to handle further touch events when I detect a click. But the onItemClick callback is still not being

ViewPager offscreen page limit

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a way to bypass the normal behavior of ViewPager and its offscreen page limit ? My ViewPager contains four fragments , each containing a gridview of images. The problem I have is that on instansiation of the ViewPager , two fragments are created, which results in that about 20 images (about 10 per fragment) is downloaded/fetched from catch simultaneously. Is it possible to disable the offscreen page limit? My goal is to only download images when a fragment is selected, or only when the user is hovering the image. One way to achieve