This commit is contained in:
qinjiaming_branch 2016-08-30 08:11:07 +08:00
commit 84c742190f
23 changed files with 429 additions and 25 deletions

View File

@ -1 +0,0 @@
ハヤホハ

View File

@ -1,14 +0,0 @@
1. bmob_test_pull——后台更新代码测试1
2. Shop ——小组任务代码
3. 文档中王尚文的project和许家铭的project
19:41 2016/8/18
4. bmob_test_pull——云端数据下载显示代码测试1——成功
13:16 2016/8/19
5. 文档更新,第三章修改,增加需求分析设计用例图
8:38 2016/8/20
6. Shop代码更新增加“学校通知”功能整合覃佳明同学
图书馆代码,修正部分冲突;增加图书馆,学校通知,
商店,商品的云端数据
18:33 2016/8/22
7. 修改需求设计用例图,软件体系结构包图,代码问题修正
9:06 2016/8/23

View File

@ -1,9 +0,0 @@
11:17 2016/8/1711:17 2016/8/17
11:17 2016/8/17
11:18 2016/8/17
1. 在标记为“对勾”的第一个文件夹下commit
2. commit只是提交到本地
3. 在相同的文件夹上进行push即可
4.change!8:20 2016/8/18

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@ -5,5 +5,6 @@
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/> <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/> <classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="bin/classes"/> <classpathentry kind="output" path="bin/classes"/>
</classpath> </classpath>

View File

@ -0,0 +1,82 @@
package com.stone.shop.adapter;
import java.util.ArrayList;
import java.util.List;
import com.stone.shop.R;
import com.stone.shop.model.News;
import android.R.integer;
import android.content.Context;
import android.graphics.pdf.PdfDocument.Page;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
/**
* 新闻列表适配器
*
* @date 2014-5-3
* @author Stone
*/
public class NewsListAdapter extends BaseAdapter {
private Context mContext;
private LayoutInflater mInflater = null;
private List<News> mNewsList = null; // 所选分类下的所有店铺列表
public NewsListAdapter(Context context, List<News> newsList) {
mContext = context;
mNewsList = newsList;
mInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return mNewsList.size();
}
@Override
public Object getItem(int position) {
return mNewsList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
// 刷新列表中的数据
public void refresh(ArrayList<News> list) {
mNewsList = list;
notifyDataSetChanged();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
NewsHolder newsHolder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.news_list_item, null);
newsHolder = new NewsHolder();
newsHolder.tvNewsType = (TextView) convertView
.findViewById(R.id.tv_news_type);
newsHolder.tvNewsTitle = (TextView) convertView
.findViewById(R.id.tv_news_title);
newsHolder.tvNewsDate = (TextView) convertView
.findViewById(R.id.tv_news_date);
convertView.setTag(newsHolder);
} else {
newsHolder = (NewsHolder) convertView.getTag();
}
//拆分字符串,只取年月日
String[] ss = new String[2];
ss = mNewsList.get(position).getCreatedAt().split(" ");
newsHolder.tvNewsType.setText(mNewsList.get(position).getType()); //新闻类型
newsHolder.tvNewsTitle.setText(mNewsList.get(position).getTitle()); //新闻标题
newsHolder.tvNewsDate.setText(ss[0]); //新闻发布日期
return convertView;
}
}

View File

@ -0,0 +1,81 @@
package com.stone.shop.adapter;
import java.util.ArrayList;
import java.util.List;
import com.stone.shop.R;
import com.stone.shop.model.News;
import android.R.integer;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
/**
* 新闻列表适配器
*
* @date 2014-5-3
* @author Stone
*/
public class NewsListAdapter extends BaseAdapter {
private Context mContext;
private LayoutInflater mInflater = null;
private List<News> mNewsList = null; // 所选分类下的所有店铺列表
public NewsListAdapter(Context context, List<News> newsList) {
mContext = context;
mNewsList = newsList;
mInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return mNewsList.size();
}
@Override
public Object getItem(int position) {
return mNewsList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
// 刷新列表中的数据
public void refresh(ArrayList<News> list) {
mNewsList = list;
notifyDataSetChanged();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
NewsHolder newsHolder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.news_list_item, null);
newsHolder = new NewsHolder();
newsHolder.tvNewsType = (TextView) convertView
.findViewById(R.id.tv_news_type);
newsHolder.tvNewsTitle = (TextView) convertView
.findViewById(R.id.tv_news_title);
newsHolder.tvNewsDate = (TextView) convertView
.findViewById(R.id.tv_news_date);
convertView.setTag(newsHolder);
} else {
newsHolder = (NewsHolder) convertView.getTag();
}
//拆分字符串,只取年月日
String[] ss = new String[2];
ss = mNewsList.get(position).getCreatedAt().split(" ");
newsHolder.tvNewsType.setText(mNewsList.get(position).getType()); //新闻类型
newsHolder.tvNewsTitle.setText(mNewsList.get(position).getTitle()); //新闻标题
newsHolder.tvNewsDate.setText(ss[0]); //新闻发布日期
return convertView;
}
}

View File

