Kaynağa Gözat

new login feature

hanjing 7 yıl önce
ebeveyn
işleme
a79625dcfa
70 değiştirilmiş dosya ile 3418 ekleme ve 181 silme
  1. 5 1
      RxGalleryFinal/build.gradle
  2. 5 1
      WaterWaveProgress/build.gradle
  3. 115 68
      app/build.gradle
  4. 31 26
      app/src/main/AndroidManifest.xml
  5. 2 0
      app/src/main/java/com/sheep/gamegroup/di/components/NetComponent.java
  6. 38 10
      app/src/main/java/com/sheep/gamegroup/greendao/DDProviderHelper.java
  7. 18 14
      app/src/main/java/com/sheep/gamegroup/greendao/download/DaoMaster.java
  8. 61 47
      app/src/main/java/com/sheep/gamegroup/greendao/download/DaoSession.java
  9. 9 0
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  10. 10 0
      app/src/main/java/com/sheep/gamegroup/model/entity/UserEntity.java
  11. 94 0
      app/src/main/java/com/sheep/gamegroup/module/ChangePasswordAct.java
  12. 188 0
      app/src/main/java/com/sheep/gamegroup/module/login/LoginAct.java
  13. 9 0
      app/src/main/java/com/sheep/gamegroup/module/login/controller/ChangePasswordController.java
  14. 23 0
      app/src/main/java/com/sheep/gamegroup/module/login/controller/LoginController.java
  15. 225 0
      app/src/main/java/com/sheep/gamegroup/module/login/fragments/EditUserInfoFgt.java
  16. 87 0
      app/src/main/java/com/sheep/gamegroup/module/login/fragments/FindAccountFgt.java
  17. 64 0
      app/src/main/java/com/sheep/gamegroup/module/login/fragments/NewPasswordFgt.java
  18. 65 0
      app/src/main/java/com/sheep/gamegroup/module/login/fragments/OldPasswordFgt.java
  19. 460 0
      app/src/main/java/com/sheep/gamegroup/module/login/fragments/SignInFgt.java
  20. 121 0
      app/src/main/java/com/sheep/gamegroup/module/login/fragments/SignUpFgt.java
  21. 153 0
      app/src/main/java/com/sheep/gamegroup/module/login/fragments/ValidCaptchaFgt.java
  22. 88 0
      app/src/main/java/com/sheep/gamegroup/module/login/model/Account.java
  23. 177 0
      app/src/main/java/com/sheep/gamegroup/module/login/model/AccountDao.java
  24. 9 1
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  25. 13 0
      app/src/main/java/com/sheep/gamegroup/util/StringUtils.java
  26. 1 0
      app/src/main/java/com/sheep/gamegroup/util/UMConfigUtils.java
  27. 8 2
      app/src/main/java/com/sheep/gamegroup/view/activity/ActSetting.java
  28. 90 0
      app/src/main/java/com/sheep/gamegroup/view/customview/CountDownButton.java
  29. 62 0
      app/src/main/java/com/sheep/gamegroup/view/customview/VerificationAction.java
  30. 346 0
      app/src/main/java/com/sheep/gamegroup/view/customview/VerificationCodeEditText.java
  31. 14 1
      app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java
  32. 6 0
      app/src/main/res/color/selector_color_radio_button.xml
  33. BIN
      app/src/main/res/drawable-xhdpi/radio_checked.png
  34. BIN
      app/src/main/res/drawable-xhdpi/radio_uncheck.png
  35. BIN
      app/src/main/res/drawable-xxhdpi/radio_checked.png
  36. BIN
      app/src/main/res/drawable-xxhdpi/radio_uncheck.png
  37. 6 0
      app/src/main/res/drawable/round_main_r25.xml
  38. 5 0
      app/src/main/res/drawable/selector_radio_img.xml
  39. 34 0
      app/src/main/res/layout/account_select_item.xml
  40. 14 0
      app/src/main/res/layout/act_setting.xml
  41. 15 0
      app/src/main/res/layout/activity_login.xml
  42. 93 0
      app/src/main/res/layout/fragment_edit_user_info.xml
  43. 111 0
      app/src/main/res/layout/fragment_find_account.xml
  44. 45 0
      app/src/main/res/layout/fragment_new_password.xml
  45. 44 0
      app/src/main/res/layout/fragment_old_password.xml
  46. 240 0
      app/src/main/res/layout/fragment_sign_in.xml
  47. 37 0
      app/src/main/res/layout/fragment_sign_up.xml
  48. 59 0
      app/src/main/res/layout/fragment_valid_captcha.xml
  49. BIN
      app/src/main/res/mipmap-xhdpi/cross_delete.png
  50. BIN
      app/src/main/res/mipmap-xhdpi/login_account.png
  51. BIN
      app/src/main/res/mipmap-xhdpi/login_phone.png
  52. BIN
      app/src/main/res/mipmap-xhdpi/login_qq.png
  53. BIN
      app/src/main/res/mipmap-xhdpi/login_wx.png
  54. BIN
      app/src/main/res/mipmap-xhdpi/text_delete.png
  55. BIN
      app/src/main/res/mipmap-xxhdpi/arrow_down.png
  56. BIN
      app/src/main/res/mipmap-xxhdpi/cross_delete.png
  57. BIN
      app/src/main/res/mipmap-xxhdpi/login_account.png
  58. BIN
      app/src/main/res/mipmap-xxhdpi/login_phone.png
  59. BIN
      app/src/main/res/mipmap-xxhdpi/login_qq.png
  60. BIN
      app/src/main/res/mipmap-xxhdpi/login_wx.png
  61. BIN
      app/src/main/res/mipmap-xxhdpi/text_delete.png
  62. 32 0
      app/src/main/res/values-v19/style_theme.xml
  63. 2 0
      app/src/main/res/values-v23/style_theme.xml
  64. 5 3
      app/src/main/res/values/common.xml
  65. 3 0
      app/src/main/res/values/strings.xml
  66. 1 0
      app/src/main/res/values/style_theme.xml
  67. 49 0
      app/src/main/res/values/styles.xml
  68. 15 0
      app/src/main/res/values/vcedittext_attrs.xml
  69. 2 2
      ucrop/build.gradle
  70. 9 5
      view/build.gradle

+ 5 - 1
RxGalleryFinal/build.gradle

@@ -25,6 +25,10 @@ android {
         }
     }
     buildToolsVersion ANDROID_BUILD_TOOLS_VERSION
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
 }
 
 
@@ -32,7 +36,7 @@ android {
 dependencies {
     compileOnly "com.android.support:appcompat-v7:$supportLibVersion"
     compileOnly "com.android.support:recyclerview-v7:$supportLibVersion"
-    compileOnly ('com.github.bumptech.glide:glide:4.1.1')
+    compileOnly 'com.github.bumptech.glide:glide:4.1.1'
     api "com.android.support:exifinterface:$supportLibVersion"
     api project(':ucrop')
     compileOnly 'io.reactivex.rxjava2:rxandroid:2.1.0'

+ 5 - 1
WaterWaveProgress/build.gradle

@@ -17,10 +17,14 @@ android {
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
         }
     }
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
 }
 
 dependencies {
-    implementation fileTree(dir: 'libs', include: ['*.jar'])
+    implementation fileTree(include: ['*.jar'], dir: 'libs')
     androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
         exclude group: 'com.android.support', module: 'support-annotations'
     })

+ 115 - 68
app/build.gradle

@@ -23,13 +23,9 @@ android {
         flavorDimensions "versionCode"
     }
     greendao {
-        schemaVersion 14
+        schemaVersion 15
         targetGenDir 'src/main/java'
     }
