• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号
您的位置:首页 > 程序设计 >Android > 快递物流信息布局,快递物流信息

快递物流信息布局,快递物流信息

作者:网友 字体:[增加 减小] 来源:互联网 时间:2017-05-26

网友通过本文主要向大家介绍了物流园区布局规划,京东物流中心布局,物流仓库布局平面图,物流网点布局,物流库房布局等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

快递物流信息布局,快递物流信息


思路:就一个ListView,每个item就是一条物流信息。然后每个item,分为左和右两边,左边是一个进度条的风格,右边是物流文字,适配器里面判断item,position为0 就设置为绿色,其他position就设置为灰色就行了。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    >
    <!-- 左边 -->
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:orientation="vertical"
        >
        <!-- 上面的竖线 -->
        <View
            android:id="@+id/view_top_line"
            android:layout_width="2dp"
            android:layout_height="15dp"
            android:background="@color/lightgray"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="-1dp"
            />
        <!-- 圆点 -->
        <ImageView
            android:id="@+id/iv_expres_spot"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:background="@drawable/express_point_old"
            android:layout_marginBottom="2dp"
            android:layout_marginTop="2dp"
            />
        <!-- 竖线 -->
        <View
            android:layout_width="2dp"
            android:layout_height="wrap_content"
            android:background="@color/lightgray"
            android:layout_gravity="center_horizontal"
            />
    </LinearLayout>

    <!-- 右边 -->
    <LinearLayout
        android:layout_weight="1"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="17dp"
        >
        <TextView
            android:id="@+id/tv_express_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="asdfasdfasd大事发生的苏打粉asdfasdfas阿斯蒂芬斯蒂芬阿萨德发达省份撒旦法"
            android:textColor="@color/gray"
            android:lineSpacingExtra="2dp"
            android:textSize="16sp"
            android:textIsSelectable="true"
            />
        <TextView
            android:id="@+id/tv_express_time"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@color/lightgray"
            android:textSize="12sp"
            android:text="2016年4月27日 00:27:45"
            android:layout_marginTop="5dp"
            android:textIsSelectable="true"
            android:paddingBottom="10dp"
            />
        <!-- 底部分割线 -->
        <View
            android:layout_width="match_parent"
            android:background="@color/lightgray"
            android:layout_height="0.5dp"
            />
    </LinearLayout>
</LinearLayout>

  

public class MessListAdapter extends BaseAdapter {
    //allContent就是所有物流信息的list
    private List<Content> allContent;
    private Context context;
    private LayoutInflater layoutInflater;
    MessListAdapter(Context context,List<Content> allContent){
        this.allContent = allContent;
        this.context = context;
        layoutInflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        return allContent.size();
    }

    @Override
    public Object getItem(int position) {
        return allContent.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if(convertView == null){
            holder = new ViewHolder();
            convertView = layoutInflater.inflate(R.layout.item_express_data,null);
            holder.viewTopLine = convertView.findViewById(R.id.view_top_line);
            holder.ivExpresSpot = (ImageView) convertView.findViewById(R.id.iv_expres_spot);
            holder.tvExpressText = (TextView) convertView.findViewById(R.id.tv_express_text);
            holder.tvExpressTime = (TextView) convertView.findViewById(R.id.tv_express_time);

            //将ViewHolder与convertView进行绑定
            convertView.setTag(holder);
        }else{
            holder = (ViewHolder)convertView.getTag();
        }

        Content content = allContent.get(position);

        //设置数据颜色,防止view 复用,必须每个设置
        if(position == 0 ){  //上顶部背景透明,点是灰色,字体是绿色
            holder.viewTopLine.setBackgroundColor(Color.TRANSPARENT);
            holder.ivExpresSpot.setBackgroundResource(R.drawable.express_point_new);
            holder.tvExpressText.setTextColor(context.getResources().getColor(R.color.mainColor));
            holder.tvExpressTime.setTextColor(context.getResources().getColor(R.color.mainColor));
        }else{
            holder.viewTopLine.setBackgroundColor(context.getResources().getColor(R.color.lightgray));
            holder.ivExpresSpot.setBackgroundResource(R.drawable.express_point_old);
            holder.tvExpressText.setTextColor(context.getResources().getColor(R.color.gray));
            holder.tvExpressTime.setTextColor(context.getResources().getColor(R.color.lightgray));
        }
        holder.tvExpressText.setText(content.getContext());
        holder.tvExpressTime.setText(content.getTime());
        return convertView;
    }


    public class ViewHolder{
        public View viewTopLine;
        private ImageView ivExpresSpot;
        private TextView tvExpressText;
        private TextView tvExpressTime;
    }

}

  

 

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • 快递物流信息布局,快递物流信息

相关文章

  • 2017-05-26Android--activity切换时的动画,android--activity
  • 2017-05-26Xamarin android 的WebClient Json下载并存储本地及sqlite数据库,xamarinsqlite
  • 2017-05-26安卓四大组件之服务,安卓四大组件
  • 2017-05-26Mac下载安装Android Studio教程,androidstudio
  • 2017-05-26硅谷新闻5--顶部新闻轮播图事件处理,硅谷5--
  • 2017-05-26多个viewpager可能产生的问题,多个viewpager产生
  • 2017-05-26Android小知识汇总,android小知识
  • 2017-05-26Android CursorAdapter的使用,cursoradapter使用
  • 2017-05-26Android开发代码规范,android开发代码
  • 2017-05-26Intent之运输大队长,Intent之运输队长

文章分类

  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号

最近更新的内容

    • Android中使用Handler以及CountDownTimer实现包含倒计时的闪屏页面,countdownview倒计时
    • Android开发学习——Android项目的目录结构,android项目
    • 开源插件 PullToRefresh: PullToRefreshListView / PullToRefreshGridView 实例详解
    • Android音频开发之基础知识介绍
    • Android常用的图片加载库,
    • activity的横屏和竖屏设置,activity
    • 谷歌电子市场3--应用,谷歌电子市场3--
    • GsonFormat插件从配置到使用,gsonformat插件配置
    • Android编程思想双11口诀,android编程思想
    • Android 测试自定义纯数字软键盘,android自定义

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有