2016.8.18 代码和文档

This commit is contained in:
kaka727 2016-08-18 21:31:33 +08:00
parent d4cef780f3
commit 3bda382d1c
2220 changed files with 80 additions and 30134 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 874 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 903 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 817 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -1,114 +0,0 @@
package com.stone.shop.adapter;
import android.R.integer;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.stone.date.TypeDef;
import com.stone.shop.R;
/**
* 生活-- 网格布局(ImageView+TextView)适配器
*
* @date 2014-4-24
* @author Stone
*/
public class GridAdapter extends BaseAdapter {
private Context mContext;
private int mIndex = 0; // 代表当前需要适配页面中第几个GridView
//学习小菜
public static String[] mSchoolTexts = TypeDef.typeSonList1;
private int[] mSchoolImages = { R.drawable.ic_81, R.drawable.ic_82 };
//吃饭小菜
public static String[] mFoodTexts = TypeDef.typeSonList2;
private int[] mFoodImages = { R.drawable.ic_41, R.drawable.ic_42};
//购物小菜
public static String[] mGiftTexts = TypeDef.typeSonList3;
private int[] mGiftImages = { R.drawable.ic_7, R.drawable.ic_7,
R.drawable.ic_7, R.drawable.ic_7, R.drawable.ic_7,
R.drawable.ic_7, R.drawable.ic_7};
//疯狂小菜
public static String[] mOutTexts = TypeDef.typeSonList4;
private int[] mOutImages = { R.drawable.ic_3, R.drawable.ic_3,
R.drawable.ic_3, R.drawable.ic_3, R.drawable.ic_3,
R.drawable.ic_3, R.drawable.ic_3 };
public GridAdapter(Context context, int index) {
mContext = context;
mIndex = index;
}
@Override
public int getCount() {
int count = 0;
switch (mIndex) {
case 0:
count = mFoodImages.length;
break;
case 1:
count = mGiftImages.length;
break;
case 2:
count = mOutImages.length;
break;
case 3:
count = mSchoolImages.length;
break;
default:
break;
}
return count;
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = View.inflate(mContext, R.layout.shop_grid_item, null);
// RelativeLayout rl = (RelativeLayout)
// view.findViewById(R.id.relaGrid);
ImageView image = (ImageView) view.findViewById(R.id.img_chooseImage);
TextView text = (TextView) view.findViewById(R.id.tv_chooseText);
switch (mIndex) {
case 0:
image.setImageResource(mFoodImages[position]);
text.setText(mFoodTexts[position]);
break;
case 1:
image.setImageResource(mGiftImages[position]);
text.setText(mGiftTexts[position]);
break;
case 2:
image.setImageResource(mOutImages[position]);
text.setText(mOutTexts[position]);
break;
case 3:
image.setImageResource(mSchoolImages[position]);
text.setText(mSchoolTexts[position]);
break;
default:
break;
}
return view;
}
}

View File

