暴走系列--高仿淘宝收货地址

谁说咱们攻城狮不能写出既幽默又能懂的博客呢,本人想推出一系列博文,可以给刚接触Android开发的做一个参考,也可以与接触Android已久的各路大神比较一下,本人喜欢交流,如果有写得不好的地方,欢迎大家指出.如果有更好的效果或者功能,希望大家多多指点,互相学习可以共同进步.

说了这么多,现在进入今天的猪蹄,<<暴走系列--高仿淘宝收货地址>>,有网购经验的同学应该对这个很熟悉,在淘宝的Android客户端里面,有一个功能是设置收货地址,不清楚的同学可以自己下载个淘宝客户端,自己添加一下看看.

本人一向喜欢贴图,这样有图有真相,才能说服每个人,废话不多说先上自己程序启动画面,然后运行界面,最后一张是淘宝客户端对照图.

 图片震楼  启动界面 运行界面 淘宝界面

淘宝客户端无法录屏所以这里只能上静态的,大家可以自己打开淘宝客户端看看.

下面进行详细的代码讲解:

(一)本人在程序启动的时候开了一条后台服务landDivideServeice,目的是为了将全国的省市县总共4,189条数据插入到手机数据库里面去,原本的数据是保存在7个txt里面的,由于放在txt里面,读取操作很不方便,所以我把它放到数据库,在后面的所属地区筛选很快就出来,这个比淘宝还快哦,不信你们可以试一下.

有个新的知识点就是landDivideServeice是继承IntentService的,不是直接继承Service的,IntentService是继承于Service并处理异步请求的一个类,在IntentService内有一个工作线程来处理耗时操作,启动IntentService的方式和启动传统Service一样,同时,当任务执行完后,IntentService会自动停止,而不需要我们去手动控制。

 so
ga...

IntentService详细解析:http://blog.csdn.net/ryantang03/article/details/8146154

/**
 * 主要的目的就是插入地址数据到数据库
 * @author kun
 *
 */
public class landDivideServeice extends IntentService {

	public landDivideServeice() {
		super("landDivideServeice");
		// TODO Auto-generated constructor stub
	}

	private String[] txt = new String[] { "city1.txt", "city2.txt",
			"city3.txt", "city4.txt", "city5.txt", "city6.txt", "city7.txt" };

