Android物联网应用程序开发(智慧城市)—— 查询购物信息界面开发
效果:

布局代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg_environment"
tools:context=".QueryShopping">
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:src="@drawable/btn_inventory_select" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignTop="@id/imageView1"
android:layout_marginBottom="20dp"
android:layout_marginRight="20dp"
android:layout_toRightOf="@id/imageView1"
android:background="@drawable/bg_frame_descend_setting"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="10dip" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="订单号:"
android:textColor="@color/white" />
<EditText
android:id="@+id/editText1"
android:layout_width="80dp"
android:layout_height="24dip"
android:background="@drawable/input"
android:padding="2dp"
android:singleLine="false"
android:textColor="@color/white" >
<requestFocus />
</EditText>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="起始时间:"
android:textColor="#ffffff" />
<Button
android:id="@+id/btnStartTime"
android:layout_width="100dip"
android:layout_height="24dip"
android:background="@drawable/input"
android:gravity="center"
android:text="2015-08-01"
android:textColor="#ffffff" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="结束时间:"
android:textColor="#ffffff" />
<Button
android:id="@+id/btnEndTime"
android:layout_width="100dip"
android:layout_height="24dip"
android:background="@drawable/input"
android:gravity="center"
android:text="2015-08-14"
android:textColor="#ffffff" />
<Button
android:id="@+id/btnSearch"
android:layout_width="142dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@drawable/btn_search" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginTop="20dp"
android:background="@drawable/input"
android:gravity="center_vertical"
android:orientation="horizontal" >
<TextView
android:id="@+id/tvNo"
android:layout_width="0.0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="订单号"
android:textColor="@color/white" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#ffffff" />
<TextView
android:id="@+id/tvAmount"
android:layout_width="0.0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="金额"
android:textColor="@color/white" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#ffffff" />
<TextView
android:id="@+id/tvState"
android:layout_width="0.0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="状态"
android:textColor="@color/white" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#ffffff" />
<TextView
android:id="@+id/tvTime"
android:layout_width="0.0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="添加时间"
android:textColor="@color/white" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#ffffff" />
<TextView
android:id="@+id/tvOperate"
android:layout_width="0.0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:text="操作"
android:textColor="@color/white" />
</LinearLayout>
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cacheColorHint="#00000000"
android:fadingEdgeLength="0dp" >
</ListView>
</LinearLayout>
</RelativeLayout>
引用布局:items.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:gravity="center_vertical"
android:background="@drawable/input"
android:orientation="horizontal" >
<TextView
android:id="@+id/tvNo"
android:layout_width="0.0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:textColor="@color/white"
android:text="订单号" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#ffffff"
/>
<TextView
android:id="@+id/tvAmount"
android:layout_width="0.0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/white"
android:text="金额" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#ffffff"
/>
<TextView
android:id="@+id/tvState"
android:layout_width="0.0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/white"
android:text="状态" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#ffffff"
/>
<TextView
android:id="@+id/tvTime"
android:layout_width="0.0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:textColor="@color/white"
android:text="添加时间" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#ffffff"
/>
<TextView
android:id="@+id/tvOperate"
android:layout_width="0.0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:textColor="@color/white"
android:text="操作" />
</LinearLayout>
</LinearLayout>
Java类进行列表项内容的添加
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 abstract class MyAdapter extends BaseAdapter {
private Context context;
public MyAdapter(Context context){
this.context = context;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHoller v;
if(convertView==null){
v = new ViewHoller();
convertView = LayoutInflater.from(context).inflate(R.layout.items, null);
v.mTvNo = (TextView) convertView.findViewById(R.id.tvNo);
v.mTvAmount = (TextView) convertView.findViewById(R.id.tvAmount);
v.mTvState = (TextView)convertView.findViewById(R.id.tvState);
v.mTvTime = (TextView)convertView.findViewById(R.id.tvTime);
v.mTvOperate = (TextView)convertView.findViewById(R.id.tvOperate);
convertView.setTag(v);
}else{
v = (ViewHoller) convertView.getTag();
}
v.mTvNo.setText("201508281043");
v.mTvAmount.setText("168");
v.mTvState.setText("已发货");
v.mTvTime.setText("2015-08-28 10:43");
v.mTvOperate.setText("");
return convertView;
}
class ViewHoller{
TextView mTvNo,mTvAmount,mTvState,mTvTime,mTvOperate;
}
}
加载列表项
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListView;
public class QueryShopping extends AppCompatActivity {
private ListView mlistView;
private MyAdapter myAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_query_shopping);
mlistView = (ListView)findViewById(R.id.listView1);
}
}
Android物联网应用程序开发(智慧城市)—— 查询购物信息界面开发的更多相关文章
- Android物联网应用程序开发(智慧城市)—— 摄像头监控界面开发
效果: 布局代码: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns: ...
- Android物联网应用程序开发(智慧城市)—— 火焰监控界面开发
效果: 布局代码: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns: ...
- Android物联网应用程序开发(智慧城市)—— 购物信息的存储界面开发
效果: 布局代码: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:an ...
- 【可视化大屏教程】用Python开发智慧城市数据分析大屏!
目录 一.开发背景 二.讲解代码 2.1 大标题+背景图 2.2 各区县交通事故统计图-系列柱形图 2.3 图书馆建设率-水球图 2.4 当年城市空气质量aqi指数-面积图 2.5 近7年人均生产总值 ...
- JAVA 图形开发中组件对齐方法及界面开发
/*文章中用到的代码只是一部分,需要源码的可通过邮箱联系我 1978702969@qq.com*/ 在上篇博客中提到了JAVA图形界面开发时的两种布局,流式布局和边框布局. 在实际使用中可能会发现,往 ...
- Android物联网应用程序开发(智慧城市)—— 用户注册界面开发
效果: 布局代码: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns: ...
- Android物联网应用程序开发(智慧城市)—— 环境状态值范围设置界面开发
效果图: 代码: 布局: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns ...
- Android物联网应用程序开发(智慧园区)—— 图片预览界面
效果图: 实现步骤: 1.首先在 build.gradle 文件中引入 RecycleView implementation 'com.android.support:recyclerview-v7: ...
- Android物联网应用程序开发(智慧园区)—— 设置传感器阈值对话框界面
效果图: 自定义对话框布局: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xml ...
随机推荐
- Linux基础命令---dig工具
dig dig是一个DNS查询工具,多数管理员会使用dig命令来解决DNS的问题. 此命令的适用范围:RedHat.RHEL.Ubuntu.CentOS.Fedora. 1.语法 di ...
- AI ubantu 环境安装
ubantu安装记录 apt install python3-pip anaconda安装 https://repo.anaconda.com/archive/Anaconda3-2020.11-Li ...
- 【Linux】【Shell】【Basic】数组
1. 数组: 变量:存储单个元素的内存空间: 数组:存储多个元素的连续的内存空间: 数组名:整个数组只有一个名字: 数组 ...
- jstl中的foreach标签
<%@ page import="java.util.ArrayList" %><%@ page import="java.util.List" ...
- 面向切面编程(Spring AOP)
一.什么是AOP AOP即面向切面编程,通过预编译方式和运行期动态代理实现程序功能的同一维护的一种技术.主要体现在日志记录.性能统计.安全控制.事务处理和异常处理等. 1.相关概念 二.切面.切入点配 ...
- numpy基础教程--对数组进行水平拼接和竖直拼接
在处理数组的时候经常要用到拼接,numpy中有两个非常实用的函数,可以快捷对数组进行拼接 1.hstack(tup)函数可以接收维度相同的数组,进行水平拼接. 2.vstack(tup)用来竖直拼接 ...
- UMDCTF 2021
6道pwn题,4道可以做.剩下一道题是arm架构,一道题是内核,溜了溜了. Jump_Not_Easy 1 from pwn import * 2 3 p = process('./pwn') 4 e ...
- CF1557B Moamen and k-subarrays 题解
Content 给定一个大小为 \(n\) 的数组.你可以将其分为 \(k\) 个子数组,并按照每个子数组的字典序重新排列这些子数组,再顺次拼接,得到一个新的数组.问是否存在一种划分子数组的方案,使得 ...
- java 图形化小工具Abstract Window Toolit 画笔 处理位图
具体编程来处理位图 知识点: 实现逻辑: 画板上的图片 new BufferedImage(canvasWidth,canvasHeight,BufferedImage.TYPE_INT_BGR); ...
- django信号机制 (每个操作前后django都预留了两个钩子,便于统一化添加功能)
信号 Django中提供了"信号调度",用于在框架执行操作时解耦.通俗来讲,就是一些动作发生的时候,信号允许特定的发送者去提醒一些接受者. 典型应用场景:在所有数据库相关操作(读/ ...