G_注意事项 及 易错点

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'
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值