	@Override
	protected void onHandleIntent(Intent intent) {
		// TODO Auto-generated method stub
		LandDivideDB landDivideDB = LandDivideDB
				.getInstance(getBaseContext());
		List<LandDivide> list = landDivideDB.queryAddress(null, null);
		if (list == null) {
			for (int i = 0; i < txt.length; i++) {
				String str = getAssetString(txt[i], getBaseContext());
				try {
					str = str.substring(1);
					JSONArray jsonArray = new JSONArray(str);
					for (int j = 0; j < jsonArray.length(); j++) {
						JSONObject temp = jsonArray.getJSONObject(j);
						LandDivide landDivide = new LandDivide();
						landDivide.setCode(temp.getString("code"));
						landDivide.setName(temp.getString("name"));
						landDivide.setSuperior(temp
								.getString("superior"));
						landDivideDB.insertAddress(landDivide);
					}
				} catch (JSONException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

			}
		} else {
			for (int i = 0; i < txt.length; i++) {
				String str = getAssetString(txt[i], getBaseContext());
				try {
					str = str.substring(1);
					JSONArray jsonArray = new JSONArray(str);
					for (int j = 0; j < jsonArray.length(); j++) {
						JSONObject temp = jsonArray.getJSONObject(j);
						LandDivide landDivide = new LandDivide();
						landDivide.setCode(temp.getString("code"));
						landDivide.setName(temp.getString("name"));
						landDivide.setSuperior(temp
								.getString("superior"));

						List<LandDivide> mList = landDivideDB.queryAddress("code=?", new String[]{temp.getString("code")});
						if(mList==null){
							landDivideDB.insertAddress(landDivide);
						}
					}
				} catch (JSONException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
	}

	public static String getAssetString(String asset, Context context) {
		BufferedReader bufferedReader = null;
		try {
			bufferedReader = new BufferedReader(new InputStreamReader(context
					.getAssets().open(asset), "utf-8"));
			String line = null;
			StringBuilder builder = new StringBuilder();
			while (null != (line = bufferedReader.readLine())) {
				builder.append(line).append("\n");
			}
			return builder.toString();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally {
			if (null != bufferedReader) {
				try {
					bufferedReader.close();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			bufferedReader = null;
		}
		return "";
	}

}

(二)剩下的主要是一些界面的切换跟数据的读取,只要思路正确是不会被搞混的.

public class AddressChoose extends Activity {

	private ListView mListView1;
	private ListView mListView2;
	private ListView mListView3;

	private LinearLayout mLinearLayout1;
	private LinearLayout mLinearLayout2;
	private LinearLayout mLinearLayout3;

	private LinearLayout onBackLinear;
	private TextView topTxt;

	private List<String> sheng = new ArrayList<String>();
	private List<String> shi = new ArrayList<String>();
	private List<String> qu = new ArrayList<String>();

	private ArrayAdapter<String> shengAdapter;
	private ArrayAdapter<String> shiAdapter;
	private ArrayAdapter<String> quAdapter;

	private TextView shengTxt2;
	private TextView shengTxt3,shiTxt3,topView3;

	private static String shengStr,shiStr,quStr;
	private LandDivideDB landDivideDB;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.my_set_addresschoose);

		mLinearLayout1 = (LinearLayout)this.findViewById(R.id.my_set_adresschoose_1);
		mLinearLayout2 = (LinearLayout)this.findViewById(R.id.my_set_adresschoose_2);
		mLinearLayout3 = (LinearLayout)this.findViewById(R.id.my_set_adresschoose_3);

		mLinearLayout1.setVisibility(View.VISIBLE);
		mLinearLayout2.setVisibility(View.GONE);
		mLinearLayout3.setVisibility(View.GONE);

		topTxt = (TextView) this.findViewById(R.id.txt_linear);
		onBackLinear = (LinearLayout) this.findViewById(R.id.download_layout1);
		topTxt.setText("添加收货地址");

		shengTxt2 = (TextView)this.findViewById(R.id.my_set_adresschoose_sheng_2);
		shengTxt3 = (TextView)this.findViewById(R.id.my_set_adresschoose_sheng_3);
		shiTxt3 = (TextView)this.findViewById(R.id.my_set_adresschoose_shi_3);
		topView3 = (TextView)this.findViewById(R.id.my_set_adresschoose_textview_3);

		landDivideDB = LandDivideDB.getInstance(getBaseContext());
		List<LandDivide> landDivide = landDivideDB.queryAddress("superior=?", new String[]{"1"});
		Iterator<LandDivide> iterator = null;
		if(landDivide!=null){
			iterator = landDivide.iterator();

			while(iterator.hasNext()){
				LandDivide l = iterator.next();
				sheng.add(l.getName());
			}
		}else{
			return;
		}

		shengAdapter = new ArrayAdapter(this,R.layout.my_set_addresschoose_listview_item,R.id.my_set_adresschoose_textview,sheng);
		shiAdapter = new ArrayAdapter(this,R.layout.my_set_addresschoose_listview_item,R.id.my_set_adresschoose_textview,shi);
		quAdapter = new ArrayAdapter(this,R.layout.my_set_addresschoose_listview_item,R.id.my_set_adresschoose_textview,qu);

		mListView1 = (ListView)this.findViewById(R.id.my_set_adresschoose_listview_1);
		mListView1.setAdapter(shengAdapter);
		mListView2 = (ListView)this.findViewById(R.id.my_set_adresschoose_listview_2);
		mListView2.setAdapter(shiAdapter);
		mListView3 = (ListView)this.findViewById(R.id.my_set_adresschoose_listview_3);
		mListView3.setAdapter(quAdapter);

		shengTxt2.setOnClickListener(click);
		shengTxt3.setOnClickListener(click);
		shiTxt3.setOnClickListener(click);

		mListView1.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int position,
					long arg3) {
				// TODO Auto-generated method stub
				mLinearLayout1.setVisibility(View.GONE);
				mLinearLayout2.setVisibility(View.VISIBLE);
				mLinearLayout3.setVisibility(View.GONE);

				shi.clear();
				String name = sheng.get(position);
				String code = null;
				shengStr = name;
				shengTxt2.setText(name);

				List<LandDivide> landDivide = landDivideDB.queryAddress("name=?", new String[]{name});
				Iterator<LandDivide> iterator= landDivide.iterator();
				while(iterator.hasNext()){
					LandDivide l = iterator.next();
					code = l.getCode();
					break;
				}

				List<LandDivide> landDivide_2 = landDivideDB.queryAddress("superior=?", new String[]{code});
				Iterator<LandDivide> iterator_2= landDivide_2.iterator();
				while(iterator_2.hasNext()){
					LandDivide l = iterator_2.next();
					shi.add(l.getName());
				}

                shiAdapter.notifyDataSetChanged();
                quAdapter.clear();
                quAdapter.notifyDataSetChanged();
			}
		});

		mListView2.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int position,
					long arg3) {
				// TODO Auto-generated method stub

				qu.clear();

				String name = shi.get(position);
				String code = null;

				shiStr = name;
				shengTxt3.setText(shengStr);
				shiTxt3.setText(name);

				List<LandDivide> landDivide = landDivideDB.queryAddress("name=?", new String[]{name});

					Iterator<LandDivide> iterator= landDivide.iterator();
					while(iterator.hasNext()){
						LandDivide l = iterator.next();
						code = l.getCode();
						break;
					}

				List<LandDivide> landDivide_2 = landDivideDB.queryAddress("superior=?", new String[]{code});
				if(landDivide_2!=null){
					Iterator<LandDivide> iterator_2= landDivide_2.iterator();
					while(iterator_2.hasNext()){
						LandDivide l = iterator_2.next();
						qu.add(l.getName());
					}
				}

				 quAdapter.notifyDataSetChanged();

				 if(qu.size()<1){
						mLinearLayout1.setVisibility(View.GONE);
						mLinearLayout2.setVisibility(View.VISIBLE);
						mLinearLayout3.setVisibility(View.GONE);

					 Intent i = new Intent(AddressChoose.this,BuyAddress.class);
					 i.putExtra("address", shengStr+","+shiStr);
					 startActivity(i);
					 finish();

				 }else{

						mLinearLayout1.setVisibility(View.GONE);
						mLinearLayout2.setVisibility(View.GONE);
						mLinearLayout3.setVisibility(View.VISIBLE);

					 mListView3.setVisibility(View.VISIBLE);
					 topView3.setText("请选择  县区/其他...");
				 }
			}
		});

