Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.imaadv.leaynik.test;
- import android.support.v4.app.Fragment;
- import android.support.v4.app.FragmentManager;
- import android.support.v4.app.FragmentPagerAdapter;
- import com.viewpagerindicator.IconPagerAdapter;
- class Tutorial_Fragment extends FragmentPagerAdapter implements
- IconPagerAdapter {
- protected static final String[] CONTENT = new String[] { "This", "Is", "s" };
- private int mCount = CONTENT.length;
- private String Content;
- private String TestName;
- public Tutorial_Fragment(FragmentManager fm, String Content, String TestName) {
- super(fm);
- this.Content = Content;
- this.TestName = TestName;
- }
- @Override
- public Fragment getItem(int position) {
- switch (position) {
- // case 0:
- // return TestDefntion.newInstance(CONTENT[0], Content);
- case 0:
- return Aye_distance.newInstance(CONTENT[0]);
- case 1:
- return Close_aye.newInstance(CONTENT[1]);
- case 2:
- if (TestName.contentEquals("astigmatism")) {
- return testone_Image.newInstance(CONTENT[2]);
- } else if (TestName.contentEquals("visionacuty")) {
- return test2_Image.newInstance(CONTENT[2]);
- } else if (TestName.contentEquals("consens")) {
- return test3_Image.newInstance(CONTENT[2]);
- } else if (TestName.contentEquals("blind")) {
- return test4_Image.newInstance(CONTENT[2]);
- } else if (TestName.contentEquals("red")) {
- return test5_Image.newInstance(CONTENT[2]);
- } else if (TestName.contentEquals("central")) {
- return test6_Image.newInstance(CONTENT[2]);
- }
- return Test_Image.newInstance(CONTENT[3], TestName);
- default:
- return Aye_distance.newInstance(CONTENT[0]);
- }
- }
- @Override
- public int getCount() {
- return mCount;
- }
- @Override
- public CharSequence getPageTitle(int position) {
- return Visual_aquity_TestFragmentAdapter.CONTENT[position
- % CONTENT.length];
- }
- @Override
- public int getIconResId(int index) {
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement