drawable文件夹下
bg_btn_style_white
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false">
<shape android:shape="rectangle">
<corners android:radius="2.0dp" />
<solid android:color="#7fd8d8d8" />
<stroke android:width="1.0dp" android:color="#dddddd" />
</shape>
</item>
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="2.0dp" />
<solid android:color="#ffd8d8d8" />
<stroke android:width="1.0dp" android:color="#ddd" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<corners android:radius="2.0dp" />
<solid android:color="#ffffff" />
<stroke android:width="1.0dp" android:color="#dddddd" />
</shape>
</item>
</selector>
shape_number_add_sub
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="2dp" />
<stroke
android:width="1dp"
android:color="#dddddd" />
<solid android:color="#FFFFFF" />
</shape>
values文件夹下
atrrs.xml
<resources>
<declare-styleable name="NumberAddSubView">
<attr name="value" format="integer|reference"/>
<attr name="minValue" format="integer|reference"/>
<attr name="maxValue" format="integer|reference"/>
<attr name="btnAddBackground" format="reference"/>
<attr name="btnSubBackground" format="reference"/>
<attr name="textViewBackground" format="reference"/>
</declare-styleable>
</resources>
添加网络权限
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".myapp.MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<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=".RegsitActivity" />
<activity android:name=".ShowActivity" />
<activity android:name=".DetailActivity" />
<activity android:name=".ShowCartsActivity"/>
</application>
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.bawie.moni_yuekao0113"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
'com.android.support.test.espresso:espresso-core:3.0.1'
//*5.0新控件的依赖*//*
compile 'com.android.support:design:26.0.0-alpha1'
compile 'com.facebook.fresco:fresco:0.12.0'
//*RxJava与RxAndroid的依赖*//*
compile 'io.reactivex:rxandroid:1.0.1'
//*Retrofit与RxAndroid配置依赖*//*
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
//*使Retrofit的转化器自定义完成数据的转化
// 就是我们可以接口中少写一些bean类
compile 'com.squareup.retrofit2:converter-scalars:+'
compile 'com.xhb:xbanner:1.2.9'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'org.greenrobot:eventbus:3.0.0'
// compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
compile 'com.jakewharton:butterknife:7.0.1'
testCompile 'junit:junit:4.12'
}