		mListView3.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int position,
					long arg3) {
				// TODO Auto-generated method stub

				String name = qu.get(position);

				quStr = name;

				Intent i2 = new Intent(AddressChoose.this,BuyAddress.class);
				i2.putExtra("address", shengStr+" "+shiStr+" "+quStr);
				startActivity(i2);
				finish();
			}
		});

		onBackLinear.setOnClickListener(click);
	}

	OnClickListener click = new OnClickListener() {

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			switch (v.getId()) {
			case R.id.my_set_adresschoose_sheng_2:
				mLinearLayout1.setVisibility(View.VISIBLE);
				mLinearLayout2.setVisibility(View.GONE);
				mLinearLayout3.setVisibility(View.GONE);
				break;
			case R.id.my_set_adresschoose_sheng_3:
				mLinearLayout1.setVisibility(View.VISIBLE);
				mLinearLayout2.setVisibility(View.GONE);
				mLinearLayout3.setVisibility(View.GONE);
				break;
			case R.id.my_set_adresschoose_shi_3:
				mLinearLayout1.setVisibility(View.GONE);
				mLinearLayout2.setVisibility(View.VISIBLE);
				mLinearLayout3.setVisibility(View.GONE);
				break;

			case R.id.download_layout1:
				finish();
				break;
			default:
				break;
			}
		}
	};

}