-//    compileOptions{
-//        sourceCompatibility org.gradle.api.JavaVersion.VERSION_1_8
-//        targetCompatibility org.gradle.api.JavaVersion.VERSION_1_8
-//    }
     signingConfigs {
         config {
             keyAlias 'sheep'
@@ -122,6 +118,10 @@ android {
         }
     }
 
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
 }
 
 repositories {
@@ -142,14 +142,16 @@ configurations.all {
 }
 
 dependencies {
+    implementation 'com.android.support:support-v4:28.+'
     debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
     releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
+
     // Optional, if you use support library fragments:
     debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.2'
 
     //noinspection GradleCompatible
     implementation "com.android.support:cardview-v7:$supportLibVersion"
-    implementation ("com.android.support:design:$supportLibVersion") {
+    implementation("com.android.support:design:$supportLibVersion") {
         exclude group: 'com.android.support', module: 'support-annotations'
         exclude group: 'com.android.support', module: 'support-compat'
         exclude group: 'com.android.support', module: 'support-core-ui'
@@ -162,8 +164,10 @@ dependencies {
     }
     implementation 'com.android.support.constraint:constraint-layout:1.1.3'
     testImplementation 'junit:junit:4.12'
-//    implementation 'com.google.code.gson:gson:2.8.2'
-        //    implementation 'com.shark:screencapture:1.0.0'
+
+    //    implementation 'com.google.code.gson:gson:2.8.2'
+
+    //    implementation 'com.shark:screencapture:1.0.0'
     implementation('com.jcodecraeer:xrecyclerview:1.5.9') {
         exclude group: 'com.android.support', module: 'design'
         exclude group: 'com.android.support', module: 'recyclerview'
@@ -171,7 +175,8 @@ dependencies {
     }
     implementation 'com.squareup.okhttp3:okhttp:3.11.0'
     implementation 'org.greenrobot:eventbus:3.1.1'
-//    implementation 'com.zhy:base-adapter:3.0.3'
+
+    //    implementation 'com.zhy:base-adapter:3.0.3'
 
     //    implementation 'com.liulishuo.filedownloader:library:1.6.9'
     implementation 'com.tencent.bugly:crashreport_upgrade:1.3.5'
@@ -180,7 +185,6 @@ dependencies {
     implementation 'com.tencent.bugly:nativecrashreport:3.3.1'
 
     //其中latest.release指代最
-
     implementation 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:5.1.6'
     debugImplementation('com.readystatesoftware.chuck:library:1.1.0') {
         exclude group: 'com.android.support', module: 'design'
@@ -195,13 +199,14 @@ dependencies {
         exclude group: 'com.squareup.okhttp3', module: 'okhttp'
     }
     implementation 'org.xutils:xutils:3.5.0'
-//    implementation 'com.mylhyl:acp:1.1.7'
 
-    implementation ('cn.yipianfengye.android:zxing-library:2.2') {
+    //    implementation 'com.mylhyl:acp:1.1.7'
+    implementation('cn.yipianfengye.android:zxing-library:2.2') {
         exclude group: 'com.android.support', module: 'appcompat-v7'
         exclude group: 'com.android.support', module: 'support-v4'
     }
-//    implementation 'com.github.huburt-Hu:NewbieGuide:v1.2.0'
+
+    //    implementation 'com.github.huburt-Hu:NewbieGuide:v1.2.0'
     debugImplementation 'com.android.support:multidex:1.0.1'
 
     //不要修改这里,相信我
@@ -209,12 +214,11 @@ dependencies {
     implementation(name: 'com.kfzs.safe-201809211354', ext: 'aar')
 
     //butterknife
-    implementation ('com.jakewharton:butterknife:8.8.1') {
+    implementation('com.jakewharton:butterknife:8.8.1') {
         exclude group: 'com.android.support', module: 'support-annotations'
         exclude group: 'com.android.support', module: 'support-compat'
 //        exclude group: 'com.jakewharton', module: 'butterknife-annotations'
     }
-
     annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
 
     //dagger2
@@ -222,47 +226,57 @@ dependencies {
     //    implementation 'com.google.dagger:dagger:+'
 
     //    implementation 'com.google.dagger:dagger-compiler:+'
-    compileOnly 'org.glassfish:javax.annotation:10.0-b28'//javax.annotation', module: 'jsr250-api
-    implementation 'com.google.dagger:dagger:2.12'//javax.inject', module: 'javax.inject
+    compileOnly 'org.glassfish:javax.annotation:10.0-b28'
+
+    //javax.annotation', module: 'jsr250-api
+    implementation 'com.google.dagger:dagger:2.12'
+
+    //javax.inject', module: 'javax.inject
     annotationProcessor 'com.google.dagger:dagger-compiler:2.12'
 
     //retrofit
-    implementation ('com.squareup.retrofit2:retrofit:2.4.0') {
+    implementation('com.squareup.retrofit2:retrofit:2.4.0') {
         exclude group: 'com.google.android', module: 'android'
         exclude group: 'com.squareup.okhttp3', module: 'okhttp'
         exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations'
     }
 
-//    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
-    implementation ('org.ligboy.retrofit2:converter-fastjson-android:2.1.0') {
+    //    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
+    implementation('org.ligboy.retrofit2:converter-fastjson-android:2.1.0') {
         exclude group: 'com.alibaba', module: 'fastjson'
         exclude group: 'com.squareup.retrofit2', module: 'retrofit'
     }
-//    implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
+
+    //    implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
 
     //    implementation 'com.squareup.retrofit2:adapter-rxjava2:+'
-//    implementation ('com.squareup.retrofit2:adapter-rxjava:2.1.0') {
-//        exclude group: 'com.squareup.retrofit2', module: 'retrofit'
-//    }
-    implementation ('com.squareup.retrofit2:adapter-rxjava2:2.5.0') {
+
+    //    implementation ('com.squareup.retrofit2:adapter-rxjava:2.1.0') {
+
+    //        exclude group: 'com.squareup.retrofit2', module: 'retrofit'
+
+    //    }
+    implementation('com.squareup.retrofit2:adapter-rxjava2:2.5.0') {
         exclude group: 'com.squareup.retrofit2', module: 'retrofit'
         exclude group: 'io.reactivex.rxjava2', module: 'rxjava'
     }
 
     //rxjava
-    implementation ('io.reactivex.rxjava2:rxandroid:2.1.0') {
+    implementation('io.reactivex.rxjava2:rxandroid:2.1.0') {
         exclude group: 'io.reactivex.rxjava2', module: 'rxjava'
     }
     implementation 'io.reactivex.rxjava2:rxjava:2.2.3'
 
     //获取动态权限三方库
-    implementation ('pub.devrel:easypermissions:1.2.0') {
+    implementation('pub.devrel:easypermissions:1.2.0') {
         exclude group: 'com.android.support', module: 'appcompat-v7'
         exclude group: 'com.android.support', module: 'support-compat'
         exclude group: 'com.android.support', module: 'support-fragment'
     }
-//    implementation 'net.danlew:android.joda:2.9.3'
-//    implementation 'com.orhanobut:logger:1.15'
+
+    //    implementation 'net.danlew:android.joda:2.9.3'
+
+    //    implementation 'com.orhanobut:logger:1.15'
 
     //友盟
     implementation 'com.umeng.sdk:common:1.5.3'
@@ -277,11 +291,13 @@ dependencies {
     implementation project(':view')
 
     //    implementation(name: 'view-release', ext: 'aar')
-//    implementation 'com.flipboard:bottomsheet-core:1.5.3'
-//    implementation 'com.flipboard:bottomsheet-commons:1.5.3'
 
+    //    implementation 'com.flipboard:bottomsheet-core:1.5.3'
+
+    //    implementation 'com.flipboard:bottomsheet-commons:1.5.3'
     implementation files('libs/open_sdk_r5923_lite.jar')
-//    implementation files('libs/wechat-sdk-android-with-mta-1.1.6.jar')
+
+    //    implementation files('libs/wechat-sdk-android-with-mta-1.1.6.jar')
     implementation files('libs/umeng_social_tool.jar')
     implementation files('libs/umeng_social_shareboard.jar')
     implementation files('libs/umeng_social_net.jar')
@@ -289,32 +305,40 @@ dependencies {
     implementation files('libs/umeng_shareboard_widget.jar')
     implementation files('libs/SocialSDK_WeiXin_Full.jar')
     implementation files('libs/SocialSDK_QQ_Full.jar')
-    implementation ('com.zhy:okhttputils:2.6.2') {
+    implementation('com.zhy:okhttputils:2.6.2') {
         exclude group: 'com.squareup.okhttp3', module: 'okhttp'
     }
 
     //    implementation 'com.kf.framework:kf-utils:latest.integration@aar'
-//    implementation 'com.kf.framework:kf-utils:1.4.5@aar'
+
+    //    implementation 'com.kf.framework:kf-utils:1.4.5@aar'
 
     //    implementation 'com.kf.framework:volleyplus:latest.integration@aar'
-//    implementation 'com.kf.framework:volleyplus:1.4.5@aar'
+
+    //    implementation 'com.kf.framework:volleyplus:1.4.5@aar'
     implementation "com.android.support:support-annotations:$supportLibVersion"
-    implementation ("com.android.support:recyclerview-v7:$supportLibVersion") {
+    implementation("com.android.support:recyclerview-v7:$supportLibVersion") {
         exclude group: 'com.android.support', module: 'support-annotations'
         exclude group: 'com.android.support', module: 'support-compat'
         exclude group: 'com.android.support', module: 'support-core-ui'
     }
-//    implementation project(':datashare')
-//    implementation files('libs/jackson-core-2.2.1.jar')
-//    implementation files('libs/jackson-dataformat-xml-2.1.2.jar')
-//    implementation 'io.reactivex:rxandroid:1.2.1'
-    implementation ('com.github.ithedan:TextViewDrawable:v1.0') {
+
+    //    implementation project(':datashare')
+
+    //    implementation files('libs/jackson-core-2.2.1.jar')
+
+    //    implementation files('libs/jackson-dataformat-xml-2.1.2.jar')
+
+    //    implementation 'io.reactivex:rxandroid:1.2.1'
+    implementation('com.github.ithedan:TextViewDrawable:v1.0') {
         exclude group: 'com.android.support', module: 'appcompat-v7'
     }
-//    implementation 'com.github.zhangkexpz:LayoutScroll:v1.0'
-//    implementation 'me.iwf.photopicker:PhotoPicker:0.9.12@aar'
+
+    //    implementation 'com.github.zhangkexpz:LayoutScroll:v1.0'
+
+    //    implementation 'me.iwf.photopicker:PhotoPicker:0.9.12@aar'
     implementation(name: 'PhotoPicker-release-201810081154', ext: 'aar')
-    implementation ('com.github.bumptech.glide:glide:4.1.1') {
+    implementation('com.github.bumptech.glide:glide:4.1.1') {
         exclude group: 'com.android.support', module: 'support-fragment'
 //        exclude group: 'com.github.bumptech.glide', module: 'gifdecoder'
 //        exclude group: 'com.github.bumptech.glide', module: 'disklrucache'
@@ -325,11 +349,13 @@ dependencies {
     //    implementation 'com.github.yalantis:ucrop:2.2.1-native'
 
     //    implementation 'com.google.zxing:core:3.3.0'
-//    implementation project(':ucrop')
-    implementation ('com.sunfusheng:marqueeview:1.3.3') {
+
+    //    implementation project(':ucrop')
+    implementation('com.sunfusheng:marqueeview:1.3.3') {
         exclude group: 'com.android.support', module: 'appcompat-v7'
     }
     implementation files('libs/alipaySdk-20170922.jar')
+
     //极光
     implementation files('libs/jcore-android-1.2.0.jar')
     implementation files('libs/jpush-android-3.1.2.jar')
@@ -339,54 +365,75 @@ dependencies {
 
     //幂动科技
     implementation files('libs/mdsdk_1123_1.2.1.12.jar')
+
     //轮播图
-    implementation 'com.youth.banner:banner:1.4.10'  //最新版本
+    implementation 'com.youth.banner:banner:1.4.10'
+
+    //最新版本
+
     //loading
     implementation 'com.github.ybq:Android-SpinKit:1.1.0'
-//    implementation 'com.github.nanchen2251:CompressHelper:1.0.5'
-//    implementation(name: 'compresshelper-release', ext: 'aar')
+
+    //    implementation 'com.github.nanchen2251:CompressHelper:1.0.5'
+
+    //    implementation(name: 'compresshelper-release', ext: 'aar')
     implementation files('libs/compresshelper-release.jar')
-    implementation ('com.haibin:calendarview:3.4.8') {
+    implementation('com.haibin:calendarview:3.4.8') {
         exclude group: 'com.android.support', module: 'appcompat-v7'
         exclude group: 'com.android.support', module: 'recyclerview-v7'
     }
-
     implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-14'
+    implementation 'org.greenrobot:greendao:3.2.2'
+
+    //org.greenrobot', module: 'greendao-api
 
-    implementation 'org.greenrobot:greendao:3.2.2'//org.greenrobot', module: 'greendao-api
     //okDownload
+
     // core
-    implementation "com.liulishuo.okdownload:okdownload:1.0.5"
+    implementation 'com.liulishuo.okdownload:okdownload:1.0.5'
+
     // provide sqlite to store breakpoints
-    implementation "com.liulishuo.okdownload:sqlite:1.0.5"
-    // provide okhttp to connect to backend
-    implementation "com.liulishuo.okdownload:okhttp:1.0.5"
+    implementation 'com.liulishuo.okdownload:sqlite:1.0.5'
 
-    implementation ('com.trello.rxlifecycle2:rxlifecycle-components:2.2.2') {
+    // provide okhttp to connect to backend
+    implementation 'com.liulishuo.okdownload:okhttp:1.0.5'
+    implementation('com.trello.rxlifecycle2:rxlifecycle-components:2.2.2') {
         exclude group: 'com.android.support', module: 'appcompat-v7'
 //        com.trello.rxlifecycle2', module: 'rxlifecycle-android
         exclude group: 'io.reactivex.rxjava2', module: 'rxjava'
     }
-//
-//    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
 
+    //
+
+    //    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
     implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34'
+
     //有米科技
     implementation(name: 'YoumiSdk_v8.3.0_2018-09-20', ext: 'aar')
     implementation project(':WaterWaveProgress')
+
     //AndroidVideoCache 网络视频缓存 https://github.com/danikula/AndroidVideoCache
     implementation 'com.danikula:videocache:2.7.1'
+
     //视频图片选择
-//    implementation ('cn.finalteam.rxgalleryfinal:library:1.1.3') {
-//        exclude group: 'com.android.support', module: 'appcompat-v7'
-//        exclude group: 'io.reactivex.rxjava2', module: 'rxandroid'
-//        exclude group: 'io.reactivex.rxjava2', module: 'rxjava'
-//        exclude group: 'com.yalantis', module: 'ucrop'
-//        exclude group: 'com.android.support', module: 'recyclerview-v7'
-//    }
-//    implementation "com.android.support:exifinterface:$supportLibVersion"
+
+    //    implementation ('cn.finalteam.rxgalleryfinal:library:1.1.3') {
+
+    //        exclude group: 'com.android.support', module: 'appcompat-v7'
+
+    //        exclude group: 'io.reactivex.rxjava2', module: 'rxandroid'
+
+    //        exclude group: 'io.reactivex.rxjava2', module: 'rxjava'
+
+    //        exclude group: 'com.yalantis', module: 'ucrop'
+
+    //        exclude group: 'com.android.support', module: 'recyclerview-v7'
+
+    //    }
+
+    //    implementation "com.android.support:exifinterface:$supportLibVersion"
     implementation project(':RxGalleryFinal')
-    implementation ('com.qiniu:qiniu-android-sdk:7.3.13') {
+    implementation('com.qiniu:qiniu-android-sdk:7.3.13') {
         exclude group: 'com.squareup.okhttp3', module: 'okhttp'
     }
 }

+ 31 - 26
app/src/main/AndroidManifest.xml

@@ -172,17 +172,18 @@
             android:configChanges="keyboardHidden|screenSize|orientation"
             android:launchMode="singleTask"
             android:screenOrientation="portrait"
-            android:theme="@style/FullScreenTheme"></activity>
-        <!--<activity-->
-        <!--android:name=".ui.activity.SignActivity"-->
-        <!--android:screenOrientation="portrait"-->
-        <!--android:theme="@style/SplashTheme">-->
-        <!--<intent-filter>-->
-        <!--<action android:name="android.intent.action.MAIN" />-->
-
-        <!--<category android:name="android.intent.category.LAUNCHER" />-->
-        <!--</intent-filter>-->
-        <!--</activity>-->
+            android:theme="@style/FullScreenTheme" />
+        <!-- <activity -->
+        <!-- android:name=".ui.activity.SignActivity" -->
+        <!-- android:screenOrientation="portrait" -->
+        <!-- android:theme="@style/SplashTheme"> -->
+        <!-- <intent-filter> -->
+        <!-- <action android:name="android.intent.action.MAIN" /> -->
+
+
+        <!-- <category android:name="android.intent.category.LAUNCHER" /> -->
+        <!-- </intent-filter> -->
+        <!-- </activity> -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.SplashAct"
             android:screenOrientation="portrait"
@@ -650,18 +651,18 @@
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActSheepPngList"
             android:screenOrientation="portrait" />
-        <!--<activity-->
-        <!--android:name="com.sheep.gamegroup.view.activity.ActFindGame"-->
-        <!--android:screenOrientation="portrait" />-->
+        <!-- <activity -->
+        <!-- android:name="com.sheep.gamegroup.view.activity.ActFindGame" -->
+        <!-- android:screenOrientation="portrait" /> -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActArticle"
             android:configChanges="orientation|screenSize|keyboardHidden" />
-        <!--小绵羊 3.4.2 合并资讯与资讯评论界面,且默认不显示输入法-->
+        <!-- 小绵羊 3.4.2 合并资讯与资讯评论界面,且默认不显示输入法 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActArticleComment"
-            android:windowSoftInputMode="adjustUnspecified|stateHidden"
             android:configChanges="orientation|keyboardHidden"
-            android:screenOrientation="portrait" />
+            android:screenOrientation="portrait"
+            android:windowSoftInputMode="adjustUnspecified|stateHidden" />
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActReservation"
             android:screenOrientation="portrait" />
@@ -743,6 +744,7 @@
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActMiDong"
             android:screenOrientation="portrait" />
+
         <service
             android:name="com.mdad.sdk.mdsdk.monitor.MonitorService"
             android:enabled="true"
@@ -781,6 +783,7 @@
             android:screenOrientation="portrait" />
         <!-- end 小绵羊sdk相关 -->
 
+
         <!-- 签到 -->
         <activity
             android:name=".ui.activity.SignActivity"
@@ -790,43 +793,45 @@
         <activity
             android:name=".ui.activity.ActiveRuleActivity"
             android:screenOrientation="portrait" />
-        <!-- 小绵羊3.4.5 我的关注  -->
+        <!-- 小绵羊3.4.5 我的关注 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActMyFocus"
             android:screenOrientation="portrait" />
-        <!-- 小绵羊3.4.5 足迹  -->
+        <!-- 小绵羊3.4.5 足迹 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActFootprint"
             android:screenOrientation="portrait" />
-        <!-- 小绵羊3.4.5 收徒红包  -->
+        <!-- 小绵羊3.4.5 收徒红包 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActApprenticeRedPacket"
             android:screenOrientation="portrait" />
-        <!-- 小绵羊3.4.5 兑换商城  -->
+        <!-- 小绵羊3.4.5 兑换商城 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActExchangeMall"
             android:screenOrientation="portrait" />
-        <!-- 小绵羊3.4.5 每日分享  -->
+        <!-- 小绵羊3.4.5 每日分享 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActEveryDayShare"
             android:screenOrientation="portrait" />
-        <!-- 小绵羊3.4.5 娱乐抽奖  -->
+        <!-- 小绵羊3.4.5 娱乐抽奖 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActEntertainmentLuckDraw"
             android:screenOrientation="portrait" />
-        <!-- 小绵羊3.4.5 金币中心  -->
+        <!-- 小绵羊3.4.5 金币中心 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActCoinCenter"
             android:screenOrientation="portrait" />
-        <!-- 小绵羊3.4.5 发布发现内容  -->
+        <!-- 小绵羊3.4.5 发布发现内容 -->
         <activity
             android:name="com.sheep.gamegroup.view.activity.ActPublishArticle"
             android:screenOrientation="portrait" />
 
-        <!-- 小绵羊3.4.5 选择图片与视频  -->
+        <!-- 小绵羊3.4.5 选择图片与视频 -->
         <activity
             android:name="cn.finalteam.rxgalleryfinal.ui.activity.MediaActivity"
             android:exported="true" />
+        <activity android:name="com.sheep.gamegroup.module.login.LoginAct" />
+        <activity android:name="com.sheep.gamegroup.module.ChangePasswordAct"></activity>
     </application>
 
 </manifest>

+ 2 - 0
app/src/main/java/com/sheep/gamegroup/di/components/NetComponent.java

@@ -17,6 +17,8 @@ import retrofit2.Retrofit;
 @Singleton
 public interface NetComponent {
     ApiService getApiService();
+
     OkHttpClient getOkHttp();
+
     Retrofit getRetrofit();
 }

+ 38 - 10
app/src/main/java/com/sheep/gamegroup/greendao/DDProviderHelper.java

@@ -14,6 +14,8 @@ import com.sheep.gamegroup.greendao.download.SdkLoginUser;
 import com.sheep.gamegroup.greendao.download.SdkLoginUserDao;
 import com.sheep.gamegroup.greendao.download.SearchRecord;
 import com.sheep.gamegroup.greendao.download.SearchRecordDao;
+import com.sheep.gamegroup.module.login.model.Account;
+import com.sheep.gamegroup.module.login.model.AccountDao;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.DownloadUtil;
 import com.sheep.jiuyan.samllsheep.SheepApp;
@@ -43,11 +45,12 @@ public class DDProviderHelper {
 
     private DDProviderHelper() {
     }
+
     private DaoMaster.DevOpenHelper openHelper;
     private DaoSession daoSession;
 
     private synchronized DaoSession getDaossion() {
-        if(daoSession == null) {
+        if (daoSession == null) {
             if (openHelper == null) {
                 openHelper = new DaoMaster.DevOpenHelper(SheepApp.getInstance(), "dd.db");
             }
@@ -105,7 +108,6 @@ public class DDProviderHelper {
 
     /**
      * 删除所有任务;
-     *
      */
     public void deleteAllDownloadTask() {
         DownLoadInfoDao loadInfoDao = getDaossion().getDownLoadInfoDao();
@@ -135,7 +137,6 @@ public class DDProviderHelper {
 
     /**
      * 获取下载中的任务;
-     *
      */
     public List<DownLoadInfo> getDownloadingTask() {
         List<DownLoadInfo> loadInfos = getDaossion()
@@ -281,7 +282,6 @@ public class DDProviderHelper {
 
     /**
      * app启动  所有任务全部暂停
-     *
      */
     public void restoreDownloadTaskStatus() {
         DownLoadInfoDao downLoadInfoDao = getDaossion().getDownLoadInfoDao();
@@ -404,7 +404,6 @@ public class DDProviderHelper {
 
     /**
      * 删除用户的任务记录数据
-     *
      */
     public void deleteTaskRecord() {
         if (AutoCheckService.IS_USE_THIS_SERVICE) {
@@ -435,7 +434,6 @@ public class DDProviderHelper {
 
     /**
      * 获取对应包名下的截图列表
-     *
      */
     public List<ScreenShotRecord> getScreenShotRecordList(String packageName) {
         return getDaossion()
@@ -448,7 +446,6 @@ public class DDProviderHelper {
 
     /**
      * 是否监听到该截图
-     *
      */
     public ScreenShotRecord getScreenShotRecord(String packageName, String imagePath) {
         return getDaossion()
@@ -459,9 +456,39 @@ public class DDProviderHelper {
                 .unique();
     }
 
+    public List<Account> getAccountList() {
+        return getDaossion()
+                .getAccountDao()
+                .loadAll();
+    }
+
+    public Account getAccount(String aid) {
+        return getDaossion()
+                .getAccountDao()
+                .queryBuilder()
+                .where(AccountDao.Properties.Aid.eq(aid))
+                .build().unique();
+    }
+
+    public void saveAccount(Account account) {
+        Account acc = getAccount(account.getAid());
+        if (acc == null) {
+            getDaossion().getAccountDao().insert(account);
+        } else {
+            acc.setLoginname(account.getLoginname());
+            acc.setNickname(account.getNickname());
+            acc.setAvatar(account.getAvatar());
+            acc.setGender(account.getGender());
+            getDaossion().getAccountDao().update(acc);
+        }
+    }
+
+    public void deleteAccount(Account account) {
+        getDaossion().getAccountDao().delete(account);
+    }
+
     /**
      * 获取对应服务器下所有登录过的用户列表
-     *
      */
     public List<SdkLoginUser> getSdkLoginUserList(String serviceName) {
         return getDaossion()
@@ -530,6 +557,7 @@ public class DDProviderHelper {
         }
         return false;
     }
+
     /**
      * 添加或更新搜索记录
      * 添加成功返回true
@@ -561,9 +589,9 @@ public class DDProviderHelper {
         }
         return false;
     }
+
     /**
      * 获取搜索历史(根据搜索次数来排序)
-     *
      */
     public List<SearchRecord> getSearchRecordList(int limit) {
         return getDaossion()
@@ -594,7 +622,7 @@ public class DDProviderHelper {
                             .where(SearchRecordDao.Properties.Input.eq(oldInfo.getInput()))
                             .build()
                             .unique();
-                    if(loadInfo != null)
+                    if (loadInfo != null)
                         loadInfoDao.delete(loadInfo);
                     return true;
                 } catch (Exception e2) {

+ 18 - 14
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoMaster.java

@@ -11,34 +11,37 @@ import org.greenrobot.greendao.database.Database;
 import org.greenrobot.greendao.database.DatabaseOpenHelper;
 import org.greenrobot.greendao.identityscope.IdentityScopeType;
 
+import com.sheep.gamegroup.module.login.model.AccountDao;
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 /**
- * Master of DAO (schema version 14): knows all DAOs.
+ * Master of DAO (schema version 15): knows all DAOs.
  */
 public class DaoMaster extends AbstractDaoMaster {
-    public static final int SCHEMA_VERSION = 14;
+    public static final int SCHEMA_VERSION = 15;
 
     /** Creates underlying database table using DAOs. */
     public static void createAllTables(Database db, boolean ifNotExists) {
-        AcceptTaskRecordDao.createTable(db, ifNotExists);
-        AppdownloadBeanDao.createTable(db, ifNotExists);
-        DownLoadInfoDao.createTable(db, ifNotExists);
         ProcessRecordDao.createTable(db, ifNotExists);
-        ScreenShotRecordDao.createTable(db, ifNotExists);
+        AppdownloadBeanDao.createTable(db, ifNotExists);
         SdkLoginUserDao.createTable(db, ifNotExists);
+        ScreenShotRecordDao.createTable(db, ifNotExists);
+        AcceptTaskRecordDao.createTable(db, ifNotExists);
         SearchRecordDao.createTable(db, ifNotExists);
+        DownLoadInfoDao.createTable(db, ifNotExists);
+        AccountDao.createTable(db, ifNotExists);
     }
 
     /** Drops underlying database table using DAOs. */
     public static void dropAllTables(Database db, boolean ifExists) {
-        AcceptTaskRecordDao.dropTable(db, ifExists);
-        AppdownloadBeanDao.dropTable(db, ifExists);
-        DownLoadInfoDao.dropTable(db, ifExists);
         ProcessRecordDao.dropTable(db, ifExists);
-        ScreenShotRecordDao.dropTable(db, ifExists);
+        AppdownloadBeanDao.dropTable(db, ifExists);
         SdkLoginUserDao.dropTable(db, ifExists);
+        ScreenShotRecordDao.dropTable(db, ifExists);
+        AcceptTaskRecordDao.dropTable(db, ifExists);
         SearchRecordDao.dropTable(db, ifExists);
+        DownLoadInfoDao.dropTable(db, ifExists);
+        AccountDao.dropTable(db, ifExists);
     }
 
     /**
@@ -57,13 +60,14 @@ public class DaoMaster extends AbstractDaoMaster {
 
     public DaoMaster(Database db) {
         super(db, SCHEMA_VERSION);
-        registerDaoClass(AcceptTaskRecordDao.class);
-        registerDaoClass(AppdownloadBeanDao.class);
-        registerDaoClass(DownLoadInfoDao.class);
         registerDaoClass(ProcessRecordDao.class);
-        registerDaoClass(ScreenShotRecordDao.class);
+        registerDaoClass(AppdownloadBeanDao.class);
         registerDaoClass(SdkLoginUserDao.class);
+        registerDaoClass(ScreenShotRecordDao.class);
+        registerDaoClass(AcceptTaskRecordDao.class);
         registerDaoClass(SearchRecordDao.class);
+        registerDaoClass(DownLoadInfoDao.class);
+        registerDaoClass(AccountDao.class);
     }
 
     public DaoSession newSession() {

+ 61 - 47
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoSession.java

@@ -8,21 +8,23 @@ import org.greenrobot.greendao.database.Database;
 import org.greenrobot.greendao.identityscope.IdentityScopeType;
 import org.greenrobot.greendao.internal.DaoConfig;
 
-import com.sheep.gamegroup.greendao.download.AcceptTaskRecord;
-import com.sheep.gamegroup.greendao.download.AppdownloadBean;
-import com.sheep.gamegroup.greendao.download.DownLoadInfo;
 import com.sheep.gamegroup.greendao.download.ProcessRecord;
-import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
+import com.sheep.gamegroup.greendao.download.AppdownloadBean;
 import com.sheep.gamegroup.greendao.download.SdkLoginUser;
+import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
+import com.sheep.gamegroup.greendao.download.AcceptTaskRecord;
 import com.sheep.gamegroup.greendao.download.SearchRecord;
+import com.sheep.gamegroup.greendao.download.DownLoadInfo;
+import com.sheep.gamegroup.module.login.model.Account;
 
-import com.sheep.gamegroup.greendao.download.AcceptTaskRecordDao;
-import com.sheep.gamegroup.greendao.download.AppdownloadBeanDao;
-import com.sheep.gamegroup.greendao.download.DownLoadInfoDao;
 import com.sheep.gamegroup.greendao.download.ProcessRecordDao;
-import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
+import com.sheep.gamegroup.greendao.download.AppdownloadBeanDao;
 import com.sheep.gamegroup.greendao.download.SdkLoginUserDao;
+import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
+import com.sheep.gamegroup.greendao.download.AcceptTaskRecordDao;
 import com.sheep.gamegroup.greendao.download.SearchRecordDao;
+import com.sheep.gamegroup.greendao.download.DownLoadInfoDao;
+import com.sheep.gamegroup.module.login.model.AccountDao;
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 
@@ -33,100 +35,112 @@ import com.sheep.gamegroup.greendao.download.SearchRecordDao;
  */
 public class DaoSession extends AbstractDaoSession {
 
-    private final DaoConfig acceptTaskRecordDaoConfig;
-    private final DaoConfig appdownloadBeanDaoConfig;
-    private final DaoConfig downLoadInfoDaoConfig;
     private final DaoConfig processRecordDaoConfig;
-    private final DaoConfig screenShotRecordDaoConfig;
+    private final DaoConfig appdownloadBeanDaoConfig;
     private final DaoConfig sdkLoginUserDaoConfig;
+    private final DaoConfig screenShotRecordDaoConfig;
+    private final DaoConfig acceptTaskRecordDaoConfig;
     private final DaoConfig searchRecordDaoConfig;
+    private final DaoConfig downLoadInfoDaoConfig;
+    private final DaoConfig accountDaoConfig;
 
-    private final AcceptTaskRecordDao acceptTaskRecordDao;
-    private final AppdownloadBeanDao appdownloadBeanDao;
-    private final DownLoadInfoDao downLoadInfoDao;
     private final ProcessRecordDao processRecordDao;
-    private final ScreenShotRecordDao screenShotRecordDao;
+    private final AppdownloadBeanDao appdownloadBeanDao;
     private final SdkLoginUserDao sdkLoginUserDao;
+    private final ScreenShotRecordDao screenShotRecordDao;
+    private final AcceptTaskRecordDao acceptTaskRecordDao;
     private final SearchRecordDao searchRecordDao;
+    private final DownLoadInfoDao downLoadInfoDao;
+    private final AccountDao accountDao;
 
     public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
             daoConfigMap) {
         super(db);
 
-        acceptTaskRecordDaoConfig = daoConfigMap.get(AcceptTaskRecordDao.class).clone();
-        acceptTaskRecordDaoConfig.initIdentityScope(type);
+        processRecordDaoConfig = daoConfigMap.get(ProcessRecordDao.class).clone();
+        processRecordDaoConfig.initIdentityScope(type);
 
         appdownloadBeanDaoConfig = daoConfigMap.get(AppdownloadBeanDao.class).clone();
         appdownloadBeanDaoConfig.initIdentityScope(type);
 
-        downLoadInfoDaoConfig = daoConfigMap.get(DownLoadInfoDao.class).clone();
-        downLoadInfoDaoConfig.initIdentityScope(type);
-
-        processRecordDaoConfig = daoConfigMap.get(ProcessRecordDao.class).clone();
-        processRecordDaoConfig.initIdentityScope(type);
+        sdkLoginUserDaoConfig = daoConfigMap.get(SdkLoginUserDao.class).clone();
+        sdkLoginUserDaoConfig.initIdentityScope(type);
 
         screenShotRecordDaoConfig = daoConfigMap.get(ScreenShotRecordDao.class).clone();
         screenShotRecordDaoConfig.initIdentityScope(type);
 
-        sdkLoginUserDaoConfig = daoConfigMap.get(SdkLoginUserDao.class).clone();
-        sdkLoginUserDaoConfig.initIdentityScope(type);
+        acceptTaskRecordDaoConfig = daoConfigMap.get(AcceptTaskRecordDao.class).clone();
+        acceptTaskRecordDaoConfig.initIdentityScope(type);
 
         searchRecordDaoConfig = daoConfigMap.get(SearchRecordDao.class).clone();
         searchRecordDaoConfig.initIdentityScope(type);
 
-        acceptTaskRecordDao = new AcceptTaskRecordDao(acceptTaskRecordDaoConfig, this);
-        appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
-        downLoadInfoDao = new DownLoadInfoDao(downLoadInfoDaoConfig, this);
+        downLoadInfoDaoConfig = daoConfigMap.get(DownLoadInfoDao.class).clone();
+        downLoadInfoDaoConfig.initIdentityScope(type);
+
+        accountDaoConfig = daoConfigMap.get(AccountDao.class).clone();
+        accountDaoConfig.initIdentityScope(type);
+
         processRecordDao = new ProcessRecordDao(processRecordDaoConfig, this);
-        screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
+        appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
         sdkLoginUserDao = new SdkLoginUserDao(sdkLoginUserDaoConfig, this);
+        screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
+        acceptTaskRecordDao = new AcceptTaskRecordDao(acceptTaskRecordDaoConfig, this);
         searchRecordDao = new SearchRecordDao(searchRecordDaoConfig, this);
+        downLoadInfoDao = new DownLoadInfoDao(downLoadInfoDaoConfig, this);
+        accountDao = new AccountDao(accountDaoConfig, this);
 
-        registerDao(AcceptTaskRecord.class, acceptTaskRecordDao);
-        registerDao(AppdownloadBean.class, appdownloadBeanDao);
-        registerDao(DownLoadInfo.class, downLoadInfoDao);
         registerDao(ProcessRecord.class, processRecordDao);
-        registerDao(ScreenShotRecord.class, screenShotRecordDao);
+        registerDao(AppdownloadBean.class, appdownloadBeanDao);
         registerDao(SdkLoginUser.class, sdkLoginUserDao);
+        registerDao(ScreenShotRecord.class, screenShotRecordDao);
+        registerDao(AcceptTaskRecord.class, acceptTaskRecordDao);
         registerDao(SearchRecord.class, searchRecordDao);
+        registerDao(DownLoadInfo.class, downLoadInfoDao);
+        registerDao(Account.class, accountDao);
     }
     
     public void clear() {
-        acceptTaskRecordDaoConfig.clearIdentityScope();
-        appdownloadBeanDaoConfig.clearIdentityScope();
-        downLoadInfoDaoConfig.clearIdentityScope();
         processRecordDaoConfig.clearIdentityScope();
-        screenShotRecordDaoConfig.clearIdentityScope();
+        appdownloadBeanDaoConfig.clearIdentityScope();
         sdkLoginUserDaoConfig.clearIdentityScope();
+        screenShotRecordDaoConfig.clearIdentityScope();
+        acceptTaskRecordDaoConfig.clearIdentityScope();
         searchRecordDaoConfig.clearIdentityScope();
+        downLoadInfoDaoConfig.clearIdentityScope();
+        accountDaoConfig.clearIdentityScope();
     }
 
-    public AcceptTaskRecordDao getAcceptTaskRecordDao() {
-        return acceptTaskRecordDao;
+    public ProcessRecordDao getProcessRecordDao() {
+        return processRecordDao;
     }
 
     public AppdownloadBeanDao getAppdownloadBeanDao() {
         return appdownloadBeanDao;
     }
 
-    public DownLoadInfoDao getDownLoadInfoDao() {
-        return downLoadInfoDao;
-    }
-
-    public ProcessRecordDao getProcessRecordDao() {
-        return processRecordDao;
+    public SdkLoginUserDao getSdkLoginUserDao() {
+        return sdkLoginUserDao;
     }
 
     public ScreenShotRecordDao getScreenShotRecordDao() {
         return screenShotRecordDao;
     }
 
-    public SdkLoginUserDao getSdkLoginUserDao() {
-        return sdkLoginUserDao;
+    public AcceptTaskRecordDao getAcceptTaskRecordDao() {
+        return acceptTaskRecordDao;
     }
 
     public SearchRecordDao getSearchRecordDao() {
         return searchRecordDao;
     }
 
+    public DownLoadInfoDao getDownLoadInfoDao() {
+        return downLoadInfoDao;
+    }
+
+    public AccountDao getAccountDao() {
+        return accountDao;
+    }
+
 }

+ 9 - 0
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -47,9 +47,18 @@ public interface ApiService {
     @POST("app/auth/sms_for_login/")
     Observable<BaseMessage> getCaptcha(@Body JSONObject jsonObject);
 
+    @POST("app/auth/register_by_username/")
+    Observable<BaseMessage> registerByUserName(@Body JSONObject jsonObject);
+
     @POST("app/auth/login_by_sms/")
     Observable<BaseMessage> loginByCaptcha(@Body JSONObject jsonObject);
 
+    @POST("app/auth/login_by_username/")
+    Observable<BaseMessage> loginByUserName(@Body JSONObject jsonObject);
+
+    @PUT("app/user/change_password/")
+    Observable<BaseMessage> changePassword(@Body JSONObject jsonObject);
+
     /**
      * @return 消息中心列表
      */

+ 10 - 0
app/src/main/java/com/sheep/gamegroup/model/entity/UserEntity.java

@@ -25,6 +25,8 @@ public class UserEntity implements Serializable {
     private String mobile;//13688480841,
     @Column(name = "nickname")
     private String nickname;//test332211,
+    @Column(name = "user_name")
+    private String user_name;//test332211,
     @Column(name = "balance")
     private String balance;//0,
     @Column(name = "invitation_code")
@@ -164,6 +166,14 @@ public class UserEntity implements Serializable {
         this.invitation_code = invitation_code;
     }
 
+    public String getUser_name() {
+        return user_name;
+    }
+
+    public void setUser_name(String user_name) {
+        this.user_name = user_name;
+    }
+
     public String getParent_code() {
         return parent_code;
     }

+ 94 - 0
app/src/main/java/com/sheep/gamegroup/module/ChangePasswordAct.java

@@ -0,0 +1,94 @@
+package com.sheep.gamegroup.module;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentTransaction;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.module.login.controller.ChangePasswordController;
+import com.sheep.gamegroup.module.login.fragments.NewPasswordFgt;
+import com.sheep.gamegroup.module.login.fragments.OldPasswordFgt;
+import com.sheep.gamegroup.module.login.fragments.SignInFgt;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+
+public class ChangePasswordAct extends BaseActivity implements ChangePasswordController {
+
+    private String newPwd, oldPwd;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.activity_login;
+    }
+
+    @Override
+    public void initView() {
+        TitleBarUtils.getInstance().setTitleBack(this).setTitle(this, "设置密码");
+        OldPasswordFgt fgt = OldPasswordFgt.newInstance(this);
+        showFragment("设置密码", fgt);
+    }
+
+    @Override
+    public void onBackPressed() {
+        if (getSupportFragmentManager().getBackStackEntryCount() == 1) {
+            finish();
+            return;
+        }
+        super.onBackPressed();
+    }
+
+    @Override
+    public void whenNext(String oldPwd) {
+        this.oldPwd = oldPwd;
+        NewPasswordFgt fgt = NewPasswordFgt.newInstance(this);
+        showFragment("设置密码", fgt);
+    }
+
+    @Override
+    public void whenComplete(String newPwd) {
+        this.newPwd = newPwd;
+        showProgress();
+        JSONObject json = new JSONObject();
+        json.put("old_password", oldPwd);
+        json.put("new_password", newPwd);
+        SheepApp.getInstance().getNetComponent().getApiService().changePassword(json)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        hideProgress();
+                        G.showToast("密码修改成功");
+                        finish();
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        hideProgress();
+                        if (baseMessage != null) {
+                            G.showToast(baseMessage);
+                        } else {
+                            G.showToast("修改密码出错");
+                        }
+                    }
+                });
+    }
+
+    private void showFragment(String tag, Fragment fragment) {
+        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
+        transaction.replace(R.id.fragment_container, fragment, tag);
+        transaction.show(fragment);
+        transaction.addToBackStack(null);
+        transaction.commitAllowingStateLoss();
+    }
+}

+ 188 - 0
app/src/main/java/com/sheep/gamegroup/module/login/LoginAct.java

@@ -0,0 +1,188 @@
+package com.sheep.gamegroup.module.login;
+
+import android.content.Intent;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentTransaction;
+import android.text.TextUtils;
+
+import com.sheep.gamegroup.absBase.BaseUMActivity;
+import com.sheep.gamegroup.greendao.DDProviderHelper;
+import com.sheep.gamegroup.model.entity.LoginEntity;
+import com.sheep.gamegroup.model.util.EntityUtils;
+import com.sheep.gamegroup.module.login.controller.LoginController;
+import com.sheep.gamegroup.module.login.fragments.EditUserInfoFgt;
+import com.sheep.gamegroup.module.login.fragments.FindAccountFgt;
+import com.sheep.gamegroup.module.login.fragments.SignInFgt;
+import com.sheep.gamegroup.module.login.fragments.SignUpFgt;
+import com.sheep.gamegroup.module.login.fragments.ValidCaptchaFgt;
+import com.sheep.gamegroup.module.login.model.Account;
+import com.sheep.gamegroup.util.CertificationUtil;
+import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.TestUtil;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
+import com.umeng.socialize.UMAuthListener;
+import com.umeng.socialize.UMShareAPI;
+import com.umeng.socialize.bean.SHARE_MEDIA;
+
+import java.util.List;
+import java.util.Map;
+
+public class LoginAct extends BaseUMActivity implements LoginController {
+
+    private Fragment currentFragment;
+
+    private boolean isLogined = false;
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.activity_login;
+    }
+
+    @Override
+    public void initView() {
+        TitleBarUtils.getInstance().setTitleBack(this);
+        SignInFgt signInFragment = SignInFgt.newInstance(this);
+        showFragment("", signInFragment);
+        currentFragment = signInFragment;
+    }
+
+    @Override
+    public void onBackPressed() {
+        if (getSupportFragmentManager().getBackStackEntryCount() == 1) {
+            finish();
+            return;
+        }
+        if (isLogined) {
+            return;
+        }
+        super.onBackPressed();
+        if (getSupportFragmentManager().getBackStackEntryCount() == 1) {
+            TitleBarUtils.getInstance().setShowOrHide(this, false);
+        }
+        TitleBarUtils.getInstance().setTitle(this, getLastFragment().getTag());
+    }
+
+    @Override
+    public void whenLoginSuccess(int platform, LoginEntity loginResult) {
+        if (TextUtils.isEmpty(SheepApp.getInstance().getGameCode())) {
+//            Snackbar.make(getWindow().getDecorView(), "登录成功", Snackbar.LENGTH_SHORT).show();
+            if (TextUtils.isEmpty(loginResult.getUser().getBirthday())
+                    ||loginResult.getUser().getBirthday().startsWith("000")) {
+                getUserInfo(platform, loginResult);
+            } else {
+                Jump2View.getInstance().checkCommendApp(this, EntityUtils.getUserCode(loginResult));
+                finish();
+            }
+        } else {
+            CertificationUtil.newInstance().addCurUserToSdkLoginUser();
+            CertificationUtil.newInstance().authCertificationCode(this, SpUtils.getToken(SheepApp.getInstance()));
+        }
+        TestUtil.saveUser(loginResult);
+        if (platform == LoginController.PLATFORM_ACCOUNT || platform == LoginController.PLATFORM_PHONE) {
+            DDProviderHelper.getInstance().saveAccount(Account.generateByUser(loginResult.getUser()));
+        }
+    }
+
+    private void getUserInfo(int platform, LoginEntity entity) {
+        if (platform == LoginController.PLATFORM_QQ || platform == LoginController.PLATFORM_WX) {
+            UMShareAPI.get(SheepApp.getInstance()).getPlatformInfo(this,
+                    platform == LoginController.PLATFORM_QQ ? SHARE_MEDIA.QQ : SHARE_MEDIA.WEIXIN,
+                    new UMAuthListener() {
+                        @Override
+                        public void onStart(SHARE_MEDIA share_media) {
+
+                        }
+
+                        @Override
+                        public void onComplete(SHARE_MEDIA share_media, int i, Map<String, String> map) {
+                            entity.getUser().setNickname(map.get("screen_name"));
+                            entity.getUser().setAvatar(map.get("profile_image_url"));
+                            entity.getUser().setGender("男".equals(map.get("gender")) ? 1 : 2);
+                            goEditUserInfo(entity);
+                        }
+
+                        @Override
+                        public void onError(SHARE_MEDIA share_media, int i, Throwable throwable) {
+                            Jump2View.getInstance().checkCommendApp(LoginAct.this, EntityUtils.getUserCode(entity));
+                            finish();
+                        }
+
+                        @Override
+                        public void onCancel(SHARE_MEDIA share_media, int i) {
+
+                        }
+                    });
+        } else {
+            goEditUserInfo(entity);
+        }
+    }
+
+    private void goEditUserInfo(LoginEntity entity) {
+        EditUserInfoFgt editUserInfoFgt = EditUserInfoFgt.newInstance(entity, this);
+        showFragment("填写基本资料", editUserInfoFgt);
+        currentFragment = editUserInfoFgt;
+    }
+
+    @Override
+    public void whenEditedInfo(LoginEntity entity) {
+        if (DDProviderHelper.getInstance().getAccount(entity.getUser().getId()) != null) {
+            DDProviderHelper.getInstance().saveAccount(Account.generateByUser(entity.getUser()));
+        }
+        Jump2View.getInstance().checkCommendApp(this, EntityUtils.getUserCode(entity));
+        finish();
+    }
+
+    @Override
+    public void whenToRegister() {
+        SignUpFgt signUpFragment = SignUpFgt.newInstance(this);
+        showFragment("注册", signUpFragment);
+        currentFragment = signUpFragment;
+    }
+
+    @Override
+    public void whenGoFindAccount() {
+        FindAccountFgt findAccountFgt = FindAccountFgt.newInstance(this);
+        showFragment("登录遇到问题", findAccountFgt);
+        currentFragment = findAccountFgt;
+    }
+
+    @Override
+    public void whenGoValidCaptcha(String phoneNum) {
+        ValidCaptchaFgt validCaptchaFgt = ValidCaptchaFgt.newInstance(phoneNum, this);
+        showFragment("输入验证码", validCaptchaFgt);
+        currentFragment = validCaptchaFgt;
+    }
+
+    private void showFragment(String tag, Fragment fragment) {
+        TitleBarUtils.getInstance().setShowOrHide(this, fragment instanceof SignInFgt ? false : true).setTitle(this, tag);
+        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
+        transaction.replace(R.id.fragment_container, fragment, tag);
+        transaction.show(fragment);
+        currentFragment = fragment;
+        transaction.addToBackStack(null);
+        transaction.commitAllowingStateLoss();
+    }
+
+    private Fragment getLastFragment() {
+        List<Fragment> fragments = getSupportFragmentManager().getFragments();
+        if (fragments != null && fragments.size() > 0) {
+            for (int i = 1; i <= fragments.size(); i++) {
+                Fragment fragment = fragments.get(fragments.size() - i);
+                if (fragment != null) {
+                    return fragment;
+                }
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent intent) {
+        super.onActivityResult(requestCode, resultCode, intent);
+        getLastFragment().onActivityResult(requestCode, resultCode, intent);
+    }
+
+}

+ 9 - 0
app/src/main/java/com/sheep/gamegroup/module/login/controller/ChangePasswordController.java

@@ -0,0 +1,9 @@
+package com.sheep.gamegroup.module.login.controller;
+
+public interface ChangePasswordController {
+
+    void whenNext(String oldPwd);
+
+    void whenComplete(String newPwd);
+
+}

+ 23 - 0
app/src/main/java/com/sheep/gamegroup/module/login/controller/LoginController.java

@@ -0,0 +1,23 @@
+package com.sheep.gamegroup.module.login.controller;
+
+import com.sheep.gamegroup.model.entity.LoginEntity;
+import com.sheep.gamegroup.model.entity.UserEntity;
+
+public interface LoginController {
+
+    public final static int PLATFORM_ACCOUNT = 0;
+    public final static int PLATFORM_PHONE = 1;
+    public final static int PLATFORM_WX = 2;
+    public final static int PLATFORM_QQ = 3;
+
+    void whenLoginSuccess(int platform, LoginEntity loginResult);
+
+    void whenEditedInfo(LoginEntity entity);
+
+    void whenToRegister();
+
+    void whenGoFindAccount();
+
+    void whenGoValidCaptcha(String phoneNum);
+
+}

+ 225 - 0
app/src/main/java/com/sheep/gamegroup/module/login/fragments/EditUserInfoFgt.java

@@ -0,0 +1,225 @@
+package com.sheep.gamegroup.module.login.fragments;
+
+import android.app.Dialog;
+import android.content.Intent;
+import android.net.Uri;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.RadioGroup;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSONObject;
+import com.bumptech.glide.Glide;
+import com.sheep.gamegroup.dateview.DatePickerDialog;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.LoginEntity;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.module.login.controller.LoginController;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.gamegroup.util.upfile.UpFileListener;
+import com.sheep.gamegroup.util.upfile.UpFileUtils;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.yalantis.ucrop.UCrop;
+
+import java.io.File;
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+import me.iwf.photopicker.PhotoPicker;
+
+import static android.app.Activity.RESULT_OK;
+
+
+public class EditUserInfoFgt extends BaseFragment {
+
+    private LoginEntity mLoginResult;
+    private LoginController mController;
+
+    @BindView(R.id.avatar_view)
+    ImageView avaterView;
+    @BindView(R.id.nickname_box)
+    EditText nickNameBox;
+    @BindView(R.id.birthday_box)
+    TextView birthdayBox;
+    @BindView(R.id.gender_box)
+    RadioGroup genderRadio;
+
+    private String newAvatar;
+
+    public EditUserInfoFgt() {
+        // Required empty public constructor
+    }
+
+    public static EditUserInfoFgt newInstance(LoginEntity entity, LoginController controller) {
+        EditUserInfoFgt fgt = new EditUserInfoFgt();
+        fgt.mLoginResult = entity;
+        fgt.mController = controller;
+        return fgt;
+    }
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.fragment_edit_user_info;
+    }
+
+    @Override
+    public void onViewCreated() {
+        new Thread() {
+            public void run() {
+                Glide.get(SheepApp.getInstance()).clearDiskCache();
+            }
+        }.start();
+        Glide.get(SheepApp.getInstance()).clearMemory();
+        if (!TextUtils.isEmpty(mLoginResult.getUser().getAvatar())) {
+            GlideImageLoader.circleImage(avaterView, mLoginResult.getUser().getAvatar());
+        }
+        if (!TextUtils.isEmpty(mLoginResult.getUser().getNickname())) {
+            nickNameBox.setText(mLoginResult.getUser().getNickname());
+        }
+        if (mLoginResult.getUser().getGender() == 2) {
+            genderRadio.check(R.id.female_radio);
+        } else {
+            genderRadio.check(R.id.male_radio);
+        }
+    }
+
+    @OnClick(R.id.birthday_box)
+    public void doSelectBirthday(View v) {
+        DatePickerDialog.Builder builder = new DatePickerDialog.Builder(getActivity());
+        builder.setOnDateSelectedListener(new DatePickerDialog.OnDateSelectedListener() {
+            @Override
+            public void onDateSelected(int[] dates) {
+                birthdayBox.setText(dates[0] + "-" + (dates[1] > 9 ? dates[1] : ("0" + dates[1])) + "-" + (dates[2] > 9 ? dates[2] : ("0" + dates[2])));
+            }
+
+            @Override
+            public void onCancel() {
+
+            }
+        }).setSelectYear(1989)
+                .setSelectMonth(0)
+                .setSelectDay(0);
+        Dialog dateDialog = builder.create();
+        dateDialog.show();
+    }
+
+    @OnClick(R.id.submit_btn)
+    public void doSubmit() {
+        if (TextUtils.isEmpty(nickNameBox.getText().toString().trim())) {
+            G.showToast("请输入昵称");
+            return;
+        }
+        if (nickNameBox.getText().toString().trim().length() > 30) {
+            G.showToast("昵称长度不能超过30");
+            return;
+        }
+        if (TextUtils.isEmpty(birthdayBox.getText().toString().trim())) {
+            G.showToast("请选择生日");
+            return;
+        }
+        if (newAvatar != null) {
+            UpFileUtils.upImage(new File(newAvatar), new UpFileListener() {
+                @Override
+                public void Success(String msg, int index) {
+                    JSONObject json = JSONObject.parseObject(msg);
+                    JSONObject data = json.getJSONObject("data");
+                    mLoginResult.getUser().setAvatar(data.getString("url"));
+                    submit();
+                }
+
+                @Override
+                public void Progress(String progress, int index) {
+
+                }
+
+                @Override
+                public void Failure(String err) {
+                    G.showToast("头像上传失败");
+                }
+            });
+        } else {
+            submit();
+        }
+
+    }
+
+    private void submit() {
+        JSONObject json = new JSONObject();
+        json.put("nickname", nickNameBox.getText().toString().trim());
+        json.put("avatar", mLoginResult.getUser().getAvatar());
+        json.put("birthday", birthdayBox.getText().toString() + "T00:00:00Z");
+        json.put("gender", genderRadio.getCheckedRadioButtonId() == R.id.male_radio ? 1 : 2);
+        SheepApp.getInstance().getNetComponent().getApiService()
+                .changeBaseInfo(json)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        DataUtil.getInstance().setUserNickName(nickNameBox.getText().toString());
+                        DataUtil.getInstance().setUserAvatar(newAvatar);
+                        mController.whenEditedInfo(mLoginResult);
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        if (baseMessage != null && !TextUtils.isEmpty(baseMessage.getMsg())) {
+                            G.showToast(baseMessage.getMsg());
+                        } else {
+                            G.showToast("提交失败");
+                        }
+                    }
+                });
+    }
+
+    @OnClick(R.id.avatar_view)
+    public void doSelectAvatar(View v) {
+        PhotoPicker.builder()
+                .setPhotoCount(1)
+                .setShowCamera(true)
+                .setShowGif(false)
+                .setPreviewEnabled(true)
+                .start(getActivity(), PhotoPicker.REQUEST_CODE);
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode == RESULT_OK) {
+            if (requestCode == PhotoPicker.REQUEST_CODE) {//拍照或者选择照片
+                if (data != null) {
+                    List<String> photos = data.getStringArrayListExtra(PhotoPicker.KEY_SELECTED_PHOTOS);
+                    if (photos != null && !photos.isEmpty() && !TextUtils.isEmpty((newAvatar = photos.get(0)))) {
+                        UCrop.of(Uri.fromFile(new File(newAvatar)),
+                                Uri.fromFile(new File(new File(newAvatar).getParentFile(), "temp.png")))
+                                .withAspectRatio(1, 1)
+                                .withMaxResultSize(500, 500)
+                                .start(getActivity());
+                        GlideImageLoader.circleImage(avaterView, newAvatar);
+                    }
+                }
+            } else if (requestCode == UCrop.REQUEST_CROP) {//裁剪
+                Uri resultUri;
+                if (data != null && (resultUri = UCrop.getOutput(data)) != null) {
+                    String cropPath;
+                    if (!TextUtils.isEmpty(cropPath = resultUri.getPath())) {
+                        newAvatar = cropPath;
+                        GlideImageLoader.circleImage(avaterView, newAvatar);
+                    }
+
+                }
+            }
+        }
+    }
+
+}

+ 87 - 0
app/src/main/java/com/sheep/gamegroup/module/login/fragments/FindAccountFgt.java

@@ -0,0 +1,87 @@
+package com.sheep.gamegroup.module.login.fragments;
+
+
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.ImageView;
+
+import com.sheep.gamegroup.module.login.controller.LoginController;
+import com.sheep.gamegroup.util.StringUtils;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class FindAccountFgt extends BaseFragment {
+
+    private LoginController mController;
+
+    @BindView(R.id.phone_number_box)
+    EditText phoneNumberBox;
+    @BindView(R.id.text_delete_btn)
+    ImageView textDeleteBtn;
+
+    public FindAccountFgt() {
+        // Required empty public constructor
+    }
+
+    public static FindAccountFgt newInstance(LoginController controller) {
+        FindAccountFgt fragment = new FindAccountFgt();
+        fragment.mController = controller;
+        return fragment;
+    }
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.fragment_find_account;
+    }
+
+    @Override
+    public void onViewCreated() {
+        phoneNumberBox.addTextChangedListener(new TextWatcher() {
+            @Override
+            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+            }
+
+            @Override
+            public void onTextChanged(CharSequence s, int start, int before, int count) {
+                textDeleteBtn.setVisibility(TextUtils.isEmpty(s) ? View.GONE : View.VISIBLE);
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+
+            }
+        });
+    }
+
+    @OnClick(R.id.send_captcha_btn)
+    public void doSendCaptcha(View v) {
+        String phoneNum = phoneNumberBox.getText().toString().trim();
+        if (TextUtils.isEmpty(phoneNum)) {
+            G.showToast("请输入手机号");
+            return;
+        }
+        if (!StringUtils.isMobile(phoneNum)) {
+            G.showToast("手机号有误");
+            return;
+        }
+        mController.whenGoValidCaptcha(phoneNumberBox.getText().toString());
+    }
+
+    @OnClick(R.id.text_delete_btn)
+    public void doDeleteText(View v) {
+        phoneNumberBox.setText("");
+    }
+
+}

+ 64 - 0
app/src/main/java/com/sheep/gamegroup/module/login/fragments/NewPasswordFgt.java

@@ -0,0 +1,64 @@
+package com.sheep.gamegroup.module.login.fragments;
+
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.EditText;
+
+import com.sheep.gamegroup.module.login.controller.ChangePasswordController;
+import com.sheep.gamegroup.util.StringUtils;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class NewPasswordFgt extends BaseFragment {
+
+    private ChangePasswordController mController;
+
+    @BindView(R.id.new_pwd_box)
+    EditText newpwdBox;
+
+    public static NewPasswordFgt newInstance(ChangePasswordController controller){
+        NewPasswordFgt fgt = new NewPasswordFgt();
+        fgt.mController = controller;
+        return fgt;
+    }
+
+    public NewPasswordFgt() {
+    }
+
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.fragment_new_password;
+    }
+
+    @Override
+    public void onViewCreated() {
+
+    }
+
+    @OnClick(R.id.done_btn)
+    public void doDone(View v){
+        String password = newpwdBox.getText().toString().trim();
+        if (TextUtils.isEmpty(password)) {
+            G.showToast("新密码不能为空");
+            return;
+        }
+        if (!StringUtils.isPassword(password)) {
+            G.showToast("用户名只能包含英文、数字、_.-@$!*%符号");
+            return;
+        }
+        mController.whenComplete(password);
+    }
+}

+ 65 - 0
app/src/main/java/com/sheep/gamegroup/module/login/fragments/OldPasswordFgt.java

@@ -0,0 +1,65 @@
+package com.sheep.gamegroup.module.login.fragments;
+
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.EditText;
+
+import com.sheep.gamegroup.module.login.controller.ChangePasswordController;
+import com.sheep.gamegroup.util.StringUtils;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+import com.sheep.jiuyan.samllsheep.utils.G;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class OldPasswordFgt extends BaseFragment {
+
+    private ChangePasswordController mController;
+
+    @BindView(R.id.old_pwd_box)
+    EditText oldpwdBox;
+
+    public static OldPasswordFgt newInstance(ChangePasswordController controller){
+        OldPasswordFgt fgt = new OldPasswordFgt();
+        fgt.mController = controller;
+        return fgt;
+    }
+
+    public OldPasswordFgt() {
+        // Required empty public constructor
+    }
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.fragment_old_password;
+    }
+
+    @Override
+    public void onViewCreated() {
+
+    }
+
+    @OnClick(R.id.next_btn)
+    public void doNext(View v){
+        String password = oldpwdBox.getText().toString().trim();
+        if (TextUtils.isEmpty(password)) {
+            G.showToast("旧密码不能为空");
+            return;
+        }
+        if (!StringUtils.isPassword(password)) {
+            G.showToast("用户名只能包含英文、数字、_.-@$!*%符号");
+            return;
+        }
+        mController.whenNext(password);
+    }
+
+}

+ 460 - 0
app/src/main/java/com/sheep/gamegroup/module/login/fragments/SignInFgt.java

@@ -0,0 +1,460 @@
+package com.sheep.gamegroup.module.login.fragments;
+
+
+import android.graphics.drawable.BitmapDrawable;
+import android.support.annotation.NonNull;
+import android.support.design.widget.Snackbar;
+import android.support.v4.app.Fragment;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.PopupWindow;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.greendao.DDProviderHelper;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.LoginEntity;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.module.login.controller.LoginController;
+import com.sheep.gamegroup.module.login.model.Account;
+import com.sheep.gamegroup.util.ChannelContent;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.FastJsonUtils;
+import com.sheep.gamegroup.util.GlideImageLoader;
+import com.sheep.gamegroup.util.PreferenceUtils;
+import com.sheep.gamegroup.util.StringUtils;
+import com.sheep.gamegroup.util.TestUtil;
+import com.sheep.gamegroup.util.UMConfigUtils;
+import com.sheep.gamegroup.view.customview.CountDownButton;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+import com.umeng.socialize.UMAuthListener;
+import com.umeng.socialize.UMShareAPI;
+import com.umeng.socialize.bean.SHARE_MEDIA;
+
+import java.util.List;
+import java.util.Map;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.LOGIN_QQ;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.LOGIN_WX;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class SignInFgt extends BaseFragment {
+
+    private LoginController mController;
+
+    @BindView(R.id.for_account_pwd_container)
+    View forAccountPwdContainer;
+    @BindView(R.id.for_phone_container)
+    View forPhoneContainer;
+    @BindView(R.id.user_name_box)
+    EditText userNameBox;
+    @BindView(R.id.password_box)
+    EditText passwordBox;
+    @BindView(R.id.phone_number_box)
+    EditText phoneNumberBox;
+    @BindView(R.id.captcha_box)
+    EditText captchaBox;
+    @BindView(R.id.login_type_toggle)
+    View loginTypeToggle;
+    @BindView(R.id.login_type_toggle_icon)
+    ImageView loginTypeToggleIcon;
+    @BindView(R.id.login_type_toggle_text)
+    TextView loginTypeToggleText;
+    @BindView(R.id.send_captcha_btn)
+    CountDownButton countDownButton;
+    @BindView(R.id.account_menu_btn)
+    ImageView accountMenuBtn;
+
+    @BindView(R.id.test_change)
+    TextView testChange;
+    @BindView(R.id.test_change_user)
+    TextView testChangeUser;
+
+    public SignInFgt() {
+        // Required empty public constructor
+    }
+
+    public static SignInFgt newInstance(LoginController controller) {
+        SignInFgt fragment = new SignInFgt();
+        fragment.mController = controller;
+        return fragment;
+    }
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.fragment_sign_in;
+    }
+
+    @Override
+    public void onViewCreated() {
+        TestUtil.testChange(getActivity(), testChange);
+        TestUtil.testChangeUser(getActivity(), testChangeUser);
+        forAccountPwdContainer.setVisibility(View.GONE);
+        forPhoneContainer.setVisibility(View.VISIBLE);
+        loginTypeToggle.setSelected(true);
+    }
+
+    @OnClick(R.id.login_btn)
+    public void doLogin(View v) {
+        showProgress();
+        if (loginTypeToggle.isSelected()) {
+            phoneLogin();
+        } else {
+            accountLogin();
+        }
+    }
+
+    private boolean validateAccountPwd() {
+        String username = userNameBox.getText().toString().trim();
+        String password = passwordBox.getText().toString().trim();
+        if (TextUtils.isEmpty(username)) {
+            G.showToast("请输入用户名");
+            return false;
+        }
+        if (TextUtils.isEmpty(password)) {
+            G.showToast("密码不能为空");
+            return false;
+        }
+        if (!StringUtils.isUserName(username)) {
+            G.showToast("用户名只能包含英文、数字、._-@符号");
+            return false;
+        }
+        if (!StringUtils.isPassword(password)) {
+            G.showToast("用户名只能包含英文、数字、_.-@$!*%符号");
+            return false;
+        }
+        return true;
+    }
+
+    private void accountLogin() {
+        if (!validateAccountPwd()) return;
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("user_name", userNameBox.getText().toString().trim());
+        jsonObject.put("password", passwordBox.getText().toString().trim());
+//        jsonObject.put("invitation_code", scope);
+        PreferenceUtils.setPrefString(SheepApp.getInstance(), UMConfigUtils.LOGIN_TYPE, UMConfigUtils.Source.SHEEP);
+        SheepApp.getInstance().getNetComponent().getApiService().loginByUserName(jsonObject)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        hideProgress();
+                        G.showToast(baseMessage);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        hideProgress();
+                        if (baseMessage == null) {
+                            return;
+                        }
+                        LoginEntity loginEty = null;
+                        try {
+                            loginEty = JSONObject.parseObject(JSONObject.toJSONString(baseMessage.getData()), LoginEntity.class);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        if (loginEty != null) {
+                            SpUtils.saveToken(getActivity(), loginEty.getToken());
+                            DataUtil.getInstance().initUserEntity(loginEty.getUser());
+                            mController.whenLoginSuccess(LoginController.PLATFORM_ACCOUNT, loginEty);
+                        }
+                    }
+                });
+    }
+
+    private boolean validatePhoneCaptcha() {
+        String etCode = captchaBox.getText().toString().trim();
+        if (TextUtils.isEmpty(etCode)) {
+            G.showToast(getString(R.string.input_your_captcha));
+            return false;
+        }
+        if (etCode.length() != 6) {
+            G.showToast(getString(R.string.toast_warning_phone_captcha_image_code_size));
+            return false;
+        }
+        return true;
+    }
+
+    private void phoneLogin() {
+        if (!validatePhoneCaptcha()) return;
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("account", phoneNumberBox.getText().toString().trim());
+        jsonObject.put("sec_code", captchaBox.getText().toString().trim());
+//        jsonObject.put("invitation_code", scope);
+        PreferenceUtils.setPrefString(SheepApp.getInstance(), UMConfigUtils.LOGIN_TYPE, UMConfigUtils.Source.SHEEP);
+        SheepApp.getInstance().getNetComponent().getApiService().loginByCaptcha(jsonObject)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        hideProgress();
+                        G.showToast(baseMessage);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        hideProgress();
+                        if (baseMessage == null) {
+                            return;
+                        }
+                        LoginEntity loginEty = null;
+                        try {
+                            loginEty = JSONObject.parseObject(JSONObject.toJSONString(baseMessage.getData()), LoginEntity.class);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        if (loginEty != null) {
+                            SpUtils.saveToken(getActivity(), loginEty.getToken());
+                            DataUtil.getInstance().initUserEntity(loginEty.getUser());
+                            mController.whenLoginSuccess(LoginController.PLATFORM_PHONE, loginEty);
+                        }
+                    }
+                });
+    }
+
+    @OnClick(R.id.send_captcha_btn)
+    public void doSendCaptcha(View v) {
+        String phoneNum = phoneNumberBox.getText().toString().trim();
+        if (TextUtils.isEmpty(phoneNum)) {
+            G.showToast("请输入手机号");
+            return;
+        }
+        if (!StringUtils.isMobile(phoneNum)) {
+            G.showToast("手机号有误");
+            return;
+        }
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("account", phoneNum);
+        SheepApp.getInstance().getNetComponent().getApiService().getCaptcha(jsonObject)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        Snackbar.make(v, "验证码已发送", Snackbar.LENGTH_SHORT).show();
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        Snackbar.make(v, "发生错误", Snackbar.LENGTH_SHORT).show();
+                    }
+                });
+    }
+
+    @OnClick(R.id.login_type_toggle)
+    public void doToggleLoginType(View v) {
+        loginTypeToggle.setSelected(!loginTypeToggle.isSelected());
+        loginTypeToggleText.setText(loginTypeToggle.isSelected() ? "账号登录" : "一键登录");
+        loginTypeToggleIcon.setImageResource(loginTypeToggle.isSelected() ? R.mipmap.login_account : R.mipmap.login_phone);
+        forPhoneContainer.setVisibility(v.isSelected() ? View.VISIBLE : View.GONE);
+        forAccountPwdContainer.setVisibility(!v.isSelected() ? View.VISIBLE : View.GONE);
+    }
+
+    @OnClick(R.id.register_btn)
+    public void doRegister(View v) {
+        mController.whenToRegister();
+    }
+
+    @OnClick(R.id.trouble_btn)
+    public void doTrouble(View v) {
+        mController.whenGoFindAccount();
+    }
+
+    @OnClick(R.id.wx_login_btn)
+    public void doWxLogin(View v) {
+        LOGIN_WX.onEvent();
+        UMShareAPI.get(SheepApp.getInstance()).doOauthVerify(getActivity(), SHARE_MEDIA.WEIXIN, new ThirdpartAuthListener("微信") {
+            @Override
+            public void onComplete(SHARE_MEDIA platform, int action, Map<String, String> data) {
+                JSONObject j = new JSONObject();
+                j.put("code", data.get("access_token"));
+                j.put("username", data.get("openid"));
+                j.put("scope", ChannelContent.getInstance().getChannel_name());
+                PreferenceUtils.setPrefString(SheepApp.getInstance(), UMConfigUtils.LOGIN_TYPE, UMConfigUtils.Source.WECHAT);
+                SheepApp.getInstance().getNetComponent().getApiService()
+                        .LoginByWX(j)
+                        .subscribeOn(Schedulers.io())
+                        .observeOn(AndroidSchedulers.mainThread())
+                        .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                            @Override
+                            public void onError(BaseMessage baseMessage) {
+                                G.showToast("微信登录失败  请检查网络是否正常");
+                                hideProgress();
+                            }
+
+                            @Override
+                            public void onNext(BaseMessage baseMessage) {
+                                hideProgress();
+                                if (baseMessage != null) {
+                                    LoginEntity loginEty = FastJsonUtils.toBean(JSONObject.toJSONString(baseMessage.getData()), LoginEntity.class);
+                                    SpUtils.saveToken(SheepApp.getInstance(), loginEty.getToken());
+                                    DataUtil.getInstance().initUserEntity(loginEty.getUser());
+                                    mController.whenLoginSuccess(LoginController.PLATFORM_WX, loginEty);
+                                    TestUtil.saveUser(loginEty);
+                                }
+                            }
+                        });
+
+            }
+        });
+    }
+
+    @OnClick(R.id.qq_login_btn)
+    public void doQQLogin(View v) {
+        LOGIN_QQ.onEvent();
+        UMShareAPI.get(SheepApp.getInstance()).doOauthVerify(getActivity(), SHARE_MEDIA.QQ, new ThirdpartAuthListener("QQ") {
+            public void onComplete(SHARE_MEDIA platform, int action, Map<String, String> data) {
+                JSONObject j = new JSONObject();
+                j.put("code", data.get("access_token"));
+                j.put("username", data.get("openid"));
+                j.put("scope", ChannelContent.getInstance().getChannel_name());
+                PreferenceUtils.setPrefString(SheepApp.getInstance(), UMConfigUtils.LOGIN_TYPE, UMConfigUtils.Source.QQ);
+                SheepApp.getInstance().getNetComponent().getApiService()
+                        .LoginByQQ(j)
+                        .subscribeOn(Schedulers.io())
+                        .observeOn(AndroidSchedulers.mainThread())
+                        .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+
+                            @Override
+                            public void onError(BaseMessage baseMessage) {
+                                G.showToast("QQ登录失败  请检查网络是否正常");
+                                hideProgress();
+                            }
+
+                            @Override
+                            public void onNext(BaseMessage baseMessage) {
+                                hideProgress();
+                                if (baseMessage != null) {
+                                    LoginEntity loginEty = FastJsonUtils.toBean(JSONObject.toJSONString(baseMessage.getData()), LoginEntity.class);
+                                    SpUtils.saveToken(SheepApp.getInstance(), loginEty.getToken());
+                                    DataUtil.getInstance().initUserEntity(loginEty.getUser());
+                                    mController.whenLoginSuccess(LoginController.PLATFORM_QQ, loginEty);
+                                    TestUtil.saveUser(loginEty);
+                                }
+                            }
+                        });
+            }
+        });
+    }
+
+    @OnClick(R.id.account_menu_btn)
+    public void doSelectAccount(View v) {
+        final List<Account> listData = DDProviderHelper.getInstance().getAccountList();
+        View flagView = mView.findViewById(R.id.login_btn);
+        RecyclerView listView = new RecyclerView(getContext());
+        listView.setBackgroundResource(R.drawable.screenshot_panel);
+        listView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
+        final PopupWindow popupWindow = new PopupWindow(listView,
+                flagView.getMeasuredWidth(),
+                ViewGroup.LayoutParams.WRAP_CONTENT);
+        listView.setAdapter(new RecyclerView.Adapter() {
+            @NonNull
+            @Override
+            public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
+                View itemView = LayoutInflater.from(getContext()).inflate(R.layout.account_select_item, viewGroup, false);
+                return new RecyclerView.ViewHolder(itemView) {
+                };
+            }
+
+            @Override
+            public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int i) {
+                Account account = listData.get(i);
+                ImageView accountAvatar = viewHolder.itemView.findViewById(R.id.account_avatar_view);
+                TextView accountName = viewHolder.itemView.findViewById(R.id.account_name_view);
+                View accountDelete = viewHolder.itemView.findViewById(R.id.account_delete_btn);
+                if (!TextUtils.isEmpty(account.getAvatar())) {
+                    GlideImageLoader.setAvatar(accountAvatar, account.getAvatar());
+                }
+                if (!TextUtils.isEmpty(account.getLoginname())) {
+                    accountName.setText(account.getLoginname());
+                }
+                accountDelete.setOnClickListener(v -> {
+                    listData.remove(account);
+                    notifyDataSetChanged();
+                    DDProviderHelper.getInstance().deleteAccount(account);
+                });
+                viewHolder.itemView.setOnClickListener(v -> {
+                    if (loginTypeToggle.isSelected()) {
+                        phoneNumberBox.setText(account.getLoginname());
+                    } else {
+                        userNameBox.setText(account.getLoginname());
+                    }
+                    popupWindow.dismiss();
+                });
+            }
+
+            @Override
+            public int getItemCount() {
+                return listData.size();
+            }
+        });
+
+        popupWindow.setFocusable(true);
+        popupWindow.setOutsideTouchable(true);
+        popupWindow.setBackgroundDrawable(new BitmapDrawable());
+        if (loginTypeToggle.isSelected()) {
+            popupWindow.showAsDropDown(phoneNumberBox, 0, 5);
+        } else {
+            popupWindow.showAsDropDown(userNameBox, 0, 5);
+        }
+        popupWindow.setOnDismissListener(() -> {
+            accountMenuBtn.setRotation(0);
+        });
+        accountMenuBtn.setRotation(180);
+    }
+
+    @Override
+    public void onDestroy() {
+        if (countDownButton != null) {
+            countDownButton.onDestroy();
+        }
+        super.onDestroy();
+    }
+
+    private abstract class ThirdpartAuthListener implements UMAuthListener {
+
+        private String platformName;
+
+        public ThirdpartAuthListener(String platformName) {
+            this.platformName = platformName;
+        }
+
+        @Override
+        public void onStart(SHARE_MEDIA platform) {
+            showProgress();
+        }
+
+        @Override
+        public void onError(SHARE_MEDIA platform, int action, Throwable t) {
+            G.showToast(platformName + "授权失败  请检查网络是否正常");
+            hideProgress();
+        }
+
+        @Override
+        public void onCancel(SHARE_MEDIA platform, int action) {
+            hideProgress();
+        }
+    }
+
+}

+ 121 - 0
app/src/main/java/com/sheep/gamegroup/module/login/fragments/SignUpFgt.java

@@ -0,0 +1,121 @@
+package com.sheep.gamegroup.module.login.fragments;
+
+
+import android.support.v4.app.Fragment;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.EditText;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.LoginEntity;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.module.login.controller.LoginController;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.PreferenceUtils;
+import com.sheep.gamegroup.util.StringUtils;
+import com.sheep.gamegroup.util.UMConfigUtils;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class SignUpFgt extends BaseFragment {
+
+    private LoginController mController;
+
+    @BindView(R.id.user_name_box)
+    EditText userNameBox;
+    @BindView(R.id.password_box)
+    EditText passwordBox;
+
+    public SignUpFgt() {
+        // Required empty public constructor
+    }
+
+    public static SignUpFgt newInstance(LoginController controller) {
+        SignUpFgt fragment = new SignUpFgt();
+        fragment.mController = controller;
+        return fragment;
+    }
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.fragment_sign_up;
+    }
+
+    @Override
+    public void onViewCreated() {
+
+    }
+
+    @OnClick(R.id.register_btn)
+    public void doRegister(View v) {
+        if (!validate()) return;
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("user_name", userNameBox.getText().toString().trim());
+        jsonObject.put("password", passwordBox.getText().toString().trim());
+        PreferenceUtils.setPrefString(SheepApp.getInstance(), UMConfigUtils.LOGIN_TYPE, UMConfigUtils.Source.SHEEP);
+        SheepApp.getInstance().getNetComponent().getApiService().registerByUserName(jsonObject)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        hideProgress();
+                        G.showToast(baseMessage);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        hideProgress();
+                        if (baseMessage == null) {
+                            return;
+                        }
+                        LoginEntity loginEty = null;
+                        try {
+                            loginEty = JSONObject.parseObject(JSONObject.toJSONString(baseMessage.getData()), LoginEntity.class);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        if (loginEty != null) {
+                            SpUtils.saveToken(getActivity(), loginEty.getToken());
+                            DataUtil.getInstance().initUserEntity(loginEty.getUser());
+                            mController.whenLoginSuccess(LoginController.PLATFORM_ACCOUNT, loginEty);
+                        }
+                    }
+                });
+    }
+
+    private boolean validate() {
+        String username = userNameBox.getText().toString().trim();
+        String password = passwordBox.getText().toString().trim();
+        if (TextUtils.isEmpty(username)) {
+            G.showToast("请输入用户名");
+            return false;
+        }
+        if (TextUtils.isEmpty(password)) {
+            G.showToast("密码不能为空");
+            return false;
+        }
+        if (!StringUtils.isUserName(username)) {
+            G.showToast("用户名只能包含英文、数字、._-@符号");
+            return false;
+        }
+        if (!StringUtils.isPassword(password)) {
+            G.showToast("用户名只能包含英文、数字、_.-@$!*%符号,长度6-16");
+            return false;
+        }
+        return true;
+    }
+
+}

+ 153 - 0
app/src/main/java/com/sheep/gamegroup/module/login/fragments/ValidCaptchaFgt.java

@@ -0,0 +1,153 @@
+package com.sheep.gamegroup.module.login.fragments;
+
+
+import android.support.design.widget.Snackbar;
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.LoginEntity;
+import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.module.login.controller.LoginController;
+import com.sheep.gamegroup.util.DataUtil;
+import com.sheep.gamegroup.util.PreferenceUtils;
+import com.sheep.gamegroup.util.UMConfigUtils;
+import com.sheep.gamegroup.view.customview.CountDownButton;
+import com.sheep.jiuyan.samllsheep.R;
+import com.sheep.jiuyan.samllsheep.SheepApp;
+import com.sheep.jiuyan.samllsheep.base.BaseFragment;
+import com.sheep.jiuyan.samllsheep.utils.G;
+import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class ValidCaptchaFgt extends BaseFragment {
+
+    private LoginController mController;
+    String phoneNum;
+    @BindView(R.id.tip_view)
+    TextView tipView;
+    @BindView(R.id.captcha_box)
+    EditText captchaBox;
+    @BindView(R.id.resend_captcha_btn)
+    CountDownButton countDownButton;
+
+    public ValidCaptchaFgt() {
+        // Required empty public constructor
+    }
+
+    public static ValidCaptchaFgt newInstance(String phone, LoginController controller) {
+        ValidCaptchaFgt fragment = new ValidCaptchaFgt();
+        fragment.mController = controller;
+        fragment.phoneNum = phone;
+        return fragment;
+    }
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.fragment_valid_captcha;
+    }
+
+    @Override
+    public void onViewCreated() {
+        tipView.setText("我们已向 " + phoneNum + " 发送验证码短信请查看短信并输入验证码");
+        captchaBox.addTextChangedListener(new TextWatcher() {
+
+            @Override
+            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+            }
+
+            @Override
+            public void onTextChanged(CharSequence s, int start, int before, int count) {
+                if (s!=null && s.length() == 6) {
+                    submitCaptcha();
+                }
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+
+            }
+        });
+        countDownButton.click();
+    }
+
+    private void submitCaptcha(){
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("account", phoneNum);
+        jsonObject.put("sec_code", captchaBox.getText().toString());
+//        jsonObject.put("invitation_code", scope);
+        PreferenceUtils.setPrefString(SheepApp.getInstance(), UMConfigUtils.LOGIN_TYPE, UMConfigUtils.Source.SHEEP);
+        SheepApp.getInstance().getNetComponent().getApiService().loginByCaptcha(jsonObject)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        hideProgress();
+                        G.showToast(baseMessage);
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        hideProgress();
+                        if (baseMessage == null) {
+                            return;
+                        }
+                        LoginEntity loginEty = null;
+                        try {
+                            loginEty = JSONObject.parseObject(JSONObject.toJSONString(baseMessage.getData()), LoginEntity.class);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                        if (loginEty != null) {
+                            SpUtils.saveToken(getActivity(), loginEty.getToken());
+                            DataUtil.getInstance().initUserEntity(loginEty.getUser());
+                            mController.whenLoginSuccess(LoginController.PLATFORM_PHONE, loginEty);
+                        }
+                    }
+                });
+    }
+
+    @OnClick(R.id.resend_captcha_btn)
+    public void sendCaptcha(View v) {
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("account", phoneNum);
+        SheepApp.getInstance().getNetComponent().getApiService().getCaptcha(jsonObject)
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()){
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+                        Snackbar.make(v, "验证码已发送", Snackbar.LENGTH_SHORT).show();
+                    }
+
+                    @Override
+                    public void onError(BaseMessage baseMessage) {
+                        Snackbar.make(v, "发生错误", Snackbar.LENGTH_SHORT).show();
+                    }
+                });
+    }
+
+    @Override
+    public void onDestroy() {
+        if (countDownButton != null) {
+            countDownButton.onDestroy();
+        }
+        super.onDestroy();
+    }
+
+}

+ 88 - 0
app/src/main/java/com/sheep/gamegroup/module/login/model/Account.java

@@ -0,0 +1,88 @@
+package com.sheep.gamegroup.module.login.model;
+
+import com.sheep.gamegroup.model.entity.UserEntity;
+
+import org.greenrobot.greendao.annotation.Entity;
+import org.greenrobot.greendao.annotation.Id;
+import org.greenrobot.greendao.annotation.Keep;
+import org.greenrobot.greendao.annotation.Property;
+import org.greenrobot.greendao.annotation.Generated;
+
+@Entity
+public class Account {
+
+    @Id(autoincrement = true)
+    private Long id;
+    @Property(nameInDb = "loginname")
+    private String loginname;
+    @Property(nameInDb = "aid")
+    private String aid;
+    @Property(nameInDb = "nickname")
+    private String nickname;
+    @Property(nameInDb = "avatar")
+    private String avatar;
+    @Property(nameInDb = "gender")
+    private int gender;
+    @Generated(hash = 579786552)
+    public Account(Long id, String loginname, String aid, String nickname,
+            String avatar, int gender) {
+        this.id = id;
+        this.loginname = loginname;
+        this.aid = aid;
+        this.nickname = nickname;
+        this.avatar = avatar;
+        this.gender = gender;
+    }
+    @Generated(hash = 882125521)
+    public Account() {
+    }
+    public int getGender() {
+        return this.gender;
+    }
+    public void setGender(int gender) {
+        this.gender = gender;
+    }
+    public String getAvatar() {
+        return this.avatar;
+    }
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+    public String getNickname() {
+        return this.nickname;
+    }
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+    public String getLoginname() {
+        return this.loginname;
+    }
+    public void setLoginname(String loginname) {
+        this.loginname = loginname;
+    }
+    public Long getId() {
+        return this.id;
+    }
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public static Account generateByUser(UserEntity user){
+        Account account = new Account();
+        account.setAid(user.getId());
+        account.setLoginname(user.getUser_name());
+        account.setNickname(user.getNickname());
+        account.setAvatar(user.getAvatar());
+        account.setGender(user.getGender());
+        return account;
+    }
+
+}

+ 177 - 0
app/src/main/java/com/sheep/gamegroup/module/login/model/AccountDao.java

@@ -0,0 +1,177 @@
+package com.sheep.gamegroup.module.login.model;
+
+import android.database.Cursor;
+import android.database.sqlite.SQLiteStatement;
+
+import org.greenrobot.greendao.AbstractDao;
+import org.greenrobot.greendao.Property;
+import org.greenrobot.greendao.internal.DaoConfig;
+import org.greenrobot.greendao.database.Database;
+import org.greenrobot.greendao.database.DatabaseStatement;
+
+import com.sheep.gamegroup.greendao.download.DaoSession;
+
+// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
+/** 
+ * DAO for table "ACCOUNT".
+*/
+public class AccountDao extends AbstractDao<Account, Long> {
+
+    public static final String TABLENAME = "ACCOUNT";
+
+    /**
+     * Properties of entity Account.<br/>
+     * Can be used for QueryBuilder and for referencing column names.
+     */
+    public static class Properties {
+        public final static Property Id = new Property(0, Long.class, "id", true, "_id");
+        public final static Property Loginname = new Property(1, String.class, "loginname", false, "loginname");
+        public final static Property Aid = new Property(2, String.class, "aid", false, "aid");
+        public final static Property Nickname = new Property(3, String.class, "nickname", false, "nickname");
+        public final static Property Avatar = new Property(4, String.class, "avatar", false, "avatar");
+        public final static Property Gender = new Property(5, int.class, "gender", false, "gender");
+    }
+
+
+    public AccountDao(DaoConfig config) {
+        super(config);
+    }
+    
+    public AccountDao(DaoConfig config, DaoSession daoSession) {
+        super(config, daoSession);
+    }
+
+    /** Creates the underlying database table. */
+    public static void createTable(Database db, boolean ifNotExists) {
+        String constraint = ifNotExists? "IF NOT EXISTS ": "";
+        db.execSQL("CREATE TABLE " + constraint + "\"ACCOUNT\" (" + //
+                "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
+                "\"loginname\" TEXT," + // 1: loginname
+                "\"aid\" TEXT," + // 2: aid
+                "\"nickname\" TEXT," + // 3: nickname
+                "\"avatar\" TEXT," + // 4: avatar
+                "\"gender\" INTEGER NOT NULL );"); // 5: gender
+    }
+
+    /** Drops the underlying database table. */
+    public static void dropTable(Database db, boolean ifExists) {
+        String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"ACCOUNT\"";
+        db.execSQL(sql);
+    }
+
+    @Override
+    protected final void bindValues(DatabaseStatement stmt, Account entity) {
+        stmt.clearBindings();
+ 
+        Long id = entity.getId();
+        if (id != null) {
+            stmt.bindLong(1, id);
+        }
+ 
+        String loginname = entity.getLoginname();
+        if (loginname != null) {
+            stmt.bindString(2, loginname);
+        }
+ 
+        String aid = entity.getAid();
+        if (aid != null) {
+            stmt.bindString(3, aid);
+        }
+ 
+        String nickname = entity.getNickname();
+        if (nickname != null) {
+            stmt.bindString(4, nickname);
+        }
+ 
+        String avatar = entity.getAvatar();
+        if (avatar != null) {
+            stmt.bindString(5, avatar);
+        }
+        stmt.bindLong(6, entity.getGender());
+    }
+
+    @Override
+    protected final void bindValues(SQLiteStatement stmt, Account entity) {
+        stmt.clearBindings();
+ 
+        Long id = entity.getId();
+        if (id != null) {
+            stmt.bindLong(1, id);
+        }
+ 
+        String loginname = entity.getLoginname();
+        if (loginname != null) {
+            stmt.bindString(2, loginname);
+        }
+ 
+        String aid = entity.getAid();
+        if (aid != null) {
+            stmt.bindString(3, aid);
+        }
+ 
+        String nickname = entity.getNickname();
+        if (nickname != null) {
+            stmt.bindString(4, nickname);
+        }
+ 
+        String avatar = entity.getAvatar();
+        if (avatar != null) {
+            stmt.bindString(5, avatar);
+        }
+        stmt.bindLong(6, entity.getGender());
+    }
+
+    @Override
+    public Long readKey(Cursor cursor, int offset) {
+        return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
+    }    
+
+    @Override
+    public Account readEntity(Cursor cursor, int offset) {
+        Account entity = new Account( //
+            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
+            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // loginname
+            cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // aid
+            cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // nickname
+            cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // avatar
+            cursor.getInt(offset + 5) // gender
+        );
+        return entity;
+    }
+     
+    @Override
+    public void readEntity(Cursor cursor, Account entity, int offset) {
+        entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
+        entity.setLoginname(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
+        entity.setAid(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
+        entity.setNickname(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
+        entity.setAvatar(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
+        entity.setGender(cursor.getInt(offset + 5));
+     }
+    
+    @Override
+    protected final Long updateKeyAfterInsert(Account entity, long rowId) {
+        entity.setId(rowId);
+        return rowId;
+    }
+    
+    @Override
+    public Long getKey(Account entity) {
+        if(entity != null) {
+            return entity.getId();
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public boolean hasKey(Account entity) {
+        return entity.getId() != null;
+    }
+
+    @Override
+    protected final boolean isEntityUpdateable() {
+        return true;
+    }
+    
+}

+ 9 - 1
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -44,6 +44,7 @@ import com.sheep.gamegroup.model.entity.VersionInfo;
 import com.sheep.gamegroup.model.entity.WebviewEntity;
 import com.sheep.gamegroup.model.entity.XianWanEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
+import com.sheep.gamegroup.module.ChangePasswordAct;
 import com.sheep.gamegroup.util.share.ShareLinkConfig;
 import com.sheep.gamegroup.view.activity.ActApprenticeRedPacket;
 import com.sheep.gamegroup.view.activity.ActArticleComment;
@@ -115,7 +116,7 @@ import com.sheep.gamegroup.view.activity.FeedbackAct;
 import com.sheep.gamegroup.view.activity.GameTaskOrderListAct;
 import com.sheep.gamegroup.view.activity.GamemakeMoneyAct;
 import com.sheep.gamegroup.view.activity.LieMakeMoneyAct;
-import com.sheep.gamegroup.view.activity.LoginAct;
+import com.sheep.gamegroup.module.login.LoginAct;
 import com.sheep.gamegroup.view.activity.PersonalCenterAct;
 import com.sheep.gamegroup.view.activity.PersonalInfoAct;
 import com.sheep.gamegroup.view.activity.RealNameAuthenAct;
@@ -181,6 +182,7 @@ import static com.sheep.gamegroup.util.UMConfigUtils.Event.SEARCH_GAME;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.SETTING;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.SYSTEM_NOTIFICATION_DETAIL;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_ABOUT_US;
+import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_CHANGE_PASSWORD;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_FEEDBACK;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_FIND_APP_ORDER;
 import static com.sheep.gamegroup.util.UMConfigUtils.Event.USER_GAME_ACCOUNT;
@@ -1548,6 +1550,12 @@ public class Jump2View {
                 });
     }
 
+    public void goChangePassword(Activity activity) {
+        Intent intent = new Intent(activity, ChangePasswordAct.class);
+        activity.startActivity(intent);
+        USER_CHANGE_PASSWORD.onEvent();
+    }
+
     public void goNewAboutUs(Activity activity) {
         Intent intent = new Intent(activity, ActNewAboutUs.class);
         activity.startActivity(intent);

+ 13 - 0
app/src/main/java/com/sheep/gamegroup/util/StringUtils.java

@@ -265,6 +265,7 @@ public class StringUtils {
         Matcher matcher = pattern.matcher(number);
         return matcher.matches();
     }
+
     // 校验中文
     public static boolean isChinese(String name) {
         Pattern p = Pattern.compile("^[\u4E00-\u9FA50]+$");
@@ -272,6 +273,18 @@ public class StringUtils {
         return m.matches();
     }
 
+    public static boolean isUserName(String name){
+        Pattern p = Pattern.compile("^[a-zA-Z0-9_.-@]{6,50}$");
+        Matcher m = p.matcher(name);
+        return m.matches();
+    }
+
+    public static boolean isPassword(String name){
+        Pattern p = Pattern.compile("^[a-zA-Z0-9_.-@$!*%]{6,16}$");
+        Matcher m = p.matcher(name);
+        return m.matches();
+    }
+
     /**
      * 格式化json
      * @param msg

+ 1 - 0
app/src/main/java/com/sheep/gamegroup/util/UMConfigUtils.java

@@ -113,6 +113,7 @@ public class UMConfigUtils {
         USER_AGENT("个人中心 -> 代理"),//5073
         USER_FAQ("个人中心 -> FAQ帮助"),//5074
         USER_ABOUT_US("个人中心 -> 关于我们"),//5075
+        USER_CHANGE_PASSWORD("个人中心 -> 修改密码"),//5075
         USER_FEEDBACK("个人中心 -> 意见反馈"),//5076
         USER_SHARE("个人中心 -> 推荐给好友"),//5077
         USER_UPGRADE("个人中心 -> 版本更新"),//5078

+ 8 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/ActSetting.java

@@ -52,14 +52,18 @@ public class ActSetting extends BaseActivity {
     public void initListener() {
 
     }
+
     @Override
     public void initData() {
         initCacheSize();
     }
 
-    @OnClick({R.id.abourt_us_layout, R.id.clear_layout, R.id.tv_submit, R.id.change_layout})
+    @OnClick({R.id.change_password_layout, R.id.abourt_us_layout, R.id.clear_layout, R.id.tv_submit, R.id.change_layout})
     public void onClick(View view) {
         switch (view.getId()) {
+            case R.id.change_password_layout:
+                Jump2View.getInstance().goChangePassword(activity);
+                break;
             case R.id.abourt_us_layout://关于我们
                 Jump2View.getInstance().goNewAboutUs(activity);
                 break;
@@ -89,11 +93,13 @@ public class ActSetting extends BaseActivity {
                 break;
         }
     }
+
     @BindView(R.id.clear_item_tv)
     TextView clear_item_tv;
+
     private void initCacheSize() {
         String size = SysAppUtil.getAppCacheSize();
-        clear_item_tv.setText(TextUtils.isEmpty(size) || TextUtils.equals("0K",size) ? "无需清理" : size);
+        clear_item_tv.setText(TextUtils.isEmpty(size) || TextUtils.equals("0K", size) ? "无需清理" : size);
     }
 
 }

+ 90 - 0
app/src/main/java/com/sheep/gamegroup/view/customview/CountDownButton.java

@@ -0,0 +1,90 @@
+package com.sheep.gamegroup.view.customview;
+
+import android.content.Context;
+import android.support.v7.widget.AppCompatButton;
+import android.util.AttributeSet;
+import android.view.View;
+
+import com.sheep.gamegroup.util.SelfCountDownTimer;
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+
+public class CountDownButton extends AppCompatButton {
+
+    private String freezonText = "发送验证码({0}s)";
+    private String enableText = "发送验证码";
+
+    private int cooldown = 60;
+
+    private OnClickListener exlistener;
+
+    private SelfCountDownTimer selfCountDownTimer = new SelfCountDownTimer(cooldown * 1000, 1000, cooldown) {
+        @Override
+        public void onTimerRest() {
+            setText(enableText);
+            setEnabled(true);
+        }
+
+        @Override
+        public void onTimerTick(long millisUntilFinished, int countTime) {
+            setText(MessageFormat.format(freezonText, countTime));
+        }
+
+        @Override
+        public void onTimerFinish() {
+            setEnabled(true);
+            setText(enableText);
+        }
+    };
+
+    public CountDownButton(Context context) {
+        super(context);
+    }
+
+    public CountDownButton(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public CountDownButton(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+    }
+
+    public void setCooldown(int cooldown) {
+        this.cooldown = cooldown;
+    }
+
+    public void startTimer() {
+        this.setEnabled(false);
+
+    }
+
+    @Override
+    public void setOnClickListener(OnClickListener exlistener) {
+        this.exlistener = exlistener;
+        super.setOnClickListener(v -> click());
+    }
+
+    public void click() {
+        selfCountDownTimer.reset(cooldown);
+        selfCountDownTimer.start();
+        setEnabled(false);
+        exlistener.onClick(this);
+    }
+
+    public void setFreezonText(String freezonText) {
+        this.freezonText = freezonText;
+    }
+
+    public void setEnableText(String enableText) {
+        this.enableText = enableText;
+    }
+
+    public void onDestroy() {
+        if (selfCountDownTimer != null) {
+            selfCountDownTimer.cancel();
+            selfCountDownTimer = null;
+        }
+    }
+}

+ 62 - 0
app/src/main/java/com/sheep/gamegroup/view/customview/VerificationAction.java

@@ -0,0 +1,62 @@
+package com.sheep.gamegroup.view.customview;
+
+import android.support.annotation.ColorRes;
+
+/**
+ * 填写验证码支持的Action
+ * Created by yj on 2017/5/11.
+ */
+
+public interface VerificationAction {
+
+    /**
+     * 设置位数
+     */
+    void setFigures(int figures);
+
+    /**
+     * 设置验证码之间的间距
+     */
+    void setVerCodeMargin(int margin);
+
+    /**
+     * 设置底部选中状态的颜色
+     */
+    void setBottomSelectedColor(@ColorRes int bottomSelectedColor);
+
+    /**
+     * 设置底部未选中状态的颜色
+     */
+    void setBottomNormalColor(@ColorRes int bottomNormalColor);
+
+    /**
+     * 设置选择的背景色
+     */
+    void setSelectedBackgroundColor(@ColorRes int selectedBackground);
+
+    /**
+     * 设置底线的高度
+     */
+    void setBottomLineHeight(int bottomLineHeight);
+
+    /**
+     * 设置当验证码变化时候的监听器
+     */
+    void setOnVerificationCodeChangedListener(OnVerificationCodeChangedListener listener);
+
+    /**
+     * 验证码变化时候的监听事件
+     */
+    interface OnVerificationCodeChangedListener {
+
+        /**
+         * 当验证码变化的时候
+         */
+        void onVerCodeChanged(CharSequence s, int start, int before, int count);
+
+        /**
+         * 输入完毕后的回调
+         */
+        void onInputCompleted(CharSequence s);
+    }
+}

+ 346 - 0
app/src/main/java/com/sheep/gamegroup/view/customview/VerificationCodeEditText.java

@@ -0,0 +1,346 @@
+package com.sheep.gamegroup.view.customview;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.os.Build;
+import android.support.annotation.ColorRes;
+import android.support.v4.content.ContextCompat;
+import android.text.Editable;
+import android.text.TextPaint;
+import android.text.TextWatcher;
+import android.util.AttributeSet;
+import android.util.DisplayMetrics;
+import android.util.TypedValue;
+import android.view.MotionEvent;
+import android.view.WindowManager;
+import android.view.inputmethod.InputMethodManager;
+
+import com.sheep.jiuyan.samllsheep.R;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+/**
+ * 验证码的EditText
+ * Created by yj on 2017/6/12.
+ */
+
+public class VerificationCodeEditText extends android.support.v7.widget.AppCompatEditText implements
+        VerificationAction, TextWatcher {
+    private static final int DEFAULT_CURSOR_DURATION = 400;
+
+    private int mFigures;//需要输入的位数
+    private int mVerCodeMargin;//验证码之间的间距
+    private int mBottomSelectedColor;//底部选中的颜色
+    private int mBottomNormalColor;//未选中的颜色
+    private float mBottomLineHeight;//底线的高度
+    private int mSelectedBackgroundColor;//选中的背景颜色
+    private int mCursorWidth;//光标宽度
+    private int mCursorColor;//光标颜色
+    private int mCursorDuration;//光标闪烁间隔
+
+    private OnVerificationCodeChangedListener onCodeChangedListener;
+    private int mCurrentPosition = 0;
+    private int mEachRectLength = 0;//每个矩形的边长
+    private Paint mSelectedBackgroundPaint;
+    private Paint mNormalBackgroundPaint;
+    private Paint mBottomSelectedPaint;
+    private Paint mBottomNormalPaint;
+    private Paint mCursorPaint;
+
+    // 控制光标闪烁
+    private boolean isCursorShowing;
+    private TimerTask mCursorTimerTask;
+    private Timer mCursorTimer;
+
+    public VerificationCodeEditText(Context context) {
+        this(context, null);
+    }
+
+    public VerificationCodeEditText(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public VerificationCodeEditText(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        initAttrs(attrs);
+        setBackgroundColor(ContextCompat.getColor(context, android.R.color.transparent));//防止出现下划线
+        initPaint();
+        initCursorTimer();
+        setFocusableInTouchMode(true);
+        super.addTextChangedListener(this);
+    }
+
+    /**
+     * 初始化paint
+     */
+    private void initPaint() {
+        mSelectedBackgroundPaint = new Paint();
+        mSelectedBackgroundPaint.setColor(mSelectedBackgroundColor);
+        mNormalBackgroundPaint = new Paint();
+        mNormalBackgroundPaint.setColor(getColor(android.R.color.transparent));
+
+        mBottomSelectedPaint = new Paint();
+        mBottomNormalPaint = new Paint();
+        mBottomSelectedPaint.setColor(mBottomSelectedColor);
+        mBottomNormalPaint.setColor(mBottomNormalColor);
+        mBottomSelectedPaint.setStrokeWidth(mBottomLineHeight);
+        mBottomNormalPaint.setStrokeWidth(mBottomLineHeight);
+
+        mCursorPaint = new Paint();
+        mCursorPaint.setAntiAlias(true);
+        mCursorPaint.setColor(mCursorColor);
+        mCursorPaint.setStyle(Paint.Style.FILL_AND_STROKE);
+        mCursorPaint.setStrokeWidth(mCursorWidth);
+    }
+
+    /**
+     * 初始化Attrs
+     */
+    private void initAttrs(AttributeSet attrs) {
+        TypedArray ta = getContext().obtainStyledAttributes(attrs, R.styleable.VerCodeEditText);
+        mFigures = ta.getInteger(R.styleable.VerCodeEditText_figures, 4);
+        mVerCodeMargin = (int) ta.getDimension(R.styleable.VerCodeEditText_verCodeMargin, 0);
+        mBottomSelectedColor = ta.getColor(R.styleable.VerCodeEditText_bottomLineSelectedColor,
+                getCurrentTextColor());
+        mBottomNormalColor = ta.getColor(R.styleable.VerCodeEditText_bottomLineNormalColor,
+                getColor(android.R.color.darker_gray));
+        mBottomLineHeight = ta.getDimension(R.styleable.VerCodeEditText_bottomLineHeight,
+                dp2px(5));
+        mSelectedBackgroundColor = ta.getColor(R.styleable.VerCodeEditText_selectedBackgroundColor,
+                getColor(android.R.color.darker_gray));
+        mCursorWidth = (int) ta.getDimension(R.styleable.VerCodeEditText_cursorWidth, dp2px(1));
+        mCursorColor = ta.getColor(R.styleable.VerCodeEditText_cursorColor, getColor(android.R.color.darker_gray));
+        mCursorDuration = ta.getInteger(R.styleable.VerCodeEditText_cursorDuration, DEFAULT_CURSOR_DURATION);
+        ta.recycle();
+        
+        // force LTR because of bug: https://github.com/JustKiddingBaby/VercodeEditText/issues/4
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
+            setLayoutDirection(LAYOUT_DIRECTION_LTR);
+        }
+    }
+
+    private void initCursorTimer() {
+        mCursorTimerTask = new TimerTask() {
+            @Override
+            public void run() {
+                // 通过光标间歇性显示实现闪烁效果
+                isCursorShowing = !isCursorShowing;
+                postInvalidate();
+            }
+        };
+        mCursorTimer = new Timer();
+    }
+
+    @Override
+    protected void onAttachedToWindow() {
+        super.onAttachedToWindow();
+
+        // 启动定时任务,定时刷新实现光标闪烁
+        mCursorTimer.scheduleAtFixedRate(mCursorTimerTask, 0, mCursorDuration);
+    }
+
+    @Override
+    protected void onDetachedFromWindow() {
+        super.onDetachedFromWindow();
+        mCursorTimer.cancel();
+    }
+
+    @Override
+    final public void setCursorVisible(boolean visible) {
+        super.setCursorVisible(visible);//隐藏光标的显示
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        int widthResult = 0, heightResult = 0;
+        //最终的宽度
+        int widthMode = MeasureSpec.getMode(widthMeasureSpec);
+        int widthSize = MeasureSpec.getSize(widthMeasureSpec);
+        if (widthMode == MeasureSpec.EXACTLY) {
+            widthResult = widthSize;
+        } else {
+            widthResult = getScreenWidth(getContext());
+        }
+        //每个矩形形的宽度
+        mEachRectLength = (widthResult - (mVerCodeMargin * (mFigures - 1))) / mFigures;
+        //最终的高度
+        int heightMode = MeasureSpec.getMode(heightMeasureSpec);
+        int heightSize = MeasureSpec.getSize(heightMeasureSpec);
+        if (heightMode == MeasureSpec.EXACTLY) {
+            heightResult = heightSize;
+        } else {
+            heightResult = mEachRectLength;
+        }
+        setMeasuredDimension(widthResult, heightResult);
+    }
+
+    @Override
+    public boolean onTouchEvent(MotionEvent event) {
+        if (event.getAction() == MotionEvent.ACTION_DOWN) {
+            requestFocus();
+            setSelection(getText().length());
+            showKeyBoard(getContext());
+            return false;
+        }
+        return super.onTouchEvent(event);
+    }
+
+    @Override
+    protected void onDraw(Canvas canvas) {
+        mCurrentPosition = getText().length();
+        int width = mEachRectLength - getPaddingLeft() - getPaddingRight();
+        int height = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
+        for (int i = 0; i < mFigures; i++) {
+            canvas.save();
+            int start = width * i + i * mVerCodeMargin;
+            int end = width + start;
+            //画一个矩形
+            if (i == mCurrentPosition) {//选中的下一个状态
+                canvas.drawRect(start, 0, end, height, mSelectedBackgroundPaint);
+            } else {
+                canvas.drawRect(start, 0, end, height, mNormalBackgroundPaint);
+            }
+            canvas.restore();
+        }
+        //绘制文字
+        String value = getText().toString();
+        for (int i = 0; i < value.length(); i++) {
+            canvas.save();
+            int start = width * i + i * mVerCodeMargin;
+            float x = start + width / 2;
+            TextPaint paint = getPaint();
+            paint.setTextAlign(Paint.Align.CENTER);
+            paint.setColor(getCurrentTextColor());
+            Paint.FontMetrics fontMetrics = paint.getFontMetrics();
+            float baseline = (height - fontMetrics.bottom + fontMetrics.top) / 2
+                    - fontMetrics.top;
+            canvas.drawText(String.valueOf(value.charAt(i)), x, baseline, paint);
+            canvas.restore();
+        }
+        //绘制底线
+        for (int i = 0; i < mFigures; i++) {
+            canvas.save();
+            float lineY = height - mBottomLineHeight / 2;
+            int start = width * i + i * mVerCodeMargin;
+            int end = width + start;
+            if (i < mCurrentPosition) {
+                canvas.drawLine(start, lineY, end, lineY, mBottomSelectedPaint);
+            } else {
+                canvas.drawLine(start, lineY, end, lineY, mBottomNormalPaint);
+            }
+            canvas.restore();
+        }
+        //绘制光标
+        if (!isCursorShowing && isCursorVisible() && mCurrentPosition < mFigures && hasFocus()) {
+            canvas.save();
+            int startX = mCurrentPosition * (width + mVerCodeMargin) + width / 2;
+            int startY = height / 4;
+            int endX = startX;
+            int endY = height - height / 4;
+            canvas.drawLine(startX, startY, endX, endY, mCursorPaint);
+            canvas.restore();
+        }
+    }
+
+    @Override
+    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+        mCurrentPosition = getText().length();
+        postInvalidate();
+    }
+
+    @Override
+    public void onTextChanged(CharSequence s, int start, int before, int count) {
+        mCurrentPosition = getText().length();
+        postInvalidate();
+        if (onCodeChangedListener != null) {
+            onCodeChangedListener.onVerCodeChanged(getText(), start, before, count);
+        }
+    }
+
+    @Override
+    public void afterTextChanged(Editable s) {
+        mCurrentPosition = getText().length();
+        postInvalidate();
+        if (getText().length() == mFigures) {
+            if (onCodeChangedListener != null) {
+                onCodeChangedListener.onInputCompleted(getText());
+            }
+        } else if (getText().length() > mFigures) {
+            getText().delete(mFigures, getText().length());
+        }
+    }
+
+    @Override
+    public void setFigures(int figures) {
+        mFigures = figures;
+        postInvalidate();
+    }
+
+    @Override
+    public void setVerCodeMargin(int margin) {
+        mVerCodeMargin = margin;
+        postInvalidate();
+    }
+
+    @Override
+    public void setBottomSelectedColor(@ColorRes int bottomSelectedColor) {
+        mBottomSelectedColor = getColor(bottomSelectedColor);
+        postInvalidate();
+    }
+
+    @Override
+    public void setBottomNormalColor(@ColorRes int bottomNormalColor) {
+        mBottomSelectedColor = getColor(bottomNormalColor);
+        postInvalidate();
+    }
+
+    @Override
+    public void setSelectedBackgroundColor(@ColorRes int selectedBackground) {
+        mSelectedBackgroundColor = getColor(selectedBackground);
+        postInvalidate();
+    }
+
+    @Override
+    public void setBottomLineHeight(int bottomLineHeight) {
+        this.mBottomLineHeight = bottomLineHeight;
+        postInvalidate();
+    }
+
+    @Override
+    public void setOnVerificationCodeChangedListener(OnVerificationCodeChangedListener listener) {
+        this.onCodeChangedListener = listener;
+    }
+
+    /**
+     * 返回颜色
+     */
+    private int getColor(@ColorRes int color) {
+        return ContextCompat.getColor(getContext(), color);
+    }
+
+    /**
+     * dp转px
+     */
+    private int dp2px(int dp) {
+        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
+                getResources().getDisplayMetrics());
+    }
+
+    /**
+     * 获取手机屏幕的宽度
+     */
+    static int getScreenWidth(Context context) {
+        DisplayMetrics metrics = new DisplayMetrics();
+        WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
+        wm.getDefaultDisplay().getMetrics(metrics);
+        return metrics.widthPixels;
+    }
+
+    public void showKeyBoard(Context context) {
+        InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
+        imm.showSoftInput(this, InputMethodManager.SHOW_FORCED);
+    }
+}

+ 14 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/utils/TitleBarUtils.java

@@ -112,6 +112,18 @@ public class TitleBarUtils {
                 });
         return mTitleBarUtils;
     }
+
+    public TitleBarUtils setTitleBack(final Activity activity) {
+        activity.findViewById(R.id.img_baseactivity_title)
+                .setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        activity.onBackPressed();
+                    }
+                });
+        return mTitleBarUtils;
+    }
+
     public TitleBarUtils setTitleFinish(final View view, final Activity activity) {
         view.findViewById(R.id.img_baseactivity_title)
                 .setOnClickListener(new View.OnClickListener() {
@@ -370,9 +382,10 @@ public class TitleBarUtils {
     /**
      * 隐藏标题栏所有组件,GONE或VISIBLE
      */
-    public void setShowOrHide(Activity activity, boolean isShow) {
+    public TitleBarUtils setShowOrHide(Activity activity, boolean isShow) {
         activity.findViewById(R.id.layout_navigationBar)
                 .setVisibility(isShow ? View.VISIBLE : View.GONE);
+        return this;
     }
 
 

+ 6 - 0
app/src/main/res/color/selector_color_radio_button.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:state_checked="true" android:color="@color/black_6_3"/>
+    <item android:color="@color/gray"/>
+</selector>

BIN
app/src/main/res/drawable-xhdpi/radio_checked.png


BIN
app/src/main/res/drawable-xhdpi/radio_uncheck.png


BIN
app/src/main/res/drawable-xxhdpi/radio_checked.png


BIN
app/src/main/res/drawable-xxhdpi/radio_uncheck.png


+ 6 - 0
app/src/main/res/drawable/round_main_r25.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <corners android:radius="@dimen/radius_25" />
+    <solid android:color="@color/btn_color_main_stroke" />
+</shape>

+ 5 - 0
app/src/main/res/drawable/selector_radio_img.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/radio_checked" android:state_checked="true" />
+    <item android:drawable="@drawable/radio_uncheck" android:state_checked="false"/>
+</selector>

+ 34 - 0
app/src/main/res/layout/account_select_item.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="60dp"
+    android:paddingLeft="16dp"
+    android:paddingRight="16dp">
+
+    <ImageView
+        android:id="@+id/account_avatar_view"
+        android:src="@mipmap/icon_unread"
+        android:layout_centerVertical="true"
+        android:layout_width="@dimen/dp_40"
+        android:layout_height="@dimen/dp_40" />
+
+    <TextView
+        android:id="@+id/account_name_view"
+        android:layout_toRightOf="@+id/account_avatar_view"
+        android:layout_centerVertical="true"
+        android:layout_marginLeft="12dp"
+        android:textSize="@dimen/sp_16"
+        android:textColor="@color/black_6_3"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" />
+
+    <ImageView
+        android:id="@+id/account_delete_btn"
+        android:src="@mipmap/cross_delete"
+        android:padding="10dp"
+        android:layout_alignParentRight="true"
+        android:layout_centerVertical="true"
+        android:layout_width="@dimen/view_size_30"
+        android:layout_height="@dimen/view_size_30" />
+
+</RelativeLayout>

+ 14 - 0
app/src/main/res/layout/act_setting.xml

@@ -18,6 +18,20 @@
         android:orientation="vertical">
 
         <LinearLayout
+            android:id="@+id/change_password_layout"
+            style="@style/style_item_container">
+
+            <TextView
+                style="@style/style_item_label"
+                android:text="修改密码" />
+
+            <TextView style="@style/style_item_end_next" />
+
+        </LinearLayout>
+
+        <View style="@style/style_item_line" />
+
+        <LinearLayout
             android:id="@+id/abourt_us_layout"
             style="@style/style_item_container">
 

+ 15 - 0
app/src/main/res/layout/activity_login.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:fitsSystemWindows="true"
+    android:orientation="vertical">
+    <include layout="@layout/title" />
+    <FrameLayout
+        android:id="@+id/fragment_container"
+        android:background="@color/white"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"></FrameLayout>
+</LinearLayout>

+ 93 - 0
app/src/main/res/layout/fragment_edit_user_info.xml

@@ -0,0 +1,93 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:gravity="center_horizontal"
+    android:orientation="vertical"
+    android:padding="@dimen/content_padding_24">
+
+    <ImageView
+        android:id="@+id/avatar_view"
+        android:layout_width="80dp"
+        android:layout_height="80dp"
+        android:layout_marginTop="30dp"
+        android:src="@mipmap/icon_unread" />
+
+    <EditText
+        android:id="@+id/nickname_box"
+        style="@style/login_edit_style"
+        android:layout_marginTop="30dp"
+        android:hint="您的名字"
+        android:lines="1"
+        android:maxLength="20" />
+
+    <View
+        style="@style/login_separetor_line_style"/>
+
+    <TextView
+        android:id="@+id/birthday_box"
+        android:layout_width="match_parent"
+        android:layout_height="50dp"
+        android:gravity="center_vertical"
+        android:layout_marginTop="10dp"
+        android:hint="选择生日"
+        android:lines="1"
+        android:maxLength="20" />
+
+    <View
+        style="@style/login_separetor_line_style"/>
+
+    <RelativeLayout
+        android:layout_marginTop="10dp"
+        android:layout_width="match_parent"
+        android:layout_height="50dp">
+
+        <RadioGroup
+            android:id="@+id/gender_box"
+            android:layout_centerVertical="true"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal">
+
+            <RadioButton
+                android:layout_marginRight="36dp"
+                android:id="@+id/male_radio"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:button="@null"
+                android:drawableRight="@drawable/selector_radio_img"
+                android:checked="true"
+                android:text="男   "
+                android:textColor="@color/selector_color_radio_button"
+                android:textSize="14sp"/>
+
+            <RadioButton
+                android:id="@+id/female_radio"
+                android:button="@null"
+                android:drawableRight="@drawable/selector_radio_img"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="14sp"
+                android:textColor="@color/selector_color_radio_button"
+                android:text="女   " />
+
+        </RadioGroup>
+        <TextView
+            android:layout_centerVertical="true"
+            android:text="注册后,性别不可以修改"
+            android:textSize="12sp"
+            android:textColor="@color/theme_app_mid"
+            android:layout_alignParentRight="true"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+    </RelativeLayout>
+
+    <View
+        style="@style/login_separetor_line_style"/>
+
+    <Button
+        android:id="@+id/submit_btn"
+        android:text="下一步"
+        android:layout_marginTop="30dp"
+        style="@style/login_theme_round_button" />
+</LinearLayout>

+ 111 - 0
app/src/main/res/layout/fragment_find_account.xml

@@ -0,0 +1,111 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:paddingTop="@dimen/content_padding_24"
+    android:paddingLeft="@dimen/content_padding_13"
+    android:paddingBottom="@dimen/content_padding_24"
+    android:paddingRight="@dimen/content_padding_24">
+
+    <LinearLayout
+        android:gravity="center_vertical"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <View
+            android:layout_marginRight="4dp"
+            android:layout_width="4dp"
+            android:layout_height="14dp"
+            android:background="@color/btn_color_main_stroke"/>
+        <TextView
+            android:text="方法一:"
+            android:textSize="14sp"
+            android:textColor="@color/black_6_3"
+            android:textStyle="bold"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"/>
+    </LinearLayout>
+
+    <TextView
+        android:layout_marginTop="12dp"
+        android:textSize="12sp"
+        android:layout_marginLeft="8dp"
+        android:text="已绑定小绵羊账户的用户,可以通过手机号+验证码来修改密码"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+
+    <RelativeLayout
+        android:layout_marginTop="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <EditText
+            android:layout_marginTop="8dp"
+            android:id="@+id/phone_number_box"
+            android:hint="请输入手机号"
+            android:inputType="phone"
+            style="@style/login_edit_style" />
+
+        <ImageView
+            android:id="@+id/text_delete_btn"
+            android:src="@mipmap/text_delete"
+            android:visibility="gone"
+            android:layout_toLeftOf="@+id/send_captcha_btn"
+            android:layout_marginTop="24dp"
+            android:layout_marginRight="12dp"
+            android:layout_width="16dp"
+            android:layout_height="16dp" />
+
+        <View
+            style="@style/login_separetor_line_style"
+            android:layout_below="@+id/phone_number_box" />
+        <Button
+            android:id="@+id/send_captcha_btn"
+            android:text="获取验证码"
+            android:textSize="12sp"
+            android:textStyle="normal"
+            android:layout_marginTop="22dp"
+            android:layout_alignParentRight="true"
+            style="@style/login_theme_round_button"
+            android:layout_width="wrap_content"
+            android:layout_height="20dp"/>
+
+    </RelativeLayout>
+
+    <LinearLayout
+        android:layout_marginTop="16dp"
+        android:gravity="center_vertical"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <View
+            android:layout_marginRight="4dp"
+            android:layout_width="4dp"
+            android:layout_height="14dp"
+            android:background="@color/btn_color_main_stroke"/>
+        <TextView
+            android:text="方法二:"
+            android:textSize="14sp"
+            android:textColor="@color/black_6_3"
+            android:textStyle="bold"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"/>
+    </LinearLayout>
+    <TextView
+        android:text="通过联系客服申述,召回无绑定手机号的小绵羊账号及密码"
+        android:layout_marginTop="12dp"
+        android:textSize="12sp"
+        android:layout_marginLeft="8dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+
+    <TextView
+        android:textColor="@color/btn_color_main_stroke"
+        android:layout_marginTop="24dp"
+        android:textSize="12sp"
+        android:layout_marginLeft="8dp"
+        android:text="客服QQ: 2441310002"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+
+</LinearLayout>

+ 45 - 0
app/src/main/res/layout/fragment_new_password.xml

@@ -0,0 +1,45 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:gravity="center_horizontal"
+    android:padding="@dimen/content_padding_24"
+    tools:context="com.sheep.gamegroup.module.login.fragments.OldPasswordFgt">
+
+    <TextView
+        android:textStyle="bold"
+        android:text="请输入新的登录密码"
+        android:gravity="center"
+        android:textColor="@color/gray_4"
+        android:textSize="14sp"
+        android:layout_marginTop="50dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+
+    <EditText
+        android:id="@+id/new_pwd_box"
+        android:hint="请输入新的登录密码"
+        style="@style/login_edit_style" />
+
+    <View
+        style="@style/login_separetor_line_style" />
+
+    <TextView
+        android:id="@+id/forget_pwd_btn"
+        android:layout_marginTop="8dp"
+        android:gravity="right"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="忘记密码?"
+        android:textSize="12sp"
+        android:visibility="invisible"
+        android:textColor="@color/blue_34a6e7" />
+
+    <Button
+        android:id="@+id/done_btn"
+        style="@style/login_theme_round_button"
+        android:layout_marginTop="100dp"
+        android:text="提交" />
+
+</LinearLayout>

+ 44 - 0
app/src/main/res/layout/fragment_old_password.xml

@@ -0,0 +1,44 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:gravity="center_horizontal"
+    android:padding="@dimen/content_padding_24"
+    tools:context="com.sheep.gamegroup.module.login.fragments.OldPasswordFgt">
+
+    <TextView
+        android:textStyle="bold"
+        android:text="请输入旧登录密码"
+        android:gravity="center"
+        android:textColor="@color/gray_4"
+        android:textSize="14sp"
+        android:layout_marginTop="50dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+
+    <EditText
+        android:id="@+id/old_pwd_box"
+        android:hint="请输入当前登录密码"
+        style="@style/login_edit_style" />
+
+    <View
+        style="@style/login_separetor_line_style" />
+
+    <TextView
+        android:id="@+id/forget_pwd_btn"
+        android:layout_marginTop="8dp"
+        android:gravity="right"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="忘记密码?"
+        android:textSize="12sp"
+        android:textColor="@color/blue_34a6e7" />
+
+    <Button
+        android:id="@+id/next_btn"
+        style="@style/login_theme_round_button"
+        android:layout_marginTop="100dp"
+        android:text="下一步" />
+
+</LinearLayout>

+ 240 - 0
app/src/main/res/layout/fragment_sign_in.xml

@@ -0,0 +1,240 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:padding="@dimen/content_padding_24">
+
+    <TextView
+        android:id="@+id/top_bar"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_margin="30dp"
+        android:gravity="center_horizontal"
+        android:text="登录小绵羊"
+        android:textColor="@color/black_6_3"
+        android:textSize="@dimen/text_size_25"
+        android:textStyle="bold" />
+
+    <RelativeLayout
+        android:id="@+id/for_account_pwd_container"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:visibility="gone"
+        android:layout_below="@+id/top_bar">
+
+        <EditText
+            android:id="@+id/user_name_box"
+            style="@style/login_edit_style"
+            android:hint="输入用户名/手机号/绵羊号"
+            android:paddingLeft="@dimen/content_padding_5" />
+
+        <View
+            style="@style/login_separetor_line_style"
+            android:layout_below="@+id/user_name_box" />
+
+        <EditText
+            android:id="@+id/password_box"
+            style="@style/login_edit_style"
+            android:layout_below="@+id/user_name_box"
+            android:hint="输入密码(6-16位)"
+            android:inputType="textPassword"
+            android:maxLength="16" />
+
+        <View
+            style="@style/login_separetor_line_style"
+            android:layout_below="@+id/password_box" />
+    </RelativeLayout>
+
+    <RelativeLayout
+        android:id="@+id/for_phone_container"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@+id/top_bar">
+
+        <EditText
+            android:id="@+id/phone_number_box"
+            style="@style/login_edit_style"
+            android:hint="输入手机号"
+            android:inputType="phone"
+            android:maxLength="11" />
+        <View
+            style="@style/login_separetor_line_style"
+            android:layout_below="@+id/phone_number_box" />
+
+        <EditText
+            android:id="@+id/captcha_box"
+            android:layout_below="@+id/phone_number_box"
+            style="@style/login_edit_style"
+            android:hint="输入验证码"
+            android:inputType="phone"
+            android:maxLength="6" />
+
+        <View
+            style="@style/login_separetor_line_style"
+            android:layout_below="@+id/captcha_box" />
+
+        <com.sheep.gamegroup.view.customview.CountDownButton
+            android:id="@+id/send_captcha_btn"
+            android:layout_width="wrap_content"
+            android:layout_height="25dp"
+            android:background="@drawable/round_main_r25"
+            android:layout_alignParentRight="true"
+            android:layout_below="@+id/phone_number_box"
+            android:layout_marginTop="28dp"
+            android:textColor="@android:color/white"
+            android:textSize="12sp"
+            android:text="获取验证码" />
+    </RelativeLayout>
+
+    <ImageView
+        android:id="@+id/account_menu_btn"
+        android:src="@mipmap/arrow_down"
+        android:tint="@color/black_6_3"
+        android:layout_alignParentRight="true"
+        android:layout_marginTop="120dp"
+        android:padding="8dp"
+        android:layout_width="30dp"
+        android:layout_height="30dp" />
+
+    <TextView
+        android:id="@+id/trouble_btn"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentRight="true"
+        android:layout_below="@id/top_bar"
+        android:layout_marginTop="130dp"
+        android:text="登录遇到问题?"
+        android:textSize="12sp"
+        android:textColor="@color/blue_34a6e7" />
+
+    <Button
+        android:id="@+id/login_btn"
+        style="@style/login_theme_round_button"
+        android:layout_below="@+id/trouble_btn"
+        android:layout_marginTop="20dp"
+        android:text="登录" />
+
+    <TextView
+        android:id="@+id/register_btn"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerHorizontal="true"
+        android:layout_below="@+id/login_btn"
+        android:layout_marginTop="16dp"
+        android:text="新用户注册"
+        android:textSize="12sp"
+        android:textColor="@color/blue_34a6e7" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:layout_marginBottom="16dp"
+        android:layout_above="@+id/thirdpart_login_container"
+        android:orientation="horizontal">
+
+        <View
+            android:background="@color/G"
+            style="@style/login_separetor_line_style"
+            android:layout_width="20dp"/>
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:layout_marginLeft="10dp"
+            android:layout_marginRight="10dp"
+            android:layout_marginBottom="2dp"
+            android:textSize="13sp"
+            android:text="or"
+            android:textColor="@color/G" />
+
+        <View
+            style="@style/login_separetor_line_style"
+            android:background="@color/G"
+            android:layout_width="20dp"/>
+
+    </LinearLayout>
+
+
+
+    <LinearLayout
+        android:id="@+id/thirdpart_login_container"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingLeft="20dp"
+        android:paddingRight="20dp"
+        android:layout_alignParentBottom="true"
+        android:orientation="horizontal">
+
+        <LinearLayout
+            android:id="@+id/login_type_toggle"
+            style="@style/login_type_btn">
+
+            <ImageView
+                android:id="@+id/login_type_toggle_icon"
+                style="@style/login_type_icon"
+                android:src="@mipmap/login_account" />
+
+            <TextView
+                android:id="@+id/login_type_toggle_text"
+                android:text="账号登录"
+                style="@style/login_type_text" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/qq_login_btn"
+            style="@style/login_type_btn">
+
+            <ImageView
+                style="@style/login_type_icon"
+                android:src="@mipmap/login_qq" />
+
+            <TextView
+                android:text="QQ"
+                style="@style/login_type_text" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/wx_login_btn"
+            style="@style/login_type_btn">
+
+            <ImageView
+                style="@style/login_type_icon"
+                android:src="@mipmap/login_wx" />
+
+            <TextView
+                android:text="微信"
+                style="@style/login_type_text"/>
+        </LinearLayout>
+
+
+    </LinearLayout>
+
+    <TextView
+        android:id="@+id/test_change"
+        style="@style/style_button_small_yellow"
+        android:layout_width="wrap_content"
+        android:layout_height="30dp"
+        android:layout_alignParentEnd="true"
+        android:layout_alignParentTop="true"
+        android:layout_margin="@dimen/dp_10"
+        android:paddingEnd="@dimen/dp_10"
+        android:paddingStart="@dimen/dp_10"
+        android:text="切换服务器"
+        android:visibility="gone" />
+
+    <TextView
+        android:id="@+id/test_change_user"
+        style="@style/style_button_small_yellow"
+        android:layout_width="wrap_content"
+        android:layout_height="30dp"
+        android:layout_alignParentEnd="true"
+        android:layout_below="@+id/test_change"
+        android:layout_margin="@dimen/dp_10"
+        android:paddingEnd="@dimen/dp_10"
+        android:paddingStart="@dimen/dp_10"
+        android:text="切换账号"
+        android:visibility="gone" />
+
+</RelativeLayout>

+ 37 - 0
app/src/main/res/layout/fragment_sign_up.xml

@@ -0,0 +1,37 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:padding="@dimen/content_padding_24">
+
+    <LinearLayout
+        android:layout_marginTop="60dp"
+        android:orientation="vertical"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <EditText
+            android:id="@+id/user_name_box"
+            android:hint="输入用户名(如邮箱地址、常用英文等唯一标识)"
+            style="@style/login_edit_style" />
+        <View
+            style="@style/login_separetor_line_style" />
+        <EditText
+            android:id="@+id/password_box"
+            android:inputType="textPassword"
+            android:maxLength="16"
+            android:lines="1"
+            android:hint="输入密码(6-16位)"
+            android:layout_below="@+id/user_name_box"
+            style="@style/login_edit_style"  />
+        <View
+            style="@style/login_separetor_line_style" />
+    </LinearLayout>
+
+    <Button
+        android:id="@+id/register_btn"
+        android:text="注册"
+        android:layout_marginTop="50dp"
+        style="@style/login_theme_round_button" />
+
+</LinearLayout>

+ 59 - 0
app/src/main/res/layout/fragment_valid_captcha.xml

@@ -0,0 +1,59 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:padding="@dimen/content_padding_36"
+    android:gravity="center_horizontal"
+    android:orientation="vertical">
+
+    <TextView
+        android:layout_marginTop="50dp"
+        android:id="@+id/title_view"
+        android:textColor="@color/gray_4"
+        android:textStyle="bold"
+        android:textSize="14sp"
+        android:gravity="center_horizontal"
+        android:text="系统检测到您已更换新设备,为了保障您的账号安全,需要验证手机号!"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+
+    <TextView
+        android:layout_marginTop="20dp"
+        android:layout_marginLeft="40dp"
+        android:layout_marginRight="40dp"
+        android:id="@+id/tip_view"
+        android:gravity="center_horizontal"
+        android:text="我们已向xxxxxx发送验证码短信请查看短信并输入验证码"
+        android:textColor="@color/G"
+        android:textSize="12sp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" />
+
+    <com.sheep.gamegroup.view.customview.VerificationCodeEditText
+        android:id="@+id/captcha_box"
+        android:layout_marginTop="30dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:inputType="number"
+        android:textColor="@color/gray_4"
+        android:textSize="30sp"
+        app:bottomLineHeight="2dp"
+        app:bottomLineNormalColor="@color/G"
+        app:bottomLineSelectedColor="@color/blue_FF53BBF2"
+        app:figures="6"
+        app:selectedBackgroundColor="@android:color/transparent"
+        app:verCodeMargin="10dp"/>
+
+    <com.sheep.gamegroup.view.customview.CountDownButton
+        android:id="@+id/resend_captcha_btn"
+        android:layout_marginTop="30dp"
+        android:text="重新发送验证码3秒"
+        android:gravity="center"
+        android:textSize="13sp"
+        android:textColor="@color/gray_4"
+        android:background="@android:color/transparent"
+        android:layout_width="wrap_content"
+        android:layout_height="30dp" />
+
+</LinearLayout>

BIN
app/src/main/res/mipmap-xhdpi/cross_delete.png


BIN
app/src/main/res/mipmap-xhdpi/login_account.png


BIN
app/src/main/res/mipmap-xhdpi/login_phone.png


BIN
app/src/main/res/mipmap-xhdpi/login_qq.png


BIN
app/src/main/res/mipmap-xhdpi/login_wx.png


BIN
app/src/main/res/mipmap-xhdpi/text_delete.png


BIN
app/src/main/res/mipmap-xxhdpi/arrow_down.png


BIN
app/src/main/res/mipmap-xxhdpi/cross_delete.png


BIN
app/src/main/res/mipmap-xxhdpi/login_account.png


BIN
app/src/main/res/mipmap-xxhdpi/login_phone.png


BIN
app/src/main/res/mipmap-xxhdpi/login_qq.png


BIN
app/src/main/res/mipmap-xxhdpi/login_wx.png


BIN
app/src/main/res/mipmap-xxhdpi/text_delete.png


+ 32 - 0
app/src/main/res/values-v19/style_theme.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
+        <item name="android:windowContentOverlay">@null</item>
+        <item name="colorPrimary">@color/colorPrimary</item>
+        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
+        <item name="colorAccent">@color/colorAccent</item>
+        <item name="colorControlHighlight">@color/black</item>
+
+        <item name="main_color">@color/theme_app_main</item>
+        <item name="main_color_dark">@color/theme_app_dark</item>
+        <item name="main_color_mid">@color/theme_app_mid</item>
+        <item name="main_color_accent">@color/theme_app_highlight</item>
+        <item name="main_color_light">@color/theme_app_highlight_more</item>
+        <item name="star_unselect">@drawable/xina</item>
+        <item name="star_select">@drawable/xinb</item>
+        <!--下面的属性全是为了兼容安卓4.0!多了好多文件啊-->
+        <item name="line_short">@drawable/sp_line_vertical</item>
+        <item name="star_style">@style/ratingbar_main</item>
+        <item name="radio_btn">@drawable/sel_circle_dot</item>
+        <item name="button_full_normal">@drawable/selector_button_full_main</item>
+        <item name="full.button">@style/full.button_main</item>
+        <item name="small.button">@style/small.button_main</item>
+        <item name="sp_dot_rota">@drawable/sp_dot_rota_main</item>
+        <item name="theme_bg_btn_corner">@drawable/theme_bg_btn_corner_main</item>
+        <item name="sp_search_edt">@drawable/sp_search_edt_main</item>
+        <item name="btn_color">@color/btn_color_main</item>
+
+        <item name="android:windowTranslucentStatus">true</item>
+    </style>
+</resources>

+ 2 - 0
app/src/main/res/values-v23/style_theme.xml

@@ -27,5 +27,7 @@
         <item name="theme_bg_btn_corner">@drawable/theme_bg_btn_corner_main</item>
         <item name="sp_search_edt">@drawable/sp_search_edt_main</item>
         <item name="btn_color">@color/btn_color_main</item>
+
+        <item name="android:windowTranslucentStatus">true</item>
     </style>
 </resources>

+ 5 - 3
app/src/main/res/values/common.xml

@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
     <!--APP的相关主要颜色值-->
-    <color name="colorPrimary">@color/white_DEDEDE</color>
-    <color name="colorPrimaryDark">@color/blue_FF53BBF2</color>
-    <color name="colorAccent">#29d6fd</color>
+    <color name="colorPrimary">@color/blue_FF53BBF2</color>
+    <color name="colorPrimaryDark">@color/white_DEDEDE</color>
+    <color name="colorAccent">@color/white_DEDEDE</color>
+    <color name="colorControlNormal">@color/black_6_3</color>
     <!--APP中的文本颜色主要值-->
     <color name="black_text_deep">#333333</color>
     <color name="black_text_gray">#898989</color>
@@ -54,6 +55,7 @@
     <dimen name="content_padding_16">16dp</dimen>
     <dimen name="content_padding_18">18dp</dimen>
     <dimen name="content_padding_20">20dp</dimen>
+    <dimen name="content_padding_24">24dp</dimen>
     <dimen name="content_padding_30">30dp</dimen>
     <dimen name="content_padding_35">35dp</dimen>
     <dimen name="content_padding_36">36dp</dimen>

+ 3 - 0
app/src/main/res/values/strings.xml

@@ -141,4 +141,7 @@
     <string name="hot_user">热门玩家</string>
     <!--小绵羊3.4.5新增功能 发布发现-->
     <string name="please_say_something">说点什么~</string>
+
+    <!-- TODO: Remove or change this placeholder text -->
+    <string name="hello_blank_fragment">Hello blank fragment</string>
 </resources>

+ 1 - 0
app/src/main/res/values/style_theme.xml

@@ -26,6 +26,7 @@
         <item name="theme_bg_btn_corner">@drawable/theme_bg_btn_corner_main</item>
         <item name="sp_search_edt">@drawable/sp_search_edt_main</item>
         <item name="btn_color">@color/btn_color_main</item>
+
     </style>
 
 

+ 49 - 0
app/src/main/res/values/styles.xml

@@ -49,4 +49,53 @@
         <item name="android:windowEnterAnimation">@anim/slide_in_bottom</item>
         <item name="android:windowExitAnimation">@anim/slide_out_bottom</item>
     </style>
+
+    <style name="login_edit_style">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">40dp</item>
+        <item name="android:layout_marginTop">20dp</item>
+        <item name="android:background">@android:color/transparent</item>
+        <item name="android:lines">1</item>
+        <item name="android:maxLines">1</item>
+        <item name="android:imeOptions">actionNext</item>
+        <item name="android:textSize">@dimen/text_size_13</item>
+        <item name="android:textColor">@color/black_6_3</item>
+    </style>
+
+    <style name="login_separetor_line_style">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">1dp</item>
+        <item name="android:background">@color/bg_line</item>
+    </style>
+
+    <style name="login_theme_round_button">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">46dp</item>
+        <item name="android:background">@drawable/round_main_r25</item>
+        <item name="android:textStyle">bold</item>
+        <item name="android:textSize">14sp</item>
+        <item name="android:textColor">@android:color/white</item>
+    </style>
+
+    <style name="login_type_btn">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:layout_weight">1</item>
+        <item name="android:gravity">center</item>
+        <item name="android:orientation">vertical</item>
+    </style>
+
+    <style name="login_type_icon">
+        <item name="android:layout_width">40dp</item>
+        <item name="android:layout_height">40dp</item>
+        <item name="android:layout_marginBottom">4dp</item>
+    </style>
+
+    <style name="login_type_text">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:gravity">center</item>
+        <item name="android:textSize">12sp</item>
+        <item name="android:textColor">@color/G</item>
+    </style>
 </resources>

+ 15 - 0
app/src/main/res/values/vcedittext_attrs.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <!--验证码的属性-->
+    <declare-styleable name="VerCodeEditText">
+        <attr name="figures" format="integer" />
+        <attr name="verCodeMargin" format="dimension" />
+        <attr name="bottomLineSelectedColor" format="reference" />
+        <attr name="bottomLineNormalColor" format="reference" />
+        <attr name="bottomLineHeight" format="dimension" />
+        <attr name="selectedBackgroundColor" format="reference" />
+        <attr name="cursorDuration" format="integer" />
+        <attr name="cursorWidth" format="dimension" />
+        <attr name="cursorColor" format="color|reference" />
+    </declare-styleable>
+</resources>

+ 2 - 2
ucrop/build.gradle

@@ -20,8 +20,8 @@ android {
         }
     }
     compileOptions {
-        sourceCompatibility JavaVersion.VERSION_1_7
-        targetCompatibility JavaVersion.VERSION_1_7
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
     }
     lintOptions {
         abortOnError false

+ 9 - 5
view/build.gradle

@@ -25,15 +25,19 @@ android {
         }
     }
     buildToolsVersion ANDROID_BUILD_TOOLS_VERSION
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
 }
 
 dependencies {
     implementation "com.android.support:appcompat-v7:$supportLibVersion"
     implementation "com.android.support:support-v4:$supportLibVersion"
     api files('libs/tbs_sdk_thirdapp_v3.6.0.1325.jar')
-//    implementation 'com.github.bumptech.glide:glide:3.7.0'
-//    implementation ('jp.wasabeef:glide-transformations:2.0.2'){
-//        exclude group: 'com.github.bumptech.glide', module: 'glide'
-//    }
-//    implementation project(':sheep')
+    //    implementation 'com.github.bumptech.glide:glide:3.7.0'
+    //    implementation ('jp.wasabeef:glide-transformations:2.0.2'){
+    //        exclude group: 'com.github.bumptech.glide', module: 'glide'
+    //    }
+    //    implementation project(':sheep')
 }