zoukankan      html  css  js  c++  java
  • 第二阶段冲刺-05

    import android.os.Bundle;
    import android.support.annotation.Nullable;
    import android.support.v4.app.Fragment;
    import android.support.v4.app.FragmentManager;
    import android.support.v4.app.FragmentPagerAdapter;
    
    import com.example.myapplication.Fragment.HistoryContentFragment;
    import com.example.myapplication.Fragment.HistoryFragment;
    
    import java.util.ArrayList;
    
    /**
     * @author:created By ZhangHao
     * 时间:2019/5/6 01
     * 邮箱:188660586@qq.com
     */
    public class historyFragmentAdapter extends FragmentPagerAdapter {
        private ArrayList<String>titles;
        public historyFragmentAdapter(FragmentManager fm) {
            super(fm);
            this.titles=new ArrayList<>();
        }
    
        /*
         **
         *数据列表
         **
        */
    
    
        public void setTitles(ArrayList<String> titles) {
            this.titles.clear();
            this.titles.addAll(titles);
            notifyDataSetChanged();
        }
    
    
        @Override
        public Fragment getItem(int i) {
            HistoryContentFragment historyContentFragment = new HistoryContentFragment();
            Bundle bundle = new Bundle();
            bundle.putString("titles",titles.get(i));
            historyContentFragment.setArguments(bundle);
            return historyContentFragment;
        }
    
        @Override
        public int getCount() {
            return titles.size();
        }
    
    
        @Override
        public CharSequence getPageTitle(int position) {
    
            String plateName= titles.get(position);
            if(plateName==null){
                plateName="";
            }else if(plateName.length()>15){
                plateName=plateName.substring(0,15)+"...";
            }
            return plateName;
        }
    }
  • 相关阅读:
    JS判断浏览器类型及版本
    php函数ob_start()、ob_end_clean()、ob_get_contents()
    HTML-embed标签详解
    QQ一键登录功能的实现过程
    windows 7系统搭建本地SVN服务器的过程
    php 环境工具官网地址
    yii2 auth access-token
    使用Yii2时遇到的实际问题
    PHPExcel正确读取excel表格时间单元格(转载)
    持续集成 Jenkins
  • 原文地址:https://www.cnblogs.com/chenyuchun/p/11066764.html
Copyright © 2011-2022 走看看