(三)这个是选择好地址之后的界面,主要还是界面的转换跟焦点的获取

有时候setFocusable(true)跟setFocusableInTouchMode(true)并不能使控件获得焦点,要再之前加上一句requestFocus(),这样控件就可以获得焦点.

public class BuyAddress extends Activity {

	private EditText jiequText;
	private EditText nameText;
	private EditText phoneText;

	private String provinces;
	private AddressInfo myAddress;

	private LinearLayout shengLinear;
	private LinearLayout jiequLinear;
	private LinearLayout nameLinear;
	private LinearLayout phoneLinear;

	private TextView shengText;
	private TextView jiequTextView;
	private TextView nameTextView;
	private TextView phoneTextView;

	private Button postBtn;
	private AddressInfo addressinfo;
	private CheckBox checkBox;

	private LinearLayout onBackLinear;
	private TextView topTxt;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.my_set_buyaddress);

		myAddress = new AddressInfo();

		Intent i = getIntent();
		provinces = i.getStringExtra("address");
		Bundle b = i.getBundleExtra("address_id");

		topTxt = (TextView) this.findViewById(R.id.txt_linear);
		onBackLinear = (LinearLayout) this.findViewById(R.id.download_layout1);
		topTxt.setText("添加收货地址");

		shengText = (TextView) this.findViewById(R.id.my_set_buyaddress_sheng);
		jiequText = (EditText) this.findViewById(R.id.my_set_buyaddress_jiequ);
		nameText = (EditText) this.findViewById(R.id.my_set_buyaddress_name);
		phoneText = (EditText) this.findViewById(R.id.my_set_buyaddress_phone);

		shengLinear = (LinearLayout) this
				.findViewById(R.id.my_set_buyaddress_sheng_linear);
		jiequLinear = (LinearLayout) this
				.findViewById(R.id.my_set_buyaddress_jiequ_linear);
		nameLinear = (LinearLayout) this
				.findViewById(R.id.my_set_buyaddress_name_linear);
		phoneLinear = (LinearLayout) this
				.findViewById(R.id.my_set_buyaddress_phone_linear);

		jiequTextView = (TextView) this
				.findViewById(R.id.my_set_buyaddress_jiequ_text);
		nameTextView = (TextView) this
				.findViewById(R.id.my_set_buyaddress_name_text);
		phoneTextView = (TextView) this
				.findViewById(R.id.my_set_buyaddress_phone_text);
		checkBox = (CheckBox) this.findViewById(R.id.my_set_address_checkbox);

		postBtn = (Button) this
				.findViewById(R.id.my_set_buyaddress_address_btn);

		if (provinces == null) {
		} else {
			myAddress.setProvinces(provinces);
			shengText.setText(provinces);
		}

		shengLinear.setOnClickListener(click);
		jiequLinear.setOnClickListener(click);
		nameLinear.setOnClickListener(click);
		phoneLinear.setOnClickListener(click);
		postBtn.setOnClickListener(click);
		onBackLinear.setOnClickListener(click);

		jiequText.setOnFocusChangeListener(focusChanger);
		nameText.setOnFocusChangeListener(focusChanger);
		phoneText.setOnFocusChangeListener(focusChanger);

		if (b != null) {
			addressinfo = (AddressInfo) b.get("address");

			phoneText.setVisibility(View.GONE);
			phoneText.setText(addressinfo.getPhone());
			phoneLinear.setVisibility(View.VISIBLE);
			phoneTextView.setText(addressinfo.getPhone());

			shengText.setText(addressinfo.getProvinces());
			jiequText.setText(addressinfo.getStreet());
			nameText.setText(addressinfo.getName());
			phoneText.setText(addressinfo.getPhone());

			jiequText.setVisibility(View.GONE);
			jiequLinear.setVisibility(View.VISIBLE);
			jiequTextView.setText(addressinfo.getStreet());

			nameText.setVisibility(View.GONE);
			nameLinear.setVisibility(View.VISIBLE);
			nameTextView.setText(addressinfo.getName());

			if(addressinfo.isStatus()){
				checkBox.setChecked(true);
			}else{
				checkBox.setChecked(false);
			}

			myAddress.setId(addressinfo.getId());
			myAddress.setProvinces(addressinfo.getProvinces());
			myAddress.setStreet(addressinfo.getStreet());
			myAddress.setName(addressinfo.getName());
			myAddress.setPhone(addressinfo.getPhone());
			myAddress.setStatus(addressinfo.isStatus());
		}

	}

	OnFocusChangeListener focusChanger = new OnFocusChangeListener() {

		@Override
		public void onFocusChange(View v, boolean hasFocus) {
			// TODO Auto-generated method stub
			myAddress.setStreet(jiequText.getText().toString());
			myAddress.setName(nameText.getText().toString());
			myAddress.setPhone(phoneText.getText().toString());

			switch (v.getId()) {
			case R.id.my_set_buyaddress_jiequ:
				if (!hasFocus && myAddress.getStreet().length() > 0) {
					jiequText.setVisibility(View.GONE);
					jiequLinear.setVisibility(View.VISIBLE);

					jiequTextView.setText(myAddress.getStreet());
				}

				if (hasFocus) {
					jiequText.setSelectAllOnFocus(true);
				}
				break;
			case R.id.my_set_buyaddress_name:
				if (!hasFocus && myAddress.getName().length() > 0) {
					nameText.setVisibility(View.GONE);
					nameLinear.setVisibility(View.VISIBLE);

					nameTextView.setText(myAddress.getName());
				}

				if (hasFocus) {
					nameText.setSelectAllOnFocus(true);
				}
				break;
			case R.id.my_set_buyaddress_phone:
				if (!hasFocus && myAddress.getPhone().length() > 0) {
					phoneText.setVisibility(View.GONE);
					phoneLinear.setVisibility(View.VISIBLE);

					phoneTextView.setText(myAddress.getPhone());
				}
				if (hasFocus) {
					phoneText.setSelectAllOnFocus(true);
				}
				break;

			default:
				break;
			}
		}
	};

	OnClickListener click = new OnClickListener() {

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			switch (v.getId()) {
			case R.id.my_set_buyaddress_sheng_linear:
				Intent i = new Intent(BuyAddress.this, AddressChoose.class);
				i.putExtra("Boolean", "aaa");
				startActivity(i);
				break;
			case R.id.my_set_buyaddress_jiequ_linear:
				jiequText.setVisibility(View.VISIBLE);
				jiequLinear.setVisibility(View.GONE);

				jiequText.setFocusable(true);
				jiequText.setFocusableInTouchMode(true);

				jiequText.requestFocus();
				break;
			case R.id.my_set_buyaddress_name_linear:
				nameText.setVisibility(View.VISIBLE);
				nameLinear.setVisibility(View.GONE);

				nameText.setFocusable(true);
				nameText.setFocusableInTouchMode(true);

				nameText.requestFocus();
				break;
			case R.id.my_set_buyaddress_phone_linear:
				phoneText.setVisibility(View.VISIBLE);
				phoneLinear.setVisibility(View.GONE);

				phoneText.setFocusable(true);
				phoneText.setFocusableInTouchMode(true);

				phoneText.requestFocus();
				break;
			case R.id.my_set_buyaddress_address_btn:
				myAddress.setStreet(jiequText.getText().toString());
				myAddress.setName(nameText.getText().toString());
				myAddress.setPhone(phoneText.getText().toString());

				if (myAddress.getPhone().length() > 0) {
					phoneText.setVisibility(View.GONE);
					phoneLinear.setVisibility(View.VISIBLE);
					phoneTextView.setText(myAddress.getPhone());
				}
				postBtn.requestFocus();

				postBtn.setFocusable(true);
				postBtn.setFocusableInTouchMode(true);

				if (myAddress.getProvinces().length() < 1 || myAddress.getStreet().length() < 1
						|| myAddress.getName().length() < 1 || myAddress.getPhone().length() < 1) {
					Toast.makeText(getBaseContext(), "请完整填写收货人资料", 0).show();
					return;
				}

				myAddress.setStatus(checkBox.isChecked());
				AddressDB addressDB = AddressDB.getInstance(getBaseContext());

				if(checkBox.isChecked()){
					List<AddressInfo> list = addressDB.queryAddress();
					if(list!=null){
						Iterator<AddressInfo> iterator = list.iterator();
						while(iterator.hasNext()){
							AddressInfo a = iterator.next();
							a.setStatus(false);
							addressDB.updeteAddress(a);
						}
					}

				}

				if (addressinfo != null) {
					if(addressDB.updeteAddress(myAddress)){
						Toast.makeText(getBaseContext(), "修改收货地址成功", Toast.LENGTH_LONG).show();
					}else{
						Toast.makeText(getBaseContext(), "修改收货地址失败", Toast.LENGTH_LONG).show();
					}
				} else {

					SimpleDateFormat format = new SimpleDateFormat(
							"yyyyMMddHHmmss");
					Date date = new Date();
					String id = format.format(date);
					myAddress.setId(id);

					if(addressDB.insertAddress(myAddress)){
						Toast.makeText(getBaseContext(), "添加收货地址成功", Toast.LENGTH_LONG).show();
					}else{
						Toast.makeText(getBaseContext(), "添加收货地址失败", Toast.LENGTH_LONG).show();
					}
				}

					Intent intent = new Intent(BuyAddress.this, PersonAddress.class);
					startActivity(intent);
					finish();

				break;

			case R.id.download_layout1:
				finish();
				break;
			default:
				break;
			}
		}
	};

}

