diff --git a/代码/在这里3.0/.classpath b/代码/在这里3.0/.classpath index feef834..54cc208 100644 --- a/代码/在这里3.0/.classpath +++ b/代码/在这里3.0/.classpath @@ -3,8 +3,8 @@ + - diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/R$anim.class b/代码/在这里3.0/bin/classes/com/stone/shop/R$anim.class deleted file mode 100644 index 302d8ec..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/R$anim.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/R$attr.class b/代码/在这里3.0/bin/classes/com/stone/shop/R$attr.class deleted file mode 100644 index b1c0a95..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/R$attr.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/R$color.class b/代码/在这里3.0/bin/classes/com/stone/shop/R$color.class deleted file mode 100644 index a7855d8..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/R$color.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/R$dimen.class b/代码/在这里3.0/bin/classes/com/stone/shop/R$dimen.class deleted file mode 100644 index 40366a7..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/R$dimen.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/R$drawable.class b/代码/在这里3.0/bin/classes/com/stone/shop/R$drawable.class deleted file mode 100644 index 48b1ed7..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/R$drawable.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/R$id.class b/代码/在这里3.0/bin/classes/com/stone/shop/R$id.class deleted file mode 100644 index c77caab..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/R$id.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/R$layout.class b/代码/在这里3.0/bin/classes/com/stone/shop/R$layout.class deleted file mode 100644 index 61f014a..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/R$layout.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/R$menu.class b/代码/在这里3.0/bin/classes/com/stone/shop/R$menu.class deleted file mode 100644 index 9367bdb..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/R$menu.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/R$string.class b/代码/在这里3.0/bin/classes/com/stone/shop/R$string.class deleted file mode 100644 index 6843a51..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/R$string.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/R$style.class b/代码/在这里3.0/bin/classes/com/stone/shop/R$style.class deleted file mode 100644 index addd23e..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/R$style.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/R.class b/代码/在这里3.0/bin/classes/com/stone/shop/R.class deleted file mode 100644 index 3fd6d56..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/R.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$1$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$1$1.class deleted file mode 100644 index 1cafd98..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$1$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$1.class deleted file mode 100644 index a66066c..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$2$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$2$1.class deleted file mode 100644 index cf5f465..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$2$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$2.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$2.class deleted file mode 100644 index cd39a4c..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$2.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$3.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$3.class deleted file mode 100644 index e84bdcb..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$3.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$ViewHolder.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$ViewHolder.class index 78f9658..9de6fc7 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$ViewHolder.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter$ViewHolder.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter.class index 84b2736..0e50da6 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/AIContentAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/BXTListAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/BXTListAdapter.class index eeb8919..1db30a5 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/BXTListAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/BXTListAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/BXTListAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/BXTListAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index df02860..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/BXTListAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,75 +0,0 @@ -package com.stone.shop.adapter; - -import java.util.Iterator; -import java.util.List; - -import com.stone.shop.R; -import com.stone.shop.model.BXTNews; -import com.stone.shop.model.Good; - -import android.content.Context; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.Button; -import android.widget.TextView; - -/** - * 教学类-博学堂-讲座列表适配器 - * - * @date 2014-5-10 - * @author Stone - */ -public class BXTListAdapter extends BaseAdapter { - - private Context mContext; - private List mNewsList; // 商品列表信息 - private LayoutInflater mInflater = null; - - public BXTListAdapter(Context context, List 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(List list) { - Log.i("BXTNewsAdapter", "Adapter刷新数据"); - mNewsList = list; - notifyDataSetChanged(); - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - BXTNewsHolder newsHolder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.bxt_list_item, null); - newsHolder = new BXTNewsHolder(); - newsHolder.tvBXTNewsTitle = (TextView) convertView - .findViewById(R.id.tv_bxt_news_item_title); - convertView.setTag(newsHolder); - } else { - newsHolder = (BXTNewsHolder) convertView.getTag(); - } - newsHolder.tvBXTNewsTitle.setText(mNewsList.get(position).getTitle()); - return convertView; - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ClassroomAdapter$ViewHolder.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ClassroomAdapter$ViewHolder.class index f269e16..e8d311a 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ClassroomAdapter$ViewHolder.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ClassroomAdapter$ViewHolder.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ClassroomAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ClassroomAdapter.class index c36e5a0..a82d3b1 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ClassroomAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ClassroomAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ClassroomAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ClassroomAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 7deb441..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ClassroomAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,69 +0,0 @@ -package com.stone.shop.adapter; - -import java.util.List; - -import com.stone.shop.R; -import com.stone.shop.model.Classroom; - -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 class ClassroomAdapter extends BaseAdapter { - - private Context mContext; - private List mNewsList; // 商品列表信息 - private LayoutInflater mInflater = null; - - public ClassroomAdapter(Context context, List 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(List list) { - mNewsList = list; - notifyDataSetChanged(); - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - ViewHolder viewHolder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.gv_item_classroom, null); - viewHolder = new ViewHolder(); - viewHolder.tv_chooseText = (TextView) convertView.findViewById(R.id.tv_chooseText); - convertView.setTag(viewHolder); - } else { - viewHolder = (ViewHolder) convertView.getTag(); - } - viewHolder.tv_chooseText.setText(mNewsList.get(position).getName()); - return convertView; - } - - class ViewHolder { - - public TextView tv_chooseText; // 博学堂讲座标题 - - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/CommentAdapter$ViewHolder.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/CommentAdapter$ViewHolder.class index 98125e5..4a9dce7 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/CommentAdapter$ViewHolder.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/CommentAdapter$ViewHolder.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/CommentAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/CommentAdapter.class index 5981294..02a1c9b 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/CommentAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/CommentAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/GoodsListAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/GoodsListAdapter.class index 7e80c2e..96936f7 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/GoodsListAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/GoodsListAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/GoodsListAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/GoodsListAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 0befe9a..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/GoodsListAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,70 +0,0 @@ -package com.stone.shop.adapter; - -import java.util.List; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.Button; -import android.widget.TextView; - -import com.stone.shop.R; -import com.stone.shop.model.Good; - -public class GoodsListAdapter extends BaseAdapter { - - private Context mContext; - private List mGoodsList; // 商品列表信息 - private LayoutInflater mInflater = null; - - public GoodsListAdapter(Context context, List goodsList) { - mContext = context; - mGoodsList = goodsList; - mInflater = LayoutInflater.from(context); - } - - @Override - public int getCount() { - return mGoodsList.size(); - } - - @Override - public Object getItem(int position) { - return mGoodsList.get(position); - } - - @Override - public long getItemId(int position) { - return position; - } - - // 刷新列表中的数据 - public void refresh(List list) { - mGoodsList = list; - notifyDataSetChanged(); - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - GoodsHolder goodHolder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.goods_list_item, null); - goodHolder = new GoodsHolder(); - goodHolder.tvName = (TextView) convertView - .findViewById(R.id.tv_good_name); - goodHolder.tvPrice = (TextView) convertView - .findViewById(R.id.tv_good_price); - goodHolder.btnBuyGood = (TextView) convertView - .findViewById(R.id.btn_buy_good); - convertView.setTag(goodHolder); - } else { - goodHolder = (GoodsHolder) convertView.getTag(); - } - goodHolder.tvName.setText(mGoodsList.get(position).getName()); - goodHolder.tvPrice.setText("¥"+mGoodsList.get(position).getPrice()); - return convertView; - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/GridAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/GridAdapter.class index 83f0134..6f8cc36 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/GridAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/GridAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/GridAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/GridAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 7c6ed22..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/GridAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -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, R.drawable.ic_8 }; - - //吃饭小菜 - 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_71, R.drawable.ic_72, - R.drawable.ic_73, R.drawable.ic_74, R.drawable.ic_75, - R.drawable.ic_76, R.drawable.ic_77}; - - //疯狂小菜 - 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; - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ImagePagerAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ImagePagerAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index c73ef5a..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ImagePagerAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,67 +0,0 @@ -package com.stone.shop.adapter; - -import java.util.List; - -import android.content.Context; -import android.os.Parcelable; -import android.support.v4.view.PagerAdapter; -import android.support.v4.view.ViewPager; -import android.view.View; - -/** - * 首页--图片轮播AutoScrollViewPager适配器 - * @author Stone - */ -public class ImagePagerAdapter extends PagerAdapter { - - private List mImgViews; - - public ImagePagerAdapter(Context context, List imgViews) { - this.mImgViews = imgViews; - } - - @Override - public int getCount() { - if(mImgViews != null){ - return mImgViews.size(); - } - return 0; - } - - @Override - public Object instantiateItem(View arg0, int arg1) { - ((ViewPager) arg0).addView(mImgViews.get(arg1)); - return mImgViews.get(arg1); - } - - @Override - public void destroyItem(View arg0, int arg1, Object arg2) { - ((ViewPager) arg0).removeView(mImgViews.get(arg1)); - } - - @Override - public boolean isViewFromObject(View arg0, Object arg1) { - return arg0 == arg1; - } - - @Override - public void restoreState(Parcelable arg0, ClassLoader arg1) { - - } - - @Override - public Parcelable saveState() { - return null; - } - - @Override - public void startUpdate(View arg0) { - - } - - @Override - public void finishUpdate(View arg0) { - - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/InfoNewsListAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/InfoNewsListAdapter.class index 735c1ce..e96d594 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/InfoNewsListAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/InfoNewsListAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/InformationListAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/InformationListAdapter.class index c072602..c15f722 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/InformationListAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/InformationListAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/MineListAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/MineListAdapter.class index 02a159c..a4fc03a 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/MineListAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/MineListAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/MineListAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/MineListAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 29a2f69..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/MineListAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,69 +0,0 @@ -package com.stone.shop.adapter; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.ImageView; -import android.widget.TextView; - -import com.stone.shop.R; - -/** - * MineActivity 项目列表适配器 - * @date 2014-5-10 - * @author Stone - */ -public class MineListAdapter extends BaseAdapter { - - private Context mContext; - private String[] mItemNames; // 项目列表名称 - private String[] mItemContents; //项目列表的备注值 - private int[] mItemImgIds; // 项目列表Icon - private LayoutInflater mInflater = null; - - public MineListAdapter(Context context, String[] names, String[] contents, int[] imgIds) { - mContext = context; - mItemNames = names; - mItemContents = contents; - mItemImgIds = imgIds; - mInflater = LayoutInflater.from(context); - } - - @Override - public int getCount() { - return mItemNames.length; - } - - @Override - public Object getItem(int position) { - return mItemNames[position]; - } - - @Override - public long getItemId(int position) { - return position; - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - MineListHolder holder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.mine_list_item, null); - holder = new MineListHolder(); - holder.imgItem = (ImageView) convertView.findViewById(R.id.img_item); - holder.tvItemName = (TextView) convertView - .findViewById(R.id.tv_item_name); - holder.tvItemContent = (TextView) convertView.findViewById(R.id.tv_item_content); - convertView.setTag(holder); - } else { - holder = (MineListHolder) convertView.getTag(); - } - holder.imgItem.setBackgroundResource(mItemImgIds[position]); - holder.tvItemName.setText(mItemNames[position]); - holder.tvItemContent.setText(mItemContents[position]); - return convertView; - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/MineSoftAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/MineSoftAdapter.class index 70549f6..44aa640 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/MineSoftAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/MineSoftAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/MineSoftAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/MineSoftAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 9dae107..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/MineSoftAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,65 +0,0 @@ -package com.stone.shop.adapter; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.ImageView; -import android.widget.TextView; - -import com.stone.shop.R; - -/** - * MineActivity 项目列表适配器 - * @date 2014-5-10 - * @author Stone - */ -public class MineSoftAdapter extends BaseAdapter { - - private Context mContext; - private String[] mItemNames; // 项目列表名称 - private String[] mItemContents; //项目列表的备注值 - private LayoutInflater mInflater = null; - - public MineSoftAdapter(Context context, String[] names, String[] contents) { - mContext = context; - mItemNames = names; - mItemContents = contents; - mInflater = LayoutInflater.from(context); - } - - @Override - public int getCount() { - return mItemNames.length; - } - - @Override - public Object getItem(int position) { - return mItemNames[position]; - } - - @Override - public long getItemId(int position) { - return position; - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - MineListHolder holder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.mine_soft_list_item, null); - holder = new MineListHolder(); - holder.tvItemName = (TextView) convertView - .findViewById(R.id.tv_item_name); - holder.tvItemContent = (TextView) convertView.findViewById(R.id.tv_item_content); - convertView.setTag(holder); - } else { - holder = (MineListHolder) convertView.getTag(); - } - holder.tvItemName.setText(mItemNames[position]); - holder.tvItemContent.setText(mItemContents[position]); - return convertView; - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/NewsListAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/NewsListAdapter.class index 73a80f9..5b18288 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/NewsListAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/NewsListAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/NewsListAdapter.java~HEAD b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/NewsListAdapter.java~HEAD deleted file mode 100644 index 92264ca..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/NewsListAdapter.java~HEAD +++ /dev/null @@ -1,82 +0,0 @@ -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 mNewsList = null; // 所选分类下的所有店铺列表 - - public NewsListAdapter(Context context, List 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 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; - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/NewsListAdapter.java~qinjiaming_branch b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/NewsListAdapter.java~qinjiaming_branch deleted file mode 100644 index 98c82f2..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/NewsListAdapter.java~qinjiaming_branch +++ /dev/null @@ -1,81 +0,0 @@ -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 mNewsList = null; // 所选分类下的所有店铺列表 - - public NewsListAdapter(Context context, List 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 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; - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/NewsListAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/NewsListAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 92264ca..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/NewsListAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,82 +0,0 @@ -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 mNewsList = null; // 所选分类下的所有店铺列表 - - public NewsListAdapter(Context context, List 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 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; - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/OrderInfoListAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/OrderInfoListAdapter.class index 7d01781..d35b4f1 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/OrderInfoListAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/OrderInfoListAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/OrderInfoListAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/OrderInfoListAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 35c9294..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/OrderInfoListAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,88 +0,0 @@ -package com.stone.shop.adapter; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.TextView; - -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.listener.GetListener; - -import com.stone.date.TypeDef; -import com.stone.shop.R; -import com.stone.shop.model.Good; -import com.stone.shop.model.Order; -import com.stone.shop.model.Shop; -import com.stone.shop.view.OrderInfoActivity; - -/** - * 适配器--适配订单列表中的数据 - * - * @date 2014-5-27 - * @author Stone - */ -public class OrderInfoListAdapter extends BaseAdapter { - - private Context mContext; - private LayoutInflater mInflater = null; - private List mOrderList = null; // 所选分类下的所有店铺列表 - private String mType; // 商店的分类 - - public OrderInfoListAdapter(Context context, List orderList) { - mContext = context; - mOrderList = orderList; - mInflater = LayoutInflater.from(context); - } - - @Override - public int getCount() { - return mOrderList.size(); - } - - @Override - public Object getItem(int position) { - return mOrderList.get(position); - } - - @Override - public long getItemId(int position) { - return position; - } - - public void refresh(List list) { - mOrderList = list; - notifyDataSetChanged(); - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - OrderInfoHolder orderInfoHolder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.order_info_list_item, null); - orderInfoHolder = new OrderInfoHolder(); - orderInfoHolder.tvOrderInfoGoodName = (TextView) convertView - .findViewById(R.id.tv_order_info_good_name); - orderInfoHolder.tvOrderInfoShopName = (TextView) convertView - .findViewById(R.id.tv_order_info_shop_name); - orderInfoHolder.tvOrderInfoPrice = (TextView) convertView - .findViewById(R.id.tv_order_info_price); - orderInfoHolder.tvOrderInfoState = (TextView) convertView - .findViewById(R.id.tv_order_info_state); - convertView.setTag(orderInfoHolder); - } else { - orderInfoHolder = (OrderInfoHolder) convertView.getTag(); - } - orderInfoHolder.tvOrderInfoGoodName.setText(mOrderList.get(position).getGoodName()); - orderInfoHolder.tvOrderInfoShopName.setText(mOrderList.get(position).getShopName()); - orderInfoHolder.tvOrderInfoPrice.setText("¥" + mOrderList.get(position).getPrice()); - orderInfoHolder.tvOrderInfoState.setText(mOrderList.get(position).getState()); - return convertView; - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/SCommentAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/SCommentAdapter.class index 3ec494e..d48e6fa 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/SCommentAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/SCommentAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/SCommentAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/SCommentAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 98cf470..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/SCommentAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,66 +0,0 @@ -package com.stone.shop.adapter; - -import java.util.List; - -import com.stone.shop.R; -import com.stone.shop.model.SComment; - -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 SCommentAdapter extends BaseAdapter { - - private Context mContext; - private LayoutInflater mInflater = null; - private List mSComList = null; // 所选分类下的所有店铺列表 - - public SCommentAdapter(Context context, List list) { - mContext = context; - mSComList = list; - mInflater = LayoutInflater.from(context); - } - - @Override - public int getCount() { - return mSComList.size(); - } - - @Override - public Object getItem(int position) { - return mSComList.get(position); - } - - @Override - public long getItemId(int position) { - return position; - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - SComHolder scomHolder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.scom_list_item, null); - scomHolder = new SComHolder(); - scomHolder.tvComUser = (TextView) convertView - .findViewById(R.id.tv_commit_user); - scomHolder.tvComContent = (TextView) convertView - .findViewById(R.id.tv_commit_content); - convertView.setTag(scomHolder); - } else { - scomHolder = (SComHolder) convertView.getTag(); - } - scomHolder.tvComUser.setText(mSComList.get(position).getUserName()); - scomHolder.tvComContent.setText(mSComList.get(position).getContent()); - return convertView; - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ShopListAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ShopListAdapter.class index 5ae24ec..d1a0a76 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ShopListAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ShopListAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ShopListAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ShopListAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 539a17f..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ShopListAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,126 +0,0 @@ -package com.stone.shop.adapter; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.TextView; - -import com.stone.date.TypeDef; -import com.stone.shop.R; -import com.stone.shop.model.Shop; - -/** - * 适配器--适配某一分类下的店铺列表数据 - * - * @date 2014-4-29 - * @author Stone - */ -public class ShopListAdapter extends BaseAdapter { - - private Context mContext; - private LayoutInflater mInflater = null; - private ArrayList mShopList = null; // 所选分类下的所有店铺列表 - private String mType; // 商店的分类 - - public ShopListAdapter(Context context, ArrayList shopList, - String type) { - mContext = context; - mShopList = shopList; - mType = type; - mInflater = LayoutInflater.from(context); - } - - @Override - public int getCount() { - return mShopList.size(); - } - - @Override - public Object getItem(int position) { - return mShopList.get(position); - } - - @Override - public long getItemId(int position) { - return position; - } - - // 刷新列表中的数据 - public void refresh(ArrayList list) { - mShopList = list; - //将数字的类型编号转换为文字 - exchangeType(mType); - notifyDataSetChanged(); - } - - /** - * 根据当前的type类型, 转换成相应的文字 - * @date 2014-4-29 - * @param typeString - */ - private void exchangeType(String typeString) { - - int type = Integer.parseInt(typeString); - int fatherType = type / 10; //父类型编号 - int sonType = type % 10; //子类型编号 - - Iterator iterator = mShopList.iterator(); - while (iterator.hasNext()) { - switch (fatherType) { - case 1: - iterator.next().setType( - TypeDef.typeDadList[fatherType-1] + "/" - + TypeDef.typeSonList1[sonType-1]); - break; - case 2: - iterator.next().setType( - TypeDef.typeDadList[fatherType-1] + "/" - + TypeDef.typeSonList2[sonType-1]); - break; - case 3: - iterator.next().setType( - TypeDef.typeDadList[fatherType-1] + "/" - + TypeDef.typeSonList3[sonType-1]); - break; - case 4: - iterator.next().setType( - TypeDef.typeDadList[fatherType-1] + "/" - + TypeDef.typeSonList4[sonType-1]); - break; - default: - break; - } - - } - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - ShopHolder shopHodler; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.shop_all_list_item, null); - shopHodler = new ShopHolder(); - shopHodler.tvShopName = (TextView) convertView - .findViewById(R.id.tv_shop_name); - shopHodler.tvShopType = (TextView) convertView - .findViewById(R.id.tv_shop_type); - shopHodler.tvShopLoc = (TextView) convertView - .findViewById(R.id.tv_shop_loc); - convertView.setTag(shopHodler); - } else { - shopHodler = (ShopHolder) convertView.getTag(); - } - shopHodler.tvShopName.setText(mShopList.get(position).getName()); - // 商店的类型需要单独处理 - shopHodler.tvShopType.setText(mShopList.get(position).getType()); - shopHodler.tvShopLoc.setText("二食堂"); - return convertView; - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ViewPagerAdapter.class b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ViewPagerAdapter.class index 99fa505..9b0463b 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ViewPagerAdapter.class and b/代码/在这里3.0/bin/classes/com/stone/shop/adapter/ViewPagerAdapter.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/AboutActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/AboutActivity.class index a5ddd38..dee6294 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/AboutActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/AboutActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/AwardActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/AwardActivity$1.class deleted file mode 100644 index 5aaf2ac..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/AwardActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/AwardActivity$2.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/AwardActivity$2.class deleted file mode 100644 index 243feb0..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/AwardActivity$2.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/AwardActivity$3.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/AwardActivity$3.class deleted file mode 100644 index 5a75215..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/AwardActivity$3.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/AwardActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/AwardActivity.class index 0a4638c..805a101 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/AwardActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/AwardActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTActivity$1.class deleted file mode 100644 index fa5b32f..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTActivity.class index 496c8ec..b65c9ea 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index b2fcb93..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,100 +0,0 @@ -package com.stone.shop.view; - -import java.util.ArrayList; -import java.util.List; - -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.listener.FindListener; - -import com.stone.shop.R; -import com.stone.shop.adapter.BXTListAdapter; -import com.stone.shop.model.BXTNews; -import com.stone.shop.model.Classroom; -import com.stone.shop.model.BXTNews; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.renderscript.Element; -import android.view.View; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.ListView; -import android.widget.Toast; -/** - * 教学类-博学堂界面 - * @date 2014-5-10 - * @author Stone - */ -public class BXTActivity extends Activity implements OnItemClickListener{ - - private static final String TAG = "BXTActivity"; - - private ListView lvBXTNews; - private BXTListAdapter mBxtListAdapter; - private List mBXTNewsList; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_bxt); - - initView(); - initData(); - - } - - private void initView() { - lvBXTNews = (ListView) findViewById(R.id.lv_bxt_news); - mBXTNewsList = new ArrayList(); - mBxtListAdapter = new BXTListAdapter(this, mBXTNewsList); - lvBXTNews.setAdapter(mBxtListAdapter); - lvBXTNews.setOnItemClickListener(this); - } - - private void initData() { - BmobQuery query = new BmobQuery(); - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List newsList) { - //toast("查询商品成功, 共" + newsList.size()); - if(newsList.size()==0) - toast("亲, 暂时还木有讲座哦"); - else { - mBXTNewsList = newsList; - mBxtListAdapter.refresh(newsList); - mBxtListAdapter.notifyDataSetChanged(); - - } - - } - - @Override - public void onError(int arg0, String arg1) { - toast("查询失败"); - } - }); - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - - @Override - public void onItemClick(AdapterView parent, View view, int position, - long id) { - Intent toBXTNewsActivity = new Intent(BXTActivity.this, BXTNewsActivity.class); - toBXTNewsActivity.putExtra("title", mBXTNewsList.get(position).getTitle()); - toBXTNewsActivity.putExtra("topic", mBXTNewsList.get(position).getTopic()); - toBXTNewsActivity.putExtra("speaker", mBXTNewsList.get(position).getSpeaker()); - toBXTNewsActivity.putExtra("time", mBXTNewsList.get(position).getTime()); - toBXTNewsActivity.putExtra("location", mBXTNewsList.get(position).getLocation()); - toBXTNewsActivity.putExtra("holder1", mBXTNewsList.get(position).getHolder1()); - toBXTNewsActivity.putExtra("holder2", mBXTNewsList.get(position).getHolder2()); - toBXTNewsActivity.putExtra("points", mBXTNewsList.get(position).getPoints()); - toBXTNewsActivity.putExtra("speakerinfo", mBXTNewsList.get(position).getSpeakerinfo()); - startActivity(toBXTNewsActivity); - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTNewsActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTNewsActivity.class index 64079bd..6ef4dcb 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTNewsActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTNewsActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTNewsActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTNewsActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index a39c090..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/BXTNewsActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,65 +0,0 @@ -package com.stone.shop.view; - -import com.stone.shop.R; -import com.stone.shop.model.BXTNews; - -import android.app.Activity; -import android.os.Bundle; -import android.widget.TextView; - -/** - * 教学类-博学堂-讲座详情界面 - * @date 2014-5-10 - * @author Stone - */ -public class BXTNewsActivity extends Activity { - - private static final String TAG = "BXTNewsActivity"; - - private BXTNews news; - private TextView tvBXTNewsTitle; - private TextView tvBXTNewsTopic; - private TextView tvBXTNewsSpeaker; - private TextView tvBXTNewsTime; - private TextView tvBXTNewsLoc; - private TextView tvBXTNewsHolder1; - private TextView tvBXTNewsHolder2; - private TextView tvBXTNewsPoints; - private TextView tvBXTNewsSpeakerInfo; - - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_bxt_news); - - initView(); - } - - private void initView() { - - tvBXTNewsTitle = (TextView) findViewById(R.id.tv_bxt_news_title); - tvBXTNewsTopic = (TextView) findViewById(R.id.tv_bxt_news_topic); - tvBXTNewsSpeaker = (TextView) findViewById(R.id.tv_bxt_news_speaker); - tvBXTNewsTime = (TextView) findViewById(R.id.tv_bxt_news_time); - tvBXTNewsLoc = (TextView) findViewById(R.id.tv_bxt_news_loc); - tvBXTNewsHolder1 = (TextView) findViewById(R.id.tv_bxt_news_holder1); - tvBXTNewsHolder2 = (TextView) findViewById(R.id.tv_bxt_news_holder2); - tvBXTNewsPoints = (TextView) findViewById(R.id.tv_bxt_news_point); - tvBXTNewsSpeakerInfo = (TextView) findViewById(R.id.tv_bxt_news_speaker_info); - - tvBXTNewsTitle.setText(getIntent().getStringExtra("title")); - tvBXTNewsTopic.setText(getIntent().getStringExtra("topic")); - tvBXTNewsSpeaker.setText(getIntent().getStringExtra("speaker")); - tvBXTNewsTime.setText(getIntent().getStringExtra("time")); - tvBXTNewsLoc.setText(getIntent().getStringExtra("location")); - tvBXTNewsHolder1.setText(getIntent().getStringExtra("holder1")); - tvBXTNewsHolder2.setText(getIntent().getStringExtra("holder2")); - tvBXTNewsPoints.setText(getIntent().getStringExtra("points")); - tvBXTNewsSpeakerInfo.setText(getIntent().getStringExtra("speakerinfo")); - - } - - - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/BaseActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/BaseActivity.class index 1c9f037..fbd0259 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/BaseActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/BaseActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/BaseActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/BaseActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 31a2a1d..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/BaseActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,104 +0,0 @@ -package com.stone.shop.view; - -import cn.bmob.v3.Bmob; - -import com.stone.shop.R; -import com.stone.shop.view.old.OldMineActivity; - -import android.os.Bundle; -import android.app.TabActivity; -import android.content.Context; -import android.content.Intent; -import android.content.SharedPreferences; -import android.content.SharedPreferences.Editor; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.ImageView; -import android.widget.Space; -import android.widget.TabHost; -import android.widget.TextView; -import android.widget.Toast; - -/** - * 应用主界面 - * @date 2014-4-24 - * @author Stone - */ -@SuppressWarnings("deprecation") -public class BaseActivity extends TabActivity { - - private static final String TAG = "BaseActivity"; - - private TabHost tabHost; - private LayoutInflater layoutInflater; - - - String[] mTitle = new String[] { "周边", "讨论区", "我的"}; - int[] mIcon = new int[] { R.drawable.ic_shop2, R.drawable.ic_sale2, - R.drawable.ic_car2, R.drawable.ic_mine }; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_base); - - initTabView(); - - - } - - public View getTabItemView(int i) { - // TODO Auto-generated method stub - View view = layoutInflater.inflate(R.layout.tab_widget_item, null); - ImageView imageView = (ImageView) view.findViewById(R.id.imageview); - imageView.setImageResource(mIcon[i]); - TextView textView = (TextView) view.findViewById(R.id.textview); - textView.setText(mTitle[i]); - return view; - } - - public void initTabView() { - - /** - * tabHost.newTabSpec("artist")创建一个标签项,其中artist为它的标签标识符,相当于jsp页面标签的name属性 - * setIndicator("艺术标签",resources.getDrawable(R.drawable.ic_tab))设置标签显示文本以及标签上的图标(该图标并不是一个图片,而是一个xml文件哦) - * setContent(intent)为当前标签指定一个意图 - * tabHost.addTab(spec); 将标签项添加到标签中 - */ - - tabHost = getTabHost(); - layoutInflater = LayoutInflater.from(this); - TabHost.TabSpec spec; - - Intent intent1 = new Intent(this, ShopActivity.class); - spec = tabHost.newTabSpec(mTitle[0]).setIndicator( getTabItemView(0) ).setContent(intent1); - tabHost.addTab(spec); - - Intent intent2 = new Intent(this, AwardActivity.class); - spec = tabHost.newTabSpec(mTitle[1]).setIndicator( getTabItemView(1) ).setContent(intent2); - tabHost.addTab(spec); - - Intent intent3 = new Intent(this, MineActivity.class); - spec = tabHost.newTabSpec(mTitle[2]).setIndicator( getTabItemView(2) ).setContent(intent3); - tabHost.addTab(spec); - - /* - Intent intent3 = new Intent(this, WsqActivity.class); - spec = tabHost.newTabSpec(mTitle[2]).setIndicator( getTabItemView(2) ).setContent(intent3); - tabHost.addTab(spec); - - Intent intent4 = new Intent(this, OldMineActivity.class); - spec = tabHost.newTabSpec(mTitle[3]).setIndicator( getTabItemView(3) ).setContent(intent4); - tabHost.addTab(spec); */ - - tabHost.setCurrentTab(0); - } - - @Override - public void onBackPressed() { - Toast.makeText(this, "确定要退出在这里么?", Toast.LENGTH_LONG).show(); - //super.onBackPressed(); - } - - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ClassroomActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/ClassroomActivity$1.class deleted file mode 100644 index a07cd1e..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/ClassroomActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ClassroomActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/ClassroomActivity.class index 5ff237e..c3590ab 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/ClassroomActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/ClassroomActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ClassroomActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/ClassroomActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 417200b..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/ClassroomActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,94 +0,0 @@ -package com.stone.shop.view; - -import java.util.ArrayList; -import java.util.List; - -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.listener.FindListener; - -import com.stone.shop.R; -import com.stone.shop.adapter.BXTListAdapter; -import com.stone.shop.adapter.ClassroomAdapter; -import com.stone.shop.model.Classroom; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.view.View; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.GridView; -import android.widget.ListView; -import android.widget.TextView; -import android.widget.Toast; - -public class ClassroomActivity extends Activity implements OnItemClickListener { - - private static final String TAG = "BXTActivity"; - - private GridView lvBXTNews; - private ClassroomAdapter mBxtListAdapter; - private List mBXTNewsList; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_classroom); - - initView(); - initData(); - - } - - private void initView() { - lvBXTNews = (GridView) findViewById(R.id.gv_classroom); - mBXTNewsList = new ArrayList(); - mBxtListAdapter = new ClassroomAdapter(this, mBXTNewsList); - lvBXTNews.setAdapter(mBxtListAdapter); - lvBXTNews.setOnItemClickListener(this); - - TextView tv_title = (TextView) findViewById(R.id.tv_title); - tv_title.setText("教室"); - } - - private void initData() { - BmobQuery query = new BmobQuery(); - query.addWhereEqualTo("type", "教室"); - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List newsList) { - // toast("查询商品成功, 共" + newsList.size()); - if (newsList.size() == 0) - toast("亲, 暂时还木有教室哦"); - else { - mBXTNewsList = newsList; - mBxtListAdapter.refresh(newsList); - mBxtListAdapter.notifyDataSetChanged(); - - } - - } - - @Override - public void onError(int arg0, String arg1) { - toast("查询失败"); - } - }); - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - - @Override - public void onItemClick(AdapterView parent, View view, int position, long id) { - Intent intent = new Intent(ClassroomActivity.this, ReservationActivity.class); - Classroom classroom = mBXTNewsList.get(position); - intent.putExtra("roomId", classroom.getObjectId()); - intent.putExtra("roomName", classroom.getName()); - startActivity(intent); - - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$1.class deleted file mode 100644 index 590cba9..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$2.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$2.class deleted file mode 100644 index cac2455..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$2.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$3$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$3$1.class deleted file mode 100644 index 78736c3..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$3$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$3.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$3.class deleted file mode 100644 index b686d6a..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$3.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$4.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$4.class deleted file mode 100644 index e71b2a3..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$4.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$5.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$5.class deleted file mode 100644 index 0f87f42..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity$5.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity.class index e8e00bf..1d34644 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/CommentActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/EditActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/EditActivity$1.class deleted file mode 100644 index 904f663..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/EditActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/EditActivity$2.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/EditActivity$2.class deleted file mode 100644 index 20b01bd..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/EditActivity$2.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/EditActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/EditActivity.class index 37721d9..05b6c65 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/EditActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/EditActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/FeedBackActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/FeedBackActivity$1.class deleted file mode 100644 index 2e468d6..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/FeedBackActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/FeedBackActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/FeedBackActivity.class index cee70b1..37f1c0c 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/FeedBackActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/FeedBackActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/FeedBackActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/FeedBackActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index af75344..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/FeedBackActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,103 +0,0 @@ -package com.stone.shop.view; - -import cn.bmob.v3.BmobUser; -import cn.bmob.v3.listener.SaveListener; - -import com.stone.shop.R; -import com.stone.shop.model.FeedBack; -import com.stone.shop.model.User; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.EditText; -import android.widget.Toast; - -/** - * 意见反馈界面 - * - * @date 2014-5-27 - * @author Stone - */ -public class FeedBackActivity extends Activity implements OnClickListener { - - private static final String TAG = "FeedBackActivity"; - - private EditText etContent; - private Button btnSubmit; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_feedback); - - initView(); - } - - private void initView() { - etContent = (EditText) findViewById(R.id.et_feedback_content); - btnSubmit = (Button) findViewById(R.id.btn_feedback_submit); - btnSubmit.setOnClickListener(this); - } - - /** - * 提交用户的反馈信息 - */ - private void submit() { - String content = etContent.getText().toString(); - if (content.equals("")) { - toast("亲,请先写点东西吧"); - } else { - BmobUser user = BmobUser.getCurrentUser(this); - FeedBack fb = new FeedBack(); - fb.setUsername(user.getUsername()); - fb.setEmail(user.getEmail()); - fb.setContent(content); - fb.save(this, new SaveListener() { - - @Override - public void onSuccess() { - // TODO Auto-generated method stub - toast("提交成功, 在这里会尽快回复"); - back(); - } - - @Override - public void onFailure(int arg0, String arg1) { - // TODO Auto-generated method stub - toast("提交失败"); - } - }); - - } - - } - - @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.btn_feedback_submit: - submit(); - break; - - default: - break; - } - } - - private void back() { - finish(); - } - - public void clickFeedBack(View v) { - finish(); - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/HomeActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/HomeActivity$1.class deleted file mode 100644 index 47b49c2..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/HomeActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/HomeActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/HomeActivity.class index f216cf9..b57c5bc 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/HomeActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/HomeActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/HomeActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/HomeActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index ef4e9c5..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/HomeActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,195 +0,0 @@ -package com.stone.shop.view; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import android.app.Activity; -import android.content.Context; -import android.content.Intent; -import android.opengl.Visibility; -import android.os.Bundle; -import android.support.v4.view.ViewPager.OnPageChangeListener; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.FrameLayout; -import android.widget.ImageButton; -import android.widget.ImageView; -import android.widget.ListView; -import android.widget.ImageView.ScaleType; -import android.widget.TextView; -import android.widget.Toast; - -import cn.bmob.v3.Bmob; -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.listener.FindListener; -import cn.bmob.v3.listener.GetServerTimeListener; - -import com.stone.date.TypeDef; -import com.stone.shop.R; -import com.stone.shop.adapter.ImagePagerAdapter; -import com.stone.shop.adapter.NewsListAdapter; -import com.stone.shop.model.News; -import com.stone.shop.model.Shop; -import com.stone.ui.AutoScrollViewPager; -import com.stone.ui.ListScrollView; - -/** - * 主界面 - * - * @date 2014-4-24 - * @author Stone - */ -public class HomeActivity extends Activity implements OnClickListener, - OnItemClickListener { - - private static final String TAG = "HomeActivity"; - - private ListScrollView listScrollView; - - // 校历 - private TextView tvWeek; // 周次和星期 - private TextView tvDay; // 年月日 - - // 图片轮播 - private FrameLayout flImageAds; - private AutoScrollViewPager viewPager; - private List mImgViews; - private ImageButton btnHideAds; - private int[] mImgResId = { R.drawable.ic_banner1, R.drawable.ic_banner1, - R.drawable.ic_banner1, R.drawable.ic_banner1 }; - - // 校园新闻 - private ListView lvNewsList; - private List newsList = new ArrayList(); - private NewsListAdapter newsListAdapter; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_home); - - // 解决ScrollView和ListView之间的冲突 - listScrollView = (ListScrollView) findViewById(R.id.listScrollView); - lvNewsList = (ListView) findViewById(R.id.lv_news); - listScrollView.setListView(lvNewsList); - - flImageAds = (FrameLayout) findViewById(R.id.fl_image_ads); - viewPager = (AutoScrollViewPager) findViewById(R.id.view_pager); - btnHideAds = (ImageButton) findViewById(R.id.btn_hide_ads); - - mImgViews = new ArrayList(); - for (int i = 0; i < mImgResId.length; i++) { - ImageView imageView = new ImageView(this); - imageView.setImageResource(mImgResId[i]); - imageView.setScaleType(ScaleType.CENTER_CROP); - mImgViews.add(imageView); - } - - btnHideAds.setOnClickListener(this); - - viewPager.setAdapter(new ImagePagerAdapter(this, mImgViews)); - viewPager.setInterval(3000); // 设置自动滚动的间隔时间,单位为毫秒 - viewPager.setDirection(AutoScrollViewPager.RIGHT); // 设置自动滚动的方向,默认向右 - viewPager.setCycle(true); // 是否自动循环轮播,默认为true - viewPager.setScrollDurationFactor(3); // 设置ViewPager滑动动画间隔时间的倍率,达到减慢动画或改变动画速度的效果 - viewPager.setStopScrollWhenTouch(true); // 当手指碰到ViewPager时是否停止自动滚动,默认为true - viewPager.setBorderAnimation(true); // 设置循环滚动时滑动到从边缘滚动到下一个是否需要动画,默认为true - viewPager - .setSlideBorderMode(AutoScrollViewPager.SLIDE_BORDER_MODE_NONE);// 滑动到第一个或最后一个Item的处理方式,支持没有任何操作、轮播以及传递到父View三种模式 - - viewPager.startAutoScroll(); - - // 校历 - tvWeek = (TextView) findViewById(R.id.tv_week); - tvDay = (TextView) findViewById(R.id.tv_day); - setTime(); - - // 新闻 - newsListAdapter = new NewsListAdapter(this, newsList); - lvNewsList.setAdapter(newsListAdapter); - lvNewsList.setOnItemClickListener(this); - - getNewsData(); - } - - /** - * 设置校历中日期的时间 - */ - public void setTime() { - Calendar calendar = Calendar.getInstance(); - String year = calendar.get(Calendar.YEAR)+""; - String month = calendar.get(Calendar.MONTH)+1+""; - String day = calendar.get(Calendar.DAY_OF_MONTH)+""; - String week = calendar.get(Calendar.WEEK_OF_YEAR)-9+""; - String dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK)+""; - String chDayOfWeek = TypeDef.chDayOfWeek[Integer.parseInt(dayOfWeek)-1]; - toast(year+"-"+month+"-"+day+" "+" 第 "+week+" 周 "+" "+" 星期 "+chDayOfWeek); - tvWeek.setText(" 第 "+week+" 周 "+" "+" 星期 "+chDayOfWeek); - tvDay.setText(year+" 年 "+month+" 月 "+day+" 日"); - } - - /** - * 初始化新闻列表数据 - * @date 2014-5-3 - * @author Stone - */ - public void getNewsData() { - BmobQuery query = new BmobQuery(); - query.order("-updatedAt"); - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List object) { - newsList = object; - // 通知Adapter数据更新 - newsListAdapter.refresh((ArrayList) newsList); - newsListAdapter.notifyDataSetChanged(); - } - - @Override - public void onError(int arg0, String arg1) { - toast("对不起, 获取数据失败了"); - } - }); - } - - @Override - protected void onResume() { - super.onResume(); - // start auto scroll when onResume - viewPager.startAutoScroll(); - } - - @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.btn_hide_ads: - flImageAds.setVisibility(View.GONE); - break; - - default: - break; - } - } - - @Override - public void onItemClick(AdapterView parent, View view, int position, - long id) { - Intent toNewsDetail = new Intent(HomeActivity.this, NewsActivity.class); - toNewsDetail.putExtra("NewsTitle", newsList.get(position).getTitle()); - toNewsDetail.putExtra("NewsAuthor", newsList.get(position).getAuthor()); - toNewsDetail.putExtra("NewsTime", newsList.get(position).getCreatedAt()); - toNewsDetail.putExtra("NewsContent", newsList.get(position).getContent()); - startActivity(toNewsDetail); - } - - public void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT); - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/InfoContentActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/InfoContentActivity.class index 6b0f013..8861311 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/InfoContentActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/InfoContentActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/InfoNewsContentActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/InfoNewsContentActivity.class index 93c6c41..bbbfdd2 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/InfoNewsContentActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/InfoNewsContentActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/InformationActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/InformationActivity$1.class deleted file mode 100644 index 4aa38a9..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/InformationActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/InformationActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/InformationActivity.class index 04055fb..0650ec3 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/InformationActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/InformationActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryActivity$1.class deleted file mode 100644 index 65dc203..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryActivity.class index 9275817..495f8e3 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity$1.class deleted file mode 100644 index fc7edb2..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity$2$1$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity$2$1$1.class deleted file mode 100644 index 3c9ec6d..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity$2$1$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity$2$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity$2$1.class deleted file mode 100644 index fa27442..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity$2$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity$2.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity$2.class deleted file mode 100644 index efb8011..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity$2.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity.class index 0cbe19e..ac0b6a1 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/LibraryReservationActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$1.class deleted file mode 100644 index 13c7193..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$2.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$2.class deleted file mode 100644 index 9cf2561..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$2.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$3.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$3.class deleted file mode 100644 index 9c65419..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$3.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$4$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$4$1.class deleted file mode 100644 index 2f40aa5..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$4$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$4.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$4.class deleted file mode 100644 index c68d858..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$4.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$BaseUiListener.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$BaseUiListener.class index 035a1cb..bf89352 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$BaseUiListener.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity$BaseUiListener.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity.class index c61600f..cbf9558 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 5993407..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/LoginActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,346 +0,0 @@ -package com.stone.shop.view; - -import java.io.IOException; -import java.io.InputStream; -import java.net.HttpURLConnection; -import java.net.URL; - -import org.json.JSONException; -import org.json.JSONObject; - -import android.app.Activity; -import android.content.Intent; -import android.content.SharedPreferences; -import android.content.SharedPreferences.Editor; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Color; -import android.os.Bundle; -import android.os.Handler; -import android.os.Message; -import android.os.SystemClock; -import android.text.TextUtils; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.EditText; -import android.widget.ImageView; -import android.widget.TextView; -import android.widget.Toast; -import cn.bmob.v3.Bmob; -import cn.bmob.v3.listener.SaveListener; - -import com.stone.shop.R; -import com.stone.shop.model.User; -import com.stone.util.Util; -import com.tencent.connect.UserInfo; -import com.tencent.connect.auth.QQAuth; -import com.tencent.connect.common.Constants; -import com.tencent.tauth.IUiListener; -import com.tencent.tauth.Tencent; -import com.tencent.tauth.UiError; - -/** - * 登陆界面 - * - * @date 2014-4-24 - * @author Stone - */ -public class LoginActivity extends Activity implements OnClickListener { - - private static final String TAG = "LoginActicity"; - - private Button btnLogin; - private Button btnReg; - private EditText etUsername; - private EditText etPassword; - - private String username; - private String password; - - private static final String APP_ID = "222222"; - private UserInfo mInfo; - private TextView mUserInfo; - private ImageView mUserLogo; - private ImageView mNewLoginButton; - private TextView backInfo; - - // QQ登陆 - private static Tencent mTencent; - // private QQAuth mQQAuth; - - Handler mHandler = new Handler() { - - @Override - public void handleMessage(Message msg) { - if (msg.what == 0) { - JSONObject response = (JSONObject) msg.obj; - if (response.has("nickname")) { - try { - mUserInfo.setVisibility(android.view.View.VISIBLE); - mUserInfo.setText(response.getString("nickname")); - } catch (JSONException e) { - e.printStackTrace(); - } - } - - } else if (msg.what == 1) { - Bitmap bitmap = (Bitmap) msg.obj; - mUserLogo.setImageBitmap(bitmap); - mUserLogo.setVisibility(android.view.View.VISIBLE); - } - } - - }; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - // 初始化 Bmob SDK - // 使用时请将第二个参数Application ID替换成你在Bmob服务器端创建的Application ID - Bmob.initialize(this, "252a2c58d0dc9a78a5411501c62ce0de"); - setContentView(R.layout.activity_login); - - // QQ登陆, 获取实例 - // mQQAuth = QQAuth.createInstance(APP_ID, - // this.getApplicationContext()); - mTencent = Tencent.createInstance(APP_ID, this.getApplicationContext()); - - btnLogin = (Button) findViewById(R.id.btn_login); - btnReg = (Button) findViewById(R.id.btn_register); - - etUsername = (EditText) findViewById(R.id.et_username); - etPassword = (EditText) findViewById(R.id.et_password); - - btnLogin.setOnClickListener(this); - btnReg.setOnClickListener(this); - - findViewById(R.id.btn_qq).setOnClickListener(this); - - mUserInfo = (TextView) findViewById(R.id.user_nickname); - mUserLogo = (ImageView) findViewById(R.id.user_logo); - mNewLoginButton = (ImageView) findViewById(R.id.new_login_btn); - mNewLoginButton.setOnClickListener(this); - backInfo = (TextView) findViewById(R.id.user_callback); - - getUserInfo(); - - } - - private void getUserInfo() { - SharedPreferences sp = getSharedPreferences("UserInfo", 0); - etUsername.setText(sp.getString("username", null)); - etPassword.setText(sp.getString("password", null)); - } - - // 保存用户的登陆记录 - private void saveUserInfo(String username, String password) { - SharedPreferences sp = getSharedPreferences("UserInfo", 0); - Editor editor = sp.edit(); - editor.putString("username", username); - editor.putString("password", password); - editor.commit(); - } - - public void onClickLogin() { - if (!mTencent.isSessionValid()) { - mTencent.login(this, "all", loginListener); - Log.d("SDKQQAgentPref", "FirstLaunch_SDK:" + SystemClock.elapsedRealtime()); - } else { - - mTencent.logout(this); - updateUserInfo(); - } - } - - @Override - public void onClick(View v) { - switch (v.getId()) { - // 登陆 - case R.id.btn_login: - username = etUsername.getText().toString(); - password = etPassword.getText().toString(); - - if (!Util.isNetworkConnected(this)) { - toast("木有网络 ( ⊙ o ⊙ ) "); - } else if (username.equals("") || password.equals("")) { - toast("请输入账号和密码"); - break; - } else { - final User bu2 = new User(); - bu2.setUsername(username); - bu2.setPassword(password); - bu2.login(this, new SaveListener() { - - @Override - public void onSuccess() { - // TODO Auto-generated method stub - toast("欢迎进入 在这里 服务系统"); - // 保存用户信息 - saveUserInfo(username, password); - // 跳转到主页 - User.userId = bu2.getObjectId(); - Intent toHome = new Intent(LoginActivity.this, BaseActivity.class); - startActivity(toHome); - finish(); - } - - @Override - public void onFailure(int arg0, String arg1) { - // TODO Auto-generated method stub - toast("用户名或密码错误"); - } - }); - } - break; - - case R.id.btn_register: - Intent toReg = new Intent(LoginActivity.this, RegisterActivity.class); - startActivity(toReg); - break; - case R.id.btn_qq: - - onClickLogin(); - - break; - - default: - break; - - } - } - - public void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - - IUiListener loginListener = new BaseUiListener() { - @Override - protected void doComplete(JSONObject values) { - Log.d("SDKQQAgentPref", "AuthorSwitch_SDK:" + SystemClock.elapsedRealtime()); - initOpenidAndToken(values); - updateUserInfo(); - } - }; - - private class BaseUiListener implements IUiListener { - - @Override - public void onComplete(Object response) { - if (null == response) { - Util.showResultDialog(LoginActivity.this, "返回为空", "登录失败"); - return; - } - JSONObject jsonResponse = (JSONObject) response; - if (null != jsonResponse && jsonResponse.length() == 0) { - Util.showResultDialog(LoginActivity.this, "返回为空", "登录失败"); - return; - } - // Util.showResultDialog(LoginActivity.this, response.toString(), - // "登录成功"); - doComplete((JSONObject) response); - try { - User.userId = jsonResponse.getString("openid"); - } catch (JSONException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - Intent toHome = new Intent(LoginActivity.this, BaseActivity.class); - startActivity(toHome); - finish(); - } - - protected void doComplete(JSONObject values) { - - } - - @Override - public void onError(UiError e) { - Util.toastMessage(LoginActivity.this, "onError: " + e.errorDetail); - Util.dismissDialog(); - } - - @Override - public void onCancel() { - Util.toastMessage(LoginActivity.this, "onCancel: "); - Util.dismissDialog(); - } - } - - private void updateUserInfo() { - if (mTencent != null && mTencent.isSessionValid()) { - IUiListener listener = new IUiListener() { - - @Override - public void onError(UiError e) { - - } - - @Override - public void onComplete(final Object response) { - Message msg = new Message(); - msg.obj = response; - msg.what = 0; - mHandler.sendMessage(msg); - new Thread() { - - @Override - public void run() { - JSONObject json = (JSONObject) response; - if (json.has("figureurl")) { - Bitmap bitmap = null; - try { - bitmap = Util.getbitmap(json.getString("figureurl_qq_2")); - } catch (JSONException e) { - - } - Message msg = new Message(); - msg.obj = bitmap; - msg.what = 1; - mHandler.sendMessage(msg); - } - } - - }.start(); - } - - @Override - public void onCancel() { - - } - }; - mInfo = new UserInfo(this, mTencent.getQQToken()); - mInfo.getUserInfo(listener); - - } else { - mUserInfo.setText(""); - mUserInfo.setVisibility(android.view.View.GONE); - mUserLogo.setVisibility(android.view.View.GONE); - } - } - - public static void initOpenidAndToken(JSONObject jsonObject) { - try { - String token = jsonObject.getString(Constants.PARAM_ACCESS_TOKEN); - String expires = jsonObject.getString(Constants.PARAM_EXPIRES_IN); - String openId = jsonObject.getString(Constants.PARAM_OPEN_ID); - if (!TextUtils.isEmpty(token) && !TextUtils.isEmpty(expires) && !TextUtils.isEmpty(openId)) { - mTencent.setAccessToken(token, expires); - mTencent.setOpenId(openId); - } - } catch (Exception e) { - } - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - Log.d(TAG, "-->onActivityResult " + requestCode + " resultCode=" + resultCode); - if (requestCode == Constants.REQUEST_LOGIN || requestCode == Constants.REQUEST_APPBAR) { - Tencent.onActivityResultData(requestCode, resultCode, data, loginListener); - } - - super.onActivityResult(requestCode, resultCode, data); - } -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MainActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/MainActivity.class index 22fe1c0..d8047eb 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/MainActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/MainActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineActivity$1.class deleted file mode 100644 index 858af0f..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineActivity$2.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineActivity$2.class deleted file mode 100644 index 6bd99a6..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineActivity$2.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineActivity.class index 7d222ef..aaa944b 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 5e612f4..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -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 query = new BmobQuery(); - 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, "校园小菜-HBUT版" +"\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(); - } - - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity$1.class deleted file mode 100644 index edd28ab..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity$2.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity$2.class deleted file mode 100644 index 2705443..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity$2.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity.class index 83ffc43..a41acb2 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity.java~HEAD b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity.java~HEAD deleted file mode 100644 index d5ce189..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity.java~HEAD +++ /dev/null @@ -1,124 +0,0 @@ -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 query = new BmobQuery(); - query.addWhereEqualTo("objectId", bmobUser.getObjectId()); - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List 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(); - } - - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity.java~qinjiaming_branch b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity.java~qinjiaming_branch deleted file mode 100644 index fd57ca9..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity.java~qinjiaming_branch +++ /dev/null @@ -1,116 +0,0 @@ -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 query = new BmobQuery(); - query.addWhereEqualTo("objectId", bmobUser.getObjectId()); - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List 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(); - } - - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index d5ce189..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,124 +0,0 @@ -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 query = new BmobQuery(); - query.addWhereEqualTo("objectId", bmobUser.getObjectId()); - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List 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(); - } - - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity$1.class deleted file mode 100644 index e9769ec..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity$2.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity$2.class deleted file mode 100644 index 39b4d0a..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity$2.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity$3.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity$3.class deleted file mode 100644 index ae38e77..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity$3.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity.class index f047b18..8431bf4 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 39902ea..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineInfoEditActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,145 +0,0 @@ -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 cn.bmob.v3.listener.UpdateListener; - -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.util.Log; -import android.view.View; -import android.widget.EditText; -import android.widget.Toast; - -/** - * 修改个人资料卡 - * @date 2014-5-28 - * @author Stone - */ -public class MineInfoEditActivity extends Activity { - - private EditText etUsername; - private EditText etSchool; - private EditText etCademy; - private EditText etDorPart; - private EditText etDorNum; - private EditText etPhone; - private EditText etQQ; - - private User curUser; - private Bundle bundle; - 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_edit); - - setCurUser(); - } - - private void initView() { - etUsername = (EditText) findViewById(R.id.et_mineinfo_username); - etSchool = (EditText) findViewById(R.id.et_mineinfo_school); - etCademy = (EditText) findViewById(R.id.et_mineinfo_cademy); - etDorPart = (EditText) findViewById(R.id.et_mineinfo_dorpart); - etDorNum = (EditText) findViewById(R.id.et_mineinfo_dornum); - etPhone = (EditText) findViewById(R.id.et_mineinfo_phone); - etQQ = (EditText) findViewById(R.id.et_mineinfo_qq); - - etUsername.setText(curUser.getUsername()); - etSchool.setText(curUser.getSchool()); - etCademy.setText(curUser.getCademy()); - etDorPart.setText(curUser.getDorPart()); - etDorNum.setText(curUser.getDorNum()); - etPhone.setText(curUser.getPhone()); - etQQ.setText(curUser.getQQ()); - } - - private void setCurUser() { - BmobUser bmobUser = BmobUser.getCurrentUser(this); - BmobQuery query = new BmobQuery(); - query.addWhereEqualTo("objectId", bmobUser.getObjectId()); - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List object) { - curUser = object.get(0); - //toast("查询到用户 " + object.size()); - Message msg = new Message(); - msg.what = MessageDef.MINE_INFO_FINISH_FIND_USER; - mHandler.sendMessage(msg); - } - - @Override - public void onError(int arg0, String arg1) { - toast("获取当前用户失败"); - } - }); - - } - - private void saveUserInfo() { - if(curUser == null) { - toast("curUser为空"); - } else { - toast("当前用户为 " + curUser.getUsername()); - } - Log.i("当前用户的ID: ", curUser.getObjectId()); - curUser.setUsername(etUsername.getText().toString()); - curUser.setSchool(etSchool.getText().toString()); - curUser.setCademy(etCademy.getText().toString()); - curUser.setDorPart(etDorPart.getText().toString()); - curUser.setDorNum(etDorNum.getText().toString()); - curUser.setPhone(etPhone.getText().toString()); - curUser.setQQ(etQQ.getText().toString()); - curUser.update(this, curUser.getObjectId(), new UpdateListener() { - - @Override - public void onSuccess() { - toast("更新成功"); - } - - @Override - public void onFailure(int arg0, String arg1) { - toast("更新失败"); - } - }); - } - - public void clickSave(View v) { - saveUserInfo(); - finish(); - } - - public void clickCancel(View v) { - finish(); - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineSoftActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineSoftActivity.class index bfefefe..caa71b5 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/MineSoftActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/MineSoftActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MultiScreenActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/MultiScreenActivity.class index 26675d3..aeb83ed 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/MultiScreenActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/MultiScreenActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/MultiViewGroup.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/MultiViewGroup.class index e1b6850..0410302 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/MultiViewGroup.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/MultiViewGroup.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/NewsActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/NewsActivity.class index 6bb09ca..ddb0c82 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/NewsActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/NewsActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/NewsActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/NewsActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 2014960..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/NewsActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,72 +0,0 @@ -package com.stone.shop.view; - -import com.stone.shop.R; - -import android.app.Activity; -import android.os.Bundle; -import android.widget.TextView; - -/** - * 新闻内容显示界面 - * @date 2014-5-8 - * @author Stone - */ -public class NewsActivity extends Activity { - - private static String TAG = "NewsActivity"; - - private TextView tvNewsTitle; - private TextView tvNewsAuthor; - private TextView tvNewsTime; - private TextView tvNewsContent; - - private String newsTitle; - private String newsAuthor; - private String newsTime; - private String newsContent; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_news); - - getIntentData(); - initView(); - } - - //获取Intent中传入的新闻数据 - private void getIntentData() { - newsTitle = getIntent().getStringExtra("NewsTitle"); - newsAuthor = getIntent().getStringExtra("NewsAuthor"); - newsTime = getIntent().getStringExtra("NewsTime"); - newsContent = getIntent().getStringExtra("NewsContent"); - - newsTitle = splitString(newsTitle); //拆分字符串, 将新闻标题设置为 "】" 后面的内容 - } - - private String splitString(String str) { - String[] strs = null; - if(str.equals("")){ - return ""; - } else if ( !(str.contains("【") || str.contains("】")) ) { - return str; - } - strs = str.split("】"); - return strs[1]; - } - - private void initView() { - tvNewsTitle = (TextView) findViewById(R.id.tv_news_title); - tvNewsAuthor = (TextView) findViewById(R.id.tv_news_author); - tvNewsTime = (TextView) findViewById(R.id.tv_news_time); - tvNewsContent = (TextView) findViewById(R.id.tv_news_content); - - tvNewsTitle.setText(newsTitle); - tvNewsAuthor.setText("作者: "+newsAuthor); - tvNewsTime.setText("发布日期 : "+newsTime); - tvNewsContent.setText(newsContent); - } - - - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderActivity$1.class deleted file mode 100644 index 0ab4111..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderActivity$2.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderActivity$2.class deleted file mode 100644 index a73fffc..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderActivity$2.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderActivity.class index 107cc7b..0927718 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index fcdf913..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,218 +0,0 @@ -package com.stone.shop.view; - -import java.util.Calendar; - -import android.app.Activity; -import android.app.TimePickerDialog; -import android.content.Intent; -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.EditText; -import android.widget.TextView; -import android.widget.TimePicker; -import android.widget.Toast; - -import cn.bmob.v3.BmobUser; -import cn.bmob.v3.listener.SaveListener; - -import com.stone.shop.R; -import com.stone.shop.model.Good; -import com.stone.shop.model.Order; -import com.stone.shop.model.Shop; -import com.stone.ui.DialogOrder; -import com.stone.util.Util; - -/** - * 应用主界面 - * - * @date 2014-5-13 - * @author Stone - */ -public class OrderActivity extends Activity implements OnClickListener { - - private TextView tvOrderShop; // 店名 - private TextView tvOrderGood; // 菜名 - private TextView tvOrderCount; // 数量 - private TextView tvOrderTime; // 取餐时间 - private TimePicker tpOrderTime; // 时间选择控件 - private EditText etOrderPhone; // 联系电话 - private EditText etOrderWords; // 附加留言 - private Button btnOrderCountMore; // 增加数量 - private Button btnOrderCountLess; // 减少数量 - - private Button btnOrderSetTime; // 设置时间 - private Button btnDlgOk; // 设置时间完成 - private Button btnOrderSubmit; // 提交订单 - - // private DialogOrder dlgSetOrderTime; - // private View dlgOrderView; - private int mHour; - private int mMinute; - private String time = "12 : 30"; - private TimePickerDialog dlgSetOrderTime; - private TimePickerDialog.OnTimeSetListener mTimeSetListener = new TimePickerDialog.OnTimeSetListener() { - - public void onTimeSet(TimePicker view, int hourOfDay, int minute) { - mHour = hourOfDay; - mMinute = minute; - updateDisplay(); - } - }; - - // 从上级页面中传入的数据 - private Shop shop; // 当期选择的Shop - private Good good; // 当前选择的商品 - private String shopID; // 当前选择的Shop的ID - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_order); - - shop = (Shop) getIntent().getSerializableExtra("shop"); - good = (Good) getIntent().getSerializableExtra("good"); - shopID = getIntent().getStringExtra("shopID"); - - initView(); - // initDlgView(); - } - - private void initView() { - - tvOrderShop = (TextView) findViewById(R.id.tv_order_shop); - tvOrderGood = (TextView) findViewById(R.id.tv_order_good); - tvOrderCount = (TextView) findViewById(R.id.tv_order_count); - tvOrderTime = (TextView) findViewById(R.id.tv_order_time); - tvOrderShop.setText(shop.getName()); - tvOrderGood.setText(good.getName()); - - etOrderPhone = (EditText) findViewById(R.id.et_order_phone); - etOrderWords = (EditText) findViewById(R.id.et_order_words); - - btnOrderCountMore = (Button) findViewById(R.id.btn_order_count_more); - btnOrderCountLess = (Button) findViewById(R.id.btn_order_count_less); - btnOrderSetTime = (Button) findViewById(R.id.btn_set_time); - btnOrderSubmit = (Button) findViewById(R.id.btn_order_submit); - btnOrderCountMore.setOnClickListener(this); - btnOrderCountLess.setOnClickListener(this); - btnOrderSetTime.setOnClickListener(this); - btnOrderSubmit.setOnClickListener(this); - - } - - // private void initDlgView() { - // LayoutInflater inflater = LayoutInflater.from(this); - // dlgOrderView = inflater.inflate(R.layout.dlg_order_settime, null); - // tpOrderTime = (TimePicker) dlgOrderView.findViewById(R.id.tp_dlg_time); - // tpOrderTime.setIs24HourView(true); - // btnDlgOk = (Button) dlgOrderView.findViewById(R.id.btn_dlg_ok); - // btnDlgOk.setOnClickListener(this); - // } - - @Override - public void onClick(View v) { - int count = 1; - switch (v.getId()) { - case R.id.btn_order_count_more: - count = Integer.parseInt(tvOrderCount.getText().toString()); - if (count == 4) { - toast("每份订单数量不能超过 4"); - } else { - tvOrderCount.setText((count + 1) + ""); - } - break; - case R.id.btn_order_count_less: - count = Integer.parseInt(tvOrderCount.getText().toString()); - if (count == 1) { - toast("每份订单数量至少为 1 "); - } else { - tvOrderCount.setText((count - 1) + ""); - } - break; - case R.id.btn_set_time: - // dlgSetOrderTime = new DialogOrder(this, R.style.MyDialog); - // dlgSetOrderTime.show(); - final Calendar c = Calendar.getInstance(); - mHour = c.get(Calendar.HOUR_OF_DAY); - mMinute = c.get(Calendar.MINUTE); - dlgSetOrderTime = new TimePickerDialog(this, mTimeSetListener, mHour, mMinute, true); - dlgSetOrderTime.show(); - break; - case R.id.btn_dlg_ok: - time = tpOrderTime.getCurrentHour() + " : " + tpOrderTime.getCurrentMinute(); - dlgSetOrderTime.dismiss(); - case R.id.btn_order_submit: - // toast("小菜订单提交成功"); - postOrder(); - finish(); - // back(); - break; - default: - break; - } - - } - - /** - * 提交订单数据 - */ - private void postOrder() { - String count = tvOrderCount.getText().toString(); - String phone = etOrderPhone.getText().toString(); - String words = etOrderWords.getText().toString(); - float price = Integer.parseInt(count) * Float.parseFloat(good.getPrice()); - if (!Util.isPhoneNumberValid(phone)) { - toast("请输入正确的联系电话, 方便取餐"); - } else { - Order order = new Order(); - BmobUser user = BmobUser.getCurrentUser(this); - order.setUserName(user.getUsername()); - order.setGoodID(good.getObjectId()); - order.setGoodName(good.getName()); - order.setShopID(shop.getObjectId()); - order.setShopName(shop.getName()); - order.setCount(count); - order.setTime(time); - order.setPrice(price + ""); - order.setPhone(phone); - order.setTips(words); - order.save(this, new SaveListener() { - - @Override - public void onSuccess() { - // TODO Auto-generated method stub - toast("订单提交成功"); - } - - @Override - public void onFailure(int arg0, String arg1) { - // TODO Auto-generated method stub - toast("订单提交失败"); - } - }); - - } - } - - private void updateDisplay() { - time = mHour + " : " + mMinute; - tvOrderTime.setText(time); - } - - private void back() { - Intent back = new Intent(OrderActivity.this, ShopItemActivity.class); - Bundle bundle = new Bundle(); - bundle.putSerializable("shop", shop); - bundle.putString("shopID", shopID); // 商铺的ID需要单独传递,否则获取到的是null - back.putExtras(bundle); - startActivity(back); - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderInfoActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderInfoActivity$1.class deleted file mode 100644 index 7b359b8..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderInfoActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderInfoActivity$2.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderInfoActivity$2.class deleted file mode 100644 index 1920a25..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderInfoActivity$2.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderInfoActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderInfoActivity.class index 544206e..6dd660a 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderInfoActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderInfoActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderInfoActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderInfoActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index e3c3d26..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/OrderInfoActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,116 +0,0 @@ -package com.stone.shop.view; - -import java.util.ArrayList; -import java.util.List; - -import android.app.Activity; -import android.os.Bundle; -import android.view.MenuItem; -import android.view.View; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemLongClickListener; -import android.widget.ListView; -import android.widget.PopupMenu; -import android.widget.Toast; -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.BmobUser; -import cn.bmob.v3.listener.FindListener; - -import com.stone.shop.R; -import com.stone.shop.adapter.OrderInfoListAdapter; -import com.stone.shop.model.Order; - -/** - * 订单详情页面 - * - * @date 2014-5-27 - * @author Stone - */ -public class OrderInfoActivity extends Activity implements OnItemLongClickListener{ - - private static final String TAG = "OrderInfoActivity"; - - private ListView lvOrderInfo; - private OrderInfoListAdapter orderInfoListAdapter; - private List orderList = new ArrayList(); - - private String type = ""; // now-当前订单 old-历史订单 - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_order_info); - - type = getIntent().getStringExtra("type"); - - initData(); - initView(); - } - - private void initView() { - lvOrderInfo = (ListView) findViewById(R.id.lv_order_info); - orderInfoListAdapter = new OrderInfoListAdapter(this, orderList); - lvOrderInfo.setAdapter(orderInfoListAdapter); - lvOrderInfo.setOnItemLongClickListener(this); - } - - // 初始化列表菜单中数据 - public void initData() { - // 获取用户 - BmobUser user = BmobUser.getCurrentUser(this); - - // 获取小菜订单(数量) - BmobQuery query = new BmobQuery(); - query.order("-updatedAt"); - query.addWhereEqualTo("userName", user.getUsername()); - if(type.equals("now")) { - query.addWhereEqualTo("state", "未取餐"); - } else if(type.equals("old")) { - query.addWhereEqualTo("state", "已取餐"); - } else { - // do nothing - } - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List object) { - if (object.size() == 0) - toast("您还没有订单"); - orderList = object; - // 通知Adapter数据更新 - orderInfoListAdapter.refresh(orderList); - orderInfoListAdapter.notifyDataSetChanged(); - } - - @Override - public void onError(int arg0, String arg1) { - toast("查询失败"); - } - }); - - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - - //订单长按响应事件 - @Override - public boolean onItemLongClick(AdapterView parent, View view, - int position, long id) { - PopupMenu popup = new PopupMenu(this, lvOrderInfo); - popup.getMenuInflater().inflate(R.menu.popup, popup.getMenu()); - - popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { - public boolean onMenuItemClick(MenuItem item) { - Toast.makeText(OrderInfoActivity.this, "Clicked popup menu item " + item.getTitle(), - Toast.LENGTH_SHORT).show(); - return true; - } - }); - - popup.show(); - return false; - }; - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/RegisterActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/RegisterActivity$1.class deleted file mode 100644 index 1db7471..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/RegisterActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/RegisterActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/RegisterActivity.class index b28aa44..beac182 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/RegisterActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/RegisterActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/RegisterActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/RegisterActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index f57ac81..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/RegisterActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,108 +0,0 @@ -package com.stone.shop.view; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import com.stone.shop.R; -import com.stone.shop.model.User; -import com.stone.util.Util; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.EditText; -import android.widget.Toast; -import cn.bmob.v3.listener.SaveListener; - -/** - * 注册界面 - * - * @date 2014-4-24 - * @author Stone - */ -public class RegisterActivity extends Activity implements OnClickListener { - - private static final String TAG = "RegisterActivity"; - - private Button btnReg; - private EditText etUsername; - private EditText etPassword; - private EditText etComfirmPsd; - private EditText etPhone; - - private String username = null; - private String password = null; - private String comfirmPsd = null; - private String phone = null; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_reg); - - etUsername = (EditText) findViewById(R.id.et_username); - etPassword = (EditText) findViewById(R.id.et_password); - etComfirmPsd = (EditText) findViewById(R.id.et_comfirm_psd); - etPhone = (EditText) findViewById(R.id.et_phone); - - btnReg = (Button) findViewById(R.id.btn_reg_now); - btnReg.setOnClickListener(this); - } - - @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.btn_reg_now: - username = etUsername.getText().toString(); - password = etPassword.getText().toString(); - comfirmPsd = etComfirmPsd.getText().toString(); - phone = etPhone.getText().toString(); - if (!Util.isNetworkConnected(this)) { - toast("木有网络 ( ⊙ o ⊙ ) "); - } else if (username.equals("") || password.equals("") || comfirmPsd.equals("") || phone.equals("")) { - toast("不填完整不能拿到身份证, ~~~~(>_<)~~~~ "); - } else if (!comfirmPsd.equals(password)) { - toast("两次密码输入不一致"); - } else if (!Util.isPhoneNumberValid(phone)) { - toast("请输入正确的手机号码"); - } else { - // 开始提交注册信息 - User bu = new User(); - bu.setUsername(username); - bu.setPassword(password); - bu.setPhone(phone); - bu.signUp(this, new SaveListener() { - - @Override - public void onSuccess() { - // TODO Auto-generated method stub - toast("拿到身份证了,快登陆吧"); - Intent backLogin = new Intent(RegisterActivity.this, LoginActivity.class); - startActivity(backLogin); - RegisterActivity.this.finish(); - } - - @Override - public void onFailure(int arg0, String arg1) { - // TODO Auto-generated method stub - toast("该名字已被人使用,换个名字吧."); - } - } - - ); - } - break; - - default: - break; - } - } - - public void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - }; - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity$1.class deleted file mode 100644 index 74a2f31..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity$2$1$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity$2$1$1.class deleted file mode 100644 index 91a52a6..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity$2$1$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity$2$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity$2$1.class deleted file mode 100644 index c8072eb..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity$2$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity$2.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity$2.class deleted file mode 100644 index a9ce27b..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity$2.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity.class index 6812395..25fb35c 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 90bf398..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/ReservationActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,138 +0,0 @@ -package com.stone.shop.view; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -import com.stone.shop.R; -import com.stone.shop.model.Reservation; -import com.stone.shop.model.User; -import com.stone.ui.DateTimePickDialogUtil; -import com.stone.ui.DateTimePickDialogUtil.DateTimeListener; - -import android.app.Activity; -import android.os.Bundle; -import android.text.TextUtils; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.TextView; -import android.widget.Toast; -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.listener.DeleteListener; -import cn.bmob.v3.listener.FindListener; -import cn.bmob.v3.listener.SaveListener; - -public class ReservationActivity extends Activity { - - private Button btn_login; - private SimpleDateFormat dateFormat; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.layout_reservation); - - TextView tv_title = (TextView) findViewById(R.id.tv_title); - tv_title.setText("教室预定"); - - final String roomId = getIntent().getStringExtra("roomId"); - final String roomName = getIntent().getStringExtra("roomName"); - - TextView tv_room = (TextView) findViewById(R.id.tv_room); - tv_room.setText("教室:" + roomName); - - btn_login = (Button) findViewById(R.id.btn_login); - - dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm"); - - // 查找Person表里面id为6b6c11c537的数据 - BmobQuery bmobQuery = new BmobQuery(); - bmobQuery.addWhereEqualTo("userId", User.userId); - bmobQuery.addWhereEqualTo("roomId", roomId); - bmobQuery.findObjects(ReservationActivity.this, new FindListener() { - - @Override - public void onSuccess(List newsList) { - // toast("查询商品成功, 共" + newsList.size()); - if (newsList.size() != 0) { - - String dateTime = newsList.get(0).getDateTime(); - - try { - if (dateFormat.parse(dateTime).before(new Date())) { - - Reservation gameScore = new Reservation(); - gameScore.setObjectId(newsList.get(0).getObjectId()); - gameScore.delete(ReservationActivity.this); - - } else { - btn_login.setEnabled(false); - btn_login.setText("已经预定" + (TextUtils.isEmpty(dateTime) ? "" : (" " + dateTime))); - } - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - } - - @Override - public void onError(int arg0, String arg1) { - toast("查询失败"); - } - }); - - btn_login.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - // TODO Auto-generated method stub - - DateTimePickDialogUtil dateTimePicKDialog = new DateTimePickDialogUtil(ReservationActivity.this, - dateFormat.format(new Date())); - dateTimePicKDialog.dateTimePicKDialog(new DateTimeListener() { - - @Override - public void onDateTimeChane(final String dateTime) { - // TODO Auto-generated method stub - - Reservation reservation = new Reservation(); - reservation.setRoomId(roomId); - reservation.setRoomName(roomName); - reservation.setUserId(User.userId); - reservation.setDateTime(dateTime); - - reservation.save(ReservationActivity.this, new SaveListener() { - - @Override - public void onSuccess() { - // TODO Auto-generated method stub - toast("预定成功"); - btn_login.setEnabled(false); - btn_login.setText("已经预定 " + dateTime); - - } - - @Override - public void onFailure(int arg0, String arg1) { - // TODO Auto-generated method stub - toast("预定失败"); - - } - }); - } - }); - - } - }); - - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopActivity.class index 5204d3e..7a1f0d5 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 01f5159..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,135 +0,0 @@ -package com.stone.shop.view; - -import com.stone.shop.R; -import com.stone.shop.adapter.GridAdapter; -import com.stone.ui.MyGridView; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; -import android.view.animation.Animation; -import android.view.animation.AnimationUtils; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.GridView; -import android.widget.ImageView; -import android.widget.TextView; -import android.widget.Toast; - -/** - * 商品主界面 - * @date 2014-4-24 - * @author Stone - */ -public class ShopActivity extends Activity implements OnItemClickListener{ - - private static final String TAG = "ShopActivity" ; - - private MyGridView gvSchoolClass; //学习小菜 - private MyGridView gvFoodClass; //吃饭小菜 - private MyGridView gvGiftClass; //购物小菜 - private MyGridView gvOutClass; //疯狂小菜 - - //private ImageView imgLoc; - //private ImageView imgSearch; - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_shop); - - initView(); - } - - /** - * 初始化组件并适配数据 - */ - public void initView() { - gvFoodClass = (MyGridView) findViewById(R.id.gv_food_class); - gvGiftClass = (MyGridView) findViewById(R.id.gv_gift_class); - gvOutClass = (MyGridView) findViewById(R.id.gv_out_class); - gvSchoolClass = (MyGridView) findViewById(R.id.gv_school_class); - - gvFoodClass.setAdapter(new GridAdapter(this, 0)); - gvFoodClass.setOnItemClickListener(this); - - gvGiftClass.setAdapter(new GridAdapter(this, 1)); - gvGiftClass.setOnItemClickListener(this); - - gvOutClass.setAdapter(new GridAdapter(this, 2)); - gvOutClass.setOnItemClickListener(this); - - gvSchoolClass.setAdapter(new GridAdapter(this, 3)); - gvSchoolClass.setOnItemClickListener(this); - - } - - @Override - public void onItemClick(AdapterView parent, View view, int position, - long id) { - Log.i("GridView点击了: ", "position"+position); - //toast("点击了: " + position); - switch (parent.getId()) { - - //点击 学习小菜 中的子项(1代表第一个GridView, (position+1)代表GridView中第几个元素) - case R.id.gv_school_class: - //教学类的做特别处理 - if(position==2) { - Intent toInformationActivity = new Intent(ShopActivity.this,InformationActivity.class); - startActivity(toInformationActivity); - } - if(position==1) { - Intent toBXTActivity = new Intent(ShopActivity.this,LibraryActivity.class); - startActivity(toBXTActivity); - } - if(position==0) { - Intent toBXTActivity = new Intent(ShopActivity.this, ClassroomActivity.class); - startActivity(toBXTActivity); - } - - break; - //点击 吃饭小菜 中的子项 - case R.id.gv_food_class: - toShopAllActivity( GridAdapter.mFoodTexts[position], "2"+(position+1) ); - break; - //点击 购物小菜 中的子项 - case R.id.gv_gift_class: - if(position==0) { - Intent toBXTActivity = new Intent(ShopActivity.this, BXTActivity.class); - startActivity(toBXTActivity); - } else { - toShopAllActivity( GridAdapter.mGiftTexts[position], "3"+(position+1) ); - } - break; - //点击 疯狂小菜 中的子项 - case R.id.gv_out_class: - toShopAllActivity( GridAdapter.mOutTexts[position], "4"+(position+1) ); - break; - default: - break; - } - - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - }; - - /** - * - * @param title 父分类标题 - * @param type - */ - private void toShopAllActivity(String title, String type) { - Intent toShopAll = new Intent(ShopActivity.this, ShopAllActivity.class); - toShopAll.putExtra("title", title); - //当前点击的项的父分类 - toShopAll.putExtra("type", type); - startActivity(toShopAll); - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopAllActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopAllActivity$1.class deleted file mode 100644 index 6d201df..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopAllActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopAllActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopAllActivity.class index 87d0a1c..8aa888a 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopAllActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopAllActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopAllActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopAllActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 9dc775b..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopAllActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,120 +0,0 @@ -package com.stone.shop.view; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.listener.FindListener; - -import com.stone.shop.R; -import com.stone.shop.adapter.ShopListAdapter; -import com.stone.shop.model.Shop; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.util.Log; -import android.view.View; -import android.widget.AdapterView; -import android.widget.ListView; -import android.widget.TextView; -import android.widget.Toast; -import android.widget.AdapterView.OnItemClickListener; - -/** - * 某一分类下的所有店铺页面 - * @author Stone - * @date 2014-4-26 - */ -public class ShopAllActivity extends Activity implements OnItemClickListener{ - - private static final String TAG = "ShopAllActivity" ; - - private TextView tvTitle; - private ListView lvShopAllList; - private ShopListAdapter shopListAdapter; - - //记录从ShopActivity中传过来的当前点击项的类型 - private String type; - private List shopList = new ArrayList(); - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_shop_all); - - //得到从上级Activity中传入的Type数据 - type = getIntent().getStringExtra("type"); - - //获取商店数据 - getShopsDate(); - - initView(); - - } - - public void initView() { - //设置标题 - tvTitle = (TextView) findViewById(R.id.tv_title); - tvTitle.setText(getIntent().getStringExtra("title")); - - lvShopAllList = (ListView) findViewById(R.id.lv_shop_all); - shopListAdapter = new ShopListAdapter(this, (ArrayList) shopList, type); - lvShopAllList.setAdapter(shopListAdapter); - lvShopAllList.setOnItemClickListener(this); - - } - - @Override - public void onItemClick(AdapterView parent, View view, int position, - long id) { - //toast("点击了: " + position); - //将当前点击的Shop对象传递给下一个Activity - Intent toShopItem = new Intent(ShopAllActivity.this, ShopItemActivity.class); - Bundle bundle = new Bundle(); - bundle.putSerializable("shop", shopList.get(position) ); - bundle.putString("shopID", shopList.get(position).getObjectId()); //商铺的ID需要单独传递,否则获取到的是null - Log.i(TAG, ">>发出>>" + "shopID: "+shopList.get(position).getObjectId()+" shopName: "+shopList.get(position).getName()); - toShopItem.putExtras(bundle); - startActivity(toShopItem); - } - - /** - * 加载当前分类的所有店铺到ListView中 - */ - private void getShopsDate() { - BmobQuery query = new BmobQuery(); - query.order("-updatedAt"); - Shop shop = new Shop(); - shop.setType(type); - query.addWhereEqualTo("type", shop.getType()); // 查询当前类型的所有店铺 - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List object) { - //toast("查询成功. 共计" + object.size()); - if(object.size()==0) - toast("还没开张, 耐心等待吧"); - shopList = object; - // 通知Adapter数据更新 - shopListAdapter.refresh((ArrayList) shopList); - shopListAdapter.notifyDataSetChanged(); - - } - - @Override - public void onError(int arg0, String msg) { - toast("查询失败:"+msg); - } - - }); - } - - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - }; - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopItemActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopItemActivity$1.class deleted file mode 100644 index e2b7e8f..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopItemActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopItemActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopItemActivity.class index 1832e70..5259b26 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopItemActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopItemActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopItemActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopItemActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 4b65a2a..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/ShopItemActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,313 +0,0 @@ -package com.stone.shop.view; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import android.app.Activity; -import android.content.Intent; -import android.graphics.Color; -import android.os.Bundle; -import android.support.v4.view.PagerTabStrip; -import android.support.v4.view.PagerTitleStrip; -import android.support.v4.view.ViewPager; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.Button; -import android.widget.EditText; -import android.widget.ImageView; -import android.widget.LinearLayout; -import android.widget.ListView; -import android.widget.TextView; -import android.widget.Toast; -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.BmobQuery.CachePolicy; -import cn.bmob.v3.listener.FindListener; - -import com.stone.shop.R; -import com.stone.shop.adapter.GoodsListAdapter; -import com.stone.shop.adapter.ViewPagerAdapter; -import com.stone.shop.model.Good; -import com.stone.shop.model.Shop; -import com.stone.ui.ViewPagerCompat; - -public class ShopItemActivity extends Activity implements OnClickListener, OnItemClickListener{ - - private static final String TAG = "ShopItemActivity"; - - // ViewPager页 - private View view1, view2; // - private ViewPagerCompat viewPager; // viewpager - private ViewPagerAdapter shopViewPagerAdapter; - private PagerTitleStrip pagerTitleStrip; // viewpager的标题 - private PagerTabStrip pagerTabStrip; // 一个viewpager的指示器,效果就是一个横的粗的下划线 - private List viewList; // 把需要滑动的页卡添加到这个list中 - private List titleList; // viewpager的标题 - - // 店铺商品列表 - private ListView lvGoodsList; - private GoodsListAdapter goodsListAdapter; - private Button btnBuyGood; - - // 店铺简介页中的控件 - private TextView tvShopName; // 店铺名 - private TextView tvShopInfo; // 店铺简介 - private TextView tvShopSale; // 店铺促销信息 - private TextView tvShopLoc; // 店铺地理位置 - private TextView tvShopPhone; // 店铺电话 - private Button btnCommit; - private EditText etCommit; - private LinearLayout llCommitParent; // 评论父线性布局 - private LinearLayout llCommitSon; // 评论子线性布局 - private ImageView imgCall; // 拨打电话 - - // UI测试数据 - private static List goodsList; - - // 从上级页面中传入的数据 - private Shop shop; // 当期选择的Shop - private Good selectGood; - private String shopID; // 当前选择的Shop的ID - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_shop_item); - - // 获取到从ShopAllActivity中传递过来的Shop对象 - shop = (Shop) getIntent().getSerializableExtra("shop"); - shopID = getIntent().getStringExtra("shopID"); - Log.i(TAG, "<<收到<<" + "shopID: " + shop.getObjectId() + " shopName: " - + shop.getName()); - Log.i(TAG, - "<<收到<<" + "shopID: " + shopID + " shopName: " + shop.getName()); - - // 初始化商品页面以及适配数据 - initGoodsDate(); - initView(); - - - } - - public void initView() { - - viewPager = (ViewPagerCompat) findViewById(R.id.viewpager); - pagerTabStrip = (PagerTabStrip) findViewById(R.id.pagertab); - pagerTabStrip.setTabIndicatorColor(Color.rgb(255, 0, 0)); - pagerTabStrip.setDrawFullUnderline(false); - pagerTabStrip.setTextSpacing(50); - pagerTabStrip.setTextColor(Color.rgb(255, 0, 0)); - - view1 = LayoutInflater.from(this) - .inflate(R.layout.viewpager_menu, null); - view2 = LayoutInflater.from(this).inflate(R.layout.viewpager_shopinfo, - null); - - initContentView(); - - viewList = new ArrayList();// 将要分页显示的View装入数组中 - viewList.add(view1); - viewList.add(view2); - - titleList = new ArrayList();// 每个页面的Title数据 - titleList.add("商品"); - titleList.add("店铺简介"); - shopViewPagerAdapter = new ViewPagerAdapter(viewList, titleList); - - viewPager.setAdapter(shopViewPagerAdapter); - viewPager.setCurrentItem(0); - - } - - /** - * 获取某一商店的所有商品 - * - * @date 2014-5-1 - * @autor Stone - */ - public void initGoodsDate() { - goodsList = new ArrayList(); - goodsListAdapter = new GoodsListAdapter(this, goodsList); - BmobQuery query = new BmobQuery(); - query.addWhereEqualTo("shopID", shopID); - query.setCachePolicy(CachePolicy.CACHE_ELSE_NETWORK); // - // 先从缓存取数据,如果没有,再从网络取。 - query.setLimit(15); // 限制最多15个结果 - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List goods) { - // toast("查询商品成功, 共" + goods.size()); - if (goods.size() == 0) { - toast("该店还没有添加商品"); - } - goodsList = goods; - goodsListAdapter.refresh(goodsList); - goodsListAdapter.notifyDataSetChanged(); - } - - @Override - public void onError(int arg0, String arg1) { - toast("查询失败"); - } - }); - - } - - public void initContentView() { - // 商品列表页 - lvGoodsList = (ListView) view1.findViewById(R.id.lv_goods_list); - lvGoodsList.setAdapter(goodsListAdapter); - lvGoodsList.setOnItemClickListener(this); - - // 店铺简介页 - tvShopName = (TextView) view2.findViewById(R.id.tv_shop_title); - tvShopInfo = (TextView) view2.findViewById(R.id.tv_shop_introduce); - tvShopSale = (TextView) view2.findViewById(R.id.tv_shop_promotion); - tvShopLoc = (TextView) view2.findViewById(R.id.tv_shop_location); - tvShopPhone = (TextView) view2.findViewById(R.id.tv_shop_phone); - tvShopName.setText(shop.getName()); // 设置店铺名 - tvShopInfo.setText(shop.getInfo()); // 设置店铺简介 - tvShopSale.setText(shop.getSale()); // 设置店铺公告 - tvShopLoc.setText("位置:" + "二食堂二楼"); // 设置店铺位置 - tvShopPhone.setText("电话:" + shop.getPhone()); // 设置店铺联系电话 - - btnCommit = (Button) view2.findViewById(R.id.btn_commit); - btnCommit.setOnClickListener(this); - - // 获取到评论的布局 - etCommit = (EditText) view2.findViewById(R.id.et_commit); - llCommitParent = (LinearLayout) view2 - .findViewById(R.id.ll_commit_parent_view); - llCommitSon = (LinearLayout) findViewById(R.id.ll_commit_son_view); - - imgCall = (ImageView) view2.findViewById(R.id.img_call); - imgCall.setOnClickListener(this); - - } - - /** - * 添加一条评论 - * - * @param user - * @param content - */ - public void insertCommit(String user, String content) { - View view = LayoutInflater.from(this).inflate(R.layout.commit, null); - TextView tvUser = (TextView) view.findViewById(R.id.tv_commit_user); - TextView tvContent = (TextView) view - .findViewById(R.id.tv_commit_content); - tvUser.setText(user); - tvContent.setText(content); - llCommitParent.addView(view); - tvUser = null; - tvContent = null; - } - -// public void clickBuyGood(View v) { -// Intent toOrderActivity = new Intent(ShopItemActivity.this, OrderActivity.class); -// Bundle bundle = new Bundle(); -// bundle.putSerializable("shop", shop ); -// bundle.putString("shopID", shopID); //商铺的ID需要单独传递,否则获取到的是null -// toOrderActivity.putExtras(bundle); -// startActivity(toOrderActivity); -// //------------------------------------------------------------------- -// toast("亲, 记得在弹出的对话框中选择数量哦"); -// Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake); -// lvGoodsList.startAnimation(shake); -// -// // 显示订单对话框 -// orderDlg = new DialogOrder(this, R.style.MyDialog); -// orderDlg.show(); -// // 得到订单对话框的View -// LayoutInflater factory = LayoutInflater.from(this); -// dlgOrderView = factory.inflate(R.layout.dlg_order, null); -// tvOrderCount = (TextView) dlgOrderView -// .findViewById(R.id.tv_order_count); -// etOrderPhone = (EditText) dlgOrderView -// .findViewById(R.id.et_order_phone); -// etOrderWords = (EditText) dlgOrderView -// .findViewById(R.id.et_order_phone); -// ; -// btnOrderCount = (Button) dlgOrderView -// .findViewById(R.id.btn_order_count); -// btnOrderSubmit = (Button) dlgOrderView -// .findViewById(R.id.btn_order_submit); -// btnOrderCount.setOnClickListener(this); -// btnOrderSubmit.setOnClickListener(this); -// //------------------------------------------------------------------- -// } - - @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.btn_commit: - if (etCommit.getText().toString().equals("")) { - toast("亲,先写一句吧"); - } else { - SimpleDateFormat formatter = new SimpleDateFormat( - "yyyy年MM月dd日 HH:mm:ss "); - Date curDate = new Date(System.currentTimeMillis());// 获取当前时间 - String time = formatter.format(curDate); - String content = etCommit.getText().toString() + " [ " + time - + " ] "; - insertCommit("admin" + ":", content); - etCommit.setText(""); - } - break; - - case R.id.img_call: - toast("店主没有留下电话"); - break; - - default: - break; - } - - } - - @Override - public void onItemClick(AdapterView parent, View view, int position, - long id) { - switch (viewPager.getCurrentItem()) { - case 0: - toast("选择的商品名称: " + goodsList.get(position).getName()); - selectGood = goodsList.get(position); - toast("点击了购买按钮"); - Intent toOrderActivity = new Intent(ShopItemActivity.this, OrderActivity.class); - Bundle bundle = new Bundle(); - bundle.putSerializable("shop", shop ); - bundle.putSerializable("good", selectGood); - bundle.putString("shopID", shopID); //商铺的ID需要单独传递,否则获取到的是null - toOrderActivity.putExtras(bundle); - startActivity(toOrderActivity); - //toast("点击了Position " + position); -// if(view.getId() == R.id.btn_buy_good) { -// toast("点击了购买按钮"); -// Intent toOrderActivity = new Intent(ShopItemActivity.this, OrderActivity.class); -// Bundle bundle = new Bundle(); -// bundle.putSerializable("shop", shop ); -// bundle.putSerializable("good", selectGood); -// bundle.putString("shopID", shopID); //商铺的ID需要单独传递,否则获取到的是null -// toOrderActivity.putExtras(bundle); -// startActivity(toOrderActivity); -// } - break; - case 1: - break; - default: - break; - } - - } - - public void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/SplashActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/SplashActivity$1.class deleted file mode 100644 index 8a23c90..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/SplashActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/SplashActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/SplashActivity.class index 3dd19d8..9887958 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/SplashActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/SplashActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/SplashActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/SplashActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 4ef6a65..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/SplashActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,75 +0,0 @@ -package com.stone.shop.view; - -import com.stone.shop.R; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.view.animation.AlphaAnimation; -import android.view.animation.Animation; -import android.view.animation.Animation.AnimationListener; -import android.view.animation.AnimationSet; -import android.view.animation.RotateAnimation; -import android.view.animation.ScaleAnimation; -import android.widget.RelativeLayout; - -public class SplashActivity extends Activity { - private RelativeLayout rlSplash; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - initView(); - initAnimation(); - } - - private void initView() { - setContentView(R.layout.activity_splash); - rlSplash = (RelativeLayout) findViewById(R.id.rl_splash); - } - - private void initAnimation() { - AnimationSet set = new AnimationSet(false); - RotateAnimation rtAnimation = new RotateAnimation(0, 360, - Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, - 0.5f); - rtAnimation.setDuration(2000); - rtAnimation.setFillAfter(true); - - ScaleAnimation scAnimation = new ScaleAnimation(0, 1, 0, 1, - Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, - 0.5f); - scAnimation.setDuration(2000); - scAnimation.setFillAfter(true); - - AlphaAnimation alAnimation = new AlphaAnimation(0, 1); - alAnimation.setDuration(2000); - alAnimation.setFillAfter(true); - - set.addAnimation(rtAnimation); - set.addAnimation(scAnimation); - set.addAnimation(alAnimation); - - set.setAnimationListener(new AnimationListener() { - - @Override - public void onAnimationStart(Animation arg0) { - - } - - @Override - public void onAnimationRepeat(Animation arg0) { - - } - - @Override - public void onAnimationEnd(Animation arg0) { - startActivity(new Intent(SplashActivity.this, - MultiScreenActivity.class)); - finish(); - } - }); - - rlSplash.startAnimation(set); - } -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/UserInfoActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/UserInfoActivity.class index 2e1050f..c27a813 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/UserInfoActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/UserInfoActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/WsqActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/WsqActivity$1.class deleted file mode 100644 index 1dfe8aa..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/WsqActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/WsqActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/WsqActivity.class index f1d0e71..9721511 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/WsqActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/WsqActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/WsqActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/WsqActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 0b1947e..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/WsqActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,60 +0,0 @@ -package com.stone.shop.view; - -import android.app.Activity; -import android.os.Bundle; -import android.webkit.WebChromeClient; -import android.webkit.WebView; -import android.webkit.WebViewClient; -import android.widget.Toast; - -import com.stone.shop.R; - -/** - * 购物车主界面 - * @date 2014-4-24 - * @author Stone - */ -public class WsqActivity extends Activity { - - private static final String TAG = "CarActivity"; - - private static final String URL_WSQ = "http://wx.wsq.qq.com/231782938"; - private WebView wsqWebView; - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_car); - - wsqWebView = (WebView) findViewById(R.id.wv_wsq); - - // ----------------------------------------------------------------- - - wsqWebView.getSettings().setJavaScriptEnabled(true); // 设置使用够执行JS脚本 - //wsqWebView.getSettings().setBuiltInZoomControls(true); // 设置使支持缩放 - wsqWebView.getSettings().setDefaultFontSize(12); - wsqWebView.setWebChromeClient(new WebChromeClient()); - wsqWebView.setWebViewClient(new WebViewClient() { - @Override - public boolean shouldOverrideUrlLoading(WebView view, - String url) { - view.loadUrl(url);// 使用当前WebView处理跳转 - return true;// true表示此事件在此处被处理,不需要再广播 - } - - @Override - // 转向错误时的处理 - public void onReceivedError(WebView view, int errorCode, - String description, String failingUrl) { - Toast.makeText(WsqActivity.this, - "Oh no! " + description, Toast.LENGTH_SHORT) - .show(); - } - }); - wsqWebView.loadUrl(URL_WSQ); - // ------------------------------------------------ - - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/old/OldAboutActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/old/OldAboutActivity.class index 53167c8..a4188e0 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/old/OldAboutActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/old/OldAboutActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/old/OldMineActivity$1.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/old/OldMineActivity$1.class deleted file mode 100644 index 7804c8b..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/old/OldMineActivity$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/old/OldMineActivity.class b/代码/在这里3.0/bin/classes/com/stone/shop/view/old/OldMineActivity.class index 1645ebf..eb9119f 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/shop/view/old/OldMineActivity.class and b/代码/在这里3.0/bin/classes/com/stone/shop/view/old/OldMineActivity.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/shop/view/old/OldMineActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/shop/view/old/OldMineActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index a8886c8..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/shop/view/old/OldMineActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,166 +0,0 @@ -package com.stone.shop.view.old; - -import java.util.List; - -import javax.security.auth.PrivateCredentialPermission; - -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.BmobUser; -import cn.bmob.v3.listener.FindListener; - -import com.stone.shop.R; -import com.stone.shop.model.User; -import com.stone.shop.view.AboutActivity; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; -import android.view.animation.Animation; -import android.view.animation.AnimationUtils; -import android.widget.Button; -import android.widget.TextView; -import android.widget.Toast; - -/** - * 个人中心主界面 - * @date 2014-4-24 - * @author Stone - */ -public class OldMineActivity extends Activity implements OnClickListener{ - - private static final String TAG = "OldMineActivity" ; - - private Button btnAbout; - private Button btnContact; - private Button btnJoin; - - private TextView tvUserName; //当前用户的用户名 - private TextView tvSchool; //学校 - private TextView tvCademy; //学院 - private TextView tvDorPart; //所在区 西区 - private TextView tvDorNum; //宿舍楼号 19栋 - - private TextView tvMe; //我 - private TextView tvXiaoCai; //小菜 - private TextView tvBowl; //饭碗 - private User user = new User(); - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_mine_old); - - BmobUser user = BmobUser.getCurrentUser(this); - Log.i(TAG, "BmobUser.userName = " + user.getUsername()); - getCurUser(user.getUsername()); - - initView(); - } - - public void initView() { - - tvUserName = (TextView) findViewById(R.id.tv_username); - tvSchool = (TextView) findViewById(R.id.tv_school); - tvCademy = (TextView) findViewById(R.id.tv_cademy); - tvDorPart = (TextView) findViewById(R.id.tv_dorPart); - tvDorNum = (TextView) findViewById(R.id.tv_dorNum); - - btnAbout = (Button) findViewById(R.id.btn_about); - btnContact = (Button) findViewById(R.id.btn_contact); - btnJoin = (Button) findViewById(R.id.btn_share); - - tvUserName = (TextView) findViewById(R.id.tv_username); - tvMe = (TextView) findViewById(R.id.tv_me); - tvXiaoCai = (TextView) findViewById(R.id.tv_xiaocai); - tvBowl = (TextView) findViewById(R.id.tv_bowl); - - btnAbout.setOnClickListener(this); - btnContact.setOnClickListener(this); - btnJoin.setOnClickListener(this); - - tvMe.setOnClickListener(this); - tvXiaoCai.setOnClickListener(this); - tvBowl.setOnClickListener(this); - } - - //获得当前用户User类型 - public void getCurUser(String username) { - BmobQuery query = new BmobQuery(); - query.addWhereEqualTo("username", username); - query.findObjects(this, new FindListener() { - @Override - public void onSuccess(List object) { - if(object.size()==1) - user = object.get(0); - else - user = null; - loadData(); - //toast("查询到:" + object.size()); - } - - @Override - public void onError(int arg0, String arg1) { - toast("获取信息失败"); - } - }); - } - - //加载查询到的用户数据 - public void loadData() { - //toast("加载数据中..."); - tvUserName.setText(user.getUsername()); - tvSchool.setText(user.getSchool()); - tvCademy.setText(user.getCademy()); - tvDorPart.setText(user.getDorPart()); - tvDorNum.setText(user.getDorNum()); - } - - @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.btn_share: - Intent toShare = new Intent(Intent.ACTION_SEND); - toShare.setType("text/plain"); - toShare.putExtra(Intent.EXTRA_SUBJECT, "分享"); - toShare.putExtra(Intent.EXTRA_TEXT, "在这里" +"\n" + "针对NUDT三号狱的在这里测试版上线了,赶紧下载体验吧" - + "http://xiaocai.bmob.cn"); - startActivity(Intent.createChooser(toShare, "分享到")); - break; - case R.id.tv_me: - startAnim(R.id.tv_me); - break; - case R.id.tv_xiaocai: - startAnim(R.id.tv_xiaocai); - break; - case R.id.tv_bowl: - startAnim(R.id.tv_bowl); - break; - default: - Intent toAbout = new Intent(OldMineActivity.this, AboutActivity.class); - startActivity(toAbout); - break; - } - } - - //点击文字动画 - private void startAnim(int id){ - Animation scale = AnimationUtils.loadAnimation(this, R.anim.shake); - if(id == R.id.tv_me) - tvMe.startAnimation(scale); - else if(id == R.id.tv_xiaocai) - tvXiaoCai.startAnimation(scale); - else if(id == R.id.tv_bowl) - tvBowl.startAnimation(scale); - else { } - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - - - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/ui/AutoScrollViewPager.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/ui/AutoScrollViewPager.java~remotes_origin_zhaozaichun deleted file mode 100644 index 0d542cd..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/ui/AutoScrollViewPager.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,337 +0,0 @@ -package com.stone.ui; - -import java.lang.reflect.Field; - -import android.content.Context; -import android.os.Handler; -import android.os.Message; -import android.support.v4.view.PagerAdapter; -import android.support.v4.view.ViewPager; -import android.util.AttributeSet; -import android.view.MotionEvent; -import android.view.animation.Interpolator; - -/** - * Auto Scroll View Pager - *
    - * Basic Setting and Usage - *
  • {@link #startAutoScroll()} start auto scroll, or {@link #startAutoScroll(int)} start auto scroll delayed
  • - *
  • {@link #stopAutoScroll()} stop auto scroll
  • - *
  • {@link #setInterval(long)} set auto scroll time in milliseconds, default is {@link #DEFAULT_INTERVAL}
  • - *
- *
    - * Advanced Settings and Usage - *
  • {@link #setDirection(int)} set auto scroll direction
  • - *
  • {@link #setCycle(boolean)} set whether automatic cycle when auto scroll reaching the last or first item, default - * is true
  • - *
  • {@link #setSlideBorderMode(int)} set how to process when sliding at the last or first item
  • - *
  • {@link #setStopScrollWhenTouch(boolean)} set whether stop auto scroll when touching, default is true
  • - *
- * - * @author Trinea 2013-12-30 - */ -public class AutoScrollViewPager extends ViewPager { - public static final int DEFAULT_INTERVAL = 1500; - - public static final int LEFT = 0; - public static final int RIGHT = 1; - - /** do nothing when sliding at the last or first item **/ - public static final int SLIDE_BORDER_MODE_NONE = 0; - /** cycle when sliding at the last or first item **/ - public static final int SLIDE_BORDER_MODE_CYCLE = 1; - /** deliver event to parent when sliding at the last or first item **/ - public static final int SLIDE_BORDER_MODE_TO_PARENT = 2; - - /** auto scroll time in milliseconds, default is {@link #DEFAULT_INTERVAL} **/ - private long interval = DEFAULT_INTERVAL; - /** auto scroll direction, default is {@link #RIGHT} **/ - private int direction = RIGHT; - /** whether automatic cycle when auto scroll reaching the last or first item, default is true **/ - private boolean isCycle = true; - /** whether stop auto scroll when touching, default is true **/ - private boolean stopScrollWhenTouch = true; - /** how to process when sliding at the last or first item, default is {@link #SLIDE_BORDER_MODE_NONE} **/ - private int slideBorderMode = SLIDE_BORDER_MODE_NONE; - /** whether animating when auto scroll at the last or first item **/ - private boolean isBorderAnimation = true; - - private Handler handler; - private boolean isAutoScroll = false; - private boolean isStopByTouch = false; - private float touchX = 0f, downX = 0f; - private CustomDurationScroller scroller = null; - - public static final int SCROLL_WHAT = 0; - - public AutoScrollViewPager(Context paramContext){ - super(paramContext); - init(); - } - - public AutoScrollViewPager(Context paramContext, AttributeSet paramAttributeSet){ - super(paramContext, paramAttributeSet); - init(); - } - - private void init() { - handler = new MyHandler(); - setViewPagerScroller(); - } - - /** - * start auto scroll, first scroll delay time is {@link #getInterval()} - */ - public void startAutoScroll() { - isAutoScroll = true; - sendScrollMessage(interval); - } - - /** - * start auto scroll - * - * @param delayTimeInMills first scroll delay time - */ - public void startAutoScroll(int delayTimeInMills) { - isAutoScroll = true; - sendScrollMessage(delayTimeInMills); - } - - /** - * stop auto scroll - */ - public void stopAutoScroll() { - isAutoScroll = false; - handler.removeMessages(SCROLL_WHAT); - } - - /** - * set the factor by which the duration of sliding animation will change - */ - public void setScrollDurationFactor(double scrollFactor) { - scroller.setScrollDurationFactor(scrollFactor); - } - - private void sendScrollMessage(long delayTimeInMills) { - /** remove messages before, keeps one message is running at most **/ - handler.removeMessages(SCROLL_WHAT); - handler.sendEmptyMessageDelayed(SCROLL_WHAT, delayTimeInMills); - } - - /** - * set ViewPager scroller to change animation duration when sliding - */ - private void setViewPagerScroller() { - try { - Field scrollerField = ViewPager.class.getDeclaredField("mScroller"); - scrollerField.setAccessible(true); - Field interpolatorField = ViewPager.class.getDeclaredField("sInterpolator"); - interpolatorField.setAccessible(true); - - scroller = new CustomDurationScroller(getContext(), (Interpolator)interpolatorField.get(null)); - scrollerField.set(this, scroller); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * scroll only once - */ - public void scrollOnce() { - PagerAdapter adapter = getAdapter(); - int currentItem = getCurrentItem(); - int totalCount; - if (adapter == null || (totalCount = adapter.getCount()) <= 1) { - return; - } - - int nextItem = (direction == LEFT) ? --currentItem : ++currentItem; - if (nextItem < 0) { - if (isCycle) { - setCurrentItem(totalCount - 1, isBorderAnimation); - } - } else if (nextItem == totalCount) { - if (isCycle) { - setCurrentItem(0, isBorderAnimation); - } - } else { - setCurrentItem(nextItem, true); - } - } - - /** - *
    - * if stopScrollWhenTouch is true - *
  • if event is down, stop auto scroll.
  • - *
  • if event is up, start auto scroll again.
  • - *
- */ - @Override - public boolean onTouchEvent(MotionEvent ev) { - if (stopScrollWhenTouch) { - if (ev.getAction() == MotionEvent.ACTION_DOWN && isAutoScroll) { - isStopByTouch = true; - stopAutoScroll(); - } else if (ev.getAction() == MotionEvent.ACTION_UP && isStopByTouch) { - startAutoScroll(); - } - } - - if (slideBorderMode == SLIDE_BORDER_MODE_TO_PARENT || slideBorderMode == SLIDE_BORDER_MODE_CYCLE) { - touchX = ev.getX(); - if (ev.getAction() == MotionEvent.ACTION_DOWN) { - downX = touchX; - } - int currentItem = getCurrentItem(); - PagerAdapter adapter = getAdapter(); - int pageCount = adapter == null ? 0 : adapter.getCount(); - /** - * current index is first one and slide to right or current index is last one and slide to left.
- * if slide border mode is to parent, then requestDisallowInterceptTouchEvent false.
- * else scroll to last one when current item is first one, scroll to first one when current item is last - * one. - */ - if ((currentItem == 0 && downX <= touchX) || (currentItem == pageCount - 1 && downX >= touchX)) { - if (slideBorderMode == SLIDE_BORDER_MODE_TO_PARENT) { - getParent().requestDisallowInterceptTouchEvent(false); - } else { - if (pageCount > 1) { - setCurrentItem(pageCount - currentItem - 1, isBorderAnimation); - } - getParent().requestDisallowInterceptTouchEvent(true); - } - return super.onTouchEvent(ev); - } - } - getParent().requestDisallowInterceptTouchEvent(true); - return super.onTouchEvent(ev); - } - - private class MyHandler extends Handler { - - @Override - public void handleMessage(Message msg) { - super.handleMessage(msg); - - switch (msg.what) { - case SCROLL_WHAT: - scrollOnce(); - sendScrollMessage(interval); - default: - break; - } - } - } - - /** - * get auto scroll time in milliseconds, default is {@link #DEFAULT_INTERVAL} - * - * @return the interval - */ - public long getInterval() { - return interval; - } - - /** - * set auto scroll time in milliseconds, default is {@link #DEFAULT_INTERVAL} - * - * @param interval the interval to set - */ - public void setInterval(long interval) { - this.interval = interval; - } - - /** - * get auto scroll direction - * - * @return {@link #LEFT} or {@link #RIGHT}, default is {@link #RIGHT} - */ - public int getDirection() { - return (direction == LEFT) ? LEFT : RIGHT; - } - - /** - * set auto scroll direction - * - * @param direction {@link #LEFT} or {@link #RIGHT}, default is {@link #RIGHT} - */ - public void setDirection(int direction) { - this.direction = direction; - } - - /** - * whether automatic cycle when auto scroll reaching the last or first item, default is true - * - * @return the isCycle - */ - public boolean isCycle() { - return isCycle; - } - - /** - * set whether automatic cycle when auto scroll reaching the last or first item, default is true - * - * @param isCycle the isCycle to set - */ - public void setCycle(boolean isCycle) { - this.isCycle = isCycle; - } - - /** - * whether stop auto scroll when touching, default is true - * - * @return the stopScrollWhenTouch - */ - public boolean isStopScrollWhenTouch() { - return stopScrollWhenTouch; - } - - /** - * set whether stop auto scroll when touching, default is true - * - * @param stopScrollWhenTouch - */ - public void setStopScrollWhenTouch(boolean stopScrollWhenTouch) { - this.stopScrollWhenTouch = stopScrollWhenTouch; - } - - /** - * get how to process when sliding at the last or first item - * - * @return the slideBorderMode {@link #SLIDE_BORDER_MODE_NONE}, {@link #SLIDE_BORDER_MODE_TO_PARENT}, - * {@link #SLIDE_BORDER_MODE_CYCLE}, default is {@link #SLIDE_BORDER_MODE_NONE} - */ - public int getSlideBorderMode() { - return slideBorderMode; - } - - /** - * set how to process when sliding at the last or first item - * - * @param slideBorderMode {@link #SLIDE_BORDER_MODE_NONE}, {@link #SLIDE_BORDER_MODE_TO_PARENT}, - * {@link #SLIDE_BORDER_MODE_CYCLE}, default is {@link #SLIDE_BORDER_MODE_NONE} - */ - public void setSlideBorderMode(int slideBorderMode) { - this.slideBorderMode = slideBorderMode; - } - - /** - * whether animating when auto scroll at the last or first item, default is true - * - * @return - */ - public boolean isBorderAnimation() { - return isBorderAnimation; - } - - /** - * set whether animating when auto scroll at the last or first item, default is true - * - * @param isBorderAnimation - */ - public void setBorderAnimation(boolean isBorderAnimation) { - this.isBorderAnimation = isBorderAnimation; - } - -} diff --git a/代码/在这里3.0/bin/classes/com/stone/ui/CustomDurationScroller.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/ui/CustomDurationScroller.java~remotes_origin_zhaozaichun deleted file mode 100644 index 6155603..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/ui/CustomDurationScroller.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,47 +0,0 @@ -package com.stone.ui; - -import android.content.Context; -import android.view.animation.Interpolator; -import android.widget.Scroller; - - -/** - * CustomDurationScroller - * - * @author Trinea 2014-3-2 - */ -public class CustomDurationScroller extends Scroller { - private double scrollFactor = 2; - - public CustomDurationScroller(Context context){ - super(context); - } - - public CustomDurationScroller(Context context, Interpolator interpolator){ - super(context, interpolator); - } - - /** - * not exist in android 2.3 - * - * @param context - * @param interpolator - * @param flywheel - */ - // @SuppressLint("NewApi") - // public CustomDurationScroller(Context context, Interpolator interpolator, boolean flywheel){ - // super(context, interpolator, flywheel); - // } - - /** - * Set the factor by which the duration will change - */ - public void setScrollDurationFactor(double scrollFactor) { - this.scrollFactor = scrollFactor; - } - - @Override - public void startScroll(int startX, int startY, int dx, int dy, int duration) { - super.startScroll(startX, startY, dx, dy, (int)(duration * scrollFactor)); - } -} diff --git a/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil$1.class b/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil$1.class deleted file mode 100644 index 2650c7e..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil$1.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil$2.class b/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil$2.class deleted file mode 100644 index 82c0e7b..0000000 Binary files a/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil$2.class and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil$DateTimeListener.class b/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil$DateTimeListener.class index ecd71fa..eb34604 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil$DateTimeListener.class and b/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil$DateTimeListener.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil.class b/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil.class index 84f3de9..0d16eb9 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil.class and b/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil.java~remotes_origin_zhaozaichun deleted file mode 100644 index 6ba2bfe..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/ui/DateTimePickDialogUtil.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,188 +0,0 @@ -package com.stone.ui; - -import java.text.SimpleDateFormat; -import java.util.Calendar; - -import com.stone.shop.R; - -import android.app.Activity; -import android.app.AlertDialog; -import android.content.DialogInterface; -import android.widget.DatePicker; -import android.widget.DatePicker.OnDateChangedListener; -import android.widget.EditText; -import android.widget.LinearLayout; -import android.widget.TimePicker; -import android.widget.TimePicker.OnTimeChangedListener; - -/** - * 日期时间选择控件 使用方法: private EditText inputDate;//需要设置的日期时间文本编辑框 private String - * initDateTime="2012年9月3日 14:44",//初始日期时间值 在点击事件中使用: - * inputDate.setOnClickListener(new OnClickListener() { - * - * @Override public void onClick(View v) { DateTimePickDialogUtil - * dateTimePicKDialog=new - * DateTimePickDialogUtil(SinvestigateActivity.this,initDateTime); - * dateTimePicKDialog.dateTimePicKDialog(inputDate); - * - * } }); - * - * @author - */ -public class DateTimePickDialogUtil implements OnDateChangedListener, OnTimeChangedListener { - private DatePicker datePicker; - private TimePicker timePicker; - private AlertDialog ad; - private String dateTime; - private String initDateTime; - private Activity activity; - private DateTimeListener dateTimeListener; - - /** - * 日期时间弹出选择框构造函数 - * - * @param activity - * :调用的父activity - * @param initDateTime - * 初始日期时间值,作为弹出窗口的标题和日期时间初始值 - */ - public DateTimePickDialogUtil(Activity activity, String initDateTime) { - this.activity = activity; - this.initDateTime = initDateTime; - - } - - public void init(DatePicker datePicker, TimePicker timePicker) { - Calendar calendar = Calendar.getInstance(); - if (!(null == initDateTime || "".equals(initDateTime))) { - calendar = this.getCalendarByInintData(initDateTime); - } else { - initDateTime = calendar.get(Calendar.YEAR) + "年" + calendar.get(Calendar.MONTH) + "月" - + calendar.get(Calendar.DAY_OF_MONTH) + "日 " + calendar.get(Calendar.HOUR_OF_DAY) + ":" - + calendar.get(Calendar.MINUTE); - } - - datePicker.init(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), - this); - timePicker.setCurrentHour(calendar.get(Calendar.HOUR_OF_DAY)); - timePicker.setCurrentMinute(calendar.get(Calendar.MINUTE)); - } - - /** - * 弹出日期时间选择框方法 - * - * @param inputDate - * :为需要设置的日期时间文本编辑框 - * @return - */ - public AlertDialog dateTimePicKDialog(final DateTimeListener dateTimeListener) { - LinearLayout dateTimeLayout = (LinearLayout) activity.getLayoutInflater().inflate(R.layout.common_datetime, - null); - datePicker = (DatePicker) dateTimeLayout.findViewById(R.id.datepicker); - timePicker = (TimePicker) dateTimeLayout.findViewById(R.id.timepicker); - init(datePicker, timePicker); - timePicker.setIs24HourView(true); - timePicker.setOnTimeChangedListener(this); - - ad = new AlertDialog.Builder(activity).setTitle(initDateTime).setView(dateTimeLayout) - .setPositiveButton("设置", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - - if (dateTimeListener != null) { - dateTimeListener.onDateTimeChane(dateTime); - } - } - }).setNegativeButton("取消", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - - } - }).show(); - - onDateChanged(null, 0, 0, 0); - return ad; - } - - public void onTimeChanged(TimePicker view, int hourOfDay, int minute) { - onDateChanged(null, 0, 0, 0); - } - - public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) { - // 获得日历实例 - Calendar calendar = Calendar.getInstance(); - - calendar.set(datePicker.getYear(), datePicker.getMonth(), datePicker.getDayOfMonth(), - timePicker.getCurrentHour(), timePicker.getCurrentMinute()); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm"); - - dateTime = sdf.format(calendar.getTime()); - ad.setTitle(dateTime); - } - - /** - * 实现将初始日期时间2012年07月02日 16:45 拆分成年 月 日 时 分 秒,并赋值给calendar - * - * @param initDateTime - * 初始日期时间值 字符串型 - * @return Calendar - */ - private Calendar getCalendarByInintData(String initDateTime) { - Calendar calendar = Calendar.getInstance(); - - // 将初始日期时间2012年07月02日 16:45 拆分成年 月 日 时 分 秒 - String date = spliteString(initDateTime, "日", "index", "front"); // 日期 - String time = spliteString(initDateTime, "日", "index", "back"); // 时间 - - String yearStr = spliteString(date, "年", "index", "front"); // 年份 - String monthAndDay = spliteString(date, "年", "index", "back"); // 月日 - - String monthStr = spliteString(monthAndDay, "月", "index", "front"); // 月 - String dayStr = spliteString(monthAndDay, "月", "index", "back"); // 日 - - String hourStr = spliteString(time, ":", "index", "front"); // 时 - String minuteStr = spliteString(time, ":", "index", "back"); // 分 - - int currentYear = Integer.valueOf(yearStr.trim()).intValue(); - int currentMonth = Integer.valueOf(monthStr.trim()).intValue() - 1; - int currentDay = Integer.valueOf(dayStr.trim()).intValue(); - int currentHour = Integer.valueOf(hourStr.trim()).intValue(); - int currentMinute = Integer.valueOf(minuteStr.trim()).intValue(); - - calendar.set(currentYear, currentMonth, currentDay, currentHour, currentMinute); - return calendar; - } - - /** - * 截取子串 - * - * @param srcStr - * 源串 - * @param pattern - * 匹配模式 - * @param indexOrLast - * @param frontOrBack - * @return - */ - public static String spliteString(String srcStr, String pattern, String indexOrLast, String frontOrBack) { - String result = ""; - int loc = -1; - if (indexOrLast.equalsIgnoreCase("index")) { - loc = srcStr.indexOf(pattern); // 取得字符串第一次出现的位置 - } else { - loc = srcStr.lastIndexOf(pattern); // 最后一个匹配串的位置 - } - if (frontOrBack.equalsIgnoreCase("front")) { - if (loc != -1) - result = srcStr.substring(0, loc); // 截取子串 - } else { - if (loc != -1) - result = srcStr.substring(loc + 1, srcStr.length()); // 截取子串 - } - return result; - } - - public interface DateTimeListener { - - void onDateTimeChane(String dateTime); - - } -} diff --git a/代码/在这里3.0/bin/classes/com/stone/ui/DialogOrder$OrderDialogListener.class b/代码/在这里3.0/bin/classes/com/stone/ui/DialogOrder$OrderDialogListener.class index dbb56fc..dc69ce3 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/ui/DialogOrder$OrderDialogListener.class and b/代码/在这里3.0/bin/classes/com/stone/ui/DialogOrder$OrderDialogListener.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/ui/DialogOrder.class b/代码/在这里3.0/bin/classes/com/stone/ui/DialogOrder.class index 8c9ef50..a2c24a7 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/ui/DialogOrder.class and b/代码/在这里3.0/bin/classes/com/stone/ui/DialogOrder.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/ui/ViewPagerCompat.java~remotes_origin_zhaozaichun b/代码/在这里3.0/bin/classes/com/stone/ui/ViewPagerCompat.java~remotes_origin_zhaozaichun deleted file mode 100644 index 4d184b3..0000000 --- a/代码/在这里3.0/bin/classes/com/stone/ui/ViewPagerCompat.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,67 +0,0 @@ -package com.stone.ui; - -import android.content.Context; -import android.support.v4.view.ViewPager; -import android.util.AttributeSet; -import android.view.MotionEvent; - -/** - * 商铺详情页--ViewPager的加强类,主要是为了解决滑动冲突的问题。不然的话, - * 在ViewPager内部加入ListView等可滑动控件,两者之间会产生干扰。 - * @author Stone - * {@link} http://blog.csdn.net/singwhatiwanna/article/details/17201587 - */ -//测试自动分析 -public class ViewPagerCompat extends ViewPager { - // mViewTouchMode表示ViewPager是否全权控制滑动事件,默认为false,即不控制 - private boolean mViewTouchMode = false; - - public ViewPagerCompat(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public void setViewTouchMode(boolean b) { - if (b && !isFakeDragging()) { - // 全权控制滑动事件 - beginFakeDrag(); - } else if (!b && isFakeDragging()) { - // 终止控制滑动事件 - endFakeDrag(); - } - mViewTouchMode = b; - } - - /** - * 在mViewTouchMode为true的时候,ViewPager不拦截点击事件,点击事件将由子View处理 - */ - @Override - public boolean onInterceptTouchEvent(MotionEvent event) { - if (mViewTouchMode) { - return false; - } - return super.onInterceptTouchEvent(event); - } - - @Override - public boolean onTouchEvent(MotionEvent ev) { - try { - return super.onTouchEvent(ev); - } catch (Exception e) { - return false; - } - } - - /** - * 在mViewTouchMode为true或者滑动方向不是左右的时候,ViewPager将放弃控制点击事件, - * 这样做有利于在ViewPager中加入ListView等可以滑动的控件,否则两者之间的滑动将会有冲突 - */ - @Override - public boolean arrowScroll(int direction) { - if (mViewTouchMode) - return false; - if (direction != FOCUS_LEFT && direction != FOCUS_RIGHT) - return false; - return super.arrowScroll(direction); - } - -} diff --git a/代码/在这里3.0/gen/com/stone/shop/R.java b/代码/在这里3.0/gen/com/stone/shop/R.java deleted file mode 100644 index f0c63af..0000000 --- a/代码/在这里3.0/gen/com/stone/shop/R.java +++ /dev/null @@ -1,490 +0,0 @@ -/* AUTO-GENERATED FILE. DO NOT MODIFY. - * - * This class was automatically generated by the - * aapt tool from the resource data it found. It - * should not be modified by hand. - */ - -package com.stone.shop; - -public final class R { - public static final class anim { - public static final int cycle_7=0x7f040000; - public static final int scale=0x7f040001; - public static final int shake=0x7f040002; - } - public static final class attr { - } - public static final class color { - public static final int actionbar_background_end=0x7f050002; - public static final int actionbar_background_item_pressed_end=0x7f050005; - public static final int actionbar_background_item_pressed_start=0x7f050004; - public static final int actionbar_background_start=0x7f050001; - public static final int actionbar_separator=0x7f050000; - public static final int actionbar_title=0x7f050003; - public static final int qq_common_bg=0x7f050006; - public static final int second_color=0x7f050008; - public static final int theme_color=0x7f050007; - } - public static final class dimen { - /** Default screen margins, per the Android Design guidelines. - - Customize dimensions originally defined in res/values/dimens.xml (such as - screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. - - */ - public static final int activity_horizontal_margin=0x7f060000; - public static final int activity_vertical_margin=0x7f060001; - } - public static final class drawable { - public static final int abs__tab_selected_focused_holo=0x7f020000; - public static final int abs__tab_selected_holo=0x7f020001; - public static final int abs__tab_selected_pressed_holo=0x7f020002; - public static final int abs__tab_unselected_pressed_holo=0x7f020003; - public static final int action_hate=0x7f020004; - public static final int action_rate=0x7f020005; - public static final int actionbar_background=0x7f020006; - public static final int back_blue=0x7f020007; - public static final int bg1=0x7f020008; - public static final int bg3=0x7f020009; - public static final int bg_account=0x7f02000a; - public static final int bg_account_focus=0x7f02000b; - public static final int bg_account_normal=0x7f02000c; - public static final int bg_comment_comment=0x7f02000d; - public static final int bg_comment_floor=0x7f02000e; - public static final int bg_logout_normal=0x7f02000f; - public static final int bg_logout_pressed=0x7f020010; - public static final int btn_comment_publish=0x7f020011; - public static final int btn_green_normal=0x7f020012; - public static final int btn_green_pressed=0x7f020013; - public static final int checkbox_bg1=0x7f020014; - public static final int checkbox_selected=0x7f020015; - public static final int checkbox_selected_press=0x7f020016; - public static final int checkbox_unselect=0x7f020017; - public static final int checkbox_unselect_press=0x7f020018; - public static final int custom_ratingbar=0x7f020019; - public static final int default_ptr_flip=0x7f02001a; - public static final int default_ptr_rotate=0x7f02001b; - public static final int edittext_focus=0x7f02001c; - public static final int edittext_normal=0x7f02001d; - public static final int ic_1=0x7f02001e; - public static final int ic_2=0x7f02001f; - public static final int ic_3=0x7f020020; - public static final int ic_41=0x7f020021; - public static final int ic_42=0x7f020022; - public static final int ic_5=0x7f020023; - public static final int ic_6=0x7f020024; - public static final int ic_7=0x7f020025; - public static final int ic_71=0x7f020026; - public static final int ic_72=0x7f020027; - public static final int ic_73=0x7f020028; - public static final int ic_74=0x7f020029; - public static final int ic_75=0x7f02002a; - public static final int ic_76=0x7f02002b; - public static final int ic_77=0x7f02002c; - public static final int ic_8=0x7f02002d; - public static final int ic_81=0x7f02002e; - public static final int ic_82=0x7f02002f; - public static final int ic_action_comment=0x7f020030; - public static final int ic_action_edit=0x7f020031; - public static final int ic_action_fav=0x7f020032; - public static final int ic_action_fav_choose=0x7f020033; - public static final int ic_action_fav_normal=0x7f020034; - public static final int ic_action_love=0x7f020035; - public static final int ic_action_share=0x7f020036; - public static final int ic_app=0x7f020037; - public static final int ic_app1=0x7f020038; - public static final int ic_app6=0x7f020039; - public static final int ic_banner1=0x7f02003a; - public static final int ic_banner_hide=0x7f02003b; - public static final int ic_banner_image_default1=0x7f02003c; - public static final int ic_banner_image_default11=0x7f02003d; - public static final int ic_banner_image_default2=0x7f02003e; - public static final int ic_banner_image_default22=0x7f02003f; - public static final int ic_banner_image_default3=0x7f020040; - public static final int ic_banner_image_default4=0x7f020041; - public static final int ic_banner_image_default55=0x7f020042; - public static final int ic_banner_image_default77=0x7f020043; - public static final int ic_breakfast=0x7f020044; - public static final int ic_car=0x7f020045; - public static final int ic_car1=0x7f020046; - public static final int ic_car2=0x7f020047; - public static final int ic_circle=0x7f020048; - public static final int ic_date=0x7f020049; - public static final int ic_hbut=0x7f02004a; - public static final int ic_hide=0x7f02004b; - public static final int ic_launcher=0x7f02004c; - public static final int ic_loc=0x7f02004d; - public static final int ic_menu_copy_holo_light=0x7f02004e; - public static final int ic_menu_find_holo_light=0x7f02004f; - public static final int ic_menu_info_details=0x7f020050; - public static final int ic_menu_myplaces=0x7f020051; - public static final int ic_menu_notifications=0x7f020052; - public static final int ic_menu_share=0x7f020053; - public static final int ic_mine=0x7f020054; - public static final int ic_page_indicator=0x7f020055; - public static final int ic_page_indicator_focused=0x7f020056; - public static final int ic_phone=0x7f020057; - public static final int ic_phone2=0x7f020058; - public static final int ic_phone3=0x7f020059; - public static final int ic_sale=0x7f02005a; - public static final int ic_sale1=0x7f02005b; - public static final int ic_sale2=0x7f02005c; - public static final int ic_search=0x7f02005d; - public static final int ic_shelf_category_divider=0x7f02005e; - public static final int ic_shop=0x7f02005f; - public static final int ic_shop1=0x7f020060; - public static final int ic_shop2=0x7f020061; - public static final int ic_shop_info_bg=0x7f020062; - public static final int ic_shop_info_bg2=0x7f020063; - public static final int ic_shop_info_bg22=0x7f020064; - public static final int ic_star_no=0x7f020065; - public static final int ic_star_yes=0x7f020066; - public static final int indicator_arrow=0x7f020067; - public static final int login_button=0x7f020068; - public static final int login_button_select=0x7f020069; - public static final int qq=0x7f02006a; - public static final int qq1=0x7f02006b; - public static final int selector_edittext=0x7f02006c; - public static final int selector_edittext_account=0x7f02006d; - public static final int selector_load_more=0x7f02006e; - public static final int selector_logout=0x7f02006f; - public static final int sgbf=0x7f020070; - public static final int shap_divider=0x7f020071; - public static final int shape_color_frame=0x7f020072; - public static final int shape_grid_item=0x7f020073; - public static final int shape_left_radius_color_square=0x7f020074; - public static final int shape_radius=0x7f020075; - public static final int shape_radius_color_square=0x7f020076; - public static final int shape_radius_square=0x7f020077; - public static final int splash=0x7f020078; - public static final int tab_bg_selector=0x7f020079; - public static final int user_icon_default=0x7f02007a; - public static final int user_icon_default_main=0x7f02007b; - public static final int w01=0x7f02007c; - public static final int w02=0x7f02007d; - public static final int w03=0x7f02007e; - public static final int w04=0x7f02007f; - public static final int w05=0x7f020080; - public static final int welcome_background=0x7f020081; - } - public static final class id { - public static final int action_settings=0x7f0a00c6; - public static final int actionbar_comment=0x7f0a000f; - public static final int area_commit=0x7f0a0014; - public static final int bt_scrollLeft=0x7f0a00a4; - public static final int bt_scrollRight=0x7f0a00a5; - public static final int btn_about=0x7f0a0056; - public static final int btn_add=0x7f0a009b; - public static final int btn_add_good=0x7f0a007d; - public static final int btn_add_news=0x7f0a007e; - public static final int btn_add_shop=0x7f0a007c; - public static final int btn_buy_good=0x7f0a0098; - public static final int btn_commit=0x7f0a00c5; - public static final int btn_contact=0x7f0a0057; - public static final int btn_dlg_ok=0x7f0a0094; - public static final int btn_feedback_submit=0x7f0a001b; - public static final int btn_hide_ads=0x7f0a0022; - public static final int btn_login=0x7f0a003c; - public static final int btn_look_goods=0x7f0a007a; - public static final int btn_look_news=0x7f0a007b; - public static final int btn_look_shops=0x7f0a0079; - public static final int btn_look_users=0x7f0a0078; - public static final int btn_order_count_less=0x7f0a005f; - public static final int btn_order_count_more=0x7f0a0061; - public static final int btn_order_submit=0x7f0a0066; - public static final int btn_publish=0x7f0a0017; - public static final int btn_qq=0x7f0a0035; - public static final int btn_reg_now=0x7f0a006d; - public static final int btn_register=0x7f0a0033; - public static final int btn_set_time=0x7f0a0063; - public static final int btn_share=0x7f0a0058; - public static final int cancel=0x7f0a00c8; - public static final int cb_rem_psd=0x7f0a0034; - public static final int comment_commit=0x7f0a0016; - public static final int comment_content=0x7f0a0015; - public static final int comment_item=0x7f0a0011; - public static final int comment_list=0x7f0a0012; - public static final int commit_scroll=0x7f0a0010; - public static final int content_comment=0x7f0a008d; - public static final int content_image=0x7f0a0085; - public static final int content_text=0x7f0a0084; - public static final int datepicker=0x7f0a0092; - public static final int edit_content=0x7f0a0019; - public static final int edit_title=0x7f0a0018; - public static final int et_comfirm_psd=0x7f0a0069; - public static final int et_commit=0x7f0a00c4; - public static final int et_feedback_content=0x7f0a001a; - public static final int et_mineinfo_cademy=0x7f0a0049; - public static final int et_mineinfo_dornum=0x7f0a004b; - public static final int et_mineinfo_dorpart=0x7f0a004a; - public static final int et_mineinfo_phone=0x7f0a004c; - public static final int et_mineinfo_qq=0x7f0a004d; - public static final int et_mineinfo_school=0x7f0a0048; - public static final int et_mineinfo_username=0x7f0a0047; - public static final int et_order_phone=0x7f0a0064; - public static final int et_order_words=0x7f0a0065; - public static final int et_password=0x7f0a003b; - public static final int et_phone=0x7f0a006b; - public static final int et_username=0x7f0a003a; - public static final int fl_image_ads=0x7f0a0020; - public static final int gv_classroom=0x7f0a000e; - public static final int gv_food_class=0x7f0a0070; - public static final int gv_gift_class=0x7f0a006f; - public static final int gv_library=0x7f0a002e; - public static final int gv_out_class=0x7f0a0071; - public static final int gv_school_class=0x7f0a006e; - public static final int header_shop_all=0x7f0a0072; - public static final int imageview=0x7f0a00b8; - public static final int img_call=0x7f0a00bf; - public static final int img_chooseImage=0x7f0a00b7; - public static final int img_date=0x7f0a001d; - public static final int img_item=0x7f0a00a6; - public static final int img_search=0x7f0a009f; - public static final int img_shop=0x7f0a00b0; - public static final int img_welcome=0x7f0a0001; - public static final int index_comment=0x7f0a008c; - public static final int item_action_comment=0x7f0a0086; - public static final int item_action_hate=0x7f0a0088; - public static final int item_action_love=0x7f0a0089; - public static final int item_action_share=0x7f0a0087; - public static final int listScrollView=0x7f0a001c; - public static final int ll_commit_parent_view=0x7f0a00c3; - public static final int ll_commit_son_view=0x7f0a008f; - public static final int ll_row1=0x7f0a002f; - public static final int ll_row2=0x7f0a0030; - public static final int ll_row3=0x7f0a0031; - public static final int ll_row4=0x7f0a006a; - public static final int ll_row6=0x7f0a006c; - public static final int loadmore=0x7f0a0013; - public static final int lv_bxt_news=0x7f0a0003; - public static final int lv_goods_list=0x7f0a00ba; - public static final int lv_information=0x7f0a002d; - public static final int lv_mine_about=0x7f0a003f; - public static final int lv_mine_order=0x7f0a003e; - public static final int lv_mine_soft=0x7f0a0076; - public static final int lv_mine_user=0x7f0a003d; - public static final int lv_news=0x7f0a0023; - public static final int lv_order_info=0x7f0a0067; - public static final int lv_shop_all=0x7f0a0073; - public static final int modify=0x7f0a00c7; - public static final int mymultiViewGroup=0x7f0a00a9; - public static final int new_login_btn=0x7f0a0036; - public static final int pagertab=0x7f0a0075; - public static final int pull_refresh_list=0x7f0a0002; - public static final int ratingBar1=0x7f0a00bc; - public static final int rb_rate=0x7f0a00b6; - public static final int relaGrid=0x7f0a0099; - public static final int rl_last=0x7f0a0032; - public static final int rl_splash=0x7f0a0077; - public static final int rl_welcome=0x7f0a0000; - public static final int sp_bxt_header=0x7f0a009c; - public static final int textView1=0x7f0a00a0; - public static final int textview=0x7f0a00b9; - public static final int time_comment=0x7f0a008e; - public static final int time_text=0x7f0a0082; - public static final int timepicker=0x7f0a0093; - public static final int title_text=0x7f0a0083; - public static final int tp_dlg_time=0x7f0a0095; - public static final int tv_bowl=0x7f0a0050; - public static final int tv_bxt_news_holder1=0x7f0a0009; - public static final int tv_bxt_news_holder2=0x7f0a000a; - public static final int tv_bxt_news_item_title=0x7f0a008a; - public static final int tv_bxt_news_loc=0x7f0a0008; - public static final int tv_bxt_news_point=0x7f0a000b; - public static final int tv_bxt_news_speaker=0x7f0a0006; - public static final int tv_bxt_news_speaker_info=0x7f0a000c; - public static final int tv_bxt_news_time=0x7f0a0007; - public static final int tv_bxt_news_title=0x7f0a0004; - public static final int tv_bxt_news_topic=0x7f0a0005; - public static final int tv_cademy=0x7f0a0053; - public static final int tv_chooseText=0x7f0a009a; - public static final int tv_commit_content=0x7f0a0091; - public static final int tv_commit_title=0x7f0a00c2; - public static final int tv_commit_user=0x7f0a0090; - public static final int tv_day=0x7f0a001f; - public static final int tv_dorNum=0x7f0a0055; - public static final int tv_dorPart=0x7f0a0054; - public static final int tv_edit=0x7f0a009e; - public static final int tv_good_name=0x7f0a0096; - public static final int tv_good_price=0x7f0a0097; - public static final int tv_hello_world=0x7f0a00a2; - public static final int tv_info_item_content=0x7f0a002c; - public static final int tv_info_item_holder=0x7f0a0029; - public static final int tv_info_item_holder2=0x7f0a002a; - public static final int tv_info_item_loc=0x7f0a0028; - public static final int tv_info_item_point=0x7f0a002b; - public static final int tv_info_item_speaker=0x7f0a0026; - public static final int tv_info_item_time=0x7f0a0027; - public static final int tv_info_item_title=0x7f0a0024; - public static final int tv_info_item_topic=0x7f0a0025; - public static final int tv_info_title=0x7f0a009d; - public static final int tv_item_content=0x7f0a00a8; - public static final int tv_item_name=0x7f0a00a7; - public static final int tv_me=0x7f0a004f; - public static final int tv_mineinfo_cademy=0x7f0a0042; - public static final int tv_mineinfo_dornum=0x7f0a0044; - public static final int tv_mineinfo_dorpart=0x7f0a0043; - public static final int tv_mineinfo_phone=0x7f0a0045; - public static final int tv_mineinfo_qq=0x7f0a0046; - public static final int tv_mineinfo_school=0x7f0a0041; - public static final int tv_mineinfo_username=0x7f0a0040; - public static final int tv_news_author=0x7f0a005a; - public static final int tv_news_content=0x7f0a005c; - public static final int tv_news_date=0x7f0a00ab; - public static final int tv_news_time=0x7f0a005b; - public static final int tv_news_title=0x7f0a0059; - public static final int tv_news_type=0x7f0a00aa; - public static final int tv_order_count=0x7f0a0060; - public static final int tv_order_good=0x7f0a005e; - public static final int tv_order_info_good_name=0x7f0a00ac; - public static final int tv_order_info_price=0x7f0a00ae; - public static final int tv_order_info_shop_name=0x7f0a00ad; - public static final int tv_order_info_state=0x7f0a00af; - public static final int tv_order_shop=0x7f0a005d; - public static final int tv_order_time=0x7f0a0062; - public static final int tv_reg_title=0x7f0a0068; - public static final int tv_res=0x7f0a0080; - public static final int tv_room=0x7f0a00a1; - public static final int tv_school=0x7f0a0052; - public static final int tv_scroll=0x7f0a00a3; - public static final int tv_shop_discount=0x7f0a00b3; - public static final int tv_shop_introduce=0x7f0a00c0; - public static final int tv_shop_loc=0x7f0a00b5; - public static final int tv_shop_location=0x7f0a00bd; - public static final int tv_shop_name=0x7f0a00b1; - public static final int tv_shop_paper=0x7f0a00b2; - public static final int tv_shop_phone=0x7f0a00be; - public static final int tv_shop_promotion=0x7f0a00c1; - public static final int tv_shop_title=0x7f0a00bb; - public static final int tv_shop_type=0x7f0a00b4; - public static final int tv_title=0x7f0a007f; - public static final int tv_username=0x7f0a004e; - public static final int tv_week=0x7f0a001e; - public static final int tv_xiaocai=0x7f0a0051; - public static final int userName_comment=0x7f0a008b; - public static final int user_callback=0x7f0a0039; - public static final int user_logo=0x7f0a0038; - public static final int user_name=0x7f0a0081; - public static final int user_nickname=0x7f0a0037; - public static final int view_pager=0x7f0a0021; - public static final int viewpager=0x7f0a0074; - public static final int wv_wsq=0x7f0a000d; - } - public static final class layout { - public static final int activity_about=0x7f030000; - public static final int activity_award=0x7f030001; - public static final int activity_base=0x7f030002; - public static final int activity_bxt=0x7f030003; - public static final int activity_bxt_news=0x7f030004; - public static final int activity_car=0x7f030005; - public static final int activity_classroom=0x7f030006; - public static final int activity_comment=0x7f030007; - public static final int activity_edit=0x7f030008; - public static final int activity_feedback=0x7f030009; - public static final int activity_home=0x7f03000a; - public static final int activity_infoitem=0x7f03000b; - public static final int activity_information=0x7f03000c; - public static final int activity_library=0x7f03000d; - public static final int activity_login=0x7f03000e; - public static final int activity_mine=0x7f03000f; - public static final int activity_mine_info=0x7f030010; - public static final int activity_mine_info_edit=0x7f030011; - public static final int activity_mine_old=0x7f030012; - public static final int activity_news=0x7f030013; - public static final int activity_order=0x7f030014; - public static final int activity_order_info=0x7f030015; - public static final int activity_reg=0x7f030016; - public static final int activity_shop=0x7f030017; - public static final int activity_shop_all=0x7f030018; - public static final int activity_shop_item=0x7f030019; - public static final int activity_soft=0x7f03001a; - public static final int activity_splash=0x7f03001b; - public static final int activity_test=0x7f03001c; - public static final int activity_userinfo=0x7f03001d; - public static final int ai_item=0x7f03001e; - public static final int bxt_list_item=0x7f03001f; - public static final int comment_item=0x7f030020; - public static final int commit=0x7f030021; - public static final int common_datetime=0x7f030022; - public static final int dlg_order_settime=0x7f030023; - public static final int goods_list_item=0x7f030024; - public static final int gv_item_classroom=0x7f030025; - public static final int header_award=0x7f030026; - public static final int header_bxt=0x7f030027; - public static final int header_bxt_news=0x7f030028; - public static final int header_feedback=0x7f030029; - public static final int header_home=0x7f03002a; - public static final int header_info=0x7f03002b; - public static final int header_info_item=0x7f03002c; - public static final int header_mine=0x7f03002d; - public static final int header_mine_info=0x7f03002e; - public static final int header_mine_info_edit=0x7f03002f; - public static final int header_news=0x7f030030; - public static final int header_order=0x7f030031; - public static final int header_order_info=0x7f030032; - public static final int header_shop=0x7f030033; - public static final int header_shop_all=0x7f030034; - public static final int header_soft=0x7f030035; - public static final int info_list_item=0x7f030036; - public static final int layout_libraryreservation=0x7f030037; - public static final int layout_reservation=0x7f030038; - public static final int main=0x7f030039; - public static final int mine_list_item=0x7f03003a; - public static final int mine_soft_list_item=0x7f03003b; - public static final int multiview=0x7f03003c; - public static final int news_list_item=0x7f03003d; - public static final int order_info_list_item=0x7f03003e; - public static final int popmenu=0x7f03003f; - public static final int scom_list_item=0x7f030040; - public static final int shop_all_list_item=0x7f030041; - public static final int shop_grid_item=0x7f030042; - public static final int tab_widget_item=0x7f030043; - public static final int viewpager_menu=0x7f030044; - public static final int viewpager_shopinfo=0x7f030045; - } - public static final class menu { - public static final int main=0x7f090000; - public static final int popup=0x7f090001; - } - public static final class string { - public static final int action_settings=0x7f070001; - public static final int app_name=0x7f070000; - public static final int hello_world=0x7f070002; - } - public static final class style { - /** - Base application theme for API 11+. This theme completely replaces - AppBaseTheme from res/values/styles.xml on API 11+ devices. - - API 11 theme customizations can go here. - - Base application theme for API 14+. This theme completely replaces - AppBaseTheme from BOTH res/values/styles.xml and - res/values-v11/styles.xml on API 14+ devices. - - API 14 theme customizations can go here. - */ - public static final int AppBaseTheme=0x7f080000; - public static final int AppNoTitleBarTheme=0x7f080003; - public static final int AppTheme=0x7f080001; - /** 自定义对话框的样式 - */ - public static final int MyDialog=0x7f080004; - public static final int NoTitleBarTheme=0x7f080002; - /** 自定义对话框样式 - - */ - public static final int TextTheme=0x7f080006; - public static final int TextTheme_tipstheme_second=0x7f080007; - /** 自定义RatingBar样式 - */ - public static final int custom_ratingbar_style=0x7f080005; - } -} diff --git a/代码/在这里3.0/project.properties b/代码/在这里3.0/project.properties index 5c5f4c7..17bdc51 100644 --- a/代码/在这里3.0/project.properties +++ b/代码/在这里3.0/project.properties @@ -11,5 +11,5 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-20 +target=android-18 proguard.config=proguard.cfg diff --git a/代码/在这里3.0/src/com/stone/shop/adapter/BXTListAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/adapter/BXTListAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index df02860..0000000 --- a/代码/在这里3.0/src/com/stone/shop/adapter/BXTListAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,75 +0,0 @@ -package com.stone.shop.adapter; - -import java.util.Iterator; -import java.util.List; - -import com.stone.shop.R; -import com.stone.shop.model.BXTNews; -import com.stone.shop.model.Good; - -import android.content.Context; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.Button; -import android.widget.TextView; - -/** - * 教学类-博学堂-讲座列表适配器 - * - * @date 2014-5-10 - * @author Stone - */ -public class BXTListAdapter extends BaseAdapter { - - private Context mContext; - private List mNewsList; // 商品列表信息 - private LayoutInflater mInflater = null; - - public BXTListAdapter(Context context, List 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(List list) { - Log.i("BXTNewsAdapter", "Adapter刷新数据"); - mNewsList = list; - notifyDataSetChanged(); - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - BXTNewsHolder newsHolder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.bxt_list_item, null); - newsHolder = new BXTNewsHolder(); - newsHolder.tvBXTNewsTitle = (TextView) convertView - .findViewById(R.id.tv_bxt_news_item_title); - convertView.setTag(newsHolder); - } else { - newsHolder = (BXTNewsHolder) convertView.getTag(); - } - newsHolder.tvBXTNewsTitle.setText(mNewsList.get(position).getTitle()); - return convertView; - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/adapter/ClassroomAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/adapter/ClassroomAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 7deb441..0000000 --- a/代码/在这里3.0/src/com/stone/shop/adapter/ClassroomAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,69 +0,0 @@ -package com.stone.shop.adapter; - -import java.util.List; - -import com.stone.shop.R; -import com.stone.shop.model.Classroom; - -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 class ClassroomAdapter extends BaseAdapter { - - private Context mContext; - private List mNewsList; // 商品列表信息 - private LayoutInflater mInflater = null; - - public ClassroomAdapter(Context context, List 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(List list) { - mNewsList = list; - notifyDataSetChanged(); - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - ViewHolder viewHolder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.gv_item_classroom, null); - viewHolder = new ViewHolder(); - viewHolder.tv_chooseText = (TextView) convertView.findViewById(R.id.tv_chooseText); - convertView.setTag(viewHolder); - } else { - viewHolder = (ViewHolder) convertView.getTag(); - } - viewHolder.tv_chooseText.setText(mNewsList.get(position).getName()); - return convertView; - } - - class ViewHolder { - - public TextView tv_chooseText; // 博学堂讲座标题 - - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/adapter/GoodsListAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/adapter/GoodsListAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 0befe9a..0000000 --- a/代码/在这里3.0/src/com/stone/shop/adapter/GoodsListAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,70 +0,0 @@ -package com.stone.shop.adapter; - -import java.util.List; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.Button; -import android.widget.TextView; - -import com.stone.shop.R; -import com.stone.shop.model.Good; - -public class GoodsListAdapter extends BaseAdapter { - - private Context mContext; - private List mGoodsList; // 商品列表信息 - private LayoutInflater mInflater = null; - - public GoodsListAdapter(Context context, List goodsList) { - mContext = context; - mGoodsList = goodsList; - mInflater = LayoutInflater.from(context); - } - - @Override - public int getCount() { - return mGoodsList.size(); - } - - @Override - public Object getItem(int position) { - return mGoodsList.get(position); - } - - @Override - public long getItemId(int position) { - return position; - } - - // 刷新列表中的数据 - public void refresh(List list) { - mGoodsList = list; - notifyDataSetChanged(); - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - GoodsHolder goodHolder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.goods_list_item, null); - goodHolder = new GoodsHolder(); - goodHolder.tvName = (TextView) convertView - .findViewById(R.id.tv_good_name); - goodHolder.tvPrice = (TextView) convertView - .findViewById(R.id.tv_good_price); - goodHolder.btnBuyGood = (TextView) convertView - .findViewById(R.id.btn_buy_good); - convertView.setTag(goodHolder); - } else { - goodHolder = (GoodsHolder) convertView.getTag(); - } - goodHolder.tvName.setText(mGoodsList.get(position).getName()); - goodHolder.tvPrice.setText("¥"+mGoodsList.get(position).getPrice()); - return convertView; - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/adapter/GridAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/adapter/GridAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 7c6ed22..0000000 --- a/代码/在这里3.0/src/com/stone/shop/adapter/GridAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -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, R.drawable.ic_8 }; - - //吃饭小菜 - 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_71, R.drawable.ic_72, - R.drawable.ic_73, R.drawable.ic_74, R.drawable.ic_75, - R.drawable.ic_76, R.drawable.ic_77}; - - //疯狂小菜 - 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; - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/adapter/ImagePagerAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/adapter/ImagePagerAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index c73ef5a..0000000 --- a/代码/在这里3.0/src/com/stone/shop/adapter/ImagePagerAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,67 +0,0 @@ -package com.stone.shop.adapter; - -import java.util.List; - -import android.content.Context; -import android.os.Parcelable; -import android.support.v4.view.PagerAdapter; -import android.support.v4.view.ViewPager; -import android.view.View; - -/** - * 首页--图片轮播AutoScrollViewPager适配器 - * @author Stone - */ -public class ImagePagerAdapter extends PagerAdapter { - - private List mImgViews; - - public ImagePagerAdapter(Context context, List imgViews) { - this.mImgViews = imgViews; - } - - @Override - public int getCount() { - if(mImgViews != null){ - return mImgViews.size(); - } - return 0; - } - - @Override - public Object instantiateItem(View arg0, int arg1) { - ((ViewPager) arg0).addView(mImgViews.get(arg1)); - return mImgViews.get(arg1); - } - - @Override - public void destroyItem(View arg0, int arg1, Object arg2) { - ((ViewPager) arg0).removeView(mImgViews.get(arg1)); - } - - @Override - public boolean isViewFromObject(View arg0, Object arg1) { - return arg0 == arg1; - } - - @Override - public void restoreState(Parcelable arg0, ClassLoader arg1) { - - } - - @Override - public Parcelable saveState() { - return null; - } - - @Override - public void startUpdate(View arg0) { - - } - - @Override - public void finishUpdate(View arg0) { - - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/adapter/MineListAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/adapter/MineListAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 29a2f69..0000000 --- a/代码/在这里3.0/src/com/stone/shop/adapter/MineListAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,69 +0,0 @@ -package com.stone.shop.adapter; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.ImageView; -import android.widget.TextView; - -import com.stone.shop.R; - -/** - * MineActivity 项目列表适配器 - * @date 2014-5-10 - * @author Stone - */ -public class MineListAdapter extends BaseAdapter { - - private Context mContext; - private String[] mItemNames; // 项目列表名称 - private String[] mItemContents; //项目列表的备注值 - private int[] mItemImgIds; // 项目列表Icon - private LayoutInflater mInflater = null; - - public MineListAdapter(Context context, String[] names, String[] contents, int[] imgIds) { - mContext = context; - mItemNames = names; - mItemContents = contents; - mItemImgIds = imgIds; - mInflater = LayoutInflater.from(context); - } - - @Override - public int getCount() { - return mItemNames.length; - } - - @Override - public Object getItem(int position) { - return mItemNames[position]; - } - - @Override - public long getItemId(int position) { - return position; - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - MineListHolder holder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.mine_list_item, null); - holder = new MineListHolder(); - holder.imgItem = (ImageView) convertView.findViewById(R.id.img_item); - holder.tvItemName = (TextView) convertView - .findViewById(R.id.tv_item_name); - holder.tvItemContent = (TextView) convertView.findViewById(R.id.tv_item_content); - convertView.setTag(holder); - } else { - holder = (MineListHolder) convertView.getTag(); - } - holder.imgItem.setBackgroundResource(mItemImgIds[position]); - holder.tvItemName.setText(mItemNames[position]); - holder.tvItemContent.setText(mItemContents[position]); - return convertView; - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/adapter/MineSoftAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/adapter/MineSoftAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 9dae107..0000000 --- a/代码/在这里3.0/src/com/stone/shop/adapter/MineSoftAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,65 +0,0 @@ -package com.stone.shop.adapter; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.ImageView; -import android.widget.TextView; - -import com.stone.shop.R; - -/** - * MineActivity 项目列表适配器 - * @date 2014-5-10 - * @author Stone - */ -public class MineSoftAdapter extends BaseAdapter { - - private Context mContext; - private String[] mItemNames; // 项目列表名称 - private String[] mItemContents; //项目列表的备注值 - private LayoutInflater mInflater = null; - - public MineSoftAdapter(Context context, String[] names, String[] contents) { - mContext = context; - mItemNames = names; - mItemContents = contents; - mInflater = LayoutInflater.from(context); - } - - @Override - public int getCount() { - return mItemNames.length; - } - - @Override - public Object getItem(int position) { - return mItemNames[position]; - } - - @Override - public long getItemId(int position) { - return position; - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - MineListHolder holder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.mine_soft_list_item, null); - holder = new MineListHolder(); - holder.tvItemName = (TextView) convertView - .findViewById(R.id.tv_item_name); - holder.tvItemContent = (TextView) convertView.findViewById(R.id.tv_item_content); - convertView.setTag(holder); - } else { - holder = (MineListHolder) convertView.getTag(); - } - holder.tvItemName.setText(mItemNames[position]); - holder.tvItemContent.setText(mItemContents[position]); - return convertView; - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/adapter/NewsListAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/adapter/NewsListAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 92264ca..0000000 --- a/代码/在这里3.0/src/com/stone/shop/adapter/NewsListAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,82 +0,0 @@ -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 mNewsList = null; // 所选分类下的所有店铺列表 - - public NewsListAdapter(Context context, List 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 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; - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/adapter/OrderInfoListAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/adapter/OrderInfoListAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 35c9294..0000000 --- a/代码/在这里3.0/src/com/stone/shop/adapter/OrderInfoListAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,88 +0,0 @@ -package com.stone.shop.adapter; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.TextView; - -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.listener.GetListener; - -import com.stone.date.TypeDef; -import com.stone.shop.R; -import com.stone.shop.model.Good; -import com.stone.shop.model.Order; -import com.stone.shop.model.Shop; -import com.stone.shop.view.OrderInfoActivity; - -/** - * 适配器--适配订单列表中的数据 - * - * @date 2014-5-27 - * @author Stone - */ -public class OrderInfoListAdapter extends BaseAdapter { - - private Context mContext; - private LayoutInflater mInflater = null; - private List mOrderList = null; // 所选分类下的所有店铺列表 - private String mType; // 商店的分类 - - public OrderInfoListAdapter(Context context, List orderList) { - mContext = context; - mOrderList = orderList; - mInflater = LayoutInflater.from(context); - } - - @Override - public int getCount() { - return mOrderList.size(); - } - - @Override - public Object getItem(int position) { - return mOrderList.get(position); - } - - @Override - public long getItemId(int position) { - return position; - } - - public void refresh(List list) { - mOrderList = list; - notifyDataSetChanged(); - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - OrderInfoHolder orderInfoHolder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.order_info_list_item, null); - orderInfoHolder = new OrderInfoHolder(); - orderInfoHolder.tvOrderInfoGoodName = (TextView) convertView - .findViewById(R.id.tv_order_info_good_name); - orderInfoHolder.tvOrderInfoShopName = (TextView) convertView - .findViewById(R.id.tv_order_info_shop_name); - orderInfoHolder.tvOrderInfoPrice = (TextView) convertView - .findViewById(R.id.tv_order_info_price); - orderInfoHolder.tvOrderInfoState = (TextView) convertView - .findViewById(R.id.tv_order_info_state); - convertView.setTag(orderInfoHolder); - } else { - orderInfoHolder = (OrderInfoHolder) convertView.getTag(); - } - orderInfoHolder.tvOrderInfoGoodName.setText(mOrderList.get(position).getGoodName()); - orderInfoHolder.tvOrderInfoShopName.setText(mOrderList.get(position).getShopName()); - orderInfoHolder.tvOrderInfoPrice.setText("¥" + mOrderList.get(position).getPrice()); - orderInfoHolder.tvOrderInfoState.setText(mOrderList.get(position).getState()); - return convertView; - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/adapter/SCommentAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/adapter/SCommentAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 98cf470..0000000 --- a/代码/在这里3.0/src/com/stone/shop/adapter/SCommentAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,66 +0,0 @@ -package com.stone.shop.adapter; - -import java.util.List; - -import com.stone.shop.R; -import com.stone.shop.model.SComment; - -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 SCommentAdapter extends BaseAdapter { - - private Context mContext; - private LayoutInflater mInflater = null; - private List mSComList = null; // 所选分类下的所有店铺列表 - - public SCommentAdapter(Context context, List list) { - mContext = context; - mSComList = list; - mInflater = LayoutInflater.from(context); - } - - @Override - public int getCount() { - return mSComList.size(); - } - - @Override - public Object getItem(int position) { - return mSComList.get(position); - } - - @Override - public long getItemId(int position) { - return position; - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - SComHolder scomHolder; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.scom_list_item, null); - scomHolder = new SComHolder(); - scomHolder.tvComUser = (TextView) convertView - .findViewById(R.id.tv_commit_user); - scomHolder.tvComContent = (TextView) convertView - .findViewById(R.id.tv_commit_content); - convertView.setTag(scomHolder); - } else { - scomHolder = (SComHolder) convertView.getTag(); - } - scomHolder.tvComUser.setText(mSComList.get(position).getUserName()); - scomHolder.tvComContent.setText(mSComList.get(position).getContent()); - return convertView; - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/adapter/ShopListAdapter.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/adapter/ShopListAdapter.java~remotes_origin_zhaozaichun deleted file mode 100644 index 539a17f..0000000 --- a/代码/在这里3.0/src/com/stone/shop/adapter/ShopListAdapter.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,126 +0,0 @@ -package com.stone.shop.adapter; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import android.content.Context; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.BaseAdapter; -import android.widget.TextView; - -import com.stone.date.TypeDef; -import com.stone.shop.R; -import com.stone.shop.model.Shop; - -/** - * 适配器--适配某一分类下的店铺列表数据 - * - * @date 2014-4-29 - * @author Stone - */ -public class ShopListAdapter extends BaseAdapter { - - private Context mContext; - private LayoutInflater mInflater = null; - private ArrayList mShopList = null; // 所选分类下的所有店铺列表 - private String mType; // 商店的分类 - - public ShopListAdapter(Context context, ArrayList shopList, - String type) { - mContext = context; - mShopList = shopList; - mType = type; - mInflater = LayoutInflater.from(context); - } - - @Override - public int getCount() { - return mShopList.size(); - } - - @Override - public Object getItem(int position) { - return mShopList.get(position); - } - - @Override - public long getItemId(int position) { - return position; - } - - // 刷新列表中的数据 - public void refresh(ArrayList list) { - mShopList = list; - //将数字的类型编号转换为文字 - exchangeType(mType); - notifyDataSetChanged(); - } - - /** - * 根据当前的type类型, 转换成相应的文字 - * @date 2014-4-29 - * @param typeString - */ - private void exchangeType(String typeString) { - - int type = Integer.parseInt(typeString); - int fatherType = type / 10; //父类型编号 - int sonType = type % 10; //子类型编号 - - Iterator iterator = mShopList.iterator(); - while (iterator.hasNext()) { - switch (fatherType) { - case 1: - iterator.next().setType( - TypeDef.typeDadList[fatherType-1] + "/" - + TypeDef.typeSonList1[sonType-1]); - break; - case 2: - iterator.next().setType( - TypeDef.typeDadList[fatherType-1] + "/" - + TypeDef.typeSonList2[sonType-1]); - break; - case 3: - iterator.next().setType( - TypeDef.typeDadList[fatherType-1] + "/" - + TypeDef.typeSonList3[sonType-1]); - break; - case 4: - iterator.next().setType( - TypeDef.typeDadList[fatherType-1] + "/" - + TypeDef.typeSonList4[sonType-1]); - break; - default: - break; - } - - } - } - - @Override - public View getView(int position, View convertView, ViewGroup parent) { - ShopHolder shopHodler; - if (convertView == null) { - convertView = mInflater.inflate(R.layout.shop_all_list_item, null); - shopHodler = new ShopHolder(); - shopHodler.tvShopName = (TextView) convertView - .findViewById(R.id.tv_shop_name); - shopHodler.tvShopType = (TextView) convertView - .findViewById(R.id.tv_shop_type); - shopHodler.tvShopLoc = (TextView) convertView - .findViewById(R.id.tv_shop_loc); - convertView.setTag(shopHodler); - } else { - shopHodler = (ShopHolder) convertView.getTag(); - } - shopHodler.tvShopName.setText(mShopList.get(position).getName()); - // 商店的类型需要单独处理 - shopHodler.tvShopType.setText(mShopList.get(position).getType()); - shopHodler.tvShopLoc.setText("二食堂"); - return convertView; - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/BXTActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/BXTActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index b2fcb93..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/BXTActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,100 +0,0 @@ -package com.stone.shop.view; - -import java.util.ArrayList; -import java.util.List; - -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.listener.FindListener; - -import com.stone.shop.R; -import com.stone.shop.adapter.BXTListAdapter; -import com.stone.shop.model.BXTNews; -import com.stone.shop.model.Classroom; -import com.stone.shop.model.BXTNews; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.renderscript.Element; -import android.view.View; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.ListView; -import android.widget.Toast; -/** - * 教学类-博学堂界面 - * @date 2014-5-10 - * @author Stone - */ -public class BXTActivity extends Activity implements OnItemClickListener{ - - private static final String TAG = "BXTActivity"; - - private ListView lvBXTNews; - private BXTListAdapter mBxtListAdapter; - private List mBXTNewsList; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_bxt); - - initView(); - initData(); - - } - - private void initView() { - lvBXTNews = (ListView) findViewById(R.id.lv_bxt_news); - mBXTNewsList = new ArrayList(); - mBxtListAdapter = new BXTListAdapter(this, mBXTNewsList); - lvBXTNews.setAdapter(mBxtListAdapter); - lvBXTNews.setOnItemClickListener(this); - } - - private void initData() { - BmobQuery query = new BmobQuery(); - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List newsList) { - //toast("查询商品成功, 共" + newsList.size()); - if(newsList.size()==0) - toast("亲, 暂时还木有讲座哦"); - else { - mBXTNewsList = newsList; - mBxtListAdapter.refresh(newsList); - mBxtListAdapter.notifyDataSetChanged(); - - } - - } - - @Override - public void onError(int arg0, String arg1) { - toast("查询失败"); - } - }); - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - - @Override - public void onItemClick(AdapterView parent, View view, int position, - long id) { - Intent toBXTNewsActivity = new Intent(BXTActivity.this, BXTNewsActivity.class); - toBXTNewsActivity.putExtra("title", mBXTNewsList.get(position).getTitle()); - toBXTNewsActivity.putExtra("topic", mBXTNewsList.get(position).getTopic()); - toBXTNewsActivity.putExtra("speaker", mBXTNewsList.get(position).getSpeaker()); - toBXTNewsActivity.putExtra("time", mBXTNewsList.get(position).getTime()); - toBXTNewsActivity.putExtra("location", mBXTNewsList.get(position).getLocation()); - toBXTNewsActivity.putExtra("holder1", mBXTNewsList.get(position).getHolder1()); - toBXTNewsActivity.putExtra("holder2", mBXTNewsList.get(position).getHolder2()); - toBXTNewsActivity.putExtra("points", mBXTNewsList.get(position).getPoints()); - toBXTNewsActivity.putExtra("speakerinfo", mBXTNewsList.get(position).getSpeakerinfo()); - startActivity(toBXTNewsActivity); - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/BXTNewsActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/BXTNewsActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index a39c090..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/BXTNewsActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,65 +0,0 @@ -package com.stone.shop.view; - -import com.stone.shop.R; -import com.stone.shop.model.BXTNews; - -import android.app.Activity; -import android.os.Bundle; -import android.widget.TextView; - -/** - * 教学类-博学堂-讲座详情界面 - * @date 2014-5-10 - * @author Stone - */ -public class BXTNewsActivity extends Activity { - - private static final String TAG = "BXTNewsActivity"; - - private BXTNews news; - private TextView tvBXTNewsTitle; - private TextView tvBXTNewsTopic; - private TextView tvBXTNewsSpeaker; - private TextView tvBXTNewsTime; - private TextView tvBXTNewsLoc; - private TextView tvBXTNewsHolder1; - private TextView tvBXTNewsHolder2; - private TextView tvBXTNewsPoints; - private TextView tvBXTNewsSpeakerInfo; - - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_bxt_news); - - initView(); - } - - private void initView() { - - tvBXTNewsTitle = (TextView) findViewById(R.id.tv_bxt_news_title); - tvBXTNewsTopic = (TextView) findViewById(R.id.tv_bxt_news_topic); - tvBXTNewsSpeaker = (TextView) findViewById(R.id.tv_bxt_news_speaker); - tvBXTNewsTime = (TextView) findViewById(R.id.tv_bxt_news_time); - tvBXTNewsLoc = (TextView) findViewById(R.id.tv_bxt_news_loc); - tvBXTNewsHolder1 = (TextView) findViewById(R.id.tv_bxt_news_holder1); - tvBXTNewsHolder2 = (TextView) findViewById(R.id.tv_bxt_news_holder2); - tvBXTNewsPoints = (TextView) findViewById(R.id.tv_bxt_news_point); - tvBXTNewsSpeakerInfo = (TextView) findViewById(R.id.tv_bxt_news_speaker_info); - - tvBXTNewsTitle.setText(getIntent().getStringExtra("title")); - tvBXTNewsTopic.setText(getIntent().getStringExtra("topic")); - tvBXTNewsSpeaker.setText(getIntent().getStringExtra("speaker")); - tvBXTNewsTime.setText(getIntent().getStringExtra("time")); - tvBXTNewsLoc.setText(getIntent().getStringExtra("location")); - tvBXTNewsHolder1.setText(getIntent().getStringExtra("holder1")); - tvBXTNewsHolder2.setText(getIntent().getStringExtra("holder2")); - tvBXTNewsPoints.setText(getIntent().getStringExtra("points")); - tvBXTNewsSpeakerInfo.setText(getIntent().getStringExtra("speakerinfo")); - - } - - - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/BaseActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/BaseActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 31a2a1d..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/BaseActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,104 +0,0 @@ -package com.stone.shop.view; - -import cn.bmob.v3.Bmob; - -import com.stone.shop.R; -import com.stone.shop.view.old.OldMineActivity; - -import android.os.Bundle; -import android.app.TabActivity; -import android.content.Context; -import android.content.Intent; -import android.content.SharedPreferences; -import android.content.SharedPreferences.Editor; -import android.view.LayoutInflater; -import android.view.View; -import android.widget.ImageView; -import android.widget.Space; -import android.widget.TabHost; -import android.widget.TextView; -import android.widget.Toast; - -/** - * 应用主界面 - * @date 2014-4-24 - * @author Stone - */ -@SuppressWarnings("deprecation") -public class BaseActivity extends TabActivity { - - private static final String TAG = "BaseActivity"; - - private TabHost tabHost; - private LayoutInflater layoutInflater; - - - String[] mTitle = new String[] { "周边", "讨论区", "我的"}; - int[] mIcon = new int[] { R.drawable.ic_shop2, R.drawable.ic_sale2, - R.drawable.ic_car2, R.drawable.ic_mine }; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_base); - - initTabView(); - - - } - - public View getTabItemView(int i) { - // TODO Auto-generated method stub - View view = layoutInflater.inflate(R.layout.tab_widget_item, null); - ImageView imageView = (ImageView) view.findViewById(R.id.imageview); - imageView.setImageResource(mIcon[i]); - TextView textView = (TextView) view.findViewById(R.id.textview); - textView.setText(mTitle[i]); - return view; - } - - public void initTabView() { - - /** - * tabHost.newTabSpec("artist")创建一个标签项,其中artist为它的标签标识符,相当于jsp页面标签的name属性 - * setIndicator("艺术标签",resources.getDrawable(R.drawable.ic_tab))设置标签显示文本以及标签上的图标(该图标并不是一个图片,而是一个xml文件哦) - * setContent(intent)为当前标签指定一个意图 - * tabHost.addTab(spec); 将标签项添加到标签中 - */ - - tabHost = getTabHost(); - layoutInflater = LayoutInflater.from(this); - TabHost.TabSpec spec; - - Intent intent1 = new Intent(this, ShopActivity.class); - spec = tabHost.newTabSpec(mTitle[0]).setIndicator( getTabItemView(0) ).setContent(intent1); - tabHost.addTab(spec); - - Intent intent2 = new Intent(this, AwardActivity.class); - spec = tabHost.newTabSpec(mTitle[1]).setIndicator( getTabItemView(1) ).setContent(intent2); - tabHost.addTab(spec); - - Intent intent3 = new Intent(this, MineActivity.class); - spec = tabHost.newTabSpec(mTitle[2]).setIndicator( getTabItemView(2) ).setContent(intent3); - tabHost.addTab(spec); - - /* - Intent intent3 = new Intent(this, WsqActivity.class); - spec = tabHost.newTabSpec(mTitle[2]).setIndicator( getTabItemView(2) ).setContent(intent3); - tabHost.addTab(spec); - - Intent intent4 = new Intent(this, OldMineActivity.class); - spec = tabHost.newTabSpec(mTitle[3]).setIndicator( getTabItemView(3) ).setContent(intent4); - tabHost.addTab(spec); */ - - tabHost.setCurrentTab(0); - } - - @Override - public void onBackPressed() { - Toast.makeText(this, "确定要退出在这里么?", Toast.LENGTH_LONG).show(); - //super.onBackPressed(); - } - - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/ClassroomActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/ClassroomActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 417200b..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/ClassroomActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,94 +0,0 @@ -package com.stone.shop.view; - -import java.util.ArrayList; -import java.util.List; - -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.listener.FindListener; - -import com.stone.shop.R; -import com.stone.shop.adapter.BXTListAdapter; -import com.stone.shop.adapter.ClassroomAdapter; -import com.stone.shop.model.Classroom; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.view.View; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.GridView; -import android.widget.ListView; -import android.widget.TextView; -import android.widget.Toast; - -public class ClassroomActivity extends Activity implements OnItemClickListener { - - private static final String TAG = "BXTActivity"; - - private GridView lvBXTNews; - private ClassroomAdapter mBxtListAdapter; - private List mBXTNewsList; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_classroom); - - initView(); - initData(); - - } - - private void initView() { - lvBXTNews = (GridView) findViewById(R.id.gv_classroom); - mBXTNewsList = new ArrayList(); - mBxtListAdapter = new ClassroomAdapter(this, mBXTNewsList); - lvBXTNews.setAdapter(mBxtListAdapter); - lvBXTNews.setOnItemClickListener(this); - - TextView tv_title = (TextView) findViewById(R.id.tv_title); - tv_title.setText("教室"); - } - - private void initData() { - BmobQuery query = new BmobQuery(); - query.addWhereEqualTo("type", "教室"); - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List newsList) { - // toast("查询商品成功, 共" + newsList.size()); - if (newsList.size() == 0) - toast("亲, 暂时还木有教室哦"); - else { - mBXTNewsList = newsList; - mBxtListAdapter.refresh(newsList); - mBxtListAdapter.notifyDataSetChanged(); - - } - - } - - @Override - public void onError(int arg0, String arg1) { - toast("查询失败"); - } - }); - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - - @Override - public void onItemClick(AdapterView parent, View view, int position, long id) { - Intent intent = new Intent(ClassroomActivity.this, ReservationActivity.class); - Classroom classroom = mBXTNewsList.get(position); - intent.putExtra("roomId", classroom.getObjectId()); - intent.putExtra("roomName", classroom.getName()); - startActivity(intent); - - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/FeedBackActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/FeedBackActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index af75344..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/FeedBackActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,103 +0,0 @@ -package com.stone.shop.view; - -import cn.bmob.v3.BmobUser; -import cn.bmob.v3.listener.SaveListener; - -import com.stone.shop.R; -import com.stone.shop.model.FeedBack; -import com.stone.shop.model.User; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.EditText; -import android.widget.Toast; - -/** - * 意见反馈界面 - * - * @date 2014-5-27 - * @author Stone - */ -public class FeedBackActivity extends Activity implements OnClickListener { - - private static final String TAG = "FeedBackActivity"; - - private EditText etContent; - private Button btnSubmit; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_feedback); - - initView(); - } - - private void initView() { - etContent = (EditText) findViewById(R.id.et_feedback_content); - btnSubmit = (Button) findViewById(R.id.btn_feedback_submit); - btnSubmit.setOnClickListener(this); - } - - /** - * 提交用户的反馈信息 - */ - private void submit() { - String content = etContent.getText().toString(); - if (content.equals("")) { - toast("亲,请先写点东西吧"); - } else { - BmobUser user = BmobUser.getCurrentUser(this); - FeedBack fb = new FeedBack(); - fb.setUsername(user.getUsername()); - fb.setEmail(user.getEmail()); - fb.setContent(content); - fb.save(this, new SaveListener() { - - @Override - public void onSuccess() { - // TODO Auto-generated method stub - toast("提交成功, 在这里会尽快回复"); - back(); - } - - @Override - public void onFailure(int arg0, String arg1) { - // TODO Auto-generated method stub - toast("提交失败"); - } - }); - - } - - } - - @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.btn_feedback_submit: - submit(); - break; - - default: - break; - } - } - - private void back() { - finish(); - } - - public void clickFeedBack(View v) { - finish(); - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/HomeActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/HomeActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index ef4e9c5..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/HomeActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,195 +0,0 @@ -package com.stone.shop.view; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - -import android.app.Activity; -import android.content.Context; -import android.content.Intent; -import android.opengl.Visibility; -import android.os.Bundle; -import android.support.v4.view.ViewPager.OnPageChangeListener; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.FrameLayout; -import android.widget.ImageButton; -import android.widget.ImageView; -import android.widget.ListView; -import android.widget.ImageView.ScaleType; -import android.widget.TextView; -import android.widget.Toast; - -import cn.bmob.v3.Bmob; -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.listener.FindListener; -import cn.bmob.v3.listener.GetServerTimeListener; - -import com.stone.date.TypeDef; -import com.stone.shop.R; -import com.stone.shop.adapter.ImagePagerAdapter; -import com.stone.shop.adapter.NewsListAdapter; -import com.stone.shop.model.News; -import com.stone.shop.model.Shop; -import com.stone.ui.AutoScrollViewPager; -import com.stone.ui.ListScrollView; - -/** - * 主界面 - * - * @date 2014-4-24 - * @author Stone - */ -public class HomeActivity extends Activity implements OnClickListener, - OnItemClickListener { - - private static final String TAG = "HomeActivity"; - - private ListScrollView listScrollView; - - // 校历 - private TextView tvWeek; // 周次和星期 - private TextView tvDay; // 年月日 - - // 图片轮播 - private FrameLayout flImageAds; - private AutoScrollViewPager viewPager; - private List mImgViews; - private ImageButton btnHideAds; - private int[] mImgResId = { R.drawable.ic_banner1, R.drawable.ic_banner1, - R.drawable.ic_banner1, R.drawable.ic_banner1 }; - - // 校园新闻 - private ListView lvNewsList; - private List newsList = new ArrayList(); - private NewsListAdapter newsListAdapter; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_home); - - // 解决ScrollView和ListView之间的冲突 - listScrollView = (ListScrollView) findViewById(R.id.listScrollView); - lvNewsList = (ListView) findViewById(R.id.lv_news); - listScrollView.setListView(lvNewsList); - - flImageAds = (FrameLayout) findViewById(R.id.fl_image_ads); - viewPager = (AutoScrollViewPager) findViewById(R.id.view_pager); - btnHideAds = (ImageButton) findViewById(R.id.btn_hide_ads); - - mImgViews = new ArrayList(); - for (int i = 0; i < mImgResId.length; i++) { - ImageView imageView = new ImageView(this); - imageView.setImageResource(mImgResId[i]); - imageView.setScaleType(ScaleType.CENTER_CROP); - mImgViews.add(imageView); - } - - btnHideAds.setOnClickListener(this); - - viewPager.setAdapter(new ImagePagerAdapter(this, mImgViews)); - viewPager.setInterval(3000); // 设置自动滚动的间隔时间,单位为毫秒 - viewPager.setDirection(AutoScrollViewPager.RIGHT); // 设置自动滚动的方向,默认向右 - viewPager.setCycle(true); // 是否自动循环轮播,默认为true - viewPager.setScrollDurationFactor(3); // 设置ViewPager滑动动画间隔时间的倍率,达到减慢动画或改变动画速度的效果 - viewPager.setStopScrollWhenTouch(true); // 当手指碰到ViewPager时是否停止自动滚动,默认为true - viewPager.setBorderAnimation(true); // 设置循环滚动时滑动到从边缘滚动到下一个是否需要动画,默认为true - viewPager - .setSlideBorderMode(AutoScrollViewPager.SLIDE_BORDER_MODE_NONE);// 滑动到第一个或最后一个Item的处理方式,支持没有任何操作、轮播以及传递到父View三种模式 - - viewPager.startAutoScroll(); - - // 校历 - tvWeek = (TextView) findViewById(R.id.tv_week); - tvDay = (TextView) findViewById(R.id.tv_day); - setTime(); - - // 新闻 - newsListAdapter = new NewsListAdapter(this, newsList); - lvNewsList.setAdapter(newsListAdapter); - lvNewsList.setOnItemClickListener(this); - - getNewsData(); - } - - /** - * 设置校历中日期的时间 - */ - public void setTime() { - Calendar calendar = Calendar.getInstance(); - String year = calendar.get(Calendar.YEAR)+""; - String month = calendar.get(Calendar.MONTH)+1+""; - String day = calendar.get(Calendar.DAY_OF_MONTH)+""; - String week = calendar.get(Calendar.WEEK_OF_YEAR)-9+""; - String dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK)+""; - String chDayOfWeek = TypeDef.chDayOfWeek[Integer.parseInt(dayOfWeek)-1]; - toast(year+"-"+month+"-"+day+" "+" 第 "+week+" 周 "+" "+" 星期 "+chDayOfWeek); - tvWeek.setText(" 第 "+week+" 周 "+" "+" 星期 "+chDayOfWeek); - tvDay.setText(year+" 年 "+month+" 月 "+day+" 日"); - } - - /** - * 初始化新闻列表数据 - * @date 2014-5-3 - * @author Stone - */ - public void getNewsData() { - BmobQuery query = new BmobQuery(); - query.order("-updatedAt"); - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List object) { - newsList = object; - // 通知Adapter数据更新 - newsListAdapter.refresh((ArrayList) newsList); - newsListAdapter.notifyDataSetChanged(); - } - - @Override - public void onError(int arg0, String arg1) { - toast("对不起, 获取数据失败了"); - } - }); - } - - @Override - protected void onResume() { - super.onResume(); - // start auto scroll when onResume - viewPager.startAutoScroll(); - } - - @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.btn_hide_ads: - flImageAds.setVisibility(View.GONE); - break; - - default: - break; - } - } - - @Override - public void onItemClick(AdapterView parent, View view, int position, - long id) { - Intent toNewsDetail = new Intent(HomeActivity.this, NewsActivity.class); - toNewsDetail.putExtra("NewsTitle", newsList.get(position).getTitle()); - toNewsDetail.putExtra("NewsAuthor", newsList.get(position).getAuthor()); - toNewsDetail.putExtra("NewsTime", newsList.get(position).getCreatedAt()); - toNewsDetail.putExtra("NewsContent", newsList.get(position).getContent()); - startActivity(toNewsDetail); - } - - public void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT); - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/LoginActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/LoginActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 5993407..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/LoginActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,346 +0,0 @@ -package com.stone.shop.view; - -import java.io.IOException; -import java.io.InputStream; -import java.net.HttpURLConnection; -import java.net.URL; - -import org.json.JSONException; -import org.json.JSONObject; - -import android.app.Activity; -import android.content.Intent; -import android.content.SharedPreferences; -import android.content.SharedPreferences.Editor; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Color; -import android.os.Bundle; -import android.os.Handler; -import android.os.Message; -import android.os.SystemClock; -import android.text.TextUtils; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.EditText; -import android.widget.ImageView; -import android.widget.TextView; -import android.widget.Toast; -import cn.bmob.v3.Bmob; -import cn.bmob.v3.listener.SaveListener; - -import com.stone.shop.R; -import com.stone.shop.model.User; -import com.stone.util.Util; -import com.tencent.connect.UserInfo; -import com.tencent.connect.auth.QQAuth; -import com.tencent.connect.common.Constants; -import com.tencent.tauth.IUiListener; -import com.tencent.tauth.Tencent; -import com.tencent.tauth.UiError; - -/** - * 登陆界面 - * - * @date 2014-4-24 - * @author Stone - */ -public class LoginActivity extends Activity implements OnClickListener { - - private static final String TAG = "LoginActicity"; - - private Button btnLogin; - private Button btnReg; - private EditText etUsername; - private EditText etPassword; - - private String username; - private String password; - - private static final String APP_ID = "222222"; - private UserInfo mInfo; - private TextView mUserInfo; - private ImageView mUserLogo; - private ImageView mNewLoginButton; - private TextView backInfo; - - // QQ登陆 - private static Tencent mTencent; - // private QQAuth mQQAuth; - - Handler mHandler = new Handler() { - - @Override - public void handleMessage(Message msg) { - if (msg.what == 0) { - JSONObject response = (JSONObject) msg.obj; - if (response.has("nickname")) { - try { - mUserInfo.setVisibility(android.view.View.VISIBLE); - mUserInfo.setText(response.getString("nickname")); - } catch (JSONException e) { - e.printStackTrace(); - } - } - - } else if (msg.what == 1) { - Bitmap bitmap = (Bitmap) msg.obj; - mUserLogo.setImageBitmap(bitmap); - mUserLogo.setVisibility(android.view.View.VISIBLE); - } - } - - }; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - // 初始化 Bmob SDK - // 使用时请将第二个参数Application ID替换成你在Bmob服务器端创建的Application ID - Bmob.initialize(this, "252a2c58d0dc9a78a5411501c62ce0de"); - setContentView(R.layout.activity_login); - - // QQ登陆, 获取实例 - // mQQAuth = QQAuth.createInstance(APP_ID, - // this.getApplicationContext()); - mTencent = Tencent.createInstance(APP_ID, this.getApplicationContext()); - - btnLogin = (Button) findViewById(R.id.btn_login); - btnReg = (Button) findViewById(R.id.btn_register); - - etUsername = (EditText) findViewById(R.id.et_username); - etPassword = (EditText) findViewById(R.id.et_password); - - btnLogin.setOnClickListener(this); - btnReg.setOnClickListener(this); - - findViewById(R.id.btn_qq).setOnClickListener(this); - - mUserInfo = (TextView) findViewById(R.id.user_nickname); - mUserLogo = (ImageView) findViewById(R.id.user_logo); - mNewLoginButton = (ImageView) findViewById(R.id.new_login_btn); - mNewLoginButton.setOnClickListener(this); - backInfo = (TextView) findViewById(R.id.user_callback); - - getUserInfo(); - - } - - private void getUserInfo() { - SharedPreferences sp = getSharedPreferences("UserInfo", 0); - etUsername.setText(sp.getString("username", null)); - etPassword.setText(sp.getString("password", null)); - } - - // 保存用户的登陆记录 - private void saveUserInfo(String username, String password) { - SharedPreferences sp = getSharedPreferences("UserInfo", 0); - Editor editor = sp.edit(); - editor.putString("username", username); - editor.putString("password", password); - editor.commit(); - } - - public void onClickLogin() { - if (!mTencent.isSessionValid()) { - mTencent.login(this, "all", loginListener); - Log.d("SDKQQAgentPref", "FirstLaunch_SDK:" + SystemClock.elapsedRealtime()); - } else { - - mTencent.logout(this); - updateUserInfo(); - } - } - - @Override - public void onClick(View v) { - switch (v.getId()) { - // 登陆 - case R.id.btn_login: - username = etUsername.getText().toString(); - password = etPassword.getText().toString(); - - if (!Util.isNetworkConnected(this)) { - toast("木有网络 ( ⊙ o ⊙ ) "); - } else if (username.equals("") || password.equals("")) { - toast("请输入账号和密码"); - break; - } else { - final User bu2 = new User(); - bu2.setUsername(username); - bu2.setPassword(password); - bu2.login(this, new SaveListener() { - - @Override - public void onSuccess() { - // TODO Auto-generated method stub - toast("欢迎进入 在这里 服务系统"); - // 保存用户信息 - saveUserInfo(username, password); - // 跳转到主页 - User.userId = bu2.getObjectId(); - Intent toHome = new Intent(LoginActivity.this, BaseActivity.class); - startActivity(toHome); - finish(); - } - - @Override - public void onFailure(int arg0, String arg1) { - // TODO Auto-generated method stub - toast("用户名或密码错误"); - } - }); - } - break; - - case R.id.btn_register: - Intent toReg = new Intent(LoginActivity.this, RegisterActivity.class); - startActivity(toReg); - break; - case R.id.btn_qq: - - onClickLogin(); - - break; - - default: - break; - - } - } - - public void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - - IUiListener loginListener = new BaseUiListener() { - @Override - protected void doComplete(JSONObject values) { - Log.d("SDKQQAgentPref", "AuthorSwitch_SDK:" + SystemClock.elapsedRealtime()); - initOpenidAndToken(values); - updateUserInfo(); - } - }; - - private class BaseUiListener implements IUiListener { - - @Override - public void onComplete(Object response) { - if (null == response) { - Util.showResultDialog(LoginActivity.this, "返回为空", "登录失败"); - return; - } - JSONObject jsonResponse = (JSONObject) response; - if (null != jsonResponse && jsonResponse.length() == 0) { - Util.showResultDialog(LoginActivity.this, "返回为空", "登录失败"); - return; - } - // Util.showResultDialog(LoginActivity.this, response.toString(), - // "登录成功"); - doComplete((JSONObject) response); - try { - User.userId = jsonResponse.getString("openid"); - } catch (JSONException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - Intent toHome = new Intent(LoginActivity.this, BaseActivity.class); - startActivity(toHome); - finish(); - } - - protected void doComplete(JSONObject values) { - - } - - @Override - public void onError(UiError e) { - Util.toastMessage(LoginActivity.this, "onError: " + e.errorDetail); - Util.dismissDialog(); - } - - @Override - public void onCancel() { - Util.toastMessage(LoginActivity.this, "onCancel: "); - Util.dismissDialog(); - } - } - - private void updateUserInfo() { - if (mTencent != null && mTencent.isSessionValid()) { - IUiListener listener = new IUiListener() { - - @Override - public void onError(UiError e) { - - } - - @Override - public void onComplete(final Object response) { - Message msg = new Message(); - msg.obj = response; - msg.what = 0; - mHandler.sendMessage(msg); - new Thread() { - - @Override - public void run() { - JSONObject json = (JSONObject) response; - if (json.has("figureurl")) { - Bitmap bitmap = null; - try { - bitmap = Util.getbitmap(json.getString("figureurl_qq_2")); - } catch (JSONException e) { - - } - Message msg = new Message(); - msg.obj = bitmap; - msg.what = 1; - mHandler.sendMessage(msg); - } - } - - }.start(); - } - - @Override - public void onCancel() { - - } - }; - mInfo = new UserInfo(this, mTencent.getQQToken()); - mInfo.getUserInfo(listener); - - } else { - mUserInfo.setText(""); - mUserInfo.setVisibility(android.view.View.GONE); - mUserLogo.setVisibility(android.view.View.GONE); - } - } - - public static void initOpenidAndToken(JSONObject jsonObject) { - try { - String token = jsonObject.getString(Constants.PARAM_ACCESS_TOKEN); - String expires = jsonObject.getString(Constants.PARAM_EXPIRES_IN); - String openId = jsonObject.getString(Constants.PARAM_OPEN_ID); - if (!TextUtils.isEmpty(token) && !TextUtils.isEmpty(expires) && !TextUtils.isEmpty(openId)) { - mTencent.setAccessToken(token, expires); - mTencent.setOpenId(openId); - } - } catch (Exception e) { - } - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - Log.d(TAG, "-->onActivityResult " + requestCode + " resultCode=" + resultCode); - if (requestCode == Constants.REQUEST_LOGIN || requestCode == Constants.REQUEST_APPBAR) { - Tencent.onActivityResultData(requestCode, resultCode, data, loginListener); - } - - super.onActivityResult(requestCode, resultCode, data); - } -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/MineActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/MineActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 5e612f4..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/MineActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -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 query = new BmobQuery(); - 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, "校园小菜-HBUT版" +"\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(); - } - - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/MineInfoActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/MineInfoActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index d5ce189..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/MineInfoActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,124 +0,0 @@ -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 query = new BmobQuery(); - query.addWhereEqualTo("objectId", bmobUser.getObjectId()); - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List 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(); - } - - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/MineInfoEditActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/MineInfoEditActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 39902ea..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/MineInfoEditActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,145 +0,0 @@ -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 cn.bmob.v3.listener.UpdateListener; - -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.util.Log; -import android.view.View; -import android.widget.EditText; -import android.widget.Toast; - -/** - * 修改个人资料卡 - * @date 2014-5-28 - * @author Stone - */ -public class MineInfoEditActivity extends Activity { - - private EditText etUsername; - private EditText etSchool; - private EditText etCademy; - private EditText etDorPart; - private EditText etDorNum; - private EditText etPhone; - private EditText etQQ; - - private User curUser; - private Bundle bundle; - 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_edit); - - setCurUser(); - } - - private void initView() { - etUsername = (EditText) findViewById(R.id.et_mineinfo_username); - etSchool = (EditText) findViewById(R.id.et_mineinfo_school); - etCademy = (EditText) findViewById(R.id.et_mineinfo_cademy); - etDorPart = (EditText) findViewById(R.id.et_mineinfo_dorpart); - etDorNum = (EditText) findViewById(R.id.et_mineinfo_dornum); - etPhone = (EditText) findViewById(R.id.et_mineinfo_phone); - etQQ = (EditText) findViewById(R.id.et_mineinfo_qq); - - etUsername.setText(curUser.getUsername()); - etSchool.setText(curUser.getSchool()); - etCademy.setText(curUser.getCademy()); - etDorPart.setText(curUser.getDorPart()); - etDorNum.setText(curUser.getDorNum()); - etPhone.setText(curUser.getPhone()); - etQQ.setText(curUser.getQQ()); - } - - private void setCurUser() { - BmobUser bmobUser = BmobUser.getCurrentUser(this); - BmobQuery query = new BmobQuery(); - query.addWhereEqualTo("objectId", bmobUser.getObjectId()); - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List object) { - curUser = object.get(0); - //toast("查询到用户 " + object.size()); - Message msg = new Message(); - msg.what = MessageDef.MINE_INFO_FINISH_FIND_USER; - mHandler.sendMessage(msg); - } - - @Override - public void onError(int arg0, String arg1) { - toast("获取当前用户失败"); - } - }); - - } - - private void saveUserInfo() { - if(curUser == null) { - toast("curUser为空"); - } else { - toast("当前用户为 " + curUser.getUsername()); - } - Log.i("当前用户的ID: ", curUser.getObjectId()); - curUser.setUsername(etUsername.getText().toString()); - curUser.setSchool(etSchool.getText().toString()); - curUser.setCademy(etCademy.getText().toString()); - curUser.setDorPart(etDorPart.getText().toString()); - curUser.setDorNum(etDorNum.getText().toString()); - curUser.setPhone(etPhone.getText().toString()); - curUser.setQQ(etQQ.getText().toString()); - curUser.update(this, curUser.getObjectId(), new UpdateListener() { - - @Override - public void onSuccess() { - toast("更新成功"); - } - - @Override - public void onFailure(int arg0, String arg1) { - toast("更新失败"); - } - }); - } - - public void clickSave(View v) { - saveUserInfo(); - finish(); - } - - public void clickCancel(View v) { - finish(); - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/NewsActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/NewsActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 2014960..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/NewsActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,72 +0,0 @@ -package com.stone.shop.view; - -import com.stone.shop.R; - -import android.app.Activity; -import android.os.Bundle; -import android.widget.TextView; - -/** - * 新闻内容显示界面 - * @date 2014-5-8 - * @author Stone - */ -public class NewsActivity extends Activity { - - private static String TAG = "NewsActivity"; - - private TextView tvNewsTitle; - private TextView tvNewsAuthor; - private TextView tvNewsTime; - private TextView tvNewsContent; - - private String newsTitle; - private String newsAuthor; - private String newsTime; - private String newsContent; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_news); - - getIntentData(); - initView(); - } - - //获取Intent中传入的新闻数据 - private void getIntentData() { - newsTitle = getIntent().getStringExtra("NewsTitle"); - newsAuthor = getIntent().getStringExtra("NewsAuthor"); - newsTime = getIntent().getStringExtra("NewsTime"); - newsContent = getIntent().getStringExtra("NewsContent"); - - newsTitle = splitString(newsTitle); //拆分字符串, 将新闻标题设置为 "】" 后面的内容 - } - - private String splitString(String str) { - String[] strs = null; - if(str.equals("")){ - return ""; - } else if ( !(str.contains("【") || str.contains("】")) ) { - return str; - } - strs = str.split("】"); - return strs[1]; - } - - private void initView() { - tvNewsTitle = (TextView) findViewById(R.id.tv_news_title); - tvNewsAuthor = (TextView) findViewById(R.id.tv_news_author); - tvNewsTime = (TextView) findViewById(R.id.tv_news_time); - tvNewsContent = (TextView) findViewById(R.id.tv_news_content); - - tvNewsTitle.setText(newsTitle); - tvNewsAuthor.setText("作者: "+newsAuthor); - tvNewsTime.setText("发布日期 : "+newsTime); - tvNewsContent.setText(newsContent); - } - - - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/OrderActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/OrderActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index fcdf913..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/OrderActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,218 +0,0 @@ -package com.stone.shop.view; - -import java.util.Calendar; - -import android.app.Activity; -import android.app.TimePickerDialog; -import android.content.Intent; -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.EditText; -import android.widget.TextView; -import android.widget.TimePicker; -import android.widget.Toast; - -import cn.bmob.v3.BmobUser; -import cn.bmob.v3.listener.SaveListener; - -import com.stone.shop.R; -import com.stone.shop.model.Good; -import com.stone.shop.model.Order; -import com.stone.shop.model.Shop; -import com.stone.ui.DialogOrder; -import com.stone.util.Util; - -/** - * 应用主界面 - * - * @date 2014-5-13 - * @author Stone - */ -public class OrderActivity extends Activity implements OnClickListener { - - private TextView tvOrderShop; // 店名 - private TextView tvOrderGood; // 菜名 - private TextView tvOrderCount; // 数量 - private TextView tvOrderTime; // 取餐时间 - private TimePicker tpOrderTime; // 时间选择控件 - private EditText etOrderPhone; // 联系电话 - private EditText etOrderWords; // 附加留言 - private Button btnOrderCountMore; // 增加数量 - private Button btnOrderCountLess; // 减少数量 - - private Button btnOrderSetTime; // 设置时间 - private Button btnDlgOk; // 设置时间完成 - private Button btnOrderSubmit; // 提交订单 - - // private DialogOrder dlgSetOrderTime; - // private View dlgOrderView; - private int mHour; - private int mMinute; - private String time = "12 : 30"; - private TimePickerDialog dlgSetOrderTime; - private TimePickerDialog.OnTimeSetListener mTimeSetListener = new TimePickerDialog.OnTimeSetListener() { - - public void onTimeSet(TimePicker view, int hourOfDay, int minute) { - mHour = hourOfDay; - mMinute = minute; - updateDisplay(); - } - }; - - // 从上级页面中传入的数据 - private Shop shop; // 当期选择的Shop - private Good good; // 当前选择的商品 - private String shopID; // 当前选择的Shop的ID - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_order); - - shop = (Shop) getIntent().getSerializableExtra("shop"); - good = (Good) getIntent().getSerializableExtra("good"); - shopID = getIntent().getStringExtra("shopID"); - - initView(); - // initDlgView(); - } - - private void initView() { - - tvOrderShop = (TextView) findViewById(R.id.tv_order_shop); - tvOrderGood = (TextView) findViewById(R.id.tv_order_good); - tvOrderCount = (TextView) findViewById(R.id.tv_order_count); - tvOrderTime = (TextView) findViewById(R.id.tv_order_time); - tvOrderShop.setText(shop.getName()); - tvOrderGood.setText(good.getName()); - - etOrderPhone = (EditText) findViewById(R.id.et_order_phone); - etOrderWords = (EditText) findViewById(R.id.et_order_words); - - btnOrderCountMore = (Button) findViewById(R.id.btn_order_count_more); - btnOrderCountLess = (Button) findViewById(R.id.btn_order_count_less); - btnOrderSetTime = (Button) findViewById(R.id.btn_set_time); - btnOrderSubmit = (Button) findViewById(R.id.btn_order_submit); - btnOrderCountMore.setOnClickListener(this); - btnOrderCountLess.setOnClickListener(this); - btnOrderSetTime.setOnClickListener(this); - btnOrderSubmit.setOnClickListener(this); - - } - - // private void initDlgView() { - // LayoutInflater inflater = LayoutInflater.from(this); - // dlgOrderView = inflater.inflate(R.layout.dlg_order_settime, null); - // tpOrderTime = (TimePicker) dlgOrderView.findViewById(R.id.tp_dlg_time); - // tpOrderTime.setIs24HourView(true); - // btnDlgOk = (Button) dlgOrderView.findViewById(R.id.btn_dlg_ok); - // btnDlgOk.setOnClickListener(this); - // } - - @Override - public void onClick(View v) { - int count = 1; - switch (v.getId()) { - case R.id.btn_order_count_more: - count = Integer.parseInt(tvOrderCount.getText().toString()); - if (count == 4) { - toast("每份订单数量不能超过 4"); - } else { - tvOrderCount.setText((count + 1) + ""); - } - break; - case R.id.btn_order_count_less: - count = Integer.parseInt(tvOrderCount.getText().toString()); - if (count == 1) { - toast("每份订单数量至少为 1 "); - } else { - tvOrderCount.setText((count - 1) + ""); - } - break; - case R.id.btn_set_time: - // dlgSetOrderTime = new DialogOrder(this, R.style.MyDialog); - // dlgSetOrderTime.show(); - final Calendar c = Calendar.getInstance(); - mHour = c.get(Calendar.HOUR_OF_DAY); - mMinute = c.get(Calendar.MINUTE); - dlgSetOrderTime = new TimePickerDialog(this, mTimeSetListener, mHour, mMinute, true); - dlgSetOrderTime.show(); - break; - case R.id.btn_dlg_ok: - time = tpOrderTime.getCurrentHour() + " : " + tpOrderTime.getCurrentMinute(); - dlgSetOrderTime.dismiss(); - case R.id.btn_order_submit: - // toast("小菜订单提交成功"); - postOrder(); - finish(); - // back(); - break; - default: - break; - } - - } - - /** - * 提交订单数据 - */ - private void postOrder() { - String count = tvOrderCount.getText().toString(); - String phone = etOrderPhone.getText().toString(); - String words = etOrderWords.getText().toString(); - float price = Integer.parseInt(count) * Float.parseFloat(good.getPrice()); - if (!Util.isPhoneNumberValid(phone)) { - toast("请输入正确的联系电话, 方便取餐"); - } else { - Order order = new Order(); - BmobUser user = BmobUser.getCurrentUser(this); - order.setUserName(user.getUsername()); - order.setGoodID(good.getObjectId()); - order.setGoodName(good.getName()); - order.setShopID(shop.getObjectId()); - order.setShopName(shop.getName()); - order.setCount(count); - order.setTime(time); - order.setPrice(price + ""); - order.setPhone(phone); - order.setTips(words); - order.save(this, new SaveListener() { - - @Override - public void onSuccess() { - // TODO Auto-generated method stub - toast("订单提交成功"); - } - - @Override - public void onFailure(int arg0, String arg1) { - // TODO Auto-generated method stub - toast("订单提交失败"); - } - }); - - } - } - - private void updateDisplay() { - time = mHour + " : " + mMinute; - tvOrderTime.setText(time); - } - - private void back() { - Intent back = new Intent(OrderActivity.this, ShopItemActivity.class); - Bundle bundle = new Bundle(); - bundle.putSerializable("shop", shop); - bundle.putString("shopID", shopID); // 商铺的ID需要单独传递,否则获取到的是null - back.putExtras(bundle); - startActivity(back); - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/OrderInfoActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/OrderInfoActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index e3c3d26..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/OrderInfoActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,116 +0,0 @@ -package com.stone.shop.view; - -import java.util.ArrayList; -import java.util.List; - -import android.app.Activity; -import android.os.Bundle; -import android.view.MenuItem; -import android.view.View; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemLongClickListener; -import android.widget.ListView; -import android.widget.PopupMenu; -import android.widget.Toast; -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.BmobUser; -import cn.bmob.v3.listener.FindListener; - -import com.stone.shop.R; -import com.stone.shop.adapter.OrderInfoListAdapter; -import com.stone.shop.model.Order; - -/** - * 订单详情页面 - * - * @date 2014-5-27 - * @author Stone - */ -public class OrderInfoActivity extends Activity implements OnItemLongClickListener{ - - private static final String TAG = "OrderInfoActivity"; - - private ListView lvOrderInfo; - private OrderInfoListAdapter orderInfoListAdapter; - private List orderList = new ArrayList(); - - private String type = ""; // now-当前订单 old-历史订单 - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_order_info); - - type = getIntent().getStringExtra("type"); - - initData(); - initView(); - } - - private void initView() { - lvOrderInfo = (ListView) findViewById(R.id.lv_order_info); - orderInfoListAdapter = new OrderInfoListAdapter(this, orderList); - lvOrderInfo.setAdapter(orderInfoListAdapter); - lvOrderInfo.setOnItemLongClickListener(this); - } - - // 初始化列表菜单中数据 - public void initData() { - // 获取用户 - BmobUser user = BmobUser.getCurrentUser(this); - - // 获取小菜订单(数量) - BmobQuery query = new BmobQuery(); - query.order("-updatedAt"); - query.addWhereEqualTo("userName", user.getUsername()); - if(type.equals("now")) { - query.addWhereEqualTo("state", "未取餐"); - } else if(type.equals("old")) { - query.addWhereEqualTo("state", "已取餐"); - } else { - // do nothing - } - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List object) { - if (object.size() == 0) - toast("您还没有订单"); - orderList = object; - // 通知Adapter数据更新 - orderInfoListAdapter.refresh(orderList); - orderInfoListAdapter.notifyDataSetChanged(); - } - - @Override - public void onError(int arg0, String arg1) { - toast("查询失败"); - } - }); - - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - - //订单长按响应事件 - @Override - public boolean onItemLongClick(AdapterView parent, View view, - int position, long id) { - PopupMenu popup = new PopupMenu(this, lvOrderInfo); - popup.getMenuInflater().inflate(R.menu.popup, popup.getMenu()); - - popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { - public boolean onMenuItemClick(MenuItem item) { - Toast.makeText(OrderInfoActivity.this, "Clicked popup menu item " + item.getTitle(), - Toast.LENGTH_SHORT).show(); - return true; - } - }); - - popup.show(); - return false; - }; - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/RegisterActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/RegisterActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index f57ac81..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/RegisterActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,108 +0,0 @@ -package com.stone.shop.view; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import com.stone.shop.R; -import com.stone.shop.model.User; -import com.stone.util.Util; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.EditText; -import android.widget.Toast; -import cn.bmob.v3.listener.SaveListener; - -/** - * 注册界面 - * - * @date 2014-4-24 - * @author Stone - */ -public class RegisterActivity extends Activity implements OnClickListener { - - private static final String TAG = "RegisterActivity"; - - private Button btnReg; - private EditText etUsername; - private EditText etPassword; - private EditText etComfirmPsd; - private EditText etPhone; - - private String username = null; - private String password = null; - private String comfirmPsd = null; - private String phone = null; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_reg); - - etUsername = (EditText) findViewById(R.id.et_username); - etPassword = (EditText) findViewById(R.id.et_password); - etComfirmPsd = (EditText) findViewById(R.id.et_comfirm_psd); - etPhone = (EditText) findViewById(R.id.et_phone); - - btnReg = (Button) findViewById(R.id.btn_reg_now); - btnReg.setOnClickListener(this); - } - - @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.btn_reg_now: - username = etUsername.getText().toString(); - password = etPassword.getText().toString(); - comfirmPsd = etComfirmPsd.getText().toString(); - phone = etPhone.getText().toString(); - if (!Util.isNetworkConnected(this)) { - toast("木有网络 ( ⊙ o ⊙ ) "); - } else if (username.equals("") || password.equals("") || comfirmPsd.equals("") || phone.equals("")) { - toast("不填完整不能拿到身份证, ~~~~(>_<)~~~~ "); - } else if (!comfirmPsd.equals(password)) { - toast("两次密码输入不一致"); - } else if (!Util.isPhoneNumberValid(phone)) { - toast("请输入正确的手机号码"); - } else { - // 开始提交注册信息 - User bu = new User(); - bu.setUsername(username); - bu.setPassword(password); - bu.setPhone(phone); - bu.signUp(this, new SaveListener() { - - @Override - public void onSuccess() { - // TODO Auto-generated method stub - toast("拿到身份证了,快登陆吧"); - Intent backLogin = new Intent(RegisterActivity.this, LoginActivity.class); - startActivity(backLogin); - RegisterActivity.this.finish(); - } - - @Override - public void onFailure(int arg0, String arg1) { - // TODO Auto-generated method stub - toast("该名字已被人使用,换个名字吧."); - } - } - - ); - } - break; - - default: - break; - } - } - - public void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - }; - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/ReservationActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/ReservationActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 90bf398..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/ReservationActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,138 +0,0 @@ -package com.stone.shop.view; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - -import com.stone.shop.R; -import com.stone.shop.model.Reservation; -import com.stone.shop.model.User; -import com.stone.ui.DateTimePickDialogUtil; -import com.stone.ui.DateTimePickDialogUtil.DateTimeListener; - -import android.app.Activity; -import android.os.Bundle; -import android.text.TextUtils; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.TextView; -import android.widget.Toast; -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.listener.DeleteListener; -import cn.bmob.v3.listener.FindListener; -import cn.bmob.v3.listener.SaveListener; - -public class ReservationActivity extends Activity { - - private Button btn_login; - private SimpleDateFormat dateFormat; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.layout_reservation); - - TextView tv_title = (TextView) findViewById(R.id.tv_title); - tv_title.setText("教室预定"); - - final String roomId = getIntent().getStringExtra("roomId"); - final String roomName = getIntent().getStringExtra("roomName"); - - TextView tv_room = (TextView) findViewById(R.id.tv_room); - tv_room.setText("教室:" + roomName); - - btn_login = (Button) findViewById(R.id.btn_login); - - dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm"); - - // 查找Person表里面id为6b6c11c537的数据 - BmobQuery bmobQuery = new BmobQuery(); - bmobQuery.addWhereEqualTo("userId", User.userId); - bmobQuery.addWhereEqualTo("roomId", roomId); - bmobQuery.findObjects(ReservationActivity.this, new FindListener() { - - @Override - public void onSuccess(List newsList) { - // toast("查询商品成功, 共" + newsList.size()); - if (newsList.size() != 0) { - - String dateTime = newsList.get(0).getDateTime(); - - try { - if (dateFormat.parse(dateTime).before(new Date())) { - - Reservation gameScore = new Reservation(); - gameScore.setObjectId(newsList.get(0).getObjectId()); - gameScore.delete(ReservationActivity.this); - - } else { - btn_login.setEnabled(false); - btn_login.setText("已经预定" + (TextUtils.isEmpty(dateTime) ? "" : (" " + dateTime))); - } - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - } - - @Override - public void onError(int arg0, String arg1) { - toast("查询失败"); - } - }); - - btn_login.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - // TODO Auto-generated method stub - - DateTimePickDialogUtil dateTimePicKDialog = new DateTimePickDialogUtil(ReservationActivity.this, - dateFormat.format(new Date())); - dateTimePicKDialog.dateTimePicKDialog(new DateTimeListener() { - - @Override - public void onDateTimeChane(final String dateTime) { - // TODO Auto-generated method stub - - Reservation reservation = new Reservation(); - reservation.setRoomId(roomId); - reservation.setRoomName(roomName); - reservation.setUserId(User.userId); - reservation.setDateTime(dateTime); - - reservation.save(ReservationActivity.this, new SaveListener() { - - @Override - public void onSuccess() { - // TODO Auto-generated method stub - toast("预定成功"); - btn_login.setEnabled(false); - btn_login.setText("已经预定 " + dateTime); - - } - - @Override - public void onFailure(int arg0, String arg1) { - // TODO Auto-generated method stub - toast("预定失败"); - - } - }); - } - }); - - } - }); - - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/ShopActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/ShopActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 01f5159..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/ShopActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,135 +0,0 @@ -package com.stone.shop.view; - -import com.stone.shop.R; -import com.stone.shop.adapter.GridAdapter; -import com.stone.ui.MyGridView; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; -import android.view.animation.Animation; -import android.view.animation.AnimationUtils; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.GridView; -import android.widget.ImageView; -import android.widget.TextView; -import android.widget.Toast; - -/** - * 商品主界面 - * @date 2014-4-24 - * @author Stone - */ -public class ShopActivity extends Activity implements OnItemClickListener{ - - private static final String TAG = "ShopActivity" ; - - private MyGridView gvSchoolClass; //学习小菜 - private MyGridView gvFoodClass; //吃饭小菜 - private MyGridView gvGiftClass; //购物小菜 - private MyGridView gvOutClass; //疯狂小菜 - - //private ImageView imgLoc; - //private ImageView imgSearch; - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_shop); - - initView(); - } - - /** - * 初始化组件并适配数据 - */ - public void initView() { - gvFoodClass = (MyGridView) findViewById(R.id.gv_food_class); - gvGiftClass = (MyGridView) findViewById(R.id.gv_gift_class); - gvOutClass = (MyGridView) findViewById(R.id.gv_out_class); - gvSchoolClass = (MyGridView) findViewById(R.id.gv_school_class); - - gvFoodClass.setAdapter(new GridAdapter(this, 0)); - gvFoodClass.setOnItemClickListener(this); - - gvGiftClass.setAdapter(new GridAdapter(this, 1)); - gvGiftClass.setOnItemClickListener(this); - - gvOutClass.setAdapter(new GridAdapter(this, 2)); - gvOutClass.setOnItemClickListener(this); - - gvSchoolClass.setAdapter(new GridAdapter(this, 3)); - gvSchoolClass.setOnItemClickListener(this); - - } - - @Override - public void onItemClick(AdapterView parent, View view, int position, - long id) { - Log.i("GridView点击了: ", "position"+position); - //toast("点击了: " + position); - switch (parent.getId()) { - - //点击 学习小菜 中的子项(1代表第一个GridView, (position+1)代表GridView中第几个元素) - case R.id.gv_school_class: - //教学类的做特别处理 - if(position==2) { - Intent toInformationActivity = new Intent(ShopActivity.this,InformationActivity.class); - startActivity(toInformationActivity); - } - if(position==1) { - Intent toBXTActivity = new Intent(ShopActivity.this,LibraryActivity.class); - startActivity(toBXTActivity); - } - if(position==0) { - Intent toBXTActivity = new Intent(ShopActivity.this, ClassroomActivity.class); - startActivity(toBXTActivity); - } - - break; - //点击 吃饭小菜 中的子项 - case R.id.gv_food_class: - toShopAllActivity( GridAdapter.mFoodTexts[position], "2"+(position+1) ); - break; - //点击 购物小菜 中的子项 - case R.id.gv_gift_class: - if(position==0) { - Intent toBXTActivity = new Intent(ShopActivity.this, BXTActivity.class); - startActivity(toBXTActivity); - } else { - toShopAllActivity( GridAdapter.mGiftTexts[position], "3"+(position+1) ); - } - break; - //点击 疯狂小菜 中的子项 - case R.id.gv_out_class: - toShopAllActivity( GridAdapter.mOutTexts[position], "4"+(position+1) ); - break; - default: - break; - } - - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - }; - - /** - * - * @param title 父分类标题 - * @param type - */ - private void toShopAllActivity(String title, String type) { - Intent toShopAll = new Intent(ShopActivity.this, ShopAllActivity.class); - toShopAll.putExtra("title", title); - //当前点击的项的父分类 - toShopAll.putExtra("type", type); - startActivity(toShopAll); - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/ShopAllActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/ShopAllActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 9dc775b..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/ShopAllActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,120 +0,0 @@ -package com.stone.shop.view; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.listener.FindListener; - -import com.stone.shop.R; -import com.stone.shop.adapter.ShopListAdapter; -import com.stone.shop.model.Shop; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.util.Log; -import android.view.View; -import android.widget.AdapterView; -import android.widget.ListView; -import android.widget.TextView; -import android.widget.Toast; -import android.widget.AdapterView.OnItemClickListener; - -/** - * 某一分类下的所有店铺页面 - * @author Stone - * @date 2014-4-26 - */ -public class ShopAllActivity extends Activity implements OnItemClickListener{ - - private static final String TAG = "ShopAllActivity" ; - - private TextView tvTitle; - private ListView lvShopAllList; - private ShopListAdapter shopListAdapter; - - //记录从ShopActivity中传过来的当前点击项的类型 - private String type; - private List shopList = new ArrayList(); - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_shop_all); - - //得到从上级Activity中传入的Type数据 - type = getIntent().getStringExtra("type"); - - //获取商店数据 - getShopsDate(); - - initView(); - - } - - public void initView() { - //设置标题 - tvTitle = (TextView) findViewById(R.id.tv_title); - tvTitle.setText(getIntent().getStringExtra("title")); - - lvShopAllList = (ListView) findViewById(R.id.lv_shop_all); - shopListAdapter = new ShopListAdapter(this, (ArrayList) shopList, type); - lvShopAllList.setAdapter(shopListAdapter); - lvShopAllList.setOnItemClickListener(this); - - } - - @Override - public void onItemClick(AdapterView parent, View view, int position, - long id) { - //toast("点击了: " + position); - //将当前点击的Shop对象传递给下一个Activity - Intent toShopItem = new Intent(ShopAllActivity.this, ShopItemActivity.class); - Bundle bundle = new Bundle(); - bundle.putSerializable("shop", shopList.get(position) ); - bundle.putString("shopID", shopList.get(position).getObjectId()); //商铺的ID需要单独传递,否则获取到的是null - Log.i(TAG, ">>发出>>" + "shopID: "+shopList.get(position).getObjectId()+" shopName: "+shopList.get(position).getName()); - toShopItem.putExtras(bundle); - startActivity(toShopItem); - } - - /** - * 加载当前分类的所有店铺到ListView中 - */ - private void getShopsDate() { - BmobQuery query = new BmobQuery(); - query.order("-updatedAt"); - Shop shop = new Shop(); - shop.setType(type); - query.addWhereEqualTo("type", shop.getType()); // 查询当前类型的所有店铺 - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List object) { - //toast("查询成功. 共计" + object.size()); - if(object.size()==0) - toast("还没开张, 耐心等待吧"); - shopList = object; - // 通知Adapter数据更新 - shopListAdapter.refresh((ArrayList) shopList); - shopListAdapter.notifyDataSetChanged(); - - } - - @Override - public void onError(int arg0, String msg) { - toast("查询失败:"+msg); - } - - }); - } - - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - }; - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/ShopItemActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/ShopItemActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 4b65a2a..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/ShopItemActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,313 +0,0 @@ -package com.stone.shop.view; - -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import android.app.Activity; -import android.content.Intent; -import android.graphics.Color; -import android.os.Bundle; -import android.support.v4.view.PagerTabStrip; -import android.support.v4.view.PagerTitleStrip; -import android.support.v4.view.ViewPager; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.AdapterView; -import android.widget.AdapterView.OnItemClickListener; -import android.widget.Button; -import android.widget.EditText; -import android.widget.ImageView; -import android.widget.LinearLayout; -import android.widget.ListView; -import android.widget.TextView; -import android.widget.Toast; -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.BmobQuery.CachePolicy; -import cn.bmob.v3.listener.FindListener; - -import com.stone.shop.R; -import com.stone.shop.adapter.GoodsListAdapter; -import com.stone.shop.adapter.ViewPagerAdapter; -import com.stone.shop.model.Good; -import com.stone.shop.model.Shop; -import com.stone.ui.ViewPagerCompat; - -public class ShopItemActivity extends Activity implements OnClickListener, OnItemClickListener{ - - private static final String TAG = "ShopItemActivity"; - - // ViewPager页 - private View view1, view2; // - private ViewPagerCompat viewPager; // viewpager - private ViewPagerAdapter shopViewPagerAdapter; - private PagerTitleStrip pagerTitleStrip; // viewpager的标题 - private PagerTabStrip pagerTabStrip; // 一个viewpager的指示器,效果就是一个横的粗的下划线 - private List viewList; // 把需要滑动的页卡添加到这个list中 - private List titleList; // viewpager的标题 - - // 店铺商品列表 - private ListView lvGoodsList; - private GoodsListAdapter goodsListAdapter; - private Button btnBuyGood; - - // 店铺简介页中的控件 - private TextView tvShopName; // 店铺名 - private TextView tvShopInfo; // 店铺简介 - private TextView tvShopSale; // 店铺促销信息 - private TextView tvShopLoc; // 店铺地理位置 - private TextView tvShopPhone; // 店铺电话 - private Button btnCommit; - private EditText etCommit; - private LinearLayout llCommitParent; // 评论父线性布局 - private LinearLayout llCommitSon; // 评论子线性布局 - private ImageView imgCall; // 拨打电话 - - // UI测试数据 - private static List goodsList; - - // 从上级页面中传入的数据 - private Shop shop; // 当期选择的Shop - private Good selectGood; - private String shopID; // 当前选择的Shop的ID - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_shop_item); - - // 获取到从ShopAllActivity中传递过来的Shop对象 - shop = (Shop) getIntent().getSerializableExtra("shop"); - shopID = getIntent().getStringExtra("shopID"); - Log.i(TAG, "<<收到<<" + "shopID: " + shop.getObjectId() + " shopName: " - + shop.getName()); - Log.i(TAG, - "<<收到<<" + "shopID: " + shopID + " shopName: " + shop.getName()); - - // 初始化商品页面以及适配数据 - initGoodsDate(); - initView(); - - - } - - public void initView() { - - viewPager = (ViewPagerCompat) findViewById(R.id.viewpager); - pagerTabStrip = (PagerTabStrip) findViewById(R.id.pagertab); - pagerTabStrip.setTabIndicatorColor(Color.rgb(255, 0, 0)); - pagerTabStrip.setDrawFullUnderline(false); - pagerTabStrip.setTextSpacing(50); - pagerTabStrip.setTextColor(Color.rgb(255, 0, 0)); - - view1 = LayoutInflater.from(this) - .inflate(R.layout.viewpager_menu, null); - view2 = LayoutInflater.from(this).inflate(R.layout.viewpager_shopinfo, - null); - - initContentView(); - - viewList = new ArrayList();// 将要分页显示的View装入数组中 - viewList.add(view1); - viewList.add(view2); - - titleList = new ArrayList();// 每个页面的Title数据 - titleList.add("商品"); - titleList.add("店铺简介"); - shopViewPagerAdapter = new ViewPagerAdapter(viewList, titleList); - - viewPager.setAdapter(shopViewPagerAdapter); - viewPager.setCurrentItem(0); - - } - - /** - * 获取某一商店的所有商品 - * - * @date 2014-5-1 - * @autor Stone - */ - public void initGoodsDate() { - goodsList = new ArrayList(); - goodsListAdapter = new GoodsListAdapter(this, goodsList); - BmobQuery query = new BmobQuery(); - query.addWhereEqualTo("shopID", shopID); - query.setCachePolicy(CachePolicy.CACHE_ELSE_NETWORK); // - // 先从缓存取数据,如果没有,再从网络取。 - query.setLimit(15); // 限制最多15个结果 - query.findObjects(this, new FindListener() { - - @Override - public void onSuccess(List goods) { - // toast("查询商品成功, 共" + goods.size()); - if (goods.size() == 0) { - toast("该店还没有添加商品"); - } - goodsList = goods; - goodsListAdapter.refresh(goodsList); - goodsListAdapter.notifyDataSetChanged(); - } - - @Override - public void onError(int arg0, String arg1) { - toast("查询失败"); - } - }); - - } - - public void initContentView() { - // 商品列表页 - lvGoodsList = (ListView) view1.findViewById(R.id.lv_goods_list); - lvGoodsList.setAdapter(goodsListAdapter); - lvGoodsList.setOnItemClickListener(this); - - // 店铺简介页 - tvShopName = (TextView) view2.findViewById(R.id.tv_shop_title); - tvShopInfo = (TextView) view2.findViewById(R.id.tv_shop_introduce); - tvShopSale = (TextView) view2.findViewById(R.id.tv_shop_promotion); - tvShopLoc = (TextView) view2.findViewById(R.id.tv_shop_location); - tvShopPhone = (TextView) view2.findViewById(R.id.tv_shop_phone); - tvShopName.setText(shop.getName()); // 设置店铺名 - tvShopInfo.setText(shop.getInfo()); // 设置店铺简介 - tvShopSale.setText(shop.getSale()); // 设置店铺公告 - tvShopLoc.setText("位置:" + "二食堂二楼"); // 设置店铺位置 - tvShopPhone.setText("电话:" + shop.getPhone()); // 设置店铺联系电话 - - btnCommit = (Button) view2.findViewById(R.id.btn_commit); - btnCommit.setOnClickListener(this); - - // 获取到评论的布局 - etCommit = (EditText) view2.findViewById(R.id.et_commit); - llCommitParent = (LinearLayout) view2 - .findViewById(R.id.ll_commit_parent_view); - llCommitSon = (LinearLayout) findViewById(R.id.ll_commit_son_view); - - imgCall = (ImageView) view2.findViewById(R.id.img_call); - imgCall.setOnClickListener(this); - - } - - /** - * 添加一条评论 - * - * @param user - * @param content - */ - public void insertCommit(String user, String content) { - View view = LayoutInflater.from(this).inflate(R.layout.commit, null); - TextView tvUser = (TextView) view.findViewById(R.id.tv_commit_user); - TextView tvContent = (TextView) view - .findViewById(R.id.tv_commit_content); - tvUser.setText(user); - tvContent.setText(content); - llCommitParent.addView(view); - tvUser = null; - tvContent = null; - } - -// public void clickBuyGood(View v) { -// Intent toOrderActivity = new Intent(ShopItemActivity.this, OrderActivity.class); -// Bundle bundle = new Bundle(); -// bundle.putSerializable("shop", shop ); -// bundle.putString("shopID", shopID); //商铺的ID需要单独传递,否则获取到的是null -// toOrderActivity.putExtras(bundle); -// startActivity(toOrderActivity); -// //------------------------------------------------------------------- -// toast("亲, 记得在弹出的对话框中选择数量哦"); -// Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake); -// lvGoodsList.startAnimation(shake); -// -// // 显示订单对话框 -// orderDlg = new DialogOrder(this, R.style.MyDialog); -// orderDlg.show(); -// // 得到订单对话框的View -// LayoutInflater factory = LayoutInflater.from(this); -// dlgOrderView = factory.inflate(R.layout.dlg_order, null); -// tvOrderCount = (TextView) dlgOrderView -// .findViewById(R.id.tv_order_count); -// etOrderPhone = (EditText) dlgOrderView -// .findViewById(R.id.et_order_phone); -// etOrderWords = (EditText) dlgOrderView -// .findViewById(R.id.et_order_phone); -// ; -// btnOrderCount = (Button) dlgOrderView -// .findViewById(R.id.btn_order_count); -// btnOrderSubmit = (Button) dlgOrderView -// .findViewById(R.id.btn_order_submit); -// btnOrderCount.setOnClickListener(this); -// btnOrderSubmit.setOnClickListener(this); -// //------------------------------------------------------------------- -// } - - @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.btn_commit: - if (etCommit.getText().toString().equals("")) { - toast("亲,先写一句吧"); - } else { - SimpleDateFormat formatter = new SimpleDateFormat( - "yyyy年MM月dd日 HH:mm:ss "); - Date curDate = new Date(System.currentTimeMillis());// 获取当前时间 - String time = formatter.format(curDate); - String content = etCommit.getText().toString() + " [ " + time - + " ] "; - insertCommit("admin" + ":", content); - etCommit.setText(""); - } - break; - - case R.id.img_call: - toast("店主没有留下电话"); - break; - - default: - break; - } - - } - - @Override - public void onItemClick(AdapterView parent, View view, int position, - long id) { - switch (viewPager.getCurrentItem()) { - case 0: - toast("选择的商品名称: " + goodsList.get(position).getName()); - selectGood = goodsList.get(position); - toast("点击了购买按钮"); - Intent toOrderActivity = new Intent(ShopItemActivity.this, OrderActivity.class); - Bundle bundle = new Bundle(); - bundle.putSerializable("shop", shop ); - bundle.putSerializable("good", selectGood); - bundle.putString("shopID", shopID); //商铺的ID需要单独传递,否则获取到的是null - toOrderActivity.putExtras(bundle); - startActivity(toOrderActivity); - //toast("点击了Position " + position); -// if(view.getId() == R.id.btn_buy_good) { -// toast("点击了购买按钮"); -// Intent toOrderActivity = new Intent(ShopItemActivity.this, OrderActivity.class); -// Bundle bundle = new Bundle(); -// bundle.putSerializable("shop", shop ); -// bundle.putSerializable("good", selectGood); -// bundle.putString("shopID", shopID); //商铺的ID需要单独传递,否则获取到的是null -// toOrderActivity.putExtras(bundle); -// startActivity(toOrderActivity); -// } - break; - case 1: - break; - default: - break; - } - - } - - public void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/SplashActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/SplashActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 4ef6a65..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/SplashActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,75 +0,0 @@ -package com.stone.shop.view; - -import com.stone.shop.R; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.view.animation.AlphaAnimation; -import android.view.animation.Animation; -import android.view.animation.Animation.AnimationListener; -import android.view.animation.AnimationSet; -import android.view.animation.RotateAnimation; -import android.view.animation.ScaleAnimation; -import android.widget.RelativeLayout; - -public class SplashActivity extends Activity { - private RelativeLayout rlSplash; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - initView(); - initAnimation(); - } - - private void initView() { - setContentView(R.layout.activity_splash); - rlSplash = (RelativeLayout) findViewById(R.id.rl_splash); - } - - private void initAnimation() { - AnimationSet set = new AnimationSet(false); - RotateAnimation rtAnimation = new RotateAnimation(0, 360, - Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, - 0.5f); - rtAnimation.setDuration(2000); - rtAnimation.setFillAfter(true); - - ScaleAnimation scAnimation = new ScaleAnimation(0, 1, 0, 1, - Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, - 0.5f); - scAnimation.setDuration(2000); - scAnimation.setFillAfter(true); - - AlphaAnimation alAnimation = new AlphaAnimation(0, 1); - alAnimation.setDuration(2000); - alAnimation.setFillAfter(true); - - set.addAnimation(rtAnimation); - set.addAnimation(scAnimation); - set.addAnimation(alAnimation); - - set.setAnimationListener(new AnimationListener() { - - @Override - public void onAnimationStart(Animation arg0) { - - } - - @Override - public void onAnimationRepeat(Animation arg0) { - - } - - @Override - public void onAnimationEnd(Animation arg0) { - startActivity(new Intent(SplashActivity.this, - MultiScreenActivity.class)); - finish(); - } - }); - - rlSplash.startAnimation(set); - } -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/WsqActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/WsqActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index 0b1947e..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/WsqActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,60 +0,0 @@ -package com.stone.shop.view; - -import android.app.Activity; -import android.os.Bundle; -import android.webkit.WebChromeClient; -import android.webkit.WebView; -import android.webkit.WebViewClient; -import android.widget.Toast; - -import com.stone.shop.R; - -/** - * 购物车主界面 - * @date 2014-4-24 - * @author Stone - */ -public class WsqActivity extends Activity { - - private static final String TAG = "CarActivity"; - - private static final String URL_WSQ = "http://wx.wsq.qq.com/231782938"; - private WebView wsqWebView; - - @Override - protected void onCreate(Bundle savedInstanceState) { - // TODO Auto-generated method stub - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_car); - - wsqWebView = (WebView) findViewById(R.id.wv_wsq); - - // ----------------------------------------------------------------- - - wsqWebView.getSettings().setJavaScriptEnabled(true); // 设置使用够执行JS脚本 - //wsqWebView.getSettings().setBuiltInZoomControls(true); // 设置使支持缩放 - wsqWebView.getSettings().setDefaultFontSize(12); - wsqWebView.setWebChromeClient(new WebChromeClient()); - wsqWebView.setWebViewClient(new WebViewClient() { - @Override - public boolean shouldOverrideUrlLoading(WebView view, - String url) { - view.loadUrl(url);// 使用当前WebView处理跳转 - return true;// true表示此事件在此处被处理,不需要再广播 - } - - @Override - // 转向错误时的处理 - public void onReceivedError(WebView view, int errorCode, - String description, String failingUrl) { - Toast.makeText(WsqActivity.this, - "Oh no! " + description, Toast.LENGTH_SHORT) - .show(); - } - }); - wsqWebView.loadUrl(URL_WSQ); - // ------------------------------------------------ - - } - -} diff --git a/代码/在这里3.0/src/com/stone/shop/view/old/OldMineActivity.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/shop/view/old/OldMineActivity.java~remotes_origin_zhaozaichun deleted file mode 100644 index a8886c8..0000000 --- a/代码/在这里3.0/src/com/stone/shop/view/old/OldMineActivity.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,166 +0,0 @@ -package com.stone.shop.view.old; - -import java.util.List; - -import javax.security.auth.PrivateCredentialPermission; - -import cn.bmob.v3.BmobQuery; -import cn.bmob.v3.BmobUser; -import cn.bmob.v3.listener.FindListener; - -import com.stone.shop.R; -import com.stone.shop.model.User; -import com.stone.shop.view.AboutActivity; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; -import android.view.animation.Animation; -import android.view.animation.AnimationUtils; -import android.widget.Button; -import android.widget.TextView; -import android.widget.Toast; - -/** - * 个人中心主界面 - * @date 2014-4-24 - * @author Stone - */ -public class OldMineActivity extends Activity implements OnClickListener{ - - private static final String TAG = "OldMineActivity" ; - - private Button btnAbout; - private Button btnContact; - private Button btnJoin; - - private TextView tvUserName; //当前用户的用户名 - private TextView tvSchool; //学校 - private TextView tvCademy; //学院 - private TextView tvDorPart; //所在区 西区 - private TextView tvDorNum; //宿舍楼号 19栋 - - private TextView tvMe; //我 - private TextView tvXiaoCai; //小菜 - private TextView tvBowl; //饭碗 - private User user = new User(); - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_mine_old); - - BmobUser user = BmobUser.getCurrentUser(this); - Log.i(TAG, "BmobUser.userName = " + user.getUsername()); - getCurUser(user.getUsername()); - - initView(); - } - - public void initView() { - - tvUserName = (TextView) findViewById(R.id.tv_username); - tvSchool = (TextView) findViewById(R.id.tv_school); - tvCademy = (TextView) findViewById(R.id.tv_cademy); - tvDorPart = (TextView) findViewById(R.id.tv_dorPart); - tvDorNum = (TextView) findViewById(R.id.tv_dorNum); - - btnAbout = (Button) findViewById(R.id.btn_about); - btnContact = (Button) findViewById(R.id.btn_contact); - btnJoin = (Button) findViewById(R.id.btn_share); - - tvUserName = (TextView) findViewById(R.id.tv_username); - tvMe = (TextView) findViewById(R.id.tv_me); - tvXiaoCai = (TextView) findViewById(R.id.tv_xiaocai); - tvBowl = (TextView) findViewById(R.id.tv_bowl); - - btnAbout.setOnClickListener(this); - btnContact.setOnClickListener(this); - btnJoin.setOnClickListener(this); - - tvMe.setOnClickListener(this); - tvXiaoCai.setOnClickListener(this); - tvBowl.setOnClickListener(this); - } - - //获得当前用户User类型 - public void getCurUser(String username) { - BmobQuery query = new BmobQuery(); - query.addWhereEqualTo("username", username); - query.findObjects(this, new FindListener() { - @Override - public void onSuccess(List object) { - if(object.size()==1) - user = object.get(0); - else - user = null; - loadData(); - //toast("查询到:" + object.size()); - } - - @Override - public void onError(int arg0, String arg1) { - toast("获取信息失败"); - } - }); - } - - //加载查询到的用户数据 - public void loadData() { - //toast("加载数据中..."); - tvUserName.setText(user.getUsername()); - tvSchool.setText(user.getSchool()); - tvCademy.setText(user.getCademy()); - tvDorPart.setText(user.getDorPart()); - tvDorNum.setText(user.getDorNum()); - } - - @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.btn_share: - Intent toShare = new Intent(Intent.ACTION_SEND); - toShare.setType("text/plain"); - toShare.putExtra(Intent.EXTRA_SUBJECT, "分享"); - toShare.putExtra(Intent.EXTRA_TEXT, "在这里" +"\n" + "针对NUDT三号狱的在这里测试版上线了,赶紧下载体验吧" - + "http://xiaocai.bmob.cn"); - startActivity(Intent.createChooser(toShare, "分享到")); - break; - case R.id.tv_me: - startAnim(R.id.tv_me); - break; - case R.id.tv_xiaocai: - startAnim(R.id.tv_xiaocai); - break; - case R.id.tv_bowl: - startAnim(R.id.tv_bowl); - break; - default: - Intent toAbout = new Intent(OldMineActivity.this, AboutActivity.class); - startActivity(toAbout); - break; - } - } - - //点击文字动画 - private void startAnim(int id){ - Animation scale = AnimationUtils.loadAnimation(this, R.anim.shake); - if(id == R.id.tv_me) - tvMe.startAnimation(scale); - else if(id == R.id.tv_xiaocai) - tvXiaoCai.startAnimation(scale); - else if(id == R.id.tv_bowl) - tvBowl.startAnimation(scale); - else { } - } - - private void toast(String toast) { - Toast.makeText(this, toast, Toast.LENGTH_SHORT).show(); - } - - - -} diff --git a/代码/在这里3.0/src/com/stone/ui/AutoScrollViewPager.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/ui/AutoScrollViewPager.java~remotes_origin_zhaozaichun deleted file mode 100644 index 0d542cd..0000000 --- a/代码/在这里3.0/src/com/stone/ui/AutoScrollViewPager.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,337 +0,0 @@ -package com.stone.ui; - -import java.lang.reflect.Field; - -import android.content.Context; -import android.os.Handler; -import android.os.Message; -import android.support.v4.view.PagerAdapter; -import android.support.v4.view.ViewPager; -import android.util.AttributeSet; -import android.view.MotionEvent; -import android.view.animation.Interpolator; - -/** - * Auto Scroll View Pager - *
    - * Basic Setting and Usage - *
  • {@link #startAutoScroll()} start auto scroll, or {@link #startAutoScroll(int)} start auto scroll delayed
  • - *
  • {@link #stopAutoScroll()} stop auto scroll
  • - *
  • {@link #setInterval(long)} set auto scroll time in milliseconds, default is {@link #DEFAULT_INTERVAL}
  • - *
- *
    - * Advanced Settings and Usage - *
  • {@link #setDirection(int)} set auto scroll direction
  • - *
  • {@link #setCycle(boolean)} set whether automatic cycle when auto scroll reaching the last or first item, default - * is true
  • - *
  • {@link #setSlideBorderMode(int)} set how to process when sliding at the last or first item
  • - *
  • {@link #setStopScrollWhenTouch(boolean)} set whether stop auto scroll when touching, default is true
  • - *
- * - * @author Trinea 2013-12-30 - */ -public class AutoScrollViewPager extends ViewPager { - public static final int DEFAULT_INTERVAL = 1500; - - public static final int LEFT = 0; - public static final int RIGHT = 1; - - /** do nothing when sliding at the last or first item **/ - public static final int SLIDE_BORDER_MODE_NONE = 0; - /** cycle when sliding at the last or first item **/ - public static final int SLIDE_BORDER_MODE_CYCLE = 1; - /** deliver event to parent when sliding at the last or first item **/ - public static final int SLIDE_BORDER_MODE_TO_PARENT = 2; - - /** auto scroll time in milliseconds, default is {@link #DEFAULT_INTERVAL} **/ - private long interval = DEFAULT_INTERVAL; - /** auto scroll direction, default is {@link #RIGHT} **/ - private int direction = RIGHT; - /** whether automatic cycle when auto scroll reaching the last or first item, default is true **/ - private boolean isCycle = true; - /** whether stop auto scroll when touching, default is true **/ - private boolean stopScrollWhenTouch = true; - /** how to process when sliding at the last or first item, default is {@link #SLIDE_BORDER_MODE_NONE} **/ - private int slideBorderMode = SLIDE_BORDER_MODE_NONE; - /** whether animating when auto scroll at the last or first item **/ - private boolean isBorderAnimation = true; - - private Handler handler; - private boolean isAutoScroll = false; - private boolean isStopByTouch = false; - private float touchX = 0f, downX = 0f; - private CustomDurationScroller scroller = null; - - public static final int SCROLL_WHAT = 0; - - public AutoScrollViewPager(Context paramContext){ - super(paramContext); - init(); - } - - public AutoScrollViewPager(Context paramContext, AttributeSet paramAttributeSet){ - super(paramContext, paramAttributeSet); - init(); - } - - private void init() { - handler = new MyHandler(); - setViewPagerScroller(); - } - - /** - * start auto scroll, first scroll delay time is {@link #getInterval()} - */ - public void startAutoScroll() { - isAutoScroll = true; - sendScrollMessage(interval); - } - - /** - * start auto scroll - * - * @param delayTimeInMills first scroll delay time - */ - public void startAutoScroll(int delayTimeInMills) { - isAutoScroll = true; - sendScrollMessage(delayTimeInMills); - } - - /** - * stop auto scroll - */ - public void stopAutoScroll() { - isAutoScroll = false; - handler.removeMessages(SCROLL_WHAT); - } - - /** - * set the factor by which the duration of sliding animation will change - */ - public void setScrollDurationFactor(double scrollFactor) { - scroller.setScrollDurationFactor(scrollFactor); - } - - private void sendScrollMessage(long delayTimeInMills) { - /** remove messages before, keeps one message is running at most **/ - handler.removeMessages(SCROLL_WHAT); - handler.sendEmptyMessageDelayed(SCROLL_WHAT, delayTimeInMills); - } - - /** - * set ViewPager scroller to change animation duration when sliding - */ - private void setViewPagerScroller() { - try { - Field scrollerField = ViewPager.class.getDeclaredField("mScroller"); - scrollerField.setAccessible(true); - Field interpolatorField = ViewPager.class.getDeclaredField("sInterpolator"); - interpolatorField.setAccessible(true); - - scroller = new CustomDurationScroller(getContext(), (Interpolator)interpolatorField.get(null)); - scrollerField.set(this, scroller); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * scroll only once - */ - public void scrollOnce() { - PagerAdapter adapter = getAdapter(); - int currentItem = getCurrentItem(); - int totalCount; - if (adapter == null || (totalCount = adapter.getCount()) <= 1) { - return; - } - - int nextItem = (direction == LEFT) ? --currentItem : ++currentItem; - if (nextItem < 0) { - if (isCycle) { - setCurrentItem(totalCount - 1, isBorderAnimation); - } - } else if (nextItem == totalCount) { - if (isCycle) { - setCurrentItem(0, isBorderAnimation); - } - } else { - setCurrentItem(nextItem, true); - } - } - - /** - *
    - * if stopScrollWhenTouch is true - *
  • if event is down, stop auto scroll.
  • - *
  • if event is up, start auto scroll again.
  • - *
- */ - @Override - public boolean onTouchEvent(MotionEvent ev) { - if (stopScrollWhenTouch) { - if (ev.getAction() == MotionEvent.ACTION_DOWN && isAutoScroll) { - isStopByTouch = true; - stopAutoScroll(); - } else if (ev.getAction() == MotionEvent.ACTION_UP && isStopByTouch) { - startAutoScroll(); - } - } - - if (slideBorderMode == SLIDE_BORDER_MODE_TO_PARENT || slideBorderMode == SLIDE_BORDER_MODE_CYCLE) { - touchX = ev.getX(); - if (ev.getAction() == MotionEvent.ACTION_DOWN) { - downX = touchX; - } - int currentItem = getCurrentItem(); - PagerAdapter adapter = getAdapter(); - int pageCount = adapter == null ? 0 : adapter.getCount(); - /** - * current index is first one and slide to right or current index is last one and slide to left.
- * if slide border mode is to parent, then requestDisallowInterceptTouchEvent false.
- * else scroll to last one when current item is first one, scroll to first one when current item is last - * one. - */ - if ((currentItem == 0 && downX <= touchX) || (currentItem == pageCount - 1 && downX >= touchX)) { - if (slideBorderMode == SLIDE_BORDER_MODE_TO_PARENT) { - getParent().requestDisallowInterceptTouchEvent(false); - } else { - if (pageCount > 1) { - setCurrentItem(pageCount - currentItem - 1, isBorderAnimation); - } - getParent().requestDisallowInterceptTouchEvent(true); - } - return super.onTouchEvent(ev); - } - } - getParent().requestDisallowInterceptTouchEvent(true); - return super.onTouchEvent(ev); - } - - private class MyHandler extends Handler { - - @Override - public void handleMessage(Message msg) { - super.handleMessage(msg); - - switch (msg.what) { - case SCROLL_WHAT: - scrollOnce(); - sendScrollMessage(interval); - default: - break; - } - } - } - - /** - * get auto scroll time in milliseconds, default is {@link #DEFAULT_INTERVAL} - * - * @return the interval - */ - public long getInterval() { - return interval; - } - - /** - * set auto scroll time in milliseconds, default is {@link #DEFAULT_INTERVAL} - * - * @param interval the interval to set - */ - public void setInterval(long interval) { - this.interval = interval; - } - - /** - * get auto scroll direction - * - * @return {@link #LEFT} or {@link #RIGHT}, default is {@link #RIGHT} - */ - public int getDirection() { - return (direction == LEFT) ? LEFT : RIGHT; - } - - /** - * set auto scroll direction - * - * @param direction {@link #LEFT} or {@link #RIGHT}, default is {@link #RIGHT} - */ - public void setDirection(int direction) { - this.direction = direction; - } - - /** - * whether automatic cycle when auto scroll reaching the last or first item, default is true - * - * @return the isCycle - */ - public boolean isCycle() { - return isCycle; - } - - /** - * set whether automatic cycle when auto scroll reaching the last or first item, default is true - * - * @param isCycle the isCycle to set - */ - public void setCycle(boolean isCycle) { - this.isCycle = isCycle; - } - - /** - * whether stop auto scroll when touching, default is true - * - * @return the stopScrollWhenTouch - */ - public boolean isStopScrollWhenTouch() { - return stopScrollWhenTouch; - } - - /** - * set whether stop auto scroll when touching, default is true - * - * @param stopScrollWhenTouch - */ - public void setStopScrollWhenTouch(boolean stopScrollWhenTouch) { - this.stopScrollWhenTouch = stopScrollWhenTouch; - } - - /** - * get how to process when sliding at the last or first item - * - * @return the slideBorderMode {@link #SLIDE_BORDER_MODE_NONE}, {@link #SLIDE_BORDER_MODE_TO_PARENT}, - * {@link #SLIDE_BORDER_MODE_CYCLE}, default is {@link #SLIDE_BORDER_MODE_NONE} - */ - public int getSlideBorderMode() { - return slideBorderMode; - } - - /** - * set how to process when sliding at the last or first item - * - * @param slideBorderMode {@link #SLIDE_BORDER_MODE_NONE}, {@link #SLIDE_BORDER_MODE_TO_PARENT}, - * {@link #SLIDE_BORDER_MODE_CYCLE}, default is {@link #SLIDE_BORDER_MODE_NONE} - */ - public void setSlideBorderMode(int slideBorderMode) { - this.slideBorderMode = slideBorderMode; - } - - /** - * whether animating when auto scroll at the last or first item, default is true - * - * @return - */ - public boolean isBorderAnimation() { - return isBorderAnimation; - } - - /** - * set whether animating when auto scroll at the last or first item, default is true - * - * @param isBorderAnimation - */ - public void setBorderAnimation(boolean isBorderAnimation) { - this.isBorderAnimation = isBorderAnimation; - } - -} diff --git a/代码/在这里3.0/src/com/stone/ui/CustomDurationScroller.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/ui/CustomDurationScroller.java~remotes_origin_zhaozaichun deleted file mode 100644 index 6155603..0000000 --- a/代码/在这里3.0/src/com/stone/ui/CustomDurationScroller.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,47 +0,0 @@ -package com.stone.ui; - -import android.content.Context; -import android.view.animation.Interpolator; -import android.widget.Scroller; - - -/** - * CustomDurationScroller - * - * @author Trinea 2014-3-2 - */ -public class CustomDurationScroller extends Scroller { - private double scrollFactor = 2; - - public CustomDurationScroller(Context context){ - super(context); - } - - public CustomDurationScroller(Context context, Interpolator interpolator){ - super(context, interpolator); - } - - /** - * not exist in android 2.3 - * - * @param context - * @param interpolator - * @param flywheel - */ - // @SuppressLint("NewApi") - // public CustomDurationScroller(Context context, Interpolator interpolator, boolean flywheel){ - // super(context, interpolator, flywheel); - // } - - /** - * Set the factor by which the duration will change - */ - public void setScrollDurationFactor(double scrollFactor) { - this.scrollFactor = scrollFactor; - } - - @Override - public void startScroll(int startX, int startY, int dx, int dy, int duration) { - super.startScroll(startX, startY, dx, dy, (int)(duration * scrollFactor)); - } -} diff --git a/代码/在这里3.0/src/com/stone/ui/DateTimePickDialogUtil.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/ui/DateTimePickDialogUtil.java~remotes_origin_zhaozaichun deleted file mode 100644 index 6ba2bfe..0000000 --- a/代码/在这里3.0/src/com/stone/ui/DateTimePickDialogUtil.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,188 +0,0 @@ -package com.stone.ui; - -import java.text.SimpleDateFormat; -import java.util.Calendar; - -import com.stone.shop.R; - -import android.app.Activity; -import android.app.AlertDialog; -import android.content.DialogInterface; -import android.widget.DatePicker; -import android.widget.DatePicker.OnDateChangedListener; -import android.widget.EditText; -import android.widget.LinearLayout; -import android.widget.TimePicker; -import android.widget.TimePicker.OnTimeChangedListener; - -/** - * 日期时间选择控件 使用方法: private EditText inputDate;//需要设置的日期时间文本编辑框 private String - * initDateTime="2012年9月3日 14:44",//初始日期时间值 在点击事件中使用: - * inputDate.setOnClickListener(new OnClickListener() { - * - * @Override public void onClick(View v) { DateTimePickDialogUtil - * dateTimePicKDialog=new - * DateTimePickDialogUtil(SinvestigateActivity.this,initDateTime); - * dateTimePicKDialog.dateTimePicKDialog(inputDate); - * - * } }); - * - * @author - */ -public class DateTimePickDialogUtil implements OnDateChangedListener, OnTimeChangedListener { - private DatePicker datePicker; - private TimePicker timePicker; - private AlertDialog ad; - private String dateTime; - private String initDateTime; - private Activity activity; - private DateTimeListener dateTimeListener; - - /** - * 日期时间弹出选择框构造函数 - * - * @param activity - * :调用的父activity - * @param initDateTime - * 初始日期时间值,作为弹出窗口的标题和日期时间初始值 - */ - public DateTimePickDialogUtil(Activity activity, String initDateTime) { - this.activity = activity; - this.initDateTime = initDateTime; - - } - - public void init(DatePicker datePicker, TimePicker timePicker) { - Calendar calendar = Calendar.getInstance(); - if (!(null == initDateTime || "".equals(initDateTime))) { - calendar = this.getCalendarByInintData(initDateTime); - } else { - initDateTime = calendar.get(Calendar.YEAR) + "年" + calendar.get(Calendar.MONTH) + "月" - + calendar.get(Calendar.DAY_OF_MONTH) + "日 " + calendar.get(Calendar.HOUR_OF_DAY) + ":" - + calendar.get(Calendar.MINUTE); - } - - datePicker.init(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), - this); - timePicker.setCurrentHour(calendar.get(Calendar.HOUR_OF_DAY)); - timePicker.setCurrentMinute(calendar.get(Calendar.MINUTE)); - } - - /** - * 弹出日期时间选择框方法 - * - * @param inputDate - * :为需要设置的日期时间文本编辑框 - * @return - */ - public AlertDialog dateTimePicKDialog(final DateTimeListener dateTimeListener) { - LinearLayout dateTimeLayout = (LinearLayout) activity.getLayoutInflater().inflate(R.layout.common_datetime, - null); - datePicker = (DatePicker) dateTimeLayout.findViewById(R.id.datepicker); - timePicker = (TimePicker) dateTimeLayout.findViewById(R.id.timepicker); - init(datePicker, timePicker); - timePicker.setIs24HourView(true); - timePicker.setOnTimeChangedListener(this); - - ad = new AlertDialog.Builder(activity).setTitle(initDateTime).setView(dateTimeLayout) - .setPositiveButton("设置", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - - if (dateTimeListener != null) { - dateTimeListener.onDateTimeChane(dateTime); - } - } - }).setNegativeButton("取消", new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - - } - }).show(); - - onDateChanged(null, 0, 0, 0); - return ad; - } - - public void onTimeChanged(TimePicker view, int hourOfDay, int minute) { - onDateChanged(null, 0, 0, 0); - } - - public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) { - // 获得日历实例 - Calendar calendar = Calendar.getInstance(); - - calendar.set(datePicker.getYear(), datePicker.getMonth(), datePicker.getDayOfMonth(), - timePicker.getCurrentHour(), timePicker.getCurrentMinute()); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm"); - - dateTime = sdf.format(calendar.getTime()); - ad.setTitle(dateTime); - } - - /** - * 实现将初始日期时间2012年07月02日 16:45 拆分成年 月 日 时 分 秒,并赋值给calendar - * - * @param initDateTime - * 初始日期时间值 字符串型 - * @return Calendar - */ - private Calendar getCalendarByInintData(String initDateTime) { - Calendar calendar = Calendar.getInstance(); - - // 将初始日期时间2012年07月02日 16:45 拆分成年 月 日 时 分 秒 - String date = spliteString(initDateTime, "日", "index", "front"); // 日期 - String time = spliteString(initDateTime, "日", "index", "back"); // 时间 - - String yearStr = spliteString(date, "年", "index", "front"); // 年份 - String monthAndDay = spliteString(date, "年", "index", "back"); // 月日 - - String monthStr = spliteString(monthAndDay, "月", "index", "front"); // 月 - String dayStr = spliteString(monthAndDay, "月", "index", "back"); // 日 - - String hourStr = spliteString(time, ":", "index", "front"); // 时 - String minuteStr = spliteString(time, ":", "index", "back"); // 分 - - int currentYear = Integer.valueOf(yearStr.trim()).intValue(); - int currentMonth = Integer.valueOf(monthStr.trim()).intValue() - 1; - int currentDay = Integer.valueOf(dayStr.trim()).intValue(); - int currentHour = Integer.valueOf(hourStr.trim()).intValue(); - int currentMinute = Integer.valueOf(minuteStr.trim()).intValue(); - - calendar.set(currentYear, currentMonth, currentDay, currentHour, currentMinute); - return calendar; - } - - /** - * 截取子串 - * - * @param srcStr - * 源串 - * @param pattern - * 匹配模式 - * @param indexOrLast - * @param frontOrBack - * @return - */ - public static String spliteString(String srcStr, String pattern, String indexOrLast, String frontOrBack) { - String result = ""; - int loc = -1; - if (indexOrLast.equalsIgnoreCase("index")) { - loc = srcStr.indexOf(pattern); // 取得字符串第一次出现的位置 - } else { - loc = srcStr.lastIndexOf(pattern); // 最后一个匹配串的位置 - } - if (frontOrBack.equalsIgnoreCase("front")) { - if (loc != -1) - result = srcStr.substring(0, loc); // 截取子串 - } else { - if (loc != -1) - result = srcStr.substring(loc + 1, srcStr.length()); // 截取子串 - } - return result; - } - - public interface DateTimeListener { - - void onDateTimeChane(String dateTime); - - } -} diff --git a/代码/在这里3.0/src/com/stone/ui/ViewPagerCompat.java~remotes_origin_zhaozaichun b/代码/在这里3.0/src/com/stone/ui/ViewPagerCompat.java~remotes_origin_zhaozaichun deleted file mode 100644 index 4d184b3..0000000 --- a/代码/在这里3.0/src/com/stone/ui/ViewPagerCompat.java~remotes_origin_zhaozaichun +++ /dev/null @@ -1,67 +0,0 @@ -package com.stone.ui; - -import android.content.Context; -import android.support.v4.view.ViewPager; -import android.util.AttributeSet; -import android.view.MotionEvent; - -/** - * 商铺详情页--ViewPager的加强类,主要是为了解决滑动冲突的问题。不然的话, - * 在ViewPager内部加入ListView等可滑动控件,两者之间会产生干扰。 - * @author Stone - * {@link} http://blog.csdn.net/singwhatiwanna/article/details/17201587 - */ -//测试自动分析 -public class ViewPagerCompat extends ViewPager { - // mViewTouchMode表示ViewPager是否全权控制滑动事件,默认为false,即不控制 - private boolean mViewTouchMode = false; - - public ViewPagerCompat(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public void setViewTouchMode(boolean b) { - if (b && !isFakeDragging()) { - // 全权控制滑动事件 - beginFakeDrag(); - } else if (!b && isFakeDragging()) { - // 终止控制滑动事件 - endFakeDrag(); - } - mViewTouchMode = b; - } - - /** - * 在mViewTouchMode为true的时候,ViewPager不拦截点击事件,点击事件将由子View处理 - */ - @Override - public boolean onInterceptTouchEvent(MotionEvent event) { - if (mViewTouchMode) { - return false; - } - return super.onInterceptTouchEvent(event); - } - - @Override - public boolean onTouchEvent(MotionEvent ev) { - try { - return super.onTouchEvent(ev); - } catch (Exception e) { - return false; - } - } - - /** - * 在mViewTouchMode为true或者滑动方向不是左右的时候,ViewPager将放弃控制点击事件, - * 这样做有利于在ViewPager中加入ListView等可以滑动的控件,否则两者之间的滑动将会有冲突 - */ - @Override - public boolean arrowScroll(int direction) { - if (mViewTouchMode) - return false; - if (direction != FOCUS_LEFT && direction != FOCUS_RIGHT) - return false; - return super.arrowScroll(direction); - } - -}