Compare commits
No commits in common. 'b208d0aea3bdf6854cf2aa5bfb1082b2d963b66e' and '2627a361b6e38f56015489d8362f7d16f827e229' have entirely different histories.
b208d0aea3
...
2627a361b6
Before Width: | Height: | Size: 226 KiB |
Before Width: | Height: | Size: 194 KiB |
Before Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 263 KiB |
Before Width: | Height: | Size: 182 KiB |
Before Width: | Height: | Size: 236 KiB |
Before Width: | Height: | Size: 108 KiB |
Before Width: | Height: | Size: 110 KiB |
Before Width: | Height: | Size: 163 KiB |
Before Width: | Height: | Size: 113 KiB |
Before Width: | Height: | Size: 107 KiB |
Before Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 106 KiB |
Before Width: | Height: | Size: 131 KiB |
Before Width: | Height: | Size: 165 KiB |
Before Width: | Height: | Size: 347 KiB |
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 125 KiB |
Before Width: | Height: | Size: 74 KiB |
Before Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 169 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 488 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 155 KiB |
@ -1,90 +0,0 @@
|
|||||||
package com.example.logistics.ui;
|
|
||||||
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Message;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.fragment.app.Fragment;
|
|
||||||
|
|
||||||
import com.example.logistics.R;
|
|
||||||
import com.example.logistics.manager.goodManager;
|
|
||||||
|
|
||||||
public class FindUI extends Fragment implements View.OnClickListener{
|
|
||||||
|
|
||||||
private String TAG = "FindUI";
|
|
||||||
|
|
||||||
private Context mContext;
|
|
||||||
private Button mButton;
|
|
||||||
private EditText mPickUpCode;
|
|
||||||
private EditText mPhoneNum;
|
|
||||||
|
|
||||||
public FindUI(){
|
|
||||||
|
|
||||||
}
|
|
||||||
@Nullable
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
|
||||||
|
|
||||||
Log.d(TAG, "onCreate");
|
|
||||||
View view = inflater.inflate(R.layout.my_fragment1,container,false);
|
|
||||||
|
|
||||||
mButton = (Button)view.findViewById(R.id.Sea_Button);
|
|
||||||
mPickUpCode = (EditText)view.findViewById(R.id.Sea_PickUpCode);
|
|
||||||
mPhoneNum = (EditText)view.findViewById(R.id.Sea_PhoneNum);
|
|
||||||
mButton.setOnClickListener(this);
|
|
||||||
mContext = getActivity();
|
|
||||||
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
switch(v.getId()){
|
|
||||||
case R.id.Sea_Button:
|
|
||||||
|
|
||||||
Log.d(TAG, "search");
|
|
||||||
search(v);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void search(View view){
|
|
||||||
|
|
||||||
new Thread(){
|
|
||||||
@Override
|
|
||||||
public void run(){
|
|
||||||
goodManager goodManager = new goodManager();
|
|
||||||
int msg = goodManager.search(mPickUpCode.getText().toString().trim(), mPhoneNum.getText().toString().trim(), getActivity());
|
|
||||||
Log.e("Main", "msg");
|
|
||||||
hand1.sendEmptyMessage(msg);
|
|
||||||
}
|
|
||||||
}.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("HandlerLeak")
|
|
||||||
final Handler hand1 = new Handler(){
|
|
||||||
@Override
|
|
||||||
public void handleMessage(Message msg){
|
|
||||||
if(msg.what == 0){
|
|
||||||
Toast.makeText(mContext, "搜索失败", Toast.LENGTH_SHORT).show();
|
|
||||||
}else if(msg.what == 2){
|
|
||||||
Toast.makeText(mContext, "手机尾号错误", Toast.LENGTH_SHORT).show();
|
|
||||||
}else if(msg.what == 3){
|
|
||||||
Toast.makeText(mContext, "取件码不存在", Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
@ -0,0 +1,123 @@
|
|||||||
|
package com.example.logistics.ui;
|
||||||
|
|
||||||
|
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.SimpleAdapter;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.example.logistics.R;
|
||||||
|
import com.example.logistics.manager.goodManager;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
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(){
|
||||||
|
goodManager goodManager = new goodManager();
|
||||||
|
dataList = goodManager.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}
|