-<manifest package="com.bawei.test.okmvpreanview" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
-<application android:theme="@style/AppTheme" android:supportsRtl="true" android:roundIcon="@mipmap/ic_launcher_round" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:allowBackup="true">
-<activity android:name=".MainActivity">
-<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".Main2Activity"/>
<activity android:name=".Main22Activity"/>
</application>
</manifest>
导入依赖
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.squareup.okio:okio:1.5.0'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.google.code.gson:gson:2.8.2'
compile 'com.jcodecraeer:xrecyclerview:1.3.2'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'org.greenrobot:eventbus:3.1.1'
compile 'com.youth.banner:banner:1.4.10'
- 布局管理
- activity_main
<LinearLayout
tools:context="com.bawei.test.okmvpreanview.MainActivity"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_width="match_parent"
xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android">
<com.youth.banner.Banner android:layout_height="200dp" android:layout_width="match_parent" android:id="@+id/banner"/>
<com.jcodecraeer.xrecyclerview.XRecyclerView android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/mRecyclerView"/>
</LinearLayout>
activity_main2
-<LinearLayout tools:context="com.bawei.test.okmvpreanview.Main2Activity" android:layout_height="match_parent" android:layout_width="match_parent" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:src="@drawable/progressloading" android:id="@+id/img"/>
</LinearLayout>
activity_main22
-<LinearLayout tools:context="com.bawei.test.okmvpreanview.Main22Activity" android:orientation="vertical" android:layout_height="match_parent" android:layout_width="match_parent" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android">
<ExpandableListView android:layout_height="match_parent" android:layout_width="match_parent" android:layout_weight="1" android:id="@+id/exlv"/>
-<RelativeLayout android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/rl" android:background="#ffffff">
<CheckBox android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/checkbox" android:layout_centerVertical="true"/>
<TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/qx" android:layout_centerVertical="true" android:text="全选" android:layout_toRightOf="@id/checkbox"/>
-<LinearLayout android:orientation="vertical" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_centerVertical="true" android:layout_toRightOf="@id/qx">
<TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/price" android:text="总价:0.0"/>
<TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/num" android:text="共0件商品"/>
</LinearLayout>
<Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/jiesuan" android:background="#ff0000" android:text="去结算" android:layout_alignParentRight="true"/>
</RelativeLayout>
</LinearLayout>
chidren
-<RelativeLayout android:layout_height="match_parent" android:layout_width="match_parent" xmlns:android="http://schemas.android.com/apk/res/android"><CheckBox android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_marginTop="11dp" android:layout_centerVertical="true" android:id="@+id/z_che"/>
-<LinearLayout android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_marginTop="30dp" android:id="@+id/linearLayout" android:orientation="vertical" android:layout_toRightOf="@id/z_che">
<TextView android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/z_title" android:textStyle="bold" android:text="三只松鼠大礼包"/>
-<RelativeLayout android:layout_height="wrap_content" android:layout_width="match_parent">
<ImageView android:layout_height="140dp" android:layout_width="140dp" android:id="@+id/z_img" android:src="@mipmap/ic_launcher"/>
<TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/z_price" android:layout_toRightOf="@+id/z_img" android:text="价钱" android:textColor="#ff0000" android:layout_toEndOf="@+id/z_img" android:layout_alignParentTop="true"/>
<TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/z_shuxing" android:layout_toRightOf="@+id/z_img" android:text="价钱" android:layout_toEndOf="@+id/z_img" android:layout_below="@+id/z_price"/>
-<LinearLayout android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_marginTop="10dp" android:orientation="horizontal" android:layout_toRightOf="@id/z_img" android:layout_below="@id/z_shuxing">
<ImageView android:layout_height="20dp" android:layout_width="20dp" android:id="@+id/iv_jian" android:src="@drawable/shopcart_minus_red"/>
<TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/tv_num" android:text="1" android:layout_marginLeft="10dp"/>
<ImageView android:layout_height="20dp" android:layout_width="20dp" android:id="@+id/iv_add" android:src="@drawable/shopcart_add_red" android:layout_marginLeft="5dp"/>
<ImageView android:layout_height="20dp" android:layout_width="20dp" android:id="@+id/del" android:src="@drawable/rublish" android:layout_weight="1" android:layout_gravity="right"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/34774.html