I need to create four different layouts, each on the ViewPagerIndicator page. How can i do this? ViewPagerIndicator already works, but I use the sample from http://viewpagerindicator.com and a simple TextView is created for all pages.
See sample (TestFragment.java):
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
TextView text = new TextView(getActivity());
text.setGravity(Gravity.CENTER);
text.setText(mContent);
text.setTextSize(20 * getResources().getDisplayMetrics().density);
text.setPadding(20, 20, 20, 20);
LinearLayout layout = new LinearLayout(getActivity());
layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
layout.setGravity(Gravity.CENTER);
layout.addView(text);
return layout;
}
I need to determine the current page (position) and refer to the corresponding resource layout (XML). Is it possible?
I also need to make sure that all views of all pages will load only once at once, when I create an action, allowing me to update the values later.
I appreciate any help !! Thanks
source
share