电商我的订单
来源:互联网 发布:歌曲串烧软件 编辑:程序博客网 时间:2024/05/16 07:08
//布局
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="ditu.bwie.com.wangluohuoqu.Main3Activity"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="24dp" android:textColor="#000" android:text="我的订单" android:layout_gravity="center" ></TextView> <TextView android:layout_width="match_parent" android:layout_height="1dp" android:background="#000" /> <android.support.design.widget.TabLayout android:id="@+id/tab2" app:tabGravity="center" app:tabIndicatorColor="@color/colorhong" app:tabSelectedTextColor="@color/colorAccent" app:tabTextColor="@color/colorhei" android:layout_width="match_parent" android:layout_height="40dp" /> <android.support.v4.view.ViewPager android:id="@+id/view_pager2" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/tab"> </android.support.v4.view.ViewPager></LinearLayout>
//activity中
public class Main3Activity extends AppCompatActivity { private TabLayout tabLayout; private ViewPager viewPager; private List<String> list; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main3); tabLayout = (TabLayout) findViewById(R.id.tab2); viewPager = (ViewPager) findViewById(R.id.view_pager2); tabLayout.setTabMode(TabLayout.MODE_FIXED); tabLayout.setTabGravity(GRAVITY_FILL); list = new ArrayList<>(); list.add("全部"); list.add("待付款"); list.add("待收货"); list.add("已完成"); list.add("已取消"); viewPager.setOffscreenPageLimit(list.size()); //1.给viewPager设置适配器 /** * 管理者对象有几种???? * getSupportFragmentManager()...activity管理他身上的fragment的时候使用 * getChildFragmentManager()...fragment嵌套的时候,,,管理孩子需要使用这个管理者 * getFragmentManager()....孩子里面还有fragment的话就使用这个 */ viewPager.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) { //2.重写这个方法getPageTitle,,,得到当前页面的标题 @Override public CharSequence getPageTitle(int position) { return list.get(position); } @Override public Fragment getItem(int position) { NewsFragment1 newsFragment = new NewsFragment1(); //应该要做的是传值,,,,去fragment里面获取,,,获取到值之后,,,在进行url路径的拼接 Bundle bundle = new Bundle(); bundle.putString("name",list.get(position)); newsFragment.setArguments(bundle); return newsFragment; } @Override public int getCount() { return list.size(); } }); //3.将tabLayout和viewPager关联起来 tabLayout.setupWithViewPager(viewPager); }
阅读全文
0 0
- 电商我的订单
- 大型电商的订单设计概要
- 2.1电商项目的订单系统
- 电商订单提交
- 业务 电商 订单
- 一般电商的几种订单状态
- 解决电商订单与支付大数据量的解决方案
- 电商订单模块的订单表与订单商品表关系,1个订单对应多个商品的页面布局,el表达式去掉重复的数据。
- 小型电商项目--订单关键流程
- 电商后台 js实现订单状态
- 电商 购物车-订单-支付流程
- 收藏:电商、O2O:订单系统设计
- 电商订单技术方案梳理
- 电商订单技术方案梳理-续
- 电商系统VIP.com订单分库分表的实践总结以及关键步骤
- 电商售后系统设计:补寄、错发和无货订单的处理流程
- 我的订单的ListVIew条目
- 电商项目笔记之六:订单操作
- 使用Scratch2和ROS进行机器人图形化编程学习
- C语言中的操作符
- Ubuntu 16.04 标题栏实时显示上下行网速、CPU及内存使用率
- emmet语法
- 一款支持大恒相机、IDS相机、普通USB相机和机械手的标定工具
- 电商我的订单
- MVP接口登录注册
- HDOJ 1064 Financial Management 抢劫
- Table+view2
- 科林明伦杯”哈尔滨理工大学第七届程序设计团队赛G
- ubuntu caffe ssd cpu-only配置
- 搜索结果高亮显示
- android购物车二级列表实现+MVP+Okhttp
- 基础版的后台管理员管理