@ -1,202 +0,0 @@
package com.stone.shop.view;
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.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.Toast;
import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.BmobUser;
import cn.bmob.v3.listener.CountListener;
import com.stone.date.MessageDef;
import com.stone.shop.R;
import com.stone.shop.adapter.MineListAdapter;
import com.stone.shop.model.Order;
/**
* 个人中心主界面
* @date 2014-4-24
* @author Stone
*/
public class MineActivity extends Activity implements OnItemClickListener{
private static final String TAG = "MineActivity" ;
private String[] userItemNames = {"stonekity"} ;
private String[] userItemContents = {""} ;
private String[] orderItemNames = {"当前订单", "历史订单"};
private String[] orderItemContents = {"*", ""};
private String[] aboutItemNames = {"通知中心", "软件相关", "推荐给朋友", "退出账号"};
private String[] aboutItemContents = {"", "", "", ""};
private int[] userImgIds = {R.drawable.ic_menu_myplaces};
private int[] orderImgIds = {R.drawable.ic_menu_find_holo_light, R.drawable.ic_menu_copy_holo_light};
private int[] aboutImgIds = {R.drawable.ic_menu_notifications, R.drawable.ic_menu_info_details, R.drawable.ic_menu_share, R.drawable.ic_star_yes};
private ListView lvMineUser;
private ListView lvMineOrder;
private ListView lvMineAbout;
private MineListAdapter userListAdapter;
private MineListAdapter orderListAdapter;
private MineListAdapter aboutListAdapter;
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MessageDef.MINE_FINISH_LOAD_DATA:
//toast("Handler 收到数据加载完成的消息");
orderListAdapter.notifyDataSetChanged();
break;
default:
break;
}
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mine);
initData("已取餐");
initData("未取餐");
initView();
}
private void initView() {
lvMineUser = (ListView) findViewById(R.id.lv_mine_user);
lvMineOrder = (ListView) findViewById(R.id.lv_mine_order);
lvMineAbout = (ListView) findViewById(R.id.lv_mine_about);
userListAdapter = new MineListAdapter(this, userItemNames, userItemContents, userImgIds);
orderListAdapter = new MineListAdapter(this, orderItemNames, orderItemContents, orderImgIds);
aboutListAdapter = new MineListAdapter(this, aboutItemNames, aboutItemContents, aboutImgIds);
lvMineUser.setAdapter(userListAdapter);
lvMineOrder.setAdapter(orderListAdapter);
lvMineAbout.setAdapter(aboutListAdapter);
lvMineUser.setOnItemClickListener(this);
lvMineOrder.setOnItemClickListener(this);
lvMineAbout.setOnItemClickListener(this);
}
//初始化列表菜单中数据
public void initData(final String type) {
//获取用户
BmobUser user = BmobUser.getCurrentUser(this);
userItemNames[0] = user.getUsername();
//获取小菜订单(数量)
BmobQuery<Order> query = new BmobQuery<Order>();
query.order("-updatedAt");
query.addWhereEqualTo("userName", user.getUsername());
query.addWhereEqualTo("state", type);
query.count(this, Order.class, new CountListener() {
@Override
public void onSuccess(int count) {
if(type.equals("未取餐")) {
orderItemContents[0] ="( " +count+ " )";
}
if(type.equals("已取餐")) {
orderItemContents[1] ="( " +count+ " )";
}
Message msg = new Message();
msg.what = MessageDef.MINE_FINISH_LOAD_DATA;
mHandler.sendMessage(msg);
}
@Override
public void onFailure(int arg0, String arg1) {
toast("查询失败");
}
});
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
//个人资料
if(parent.getId() == R.id.lv_mine_user) {
switch (position) {
case 0: //资料卡
//toast("点击个人资料");
Intent toMineInfo = new Intent(MineActivity.this, MineInfoActivity.class);
startActivity(toMineInfo);
break;
default:
break;
}
}
//小菜订单
if(parent.getId() == R.id.lv_mine_order) {
//toast("点击了订单区域");
Intent toOrderInfo;
switch (position) {
case 0:
toOrderInfo = new Intent(MineActivity.this, OrderInfoActivity.class);
toOrderInfo.putExtra("type", "now");
startActivity(toOrderInfo);
break;
case 1:
toOrderInfo = new Intent(MineActivity.this, OrderInfoActivity.class);
toOrderInfo.putExtra("type", "old");
startActivity(toOrderInfo);
break;
default:
break;
}
}
//其他
if(parent.getId() == R.id.lv_mine_about) {
switch (position) {
case 1: //软件相关
Intent toMineSoft = new Intent(MineActivity.this, MineSoftActivity.class);
startActivity(toMineSoft);
break;
case 2: //推荐给朋友
Intent toShare = new Intent(Intent.ACTION_SEND);
toShare.setType("text/plain");
toShare.putExtra(Intent.EXTRA_SUBJECT, "分享");
toShare.putExtra(Intent.EXTRA_TEXT, "在这里-抢鲜版" +"\n" + "针对三号院的“在这里”上线了,赶紧下载体验吧"
+ "http://xiaocai.bmob.cn");
startActivity(Intent.createChooser(toShare, "分享到"));
break;
case 3: //退出当期账号
BmobUser.logOut(this);
Intent toLogin = new Intent(MineActivity.this, LoginActivity.class);
startActivity(toLogin);
finish();
break;
default:
//toast("点击了通知区域");
break;
}
}
}
private void toast(String toast) {
Toast.makeText(this, toast, Toast.LENGTH_SHORT).show();
}
}

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry exported="true" kind="lib" path="libs/android-support-v4.jar"/>
<classpathentry exported="true" kind="lib" path="libs/open_sdk.jar"/>
<classpathentry exported="true" kind="lib" path="libs/mta-sdk-1.0.0.jar"/>
<classpathentry exported="true" kind="lib" path="libs/bmob_v3.1.0beta.jar"/>
<classpathentry kind="lib" path="libs/bmobPush_0.1beta.jar"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>

View File

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Shop</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -1,2 +0,0 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View File

@ -1,134 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.stone.shop"
android:versionCode="2"
android:versionName="Beta 1.5.8" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_app"
android:label="@string/app_name"
android:theme="@style/NoTitleBarTheme" >
<!-- ********************************QQ登陆配置*********************************** -->
<!--
<activity
android:name="com.tencent.connect.common.AssistActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity
android:name="com.tencent.tauth.AuthActivity"
android:launchMode="singleTask"
android:noHistory="true" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="tencent101080318" />
</intent-filter>
</activity> -->
<!-- ********************************QQ登陆配置*********************************** -->
<activity
android:name="com.stone.shop.view.LoginActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.stone.shop.view.BaseActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.RegisterActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.ShopActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.ShopAllActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.ShopItemActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.OrderActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.OrderInfoActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.HomeActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.WsqActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.AwardActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.MineActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.MineInfoActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.MineInfoEditActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.MineSoftActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.FeedBackActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.old.OldMineActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.NewsActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.AboutActivity"
android:label="@string/app_name" >
</activity>
<!-- 教学类 -->
<activity
android:name="com.stone.shop.view.BXTActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.BXTNewsActivity"
android:label="@string/app_name" >
</activity>
</application>
</manifest>

View File

@ -1,134 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.stone.shop"
android:versionCode="2"
android:versionName="Beta 1.5.8" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_app"
android:label="@string/app_name"
android:theme="@style/NoTitleBarTheme" >
<!-- ********************************QQ登陆配置*********************************** -->
<!--
<activity
android:name="com.tencent.connect.common.AssistActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity
android:name="com.tencent.tauth.AuthActivity"
android:launchMode="singleTask"
android:noHistory="true" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="tencent101080318" />
</intent-filter>
</activity> -->
<!-- ********************************QQ登陆配置*********************************** -->
<activity
android:name="com.stone.shop.view.LoginActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.stone.shop.view.BaseActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.RegisterActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.ShopActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.ShopAllActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.ShopItemActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.OrderActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.OrderInfoActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.HomeActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.WsqActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.AwardActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.MineActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.MineInfoActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.MineInfoEditActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.MineSoftActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.FeedBackActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.old.OldMineActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.NewsActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.AboutActivity"
android:label="@string/app_name" >
</activity>
<!-- 教学类 -->
<activity
android:name="com.stone.shop.view.BXTActivity"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.stone.shop.view.BXTNewsActivity"
android:label="@string/app_name" >
</activity>
</application>
</manifest>

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More