淘宝首页怎么设计 手机如何制作淘宝详情页

我们在淘宝购物下单了后,肯定是会去看订单页面的,因为这里,大家看到物流的信息和订单的编码等,最近有网友咨询小编手机淘宝订单页面设计方面的内容,想知道该如何去设计 。H1
订单的页面效果如下:
需要设计订单页面话,一些代码是需要而更改的 。布局代码如下 。
[plain] view plain copy
布局很简单,就不多说明,然后就是mainactivity的代码了
[plain] view plain copypackage com.taobao.pll.tborderdemo;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
public class MainActivity extends Activity {
private RelativeLayout rl_person_alllist;//全部订单
private RelativeLayout rl_person_wait_pay;//待支付
private RelativeLayout rl_person_send;//待发货
private RelativeLayout rl_person_wait_get;//待收货
private RelativeLayout rl_person_aftermarket;//售后
【淘宝首页怎么设计 手机如何制作淘宝详情页】private Intent intent;//需要启动的界面
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
initData();
}
private void initData() {
/**
* 全部订单
*/
rl_person_alllist.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
intent = new Intent(getApplicationContext(),OrderActivity.class);
intent.putExtra("page",0);
startActivity(intent);
}
});
/**
* 待支付
*/
rl_person_wait_pay.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
intent = new Intent(getApplicationContext(),OrderActivity.class);
intent.putExtra("page",1);
startActivity(intent);
}
});
/**
* 待发货
*/
rl_person_send.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
intent = new Intent(getApplicationContext(),OrderActivity.class);
intent.putExtra("page",2);
startActivity(intent);
}
});
/**
* 待收货
*/
rl_person_wait_get.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
intent = new Intent(getApplicationContext(),OrderActivity.class);
intent.putExtra("page",3);
startActivity(intent);
}
});
/**
* 售后
*/
rl_person_aftermarket.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
intent = new Intent(getApplicationContext(),OrderActivity.class);
intent.putExtra("page",4);
startActivity(intent);
}
});
}
private void initView() {
rl_person_alllist = (RelativeLayout) findViewById(R.id.rl_person_alllist);
rl_person_wait_pay = (RelativeLayout) findViewById(R.id.rl_person_wait_pay);
rl_person_send = (RelativeLayout) findViewById(R.id.rl_person_send);
rl_person_wait_get = (RelativeLayout) findViewById(R.id.rl_person_wait_get);
rl_person_aftermarket = (RelativeLayout) findViewById(R.id.rl_person_aftermarket);
}
}
这里需要说明就只有一点:intent.putExtra("page",0);因为每个点击都需要对应跳转页面的页卡选中哪个,所以需要传入一个page值
再来看OrderActivity的局部,这里稍微复杂那么一点点吧,使用的是radiogroup+viewpager,但是需要禁止左右滑动的,所以
我这里的viewpager是自定义的,先看布局,再看自定的viewpager吧 。
[plain] view plain copy
[plain] view plain copypackage com.taobao.pll.tborderdemo.view;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;
/**
* Created by pll on 2016/6/26.
*/
public class CustomViewPager extends ViewPager{
private boolean isCanScroll = false;
public CustomViewPager(Context context) {
super(context);
}
public CustomViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
public void setScanScroll(boolean isCanScroll){
this.isCanScroll = isCanScroll;
}
@Override
public void scrollTo(int x, int y){
// if (isCanScroll){
super.scrollTo(x, y);
// }
}
@Override
public void setCurrentItem(int item) {
// TODO Auto-generated method stub
super.setCurrentItem(item);
}
@Override
public boolean onTouchEvent(MotionEvent arg0) {


推荐阅读