【商城开发三】Android 仿淘宝商品详情页下拉足迹修改版

开发商城的快有半个月了,需要做到详情页下拉足迹的效果,网上找了找没找到,找到一个差不多还有点问题,然后在基础上进行了二次开发

感谢http://blog.csdn.net/yaphetzhao/article/details/53736471  YaphetZhao的博客,下面先看效果吧。


修改内容一:增加了数据注入和数据绑定

  dropDownMultiPagerView = new DropDownMultiPagerView(MainActivity.this, getList());
public class DropDownMultiPagerItem extends LinearLayout {
    public DropDownMultiPagerItem(Context context, int num, List<Bean> beanList) {
        super(context);
        LayoutInflater.from(context).inflate(R.layout.item_dropdownfootprint, this);

        //当前位置
        TextView textNum = (TextView) findViewById(R.id.item_num);
        textNum.setText("我的足迹(" + (num + 1) + "/" + beanList.size() + ")");

        //描述
        TextView textDes = (TextView) findViewById(R.id.item_des);
        textDes.setText(beanList.get(num).getName());

        //价格
        TextView textPrice = (TextView) findViewById(R.id.item_price);
        textPrice.setText(beanList.get(num).getPrice());

        //图文
        ImageView img = (ImageView) findViewById(R.id.item_img);
        Glide.with(context).load(beanList.get(num).getImg()).into(img);

    }

}
修改内容二:增加了点击事件

 dropDownMultiPagerView.setOnDropDownMultiPagerViewItemClick(new DropDownMultiPagerView.OnDropDownMultiPagerViewItemClick() {
                    @Override
                    public void onItemClick(int position) {
                        Toast.makeText(MainActivity.this, "position:" + position, Toast.LENGTH_SHORT).show();
                    }
                });

资源下载要1分辛苦分,也为了以后能上传更多资源,谢谢了

点击下载


bug修复追加

用了一段时间发现下拉足迹有一个bug,重复下拉有时候不会显示,这很致命啊,必须修复,顺便做了一个动画效果看图吧

用SuperSwipeRefreshLayout替换了原来的下拉控件,还可以做刷新和加载更多的功能,基本都是参考下拉刷新做的,代码不难自己下载看吧


点击下载


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值