/* * Copyright (C) 2012 www.amsoft.cn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.ab.adapter; import java.util.ArrayList; import android.app.Fragment; import android.app.FragmentManager; import android.support.v13.app.FragmentPagerAdapter; // TODO: Auto-generated Javadoc /** * © 2012 amsoft.cn * 名称:AbFragmentPagerAdapter.java * 描述:一个通用的Fragment适配器 * * @author 还如一梦中 * @version v1.0 * @date:2013-11-28 上午10:57:53 */ public class AbFragmentPagerAdapter extends FragmentPagerAdapter { /** The m fragment list. */ private ArrayList<Fragment> mFragmentList = null; /** * Instantiates a new ab fragment pager adapter. * @param mFragmentManager the m fragment manager * @param fragmentList the fragment list */ public AbFragmentPagerAdapter(FragmentManager mFragmentManager,ArrayList<Fragment> fragmentList) { super(mFragmentManager); mFragmentList = fragmentList; } /** * 描述:获取数量. * * @return the count * @see android.support.v4.view.PagerAdapter#getCount() */ @Override public int getCount() { return mFragmentList.size(); } /** * 描述:获取索引位置的Fragment. * * @param position the position * @return the item * @see android.support.v4.app.FragmentPagerAdapter#getItem(int) */ @Override public Fragment getItem(int position) { Fragment fragment = null; if (position < mFragmentList.size()){ fragment = mFragmentList.get(position); }else{ fragment = mFragmentList.get(0); } return fragment; } }

652654393 LV5
2024年11月18日
haozhilang LV9
2023年11月2日
yyyyyyzh LV8
2023年6月11日
wanfeng_233 LV4
2023年5月29日
sks666 LV5
2023年2月19日
lasherry LV2
2023年2月14日
快乐的程序员 LV25
2023年1月21日
ABU元帅 LV2
2022年11月7日
787194770 LV10
2022年10月19日
yjycdjb LV5
2022年5月23日

652654393 LV5
2024年11月18日
Silence丶二哈 LV13
2024年9月2日
17693282606 LV12
2024年6月20日
2636804923 LV6
2024年6月20日
lilitu LV6
2024年5月31日
阿九11111 LV4
2024年5月21日
panwill LV5
2024年5月15日
13543528515 LV8
2024年4月29日
小yuzhennice
2024年4月27日
暂无贡献等级
syd1988 LV7
2024年3月7日