Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,20 @@
|
||||
{
|
||||
"version": 3,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.example.logistics",
|
||||
"variantName": "release",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 1,
|
||||
"versionName": "1.0",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File"
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
package com.example.logistics.ui;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.media.Image;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ListView;
|
||||
import android.widget.SimpleAdapter;
|
||||
import android.widget.AbsListView.OnScrollListener;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.logistics.R;
|
||||
import com.example.logistics.dao.goodDao;
|
||||
import com.example.logistics.dao.operationDao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class HistoryActivity extends Activity implements OnItemClickListener, OnScrollListener, View.OnClickListener {
|
||||
|
||||
private String TAG = "HistoryActivity";
|
||||
private ListView lv_history;
|
||||
private ArrayAdapter<String> arr_adapter;
|
||||
private SimpleAdapter simp_adapter;
|
||||
private String phonenum;
|
||||
private List<Map<String, Object>> dataList;
|
||||
private ImageButton sync_his;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_history);
|
||||
sync_his = (ImageButton) findViewById(R.id.sync_his);
|
||||
dataList=new ArrayList<Map<String,Object>>();
|
||||
lv_history = (ListView) findViewById(R.id.lv_history);
|
||||
|
||||
simp_adapter=new SimpleAdapter(this, dataList, R.layout.item, new String[]{"pickupcode","time"}, new int[]{R.id.np_id,R.id.np_time});
|
||||
lv_history.setAdapter(simp_adapter);
|
||||
lv_history.setOnItemClickListener(this);
|
||||
lv_history.setOnScrollListener(this);
|
||||
sync_his.setOnClickListener(this);
|
||||
|
||||
Intent intent = getIntent();
|
||||
phonenum = intent.getStringExtra("user");
|
||||
|
||||
sync();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
// TODO Auto-generated method stub
|
||||
String text=lv_history.getItemAtPosition(position)+"";
|
||||
Toast.makeText(this, "position="+position+" text="+text, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v){
|
||||
switch(v.getId()){
|
||||
case R.id.sync_his:
|
||||
sync();
|
||||
Toast.makeText(this, "同步成功", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onScrollStateChanged(AbsListView view, int scrollState){
|
||||
// TODO Auto-generated method stub
|
||||
switch(scrollState){
|
||||
case SCROLL_STATE_FLING:
|
||||
Log.i(TAG, "用户在手指离开屏幕之前,由于用力划了一下,试图仍依靠惯性继续滑动");
|
||||
break;
|
||||
case SCROLL_STATE_IDLE:
|
||||
Log.i(TAG, "视图已经停止滑动");
|
||||
break;
|
||||
case SCROLL_STATE_TOUCH_SCROLL:
|
||||
Log.i(TAG, "手指没有离开屏幕,视图正在滑动");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScroll(AbsListView view, int arg1, int arg2, int arg3){
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
public void sync(){
|
||||
new Thread(){
|
||||
@Override
|
||||
public void run(){
|
||||
operationDao operationDao = new operationDao();
|
||||
dataList = operationDao.history(phonenum);
|
||||
|
||||
int msg = 1;
|
||||
hand1.sendEmptyMessage(msg);
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
@SuppressLint("HandlerLeak")
|
||||
final Handler hand1 = new Handler(){
|
||||
@Override
|
||||
public void handleMessage(Message msg){
|
||||
if(msg.what == 1){
|
||||
simp_adapter=new SimpleAdapter(HistoryActivity.this, dataList, R.layout.item, new String[]{"pickupcode","time"}, new int[]{R.id.np_id,R.id.np_time});
|
||||
lv_history.setAdapter(simp_adapter);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
package com.example.logistics.ui;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.AbsListView.OnScrollListener;
|
||||
import android.widget.AdapterView.OnItemClickListener;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ListView;
|
||||
import android.widget.NumberPicker;
|
||||
import android.widget.SimpleAdapter;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.logistics.R;
|
||||
import com.example.logistics.dao.goodDao;
|
||||
import com.example.logistics.dao.userDao;
|
||||
import com.example.logistics.entity.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.Map;
|
||||
|
||||
public class NoPickActivity extends Activity implements OnItemClickListener, OnScrollListener, View.OnClickListener {
|
||||
|
||||
private String TAG = "NoPickActivity";
|
||||
private ListView lv_nopick;
|
||||
private ArrayAdapter<String> arr_adapter;
|
||||
private SimpleAdapter simp_adapter;
|
||||
private String phonenum;
|
||||
private List<Map<String, Object>> dataList;
|
||||
private ImageButton sync_np;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_no_pick);
|
||||
|
||||
dataList=new ArrayList<Map<String,Object>>();
|
||||
lv_nopick = (ListView) findViewById(R.id.lv_nopick);
|
||||
sync_np = (ImageButton) findViewById(R.id.sync_np);
|
||||
|
||||
simp_adapter=new SimpleAdapter(this, dataList, R.layout.item, new String[]{"id","time"}, new int[]{R.id.np_id,R.id.np_time});
|
||||
lv_nopick.setAdapter(simp_adapter);
|
||||
lv_nopick.setOnItemClickListener(this);
|
||||
lv_nopick.setOnScrollListener(this);
|
||||
sync_np.setOnClickListener(this);
|
||||
|
||||
Intent intent = getIntent();
|
||||
phonenum = intent.getStringExtra("user");
|
||||
|
||||
sync();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
// TODO Auto-generated method stub
|
||||
String text=lv_nopick.getItemAtPosition(position)+"";
|
||||
Toast.makeText(this, "position="+position+" text="+text, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v){
|
||||
switch(v.getId()){
|
||||
case R.id.sync_np:
|
||||
sync();
|
||||
Toast.makeText(this, "同步成功", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScrollStateChanged(AbsListView view, int scrollState){
|
||||
// TODO Auto-generated method stub
|
||||
switch(scrollState){
|
||||
case SCROLL_STATE_FLING:
|
||||
Log.i(TAG, "用户在手指离开屏幕之前,由于用力划了一下,试图仍依靠惯性继续滑动");
|
||||
break;
|
||||
case SCROLL_STATE_IDLE:
|
||||
Log.i(TAG, "视图已经停止滑动");
|
||||
break;
|
||||
case SCROLL_STATE_TOUCH_SCROLL:
|
||||
Log.i(TAG, "手指没有离开屏幕,视图正在滑动");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScroll(AbsListView view, int arg1, int arg2, int arg3){
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
public void sync(){
|
||||
new Thread(){
|
||||
@Override
|
||||
public void run(){
|
||||
goodDao goodDao = new goodDao();
|
||||
dataList = goodDao.nopick(phonenum);
|
||||
|
||||
int msg = 1;
|
||||
hand1.sendEmptyMessage(msg);
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
@SuppressLint("HandlerLeak")
|
||||
final Handler hand1 = new Handler(){
|
||||
@Override
|
||||
public void handleMessage(Message msg){
|
||||
if(msg.what == 1){
|
||||
simp_adapter=new SimpleAdapter(NoPickActivity.this, dataList, R.layout.item, new String[]{"id","time"}, new int[]{R.id.np_id,R.id.np_time});
|
||||
lv_nopick.setAdapter(simp_adapter);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
After Width: | Height: | Size: 7.0 KiB |
@ -0,0 +1,51 @@
|
||||
<?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="50dp"
|
||||
android:background="@color/blue">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text=" 取件码"
|
||||
android:background="@color/blue"
|
||||
android:textColor="#FFFFFF"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="25dp"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/sync_his"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/blue"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:src="@drawable/sync" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="取件时间 "
|
||||
android:background="@color/blue"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="25dp"
|
||||
android:gravity="right|center_vertical"/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/lv_history"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
</ListView>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -0,0 +1,49 @@
|
||||
<?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="50dp"
|
||||
android:background="@color/blue">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text=" 取件码"
|
||||
android:background="@color/blue"
|
||||
android:textColor="#FFFFFF"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="25dp"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/sync_np"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/blue"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:src="@drawable/sync" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="入库时间 "
|
||||
android:background="@color/blue"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="25dp"
|
||||
android:gravity="right|center_vertical"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<ListView
|
||||
android:id="@+id/lv_nopick"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
</ListView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
@ -0,0 +1,25 @@
|
||||
<?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="horizontal"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/np_id"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="abc"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="60dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/np_time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="abc"
|
||||
android:gravity="right"
|
||||
android:textSize="20dp"/>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
@ -1,14 +1,119 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="50sp"
|
||||
android:text="frag3" />
|
||||
</LinearLayout>
|
||||
android:layout_height="match_parent"
|
||||
android:background="#F5F5F5"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/userLogo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="160dp"
|
||||
android:layout_marginTop="100dp"
|
||||
android:src="@drawable/logo" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="100dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/waiting"
|
||||
android:clickable="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#ffffff"
|
||||
android:text="待取件"
|
||||
android:padding="15dp"
|
||||
android:clickable="false"
|
||||
android:textSize="24dp"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFFFFF"
|
||||
android:gravity="right|center_vertical"
|
||||
android:text="> "
|
||||
android:clickable="false"
|
||||
android:textSize="24dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/history"
|
||||
android:layout_width="match_parent"
|
||||
android:clickable="true"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#ffffff"
|
||||
android:text="历史取件"
|
||||
android:padding="15dp"
|
||||
android:clickable="false"
|
||||
android:textSize="24dp"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFFFFF"
|
||||
android:gravity="right|center_vertical"
|
||||
android:text="> "
|
||||
android:clickable="false"
|
||||
android:textSize="24dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/exit"
|
||||
android:clickable="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#ffffff"
|
||||
android:text="退出登录"
|
||||
android:padding="15dp"
|
||||
android:clickable="false"
|
||||
android:textSize="24dp"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFFFFF"
|
||||
android:gravity="right|center_vertical"
|
||||
android:text="> "
|
||||
android:clickable="false"
|
||||
android:textSize="24dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
Loading…
Reference in new issue