作为一名后台人员,突然让搞安卓也是醉的不行不行的了,多余的话略过,代码走起。

首先添加依赖,在build.gradle中加入retrofit2和recycleView的依赖,要用到这个。

compile 'com.android.support:recyclerview-v7:26.1.0'    compile 'com.squareup.retrofit2:retrofit:2.0.1'    compile 'com.squareup.retrofit2:converter-gson:2.0.1'    compile 'com.github.bumptech.glide:glide:3.7.0'

先看一下项目结构吧,如下图所示

布局文件 activity_main.xml

<?xml version="1.0" encoding="utf-8"?>                

content_main.xml

<?xml version="1.0" encoding="utf-8"?>    

item.xml

<?xml version="1.0" encoding="utf-8"?>            

 

在res下新建menu文件夹,menu_main.xml

    

在values下新建attrs.xml和dimens.xml。

attrs.xml

<?xml version="1.0" encoding="utf-8"?>                                                            

dimens.xml

        16dp    16dp    16dp

color.xml中增加

#80c3db

styles中添加