最后就这样了哈,有什么不懂的或者更好的建议的,可以提出来哈,欢迎大家指教

小弟不才,参加了CSDN的博客大赛,在这里想请各位帮个忙,投下您尊贵的一票,您说都看到这里了,是不是,底下就是投票的位置了,就顺便投一下嘛. http://vote.blog.csdn.net/Article/Details?articleid=32936187

源码地址: http://download.csdn.net/detail/chillax_li/7531409

尊重原创,转载请注明出处:http://blog.csdn.net/chillax_li/article/details/32936187

暴走系列--高仿淘宝收货地址,布布扣,bubuko.com

时间: 2024-12-20 15:01:07

暴走系列--高仿淘宝收货地址的相关文章

高仿淘宝客户端

高仿淘宝客户端 仿淘宝安卓客户端的demo源码,主要实现了:商品的基本展示.宝贝详情,图片展示的放大缩小功能.界面之间切换的动画.购物车多项删除.弹窗的动画效果.首页广告的轮播效果.获得本机具有传感器的列表.listView的上拉刷新,下拉加载功能.二维码扫描.刮刮乐等功能和效果. 下载地址:http://www.devstore.cn/code/info/925.html 运行截图:    

android版高仿淘宝客户端源码V2.3

android版高仿淘宝客户端源码V2.3,这个版本我已经更新到2.3了,源码也上传到源码天堂那里了,大家可以看一下吧,该应用实现了我们常用的购物功能了,也就是在手机上进行网购的流程的,如查看产品(浏览),下订单,进行付款等流程,该应用一一实现了,同时还可以远程读取图片功能,和实时监控网络状态等操作,大家如果有什么不同的意见可以留下,我们会定时来查看. 原文地址:http://www.cnblogs.com/androidioscom/p/3613035.html [1].[代码] [Java]

