package com.sanrenx.adapter;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;
import com.sanrenx.entity.OneStatusEntity;
import com.sanrenx.entity.TwoStatusEntity;
import com.sanrenx.main.R;
public class StatusExpandAdapter extends BaseExpandableListAdapter {
//private static final String TAG = "StatusExpandAdapter";
private LayoutInflater inflater = null;
private List<OneStatusEntity> oneList;
private Context context;
public StatusExpandAdapter(Context context, List<OneStatusEntity> oneList) {
this.oneList = oneList;
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
this.context = context;
}
@Override
public int getGroupCount() {
// TODO Auto-generated method stub
return oneList.size();
}
@Override
public int getChildrenCount(int groupPosition) {
if(oneList.get(groupPosition).getTwoList() == null){
return 0;
}else{
return oneList.get(groupPosition).getTwoList().size();
}
}
@Override
public OneStatusEntity getGroup(int groupPosition) {
// TODO Auto-generated method stub
return oneList.get(groupPosition);
}
@Override
public TwoStatusEntity getChild(int groupPosition, int childPosition) {
// TODO Auto-generated method stub
return oneList.get(groupPosition).getTwoList().get(childPosition);
}
@Override
public long getGroupId(int groupPosition) {
// TODO Auto-generated method stub
return groupPosition;
}
@Override
public long getChildId(int groupPosition, int childPosition) {
// TODO Auto-generated method stub
return childPosition;
}
@Override
public boolean hasStableIds() {
// TODO Auto-generated method stub
return false;
}
@Override
public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
GroupViewHolder holder = new GroupViewHolder();
if (convertView == null) {
convertView = inflater.inflate(R.layout.one_status_item, null);
}
holder.groupName = (TextView) convertView.findViewById(R.id.one_status_name);
holder.group_tiao = (TextView) convertView.findViewById(R.id.group_tiao);
holder.groupName.setText(oneList.get(groupPosition).getStatusName());
if(oneList.get(groupPosition).getTwoList().get(0).isIsfinished()){
holder.group_tiao.setBackgroundColor(context.getResources().getColor(R.color.yellow));
}else{
holder.group_tiao.setBackgroundColor(context.getResources().getColor(R.color.grey));
}
return convertView;
}
@Override
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView,
ViewGroup parent) {
ChildViewHolder viewHolder = null;
TwoStatusEntity entity = getChild(groupPosition, childPosition);
if (convertView != null) {
viewHolder = (ChildViewHolder) convertView.getTag();
} else {
viewHolder = new ChildViewHolder();
convertView = inflater.inflate(R.layout.two_status_item, null);
viewHolder.childName = (TextView) convertView.findViewById(R.id.two_status_name);
viewHolder.twoStatusTime = (TextView) convertView.findViewById(R.id.two_complete_time);
viewHolder.tiao = (TextView) convertView.findViewById(R.id.tiao);
}
viewHolder.childName.setText(entity.getStatusName());
viewHolder.twoStatusTime.setText(entity.getCompleteTime());
if(entity.isIsfinished()){
viewHolder.tiao.setBackgroundColor(context.getResources().getColor(R.color.yellow));
}else{
viewHolder.tiao.setBackgroundColor(context.getResources().getColor(R.color.grey));
}
convertView.setTag(viewHolder);
return convertView;
}
@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
// TODO Auto-generated method stub
return false;
}
private class GroupViewHolder {
TextView groupName;
public TextView group_tiao;
}
private class ChildViewHolder {
public TextView childName;
public TextView twoStatusTime;
public TextView tiao;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
Android应用源码之Android 时间轴样式.zip项目安卓应用源码下载
共65个文件
png:24个
class:15个
xml:10个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 53 浏览量
2022-03-07
21:05:07
上传
评论
收藏 2.18MB ZIP 举报
温馨提示
Android应用源码之Android 时间轴样式.zip项目安卓应用源码下载Android应用源码之Android 时间轴样式.zip项目安卓应用源码下载 1.适合学生毕业设计研究参考 2.适合个人学习研究参考 3.适合公司开发项目技术参考
资源详情
资源评论
资源推荐
收起资源包目录
Android应用源码之Android 时间轴样式.zip (65个子文件)
Android应用源码之Android 时间轴样式
Android应用源码之Android 时间轴样式
MainActivity
AndroidManifest.xml 698B
res
layout
two_status_item.xml 2KB
item.xml 3KB
one_status_item.xml 2KB
timeline_item_backup.xml 3KB
main.xml 663B
drawable-ldpi
icon.png 2KB
drawable
list_line.xml 350B
drawable-mdpi
search_bar_edit_normal.9.png 1KB
xuanfenghei_3.png 199KB
hawana_0.png 218KB
demobg.png 3KB
xuanfenghei_10.png 207KB
icon.png 3KB
weibo.png 6KB
drawable-hdpi
one_status_circle.png 5KB
small_circle.png 5KB
icon.png 4KB
two_status_circle.png 4KB
drawable-xhdpi
values
strings.xml 175B
colors.xml 155B
project 815B
classpath 466B
proguard.cfg 1KB
src
com
sanrenx
entity
TwoStatusEntity.java 800B
OneStatusEntity.java 813B
adapter
StatusExpandAdapter.java 4KB
main
MainActivity.java 3KB
bin
classes
com
sanrenx
entity
OneStatusEntity.class 1KB
TwoStatusEntity.class 998B
adapter
StatusExpandAdapter$ChildViewHolder.class 824B
StatusExpandAdapter.class 5KB
StatusExpandAdapter$GroupViewHolder.class 806B
main
MainActivity$1.class 950B
R$color.class 415B
BuildConfig.class 341B
R.class 563B
MainActivity.class 4KB
R$layout.class 538B
R$attr.class 334B
R$id.class 833B
R$string.class 421B
R$drawable.class 757B
dexedLibs
annotations-40d3ae8ffc74a17c3f8e15400e9fb791.jar 931B
MainActivity.apk 522KB
AndroidManifest.xml 698B
res
crunch
drawable-ldpi
icon.png 2KB
drawable-mdpi
search_bar_edit_normal.9.png 2KB
xuanfenghei_3.png 151KB
hawana_0.png 171KB
demobg.png 658B
xuanfenghei_10.png 162KB
icon.png 2KB
weibo.png 5KB
drawable-hdpi
one_status_circle.png 1KB
small_circle.png 2KB
icon.png 4KB
two_status_circle.png 1KB
classes.dex 14KB
resources.ap_ 514KB
.classpath 466B
assets
project.properties 562B
.project 815B
gen
com
sanrenx
main
R.java 2KB
BuildConfig.java 158B
共 65 条
- 1
yxkfw
- 粉丝: 81
- 资源: 2万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Django和HTML的新疆地区水稻产量影响因素可视化分析系统(含数据集)
- windows conan2应用构建模板
- 3_base.apk.1
- 基于STM32F103C8T6的4g模块(air724ug)
- 基于Java技术的ASC学业支持中心并行项目开发设计源码
- 基于Java和微信支付的wxmall开源卖票商城设计源码
- 基于Java和前端技术的东软环保公众监督系统设计源码
- 基于Python、HTML、CSS的crawlerdemo软件工程实训爬虫设计源码
- 基于多智能体深度强化学习的边缘协同任务卸载方法设计源码
- 基于BS架构的Java、Vue、JavaScript、CSS、HTML整合的毕业设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0