位置: 编程技术 - 正文
推荐整理分享android快递跟踪进度条(跟踪快件),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:跟踪快件,快递跟踪系统软件,快递跟踪软件下载,包裹快递追踪器,跟踪快递软件,快递跟踪软件下载,跟踪快递软件,跟踪快递软件,内容如对您有帮助,希望把文章链接给更多的朋友!
android 快递跟踪进度条
activity.class
import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map;import android.app.Activity;import android.os.Bundle;import android.widget.ListView;public class MainActivity extends Activity { private ListView listView; List<String> data; private TimelineAdapter timelineAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); listView = (ListView) this.findViewById(R.id.listview); listView.setDividerHeight(0); timelineAdapter = new TimelineAdapter(this, getData()); listView.setAdapter(timelineAdapter); } private List<Map<String, Object>> getData() { List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); Map<String, Object> map = new HashMap<String, Object>(); map.put("time", "-- :"); map.put("title", "深圳龙华收件"); list.add(map); map = new HashMap<String, Object>(); map.put("time", "-- 9:"); map.put("title", "离开深圳,发往上海"); list.add(map); map = new HashMap<String, Object>(); map.put("time", "-- :"); map.put("title", "上海浦江集散中心"); list.add(map); map = new HashMap<String, Object>(); map.put("time", "-- 9:"); map.put("title", "已收取快件"); list.add(map); return list; }}
适配器
import java.util.List;import java.util.Map;import android.content.Context;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.BaseAdapter;import android.widget.TextView;public class TimelineAdapter extends BaseAdapter { private List<Map<String, Object>> list; private LayoutInflater inflater; public TimelineAdapter(Context context, List<Map<String, Object>> list) { super(); this.inflater = LayoutInflater.from(context); this.list = list; } @Override public int getCount() { return list.size(); } @Override public Object getItem(int position) { return position; } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder viewHolder = null; if (convertView == null) { convertView = inflater.inflate(R.layout.listview_item, null); viewHolder = new ViewHolder(); viewHolder.time = (TextView) convertView.findViewById(R.id.tv_time); viewHolder.title = (TextView) convertView.findViewById(R.id.title); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } viewHolder.time.setText(list.get(position).get("time").toString()); viewHolder.title.setText(list.get(position).get("title").toString()); return convertView; } static class ViewHolder { public TextView time; public TextView title; }}布局文件activity_main
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android=" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ListView android:id="@id/listview" android:layout_width="fill_parent" android:layout_height="wrap_content"/> </LinearLayout>
listview_item
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android=" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ffffff" android:orientation="vertical" android:paddingRight="dp" ><!--android:src="@drawable/timeline_green" 圆点图片 --> <ImageView android:id="@id/image" android:layout_width="dp" android:layout_height="dp" android:layout_marginLeft="dp" android:layout_marginTop="5dp" android:layout_marginBottom="5dp" android:scaleType="fitCenter" android:src="@drawable/timeline_green" /> <View android:id="@id/view_2" android:layout_width="1dp" android:layout_height="dp" android:layout_below="@id/image" android:layout_marginLeft="dp" android:background="#A6A6A6" /><!--android:background="@drawable/timeline_content" 右边图片 --> <RelativeLayout android:id="@id/relative" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="2dp" android:layout_toRightOf="@id/image" android:background="@drawable/timeline_content" android:padding="5dp" > <TextView android:id="@id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:layout_marginLeft="5dp" android:textSize="sp" /> <TextView android:id="@id/tv_time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/title" android:layout_marginLeft="5dp" android:textColor="#ff" android:textSize="9sp" /> </RelativeLayout></RelativeLayout>
获取Android设备的唯一识别码|设备号|序号|UUID 如何获取一个能唯一标识每台Android设备的序号?这个问题有很多答案,但是他们中的大部分只在某些情况下有效。根据测试:所有的设备都可以返回一
Android刷新本地相册 发现程序把图片保存到sdcard后,在相册里面找不到,只有在sdcard重新装载后会出现图片;原来图片保存到本地后,需要通知相册,加上如下代码就好了
开发技术前线 第十一期 Android领域技术文章CodeReview最佳实践听FackBook工程师讲CustomViewGroups详解Dagger2Android进行单元测试难在哪-part3Android-Espresso测试框架介绍开源库AndroidEventBus:
标签: 跟踪快件
本文链接地址:https://www.jiuchutong.com/biancheng/384259.html 转载请保留说明!友情链接: 武汉网站建设