@ -0,0 +1,124 @@
package com.stone.shop.view;
import java.util.List;
import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.BmobUser;
import cn.bmob.v3.listener.FindListener;
import com.stone.date.MessageDef;
import com.stone.shop.R;
import com.stone.shop.model.User;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
/**
* 个人资料卡
* @date 2014-5-21
* @author Stone
*/
public class MineInfoActivity extends Activity {
private TextView tvUsername;
private TextView tvSchool;
private TextView tvCademy;
private TextView tvDorPart;
private TextView tvDorNum;
private TextView tvPhone;
private TextView tvQQ;
private User curUser = new User();
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MessageDef.MINE_INFO_FINISH_FIND_USER:
initView();
break;
default:
break;
}
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mine_info);
getCurUser();
}
private void initView() {
tvUsername = (TextView) findViewById(R.id.tv_mineinfo_username);
tvSchool = (TextView) findViewById(R.id.tv_mineinfo_school);
tvCademy = (TextView) findViewById(R.id.tv_mineinfo_cademy);
tvDorPart = (TextView) findViewById(R.id.tv_mineinfo_dorpart);
tvDorNum = (TextView) findViewById(R.id.tv_mineinfo_dornum);
tvPhone = (TextView) findViewById(R.id.tv_mineinfo_phone);
tvQQ = (TextView) findViewById(R.id.tv_mineinfo_qq);
tvUsername.setText(curUser.getUsername());
tvSchool.setText(curUser.getSchool());
tvCademy.setText(curUser.getCademy());
tvDorPart.setText(curUser.getDorPart());
tvDorNum.setText(curUser.getDorNum());
tvPhone.setText(curUser.getPhone());
tvQQ.setText(curUser.getQQ());
}
private void getCurUser() {
BmobUser bmobUser = BmobUser.getCurrentUser(this);
BmobQuery<User> query = new BmobQuery<User>();
query.addWhereEqualTo("objectId", bmobUser.getObjectId());
query.findObjects(this, new FindListener<User>() {
@Override
public void onSuccess(List<User> object) {
curUser = object.get(0);
Message msg = new Message();
msg.what = MessageDef.MINE_INFO_FINISH_FIND_USER;
mHandler.sendMessage(msg);
}
@Override
public void onError(int arg0, String arg1) {
toast("亲, 获取当前用户失败");
}
});
}
public void clickEdit(View v) {
Intent toEditMineInfo = new Intent(MineInfoActivity.this, MineInfoEditActivity.class);
// Bundle bundle = new Bundle();
// bundle.putString("username", curUser.getUsername());
// bundle.putString("school", curUser.getSchool());
// bundle.putString("cademy", curUser.getCademy());
// bundle.putString("dorpart", curUser.getDorPart());
// bundle.putString("dornum", curUser.getDorNum());
// bundle.putString("phone", curUser.getPhone());
// bundle.putString("qq", curUser.getQQ());
// toEditMineInfo.putExtras(bundle);
startActivity(toEditMineInfo);
}
public void clickBack(View v) {
finish();
}
private void toast(String toast) {
Toast.makeText(this, toast, Toast.LENGTH_SHORT).show();
}
}

View File

@ -0,0 +1,116 @@
package com.stone.shop.view;
import java.util.List;
import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.BmobUser;
import cn.bmob.v3.listener.FindListener;
import com.stone.date.MessageDef;
import com.stone.shop.R;
import com.stone.shop.model.User;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
/**
* 个人资料卡
* @date 2014-5-21
* @author Stone
*/
public class MineInfoActivity extends Activity {
private TextView tvUsername;
private TextView tvSchool;
private TextView tvCademy;
private TextView tvDorPart;
private TextView tvDorNum;
private TextView tvPhone;
private TextView tvQQ;
private User curUser = new User();
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MessageDef.MINE_INFO_FINISH_FIND_USER:
initView();
break;
default:
break;
}
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mine_info);
getCurUser();
}
private void initView() {
tvUsername = (TextView) findViewById(R.id.tv_mineinfo_username);
tvSchool = (TextView) findViewById(R.id.tv_mineinfo_school);
tvCademy = (TextView) findViewById(R.id.tv_mineinfo_cademy);
tvDorPart = (TextView) findViewById(R.id.tv_mineinfo_dorpart);
tvDorNum = (TextView) findViewById(R.id.tv_mineinfo_dornum);
tvPhone = (TextView) findViewById(R.id.tv_mineinfo_phone);
tvQQ = (TextView) findViewById(R.id.tv_mineinfo_qq);
tvUsername.setText(curUser.getUsername());
tvSchool.setText(curUser.getSchool());
tvCademy.setText(curUser.getCademy());
tvDorPart.setText(curUser.getDorPart());
tvDorNum.setText(curUser.getDorNum());
tvPhone.setText(curUser.getPhone());
tvQQ.setText(curUser.getQQ());
}
private void getCurUser() {
BmobUser bmobUser = BmobUser.getCurrentUser(this);
BmobQuery<User> query = new BmobQuery<User>();
query.addWhereEqualTo("objectId", bmobUser.getObjectId());
query.findObjects(this, new FindListener<User>() {
@Override
public void onSuccess(List<User> object) {
curUser = object.get(0);
Message msg = new Message();
msg.what = MessageDef.MINE_INFO_FINISH_FIND_USER;
mHandler.sendMessage(msg);
}
@Override
public void onError(int arg0, String arg1) {
toast("亲, 获取当前用户失败");
}
});
}
public void clickEdit(View v) {
Intent toEditMineInfo = new Intent(MineInfoActivity.this, MineInfoEditActivity.class);
startActivity(toEditMineInfo);
}
public void clickBack(View v) {
finish();
}
private void toast(String toast) {
Toast.makeText(this, toast, Toast.LENGTH_SHORT).show();
}
}

View File

@ -11,5 +11,5 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target. # Project target.
target=android-18 target=android-20
proguard.config=proguard.cfg proguard.config=proguard.cfg

View File

@ -0,0 +1,24 @@
package com.stone.util;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
public class UtilTest {
private static Util util = new Util();
@Before
public void setUp() throws Exception {
}
@Test
public void testIsPhoneNumberValid() {
String testPhone = "12345678900";
assertEquals(false,testPhone);
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.