andriod——Retrofit+Fresco+MVP+Fragment
来源:互联网 发布:php过滤微信表情符号 编辑:程序博客网 时间:2024/05/22 01:56
导依赖包:
compile 'com.jakewharton:butterknife:8.5.1' compile 'com.hjm:BottomTabBar:1.1.1'
fragment——fragment01
package com.example.newfragment.fragment;import android.os.Bundle;import android.support.annotation.Nullable;import android.support.v4.app.Fragment;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import com.example.newfragment.R;/** * Created by Administrator on 2017/12/2. */public class fragment01 extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view=View.inflate(getActivity(),R.layout.fragment01,null); return view; }}
MainActivity
package com.example.newfragment;import android.graphics.Color;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import com.example.newfragment.fragment.fragment01;import com.example.newfragment.fragment.fragment02;import com.example.newfragment.fragment.fragment03;import com.example.newfragment.fragment.fragment04;import com.hjm.bottomtabbar.BottomTabBar;public class MainActivity extends AppCompatActivity { private BottomTabBar mb; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mb=(BottomTabBar)findViewById(R.id.bottom_tab_bar); mb.init(getSupportFragmentManager()) .setImgSize(0,0) .setFontSize(10) .setTabPadding(4,6,10) .setChangeColor(Color.RED,Color.DKGRAY) .addTabItem("首页",R.drawable.ic_launcher_round, fragment01.class) .addTabItem("分类",R.drawable.ic_launcher_round, fragment02.class) .addTabItem("购物车",R.drawable.ic_launcher_round, fragment03.class) .addTabItem("我的",R.drawable.ic_launcher_round, fragment04.class) .isShowDivider(false) .setOnTabChangeListener(new BottomTabBar.OnTabChangeListener() { @Override public void onTabChange(int position, String name) { } }); }}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?><android.support.constraint.ConstraintLayout 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" tools:context="com.example.newfragment.MainActivity"> <com.hjm.bottomtabbar.BottomTabBar android:id="@+id/bottom_tab_bar" android:layout_width="match_parent" android:layout_height="match_parent" > </com.hjm.bottomtabbar.BottomTabBar></android.support.constraint.ConstraintLayout>
fragment01.xml
<?xml version="1.0" encoding="utf-8"?><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"></LinearLayout>
阅读全文
0 0
- andriod——Retrofit+Fresco+MVP+Fragment
- andriod——Retrofit+Fresco+MVP+Fragment里添加购物车
- andriod——Retrofit+Fresco+MVP+Fragment判断网络获取数据
- andriod——Retrofit+Fresco+MVP+Fragment自定义动画3秒跳转
- andriod——Retrofit+Fresco+MVP网络获取数据
- andriod——Retrofit+Fresco+MVP接口拼接传值
- andriod——Retrofit+Fresco+MVP多条目
- andriod——Retrofit+Fresco+MVP商品分类
- andriod——Retrofit+Fresco+MVP+RxJAVA列表展示商品点击跳转此详情页面
- andriod——Retrofit+Fresco+MVP+解绑实现购物车
- andriod——Retrofit+Fresco+MVP+解绑实现二级购物车
- andriod——Fresco+Retrofit+GreenDao
- Retrofit+RxJava+Fresco+MVP
- Retrofit+RxJava+Fresco+MVP
- MVP+Retrofit+fresco+greendao+eventbus
- MVP+XRexyclerview+RxJava+Retrofit+Fresco
- MVP+Fresco+OKhttp+Retrofit+Recycleview
- MVP+Retrofit+RxJava+fresco+RecyclerView
- 用HttpSessionListener与HttpSessionBindingListener实现在线人数统计
- C语言操作符
- 沉浸式
- Javaweb提供下载的Servlet
- include、require、include_once、require_once的区别
- andriod——Retrofit+Fresco+MVP+Fragment
- Android开发中的SQLite事务处理,即beginTransaction()方法...
- 现在只有上帝懂了
- 数据结构实验之排序五:归并求逆序数
- C的操作符
- 数据结构实验之排序五:归并求逆序数
- 20171220
- 使用fiddler抓取数据包的时候,查看出现乱码
- 数据结构课程设计(考试管理系统)