高仿淘宝和聚美优品商城详情页实现《IT蓝豹》

android-vertical-slide-view高仿淘宝和聚美优品商城详情页实现,在商品详情页,向上拖动时,可以加载下一页.使用ViewDragHelper,滑动比较流畅. scrollView滑动到底部的时候,再行向上拖动时,添加了一些阻力.本项目来源:https://github.com/xmuSistone/android-vertical-slide-view主要代码如下:首先先看一下布局:  <com.stone.verticalslide.DragLayout        a

java高仿新浪微博短链接地址生成工具ShortUrlGenerator.java

原文:仿新浪微博 短链接地址生成工具 ShortUrlGenerator.java 源代码下载地址:http://www.zuidaima.com/share/1550463378934784.htm 仿新浪微博 短链接地址生成工具 ShortUrlGenerator.java String sLongUrl = "http://www.zuidaima.com/share/1550463378934784.htm"; // 3BD768E58042156E54626860E241E9

iOS高仿淘宝购物车,功能模块应有尽有

刚做完一个淘宝的购物车,按着淘宝做的,换了个产品经理,人家喜欢JD的购物车,一句话,咱换个风格,好心 酸有没有,天天刷存在感,只有我们苦逼了,那么既然需求来了,就要按着大爷的要求改了,为了纪念下,咱写个 Demo给大家分享下.    我擦,我一看代码,我还是用AutoLayout做的,主界面代码都能快接近800了,全加起来想想有点多啊,这简直是用 生命在写Demo啊,该有的效果全有了,各位请看图       再来一组 简单分析下功能 1.给UIKit控件增加Badge的扩展(这个扩展需要的去代码

高仿a币货到付款

高 仿 a 币 货 到 付 款 +_Q[2675831689],真实信誉,诚信]kjashk 原文地址:https://www.cnblogs.com/fadsa12412412/p/12117341.html

(android高仿系列)今日头条 --新闻阅读器 (三) 完结 、总结 篇

从写第一篇今日头条高仿系列开始,到现在已经过去了1个多月了,其实大体都做好了,就是迟迟没有放出来,因为我觉得,做这个东西也是有个过程的,我想把这个模仿中一步一步学习的过程,按照自己的思路写下来,在根据碰到的知识点和问题,并且罗列出这些东西的知识点和使用方法.如果你单纯的把做好的一个DEMO拿去改改用用,那样,你永远不知道里面用到的内容是涉及到什么知识点,用什么方法实现,那样就没有多少提升价值而言了. 近期都是在通过开发文档把以前的一些东西重新过一遍,看好多网友都催促想要新版本的,那我就在这里先把

Web API (scroll系列)、(仿淘宝侧边栏效果实现)、(mouseenter与mouseover的区别)、(动画的原理)、(缓动动画)

一 .三大系列中的scroll系列 : (1)scrollLeft |  scrollTop  :水平   |   垂直方向滚动出去的距离  : (2)scrollWidth |  scrollHeight   :内容的真是宽度  |  高度   : (3)滚动整个页面的时候  :   window . pageYOffset   : 二 .仿淘宝侧边栏效果实现 : 1.  找到关心的元素对象  : (1)banner区域  元素对象  : (2)侧边栏的元素对象   : (3)主体部分元素对象

浅谈android中仅仅使用一个TextView实现高仿京东,淘宝各种倒计时

今天给大家带来的是仅仅使用一个TextView实现一个高仿京东.淘宝.唯品会等各种电商APP的活动倒计时.最近公司一直加班也没来得及时间去整理,今天难得休息想把这个分享给大家,只求共同学习,以及自己后续的复习.为什么会想到使用一个TextView来实现呢?因为最近公司在做一些优化的工作,其中就有一个倒计时样式,原来开发的这个控件的同事使用了多个TextView拼接在一起的,实现的代码冗余比较大,故此项目经理就说:小宏这个就交给你来优化了,并且还要保证有一定的扩展性,当时就懵逼了.不知道从何处开始