Explorar o código

2.0 筛选某些代码

xiongxiaohe %!s(int64=8) %!d(string=hai) anos
pai
achega
e04ada2741
Modificáronse 100 ficheiros con 1237 adicións e 298 borrados
  1. 7 6
      app/build.gradle
  2. 41 121
      app/src/main/AndroidManifest.xml
  3. 33 0
      app/src/main/java/com/sheep/gamegroup/BaseApplication.java
  4. 13 0
      app/src/main/java/com/sheep/gamegroup/IBase/IBasePresenter.java
  5. 12 0
      app/src/main/java/com/sheep/gamegroup/IBase/IBaseView.java
  6. 125 0
      app/src/main/java/com/sheep/gamegroup/SheepApp.java
  7. 50 0
      app/src/main/java/com/sheep/gamegroup/absBase/AppActivity.java
  8. 95 0
      app/src/main/java/com/sheep/gamegroup/absBase/BaseActivity.java
  9. 22 0
      app/src/main/java/com/sheep/gamegroup/absBase/BaseUMActivity.java
  10. 19 0
      app/src/main/java/com/sheep/gamegroup/exception/ApiException.java
  11. 26 0
      app/src/main/java/com/sheep/gamegroup/exception/ERROR.java
  12. 75 0
      app/src/main/java/com/sheep/gamegroup/exception/ExceptionEngine.java
  13. 12 0
      app/src/main/java/com/sheep/gamegroup/exception/ServerException.java
  14. 51 12
      app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java
  15. 4 2
      app/src/main/java/com/sheep/gamegroup/model/util/AddPuplicParameIntercept.java
  16. 19 0
      app/src/main/java/com/sheep/gamegroup/presenter/AskGetMoneyContract.java
  17. 59 0
      app/src/main/java/com/sheep/gamegroup/presenter/AskGetMoneyPresenter.java
  18. 2 1
      app/src/main/java/com/sheep/gamegroup/presenter/BindDataPresenter.java
  19. 3 2
      app/src/main/java/com/sheep/gamegroup/presenter/HomePagePresenter.java
  20. 4 2
      app/src/main/java/com/sheep/gamegroup/presenter/LoginContract.java
  21. 62 0
      app/src/main/java/com/sheep/gamegroup/presenter/LoginPresenter.java
  22. 3 2
      app/src/main/java/com/sheep/gamegroup/presenter/PersonalCenterPresenter.java
  23. 3 1
      app/src/main/java/com/sheep/gamegroup/presenter/PhoneContract.java
  24. 4 1
      app/src/main/java/com/sheep/gamegroup/presenter/PhonePresenter.java
  25. 2 1
      app/src/main/java/com/sheep/gamegroup/presenter/TryMakeMoneyPresenter.java
  26. 2 1
      app/src/main/java/com/sheep/gamegroup/presenter/WithdrawalPresenter.java
  27. 110 0
      app/src/main/java/com/sheep/gamegroup/util/FastJsonUtils.java
  28. 65 0
      app/src/main/java/com/sheep/gamegroup/util/G.java
  29. 18 2
      app/src/main/java/com/sheep/gamegroup/util/Jump2View.java
  30. 11 0
      app/src/main/java/com/sheep/gamegroup/util/Parmameter.java
  31. 66 0
      app/src/main/java/com/sheep/gamegroup/util/SpUtils.java
  32. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/AccountAndSecurityAct.java
  33. 24 5
      app/src/main/java/com/sheep/gamegroup/view/activity/AskGetMoneyAct.java
  34. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/AskRewardAct.java
  35. 1 1
      app/src/main/java/com/sheep/gamegroup/view/activity/AuthenticationAct.java
  36. 5 5
      app/src/main/java/com/sheep/gamegroup/view/activity/BindDataAct.java
  37. 2 2
      app/src/main/java/com/sheep/gamegroup/view/activity/BindOrChangeWeixinAct.java
  38. 2 1
      app/src/main/java/com/sheep/gamegroup/view/activity/FriendAndRewardAct.java
  39. 4 4
      app/src/main/java/com/sheep/gamegroup/view/activity/HomePageAct.java
  40. 81 66
      app/src/main/java/com/sheep/gamegroup/view/activity/LoginAct.java
  41. 2 1
      app/src/main/java/com/sheep/gamegroup/view/activity/PersionInfoAct.java
  42. 3 4
      app/src/main/java/com/sheep/gamegroup/view/activity/PersonalCenterAct.java
  43. 13 21
      app/src/main/java/com/sheep/gamegroup/view/activity/PhoneAct.java
  44. 5 5
      app/src/main/java/com/sheep/gamegroup/view/activity/SplashAct.java
  45. 8 9
      app/src/main/java/com/sheep/gamegroup/view/activity/TryMakeMoneyact.java
  46. 5 6
      app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalAct.java
  47. 3 2
      app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalResultAct.java
  48. 2 1
      app/src/main/java/com/sheep/gamegroup/view/adapter/WithdrawalAdapter.java
  49. 3 0
      app/src/main/java/com/sheep/gamegroup/view/customview/TextProgressBar.java
  50. 54 9
      app/src/main/res/layout/login_act_layout.xml
  51. BIN=BIN
      app/src/main/res/mipmap-hdpi/you_hui_wan_pop_bg.png
  52. BIN=BIN
      app/src/main/res/mipmap-xhdpi/arrow_bottom.png
  53. BIN=BIN
      app/src/main/res/mipmap-xhdpi/arrow_top.png
  54. BIN=BIN
      app/src/main/res/mipmap-xhdpi/bg_bottom_line.png
  55. BIN=BIN
      app/src/main/res/mipmap-xhdpi/bg_default_icon.png
  56. BIN=BIN
      app/src/main/res/mipmap-xhdpi/bg_fail_tip.png
  57. BIN=BIN
      app/src/main/res/mipmap-xhdpi/bg_green.png
  58. BIN=BIN
      app/src/main/res/mipmap-xhdpi/bg_icon_corner.png
  59. BIN=BIN
      app/src/main/res/mipmap-xhdpi/bg_rect.png
  60. BIN=BIN
      app/src/main/res/mipmap-xhdpi/btn_back_normal.png
  61. BIN=BIN
      app/src/main/res/mipmap-xhdpi/btn_clear.png
  62. BIN=BIN
      app/src/main/res/mipmap-xhdpi/btn_query_condition_left_ing.png
  63. BIN=BIN
      app/src/main/res/mipmap-xhdpi/btn_search.png
  64. BIN=BIN
      app/src/main/res/mipmap-xhdpi/h1.png
  65. BIN=BIN
      app/src/main/res/mipmap-xhdpi/icon_category_game.png
  66. BIN=BIN
      app/src/main/res/mipmap-xhdpi/icon_category_play.png
  67. BIN=BIN
      app/src/main/res/mipmap-xhdpi/icon_category_theme.png
  68. BIN=BIN
      app/src/main/res/mipmap-xhdpi/icon_timer.png
  69. BIN=BIN
      app/src/main/res/mipmap-xhdpi/line_left.png
  70. BIN=BIN
      app/src/main/res/mipmap-xhdpi/line_right.png
  71. BIN=BIN
      app/src/main/res/mipmap-xhdpi/main_segment1_selected.png
  72. BIN=BIN
      app/src/main/res/mipmap-xhdpi/main_segment2_selected.png
  73. BIN=BIN
      app/src/main/res/mipmap-xhdpi/main_segment3_selected.png
  74. BIN=BIN
      app/src/main/res/mipmap-xhdpi/new_game1.png
  75. BIN=BIN
      app/src/main/res/mipmap-xhdpi/new_game2.png
  76. BIN=BIN
      app/src/main/res/mipmap-xhdpi/play_game.png
  77. BIN=BIN
      app/src/main/res/mipmap-xhdpi/rank_1_bg.png
  78. BIN=BIN
      app/src/main/res/mipmap-xhdpi/rank_1_img.png
  79. BIN=BIN
      app/src/main/res/mipmap-xhdpi/rank_2_img.png
  80. BIN=BIN
      app/src/main/res/mipmap-xhdpi/rank_3_img.png
  81. BIN=BIN
      app/src/main/res/mipmap-xhdpi/rb_star_full.png
  82. BIN=BIN
      app/src/main/res/mipmap-xhdpi/rb_star_half.png
  83. BIN=BIN
      app/src/main/res/mipmap-xhdpi/tab_category.png
  84. BIN=BIN
      app/src/main/res/mipmap-xhdpi/tab_order.png
  85. BIN=BIN
      app/src/main/res/mipmap-xhdpi/tab_recommend.png
  86. BIN=BIN
      app/src/main/res/mipmap-xhdpi/tab_selected_left.png
  87. BIN=BIN
      app/src/main/res/mipmap-xhdpi/tab_selected_right.png
  88. BIN=BIN
      app/src/main/res/mipmap-xhdpi/tab_sole.png
  89. BIN=BIN
      app/src/main/res/mipmap-xhdpi/try_dialog_bg.png
  90. BIN=BIN
      app/src/main/res/mipmap-xhdpi/try_dialog_x.png
  91. BIN=BIN
      app/src/main/res/mipmap-xhdpi/x_ic_login_qq.png
  92. BIN=BIN
      app/src/main/res/mipmap-xhdpi/x_ic_login_wx.png
  93. BIN=BIN
      app/src/main/res/mipmap-xxhdpi/bg_default_icon.png
  94. BIN=BIN
      app/src/main/res/mipmap-xxhdpi/bg_green.png
  95. BIN=BIN
      app/src/main/res/mipmap-xxhdpi/bg_icon_corner.png
  96. BIN=BIN
      app/src/main/res/mipmap-xxhdpi/bg_rect.png
  97. BIN=BIN
      app/src/main/res/mipmap-xxhdpi/btn_back_normal.png
  98. BIN=BIN
      app/src/main/res/mipmap-xxhdpi/btn_clear.png
  99. BIN=BIN
      app/src/main/res/mipmap-xxhdpi/btn_search.png
  100. 0 0
      app/src/main/res/mipmap-xxhdpi/h1.png

+ 7 - 6
app/build.gradle

@@ -47,6 +47,12 @@ android {
             signingConfig signingConfigs.config
         }
     }
+
+
+    dexOptions {
+        preDexLibraries  false
+        javaMaxHeapSize "4g"
+    }
 }
 
 repositories {
@@ -56,15 +62,10 @@ repositories {
     google()
 }
 
-dependencies {
-
-    //    compile fileTree(include: ['*.jar'], dir: 'libs')
 
-    //    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
 
-    //        exclude group: 'com.android.support', module: 'support-annotations'
+dependencies {
 
-    //    })
     compile 'com.android.support:appcompat-v7:27.0.2'
     compile 'com.android.support:support-v4:27.0.2'
     compile 'com.android.support:design:27.0.2'

+ 41 - 121
app/src/main/AndroidManifest.xml

@@ -18,7 +18,7 @@
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
     <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
-    <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"/>
+    <!--<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"/>-->
 
 
     <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
@@ -42,69 +42,25 @@
         tools:ignore="ProtectedPermissions"/>
 
     <application
-        android:name=".SheepApp"
+        android:name="com.sheep.gamegroup.SheepApp"
         android:allowBackup="true"
         android:icon="@drawable/icon"
         android:label="@string/app_name"
         android:supportsRtl="true"
         android:theme="@style/AppTheme">
 
-        <activity
-            android:name=".wxapi.WXEntryActivity"
-            android:exported="true"
-            android:launchMode="singleTop"/>
-        <activity
-            android:name=".page.MainActivity"
-            android:exported="true"
-            android:launchMode="singleTask"
-            android:screenOrientation="portrait">
-        </activity>
-        <activity
-            android:name=".floatwindow.FloatWindow"
-            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
-        <activity
-            android:name=".page.ShotScreenActivity"
-            android:exported="true"
-            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
-        <activity
-            android:name=".page.UserCenterActivity"
-            android:screenOrientation="portrait"/>
-        <activity
-            android:name=".page.WithdrawActivity"
-            android:screenOrientation="portrait"/>
-        <activity
-            android:name=".page.WxAccountDetail"
-            android:screenOrientation="portrait"/>
-        <activity
-            android:name=".page.LoginActivity"
-            android:screenOrientation="portrait">
-
-        </activity>
 
-        <service
-            android:name=".floatwindow.FloatService"
-            android:enabled="true"
-            android:exported="true">
-        </service>
+        <!--<provider-->
+            <!--android:name=".provider.SheepFileProvider"-->
+            <!--android:authorities="${applicationId}.fileprovider"-->
+            <!--android:exported="false"-->
+            <!--android:grantUriPermissions="true">-->
 
-        <service
-            android:name=".service.DownloadService"
-      >
-        </service>
-
-
-
-        <provider
-            android:name=".provider.SheepFileProvider"
-            android:authorities="${applicationId}.fileprovider"
-            android:exported="false"
-            android:grantUriPermissions="true">
-
-            <!-- 元数据 -->
-            <meta-data
-                android:name="android.support.FILE_PROVIDER_PATHS"
-                android:resource="@xml/file_paths"/>
-        </provider>
+            <!--&lt;!&ndash; 元数据 &ndash;&gt;-->
+            <!--<meta-data-->
+                <!--android:name="android.support.FILE_PROVIDER_PATHS"-->
+                <!--android:resource="@xml/file_paths"/>-->
+        <!--</provider>-->
 
 
 
@@ -126,61 +82,8 @@
 
         </provider>
 
-        <activity
-            android:name=".page.BindWxActivity"
-            android:screenOrientation="portrait"/>
-        <activity
-            android:name=".page.RegisterActivity"
-            android:screenOrientation="portrait"/>
-        <activity
-            android:name=".page.TaskRecordActivity"
-            android:screenOrientation="portrait"/>
-        <activity
-            android:name=".page.WithdrawRecordActivity"
-            android:screenOrientation="portrait"/>
-        <activity
-            android:name=".page.WebActivity"
-            android:screenOrientation="portrait"/>
-
-        <activity
-            android:name=".page.MoneyHistroyActivity"
-            android:screenOrientation="portrait"/>
-        <activity
-            android:name=".page.NewUserGuideActivity"
-            android:screenOrientation="portrait"/>
-        <activity
-            android:name=".page.WXAccountActivity"
-            android:screenOrientation="portrait"/>
-
-        <activity
-            android:name=".page.InputWXAccountActivity"
-            android:screenOrientation="portrait"/>
-        <activity android:name=".page.GameDetailActivity"/>
-
-        <activity
-            android:name=".page.XDownLoadActivity"
-            android:screenOrientation="portrait"/>
-
-        <activity
-            android:name=".page.ResetPWDActivity"
-            android:screenOrientation="portrait"/>
-
-
-        <activity
-            android:name=".page.AskFriendActivity"
-            android:screenOrientation="portrait"/>
-
-        <activity
-            android:name=".page.BindPhoneActivity"
-            android:screenOrientation="portrait"/>
 
         <activity
-            android:name=".page.SplashActivity"
-            android:screenOrientation="portrait">
-
-
-        </activity>
-        <activity
             android:name="com.sheep.gamegroup.view.activity.AskRewardAct"
             android:screenOrientation="portrait">
 
@@ -205,6 +108,11 @@
             </intent-filter>
             </activity>
 
+        <activity
+            android:name="com.sheep.jiuyan.samllsheep.wxapi.WXEntryActivity"
+            android:exported="true"
+            android:launchMode="singleTop"/>
+
         <activity android:name="com.sheep.gamegroup.view.activity.PhoneAct"/>
         <activity android:name="com.sheep.gamegroup.view.activity.PersonalCenterAct"/>
         <activity android:name="com.sheep.gamegroup.view.activity.WithdrawalAct"/>
@@ -214,23 +122,35 @@
         <activity android:name="com.sheep.gamegroup.view.activity.HomePageAct"/>
         <activity android:name="com.sheep.gamegroup.view.activity.BindDataAct"/>
 
-        <service android:name=".service.TopService"
-                 android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
-            >
-            <intent-filter>
-                <action android:name="android.accessibilityservice.AccessibilityService"/>
-            </intent-filter>
-            <meta-data
-                android:name="android.accessibilityservice"
-                android:resource="@xml/accessibility"
-                />
-        </service>
+        <activity android:name="com.sheep.gamegroup.view.activity.AskGetMoneyAct"/>
 
         <!--友盟start-->
         <meta-data
             android:name="UMENG_APPKEY"
-            android:value="58edcfeb310c93091c000be2"></meta-data>
+            android:value="5ab0a1da8f4a9d742900035f"></meta-data>
         <meta-data android:value="xxx" android:name="UMENG_CHANNEL"/>
+
+        <activity
+            android:name="com.tencent.tauth.AuthActivity"
+            android:launchMode="singleTask"
+            android:noHistory="true" >
+
+            <intent-filter>
+                <action android:name="android.intent.action.VIEW" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.BROWSABLE" />
+                <data android:scheme="tencent101461115" />
+            </intent-filter>
+
+        </activity>
+
+        <activity
+            android:name="com.tencent.connect.common.AssistActivity"
+            android:screenOrientation="portrait"
+            android:theme="@android:style/Theme.Translucent.NoTitleBar"
+            android:configChanges="orientation|keyboardHidden|screenSize"/>
+
+
         <!--友盟end-->
     </application>
 

+ 33 - 0
app/src/main/java/com/sheep/gamegroup/BaseApplication.java

@@ -0,0 +1,33 @@
+package com.sheep.gamegroup;
+
+
+import android.support.multidex.MultiDexApplication;
+
+import com.umeng.commonsdk.UMConfigure;
+import com.umeng.socialize.PlatformConfig;
+import com.umeng.socialize.UMShareAPI;
+import com.uuzuche.lib_zxing.activity.ZXingLibrary;
+
+import org.xutils.BuildConfig;
+import org.xutils.x;
+
+/**
+ * Created by Administrator on 2018/1/19.
+ */
+
+public class BaseApplication extends MultiDexApplication {
+
+    @Override
+    public void onCreate() {
+        super.onCreate();
+        x.Ext.init(this);
+        x.Ext.setDebug(BuildConfig.DEBUG); // 是否输出debug日志, 开启debug会影响性能.
+        ZXingLibrary.initDisplayOpinion(this);
+        UMConfigure.setLogEnabled(true);
+        UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, "5ab0a1da8f4a9d742900035f");
+
+        UMShareAPI.get(this);
+        PlatformConfig.setWeixin("wx2be7f59bb7bb963f", "6cf7ca0f6c6ac97c6961d901fee8adb9");
+        PlatformConfig.setQQZone("101461115", "b874bc950bcf066f17fd52cf2bb959e9");
+    }
+}

+ 13 - 0
app/src/main/java/com/sheep/gamegroup/IBase/IBasePresenter.java

@@ -0,0 +1,13 @@
+package com.sheep.gamegroup.IBase;
+
+import java.util.HashMap;
+
+/**
+ * Created by Administrator on 2018/3/21.
+ */
+
+public interface IBasePresenter {
+
+    void getTask(HashMap<String, Object> map);
+
+}

+ 12 - 0
app/src/main/java/com/sheep/gamegroup/IBase/IBaseView.java

@@ -0,0 +1,12 @@
+package com.sheep.gamegroup.IBase;
+
+/**
+ * Created by Administrator on 2018/3/21.
+ */
+
+public interface IBaseView {
+
+    void  NetSuccess(int code, String msg);
+    void  NetError(int code, String errorMsg);
+
+}

+ 125 - 0
app/src/main/java/com/sheep/gamegroup/SheepApp.java

@@ -0,0 +1,125 @@
+package com.sheep.gamegroup;
+
+import android.app.Activity;
+import android.app.Application;
+import android.content.Context;
+import android.os.Bundle;
+import android.support.multidex.MultiDex;
+import android.util.DisplayMetrics;
+
+import com.liulishuo.filedownloader.FileDownloader;
+import com.sheep.gamegroup.BaseApplication;
+import com.sheep.gamegroup.di.components.DaggerNetComponent;
+import com.sheep.gamegroup.di.components.NetComponent;
+import com.sheep.gamegroup.di.modules.NetModule;
+import com.sheep.gamegroup.util.G;
+import com.sheep.gamegroup.util.Parmameter;
+
+import com.tencent.bugly.Bugly;
+import com.tencent.mm.opensdk.openapi.IWXAPI;
+import com.tencent.mm.opensdk.openapi.WXAPIFactory;
+import com.umeng.commonsdk.UMConfigure;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by kemllor on 2017/12/21.
+ */
+
+public class SheepApp extends BaseApplication {
+
+    public static Context mContext;
+    public static IWXAPI mWxapi;
+    public static SheepApp mSheepApp;
+
+    public static Map<String, Activity> mActivitys;
+
+    private NetComponent netComponent;
+
+    public static SheepApp get(Context context){
+        return (SheepApp) context.getApplicationContext();
+    }
+
+    @Override
+    public void onCreate() {
+        super.onCreate();
+        mContext = getApplicationContext();
+        FileDownloader.setup(this);
+        mSheepApp = this;
+        registerActivityLifecycleCallbacks(activityLifecycleCallbacks);
+        initGoble();
+        Bugly.init(getApplicationContext(), Parmameter.BUGLY_APPID, true);
+
+        //友盟
+        UMConfigure.init(this, UMConfigure.DEVICE_TYPE_PHONE, "xxxxx");
+
+        initNet();
+    }
+
+    private void initNet() {
+        netComponent = DaggerNetComponent.builder()
+                .netModule(new NetModule())
+                .build();
+    }
+
+    /**
+     * 初始化系统常用参数
+     */
+    private void initGoble() {
+        DisplayMetrics metric = getResources().getDisplayMetrics();
+        G.HEIGHT = metric.heightPixels;
+        G.WIDTH = metric.widthPixels;
+        G.DENSITY = metric.density;
+    }
+
+    public int mActivityAount;
+    /**
+     * Activity 生命周期监听,用于监控app前后台状态切换
+     */
+    ActivityLifecycleCallbacks activityLifecycleCallbacks = new ActivityLifecycleCallbacks() {
+        @Override
+        public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
+        }
+
+        @Override
+        public void onActivityStarted(Activity activity) {
+            mActivityAount++;
+        }
+
+        @Override
+        public void onActivityResumed(Activity activity) {
+        }
+
+        @Override
+        public void onActivityPaused(Activity activity) {
+        }
+
+        @Override
+        public void onActivityStopped(Activity activity) {
+            mActivityAount--;
+        }
+
+        @Override
+        public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
+        }
+
+        @Override
+        public void onActivityDestroyed(Activity activity) {
+        }
+    };
+
+    public NetComponent getNetComponent(){
+        return netComponent;
+    }
+
+    public static SheepApp getInstance(){
+        return mSheepApp;
+    }
+
+    @Override
+    protected void attachBaseContext(Context base) {
+        super.attachBaseContext(base);
+        MultiDex.install(this);
+    }
+}

+ 50 - 0
app/src/main/java/com/sheep/gamegroup/absBase/AppActivity.java

@@ -0,0 +1,50 @@
+package com.sheep.gamegroup.absBase;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v7.app.AppCompatActivity;
+
+import com.sheep.gamegroup.SheepApp;
+
+import org.greenrobot.eventbus.EventBus;
+
+/**
+ * Created by Administrator on 2018/1/7.
+ */
+
+public class AppActivity extends AppCompatActivity{
+    private String mName;
+
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        mName = this.getClass().getSimpleName();
+//        SheepApp.mActivitys.put(mName, this);
+    }
+    @Override
+    protected void onResume() {
+        super.onResume();
+
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+//        SheepApp.mActivitys.remove(mName);
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+
+    }
+
+
+}

+ 95 - 0
app/src/main/java/com/sheep/gamegroup/absBase/BaseActivity.java

@@ -0,0 +1,95 @@
+package com.sheep.gamegroup.absBase;
+
+import android.app.ProgressDialog;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.view.KeyEvent;
+import android.widget.Toast;
+
+import butterknife.ButterKnife;
+
+/**
+ * Created by kemllor on 2017/12/15.
+ */
+
+public abstract class BaseActivity extends AppActivity  {
+
+    protected ProgressDialog  mPd;
+
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(getLayoutId());
+        ButterKnife.bind(this);
+        initView();
+        initListener();
+        initData();
+
+    }
+
+    protected void  showProgress(){
+        if(mPd!=null){
+            hideProgress();
+        }
+        mPd = new ProgressDialog(this);
+//        View view= LayoutInflater.from(this).inflate(R.layout.dialog_layout,null);
+//        mPd.setContentView(view);//自己定义布局
+        mPd.setMessage("数据加载中...");
+        mPd.setCancelable(true);//能否够被取消
+//        mPd.setProgressStyle(ProgressDialog.STYLE_SPINNER);//圆环风格
+        mPd.show();
+    }
+
+
+    protected void  hideProgress(){
+        this.runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                if(mPd!=null){
+                    mPd.dismiss();
+                }
+            }
+        });
+
+    }
+    protected   void  showToast(String msg){
+        this.runOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                Toast.makeText(BaseActivity.this,msg,Toast.LENGTH_LONG).show();
+            }
+        });
+
+
+    }
+
+
+
+
+
+
+
+
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        /*if (BuildConfig.DEBUG)
+            if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
+                Intent intent = Chuck.getLaunchIntent(BaseActivity.this);
+                startActivity(intent);
+                return true;
+            }*/
+        return super.onKeyDown(keyCode, event);
+    }
+
+    protected abstract int getLayoutId();
+
+    public abstract void initView();
+
+    public abstract void initListener();
+
+    public abstract void initData();
+
+
+}

+ 22 - 0
app/src/main/java/com/sheep/gamegroup/absBase/BaseUMActivity.java

@@ -0,0 +1,22 @@
+package com.sheep.gamegroup.absBase;
+
+import android.content.Intent;
+
+
+import com.umeng.socialize.UMShareAPI;
+
+/**
+ * Created by Administrator on 2018/3/21.
+ */
+
+public  abstract  class BaseUMActivity extends BaseActivity {
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
+
+
+    }
+
+}

+ 19 - 0
app/src/main/java/com/sheep/gamegroup/exception/ApiException.java

@@ -0,0 +1,19 @@
+package com.sheep.gamegroup.exception;
+
+/**
+ * Created by Administrator on 2018/3/22.
+ */
+
+public class ApiException  extends  Exception{
+
+
+    public int code;
+    public String message;
+
+    public ApiException(Throwable throwable, int code) {
+        super(throwable);
+        this.code = code;
+
+    }
+}
+

+ 26 - 0
app/src/main/java/com/sheep/gamegroup/exception/ERROR.java

@@ -0,0 +1,26 @@
+package com.sheep.gamegroup.exception;
+
+/**
+ * Created by Administrator on 2018/3/22.
+ */
+
+public class ERROR {
+    /**
+     * 未知错误
+     */
+    public static final int UNKNOWN = 1000;
+    /**
+     * 解析错误
+     */
+    public static final int PARSE_ERROR = 1001;
+    /**
+     * 网络错误
+     */
+    public static final int NETWORD_ERROR = 1002;
+    /**
+     * 协议出错
+     */
+    public static final int HTTP_ERROR = 1003;
+
+
+}

+ 75 - 0
app/src/main/java/com/sheep/gamegroup/exception/ExceptionEngine.java

@@ -0,0 +1,75 @@
+package com.sheep.gamegroup.exception;
+
+import com.alibaba.fastjson.JSONException;
+import com.google.gson.JsonParseException;
+
+
+
+import java.net.ConnectException;
+import java.text.ParseException;
+
+import retrofit2.adapter.rxjava.HttpException;
+
+/**
+ * Created by Administrator on 2018/3/22.
+ */
+
+public class ExceptionEngine {
+
+    //对应HTTP的状态码
+    private static final int UNAUTHORIZED = 401;
+    private static final int FORBIDDEN = 403;
+    private static final int NOT_FOUND = 404;
+    private static final int REQUEST_TIMEOUT = 408;
+    private static final int INTERNAL_SERVER_ERROR = 500;
+    private static final int BAD_GATEWAY = 502;
+    private static final int SERVICE_UNAVAILABLE = 503;
+    private static final int GATEWAY_TIMEOUT = 504;
+    private static final int SMS_ERROR = 422;
+
+    public static ApiException handleException(Throwable e){
+        ApiException ex;
+        if (e instanceof HttpException){             //HTTP错误
+            HttpException httpException = (HttpException) e;
+            ex = new ApiException(e, httpException.code());
+            switch(httpException.code()){
+                case UNAUTHORIZED:
+                case FORBIDDEN:
+                case NOT_FOUND:
+                case REQUEST_TIMEOUT:
+                case GATEWAY_TIMEOUT:
+                case INTERNAL_SERVER_ERROR:
+                case BAD_GATEWAY:
+                case SERVICE_UNAVAILABLE:
+                    ex.message = "网络错误";  //均视为网络错误
+                    break;
+                case  SMS_ERROR:
+                    ex.message = "验证码错误";  //均视为网络错误
+                    break;
+
+
+            }
+            return ex;
+        } else if (e instanceof ServerException){    //服务器返回的错误
+            ServerException resultException = (ServerException) e;
+            ex = new ApiException(resultException, resultException.code);
+            ex.message = resultException.message;
+            return ex;
+        } else if (e instanceof JsonParseException
+                || e instanceof JSONException
+                || e instanceof ParseException){
+            ex = new ApiException(e, ERROR.PARSE_ERROR);
+            ex.message = "解析错误";            //均视为解析错误
+            return ex;
+        }else if(e instanceof ConnectException){
+            ex = new ApiException(e, ERROR.NETWORD_ERROR);
+            ex.message = "连接失败";  //均视为网络错误
+            return ex;
+        }else {
+            ex = new ApiException(e, ERROR.UNKNOWN);
+            ex.message = "未知错误";          //未知错误
+            return ex;
+        }
+    }
+
+}

+ 12 - 0
app/src/main/java/com/sheep/gamegroup/exception/ServerException.java

@@ -0,0 +1,12 @@
+package com.sheep.gamegroup.exception;
+
+/**
+ * Created by Administrator on 2018/3/22.
+ */
+
+public class ServerException extends RuntimeException {
+    public int code;
+    public String message;
+
+
+}

+ 51 - 12
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -21,6 +21,8 @@ import retrofit2.http.QueryMap;
 import retrofit2.http.Streaming;
 import rx.Observable;
 
+import static com.sheep.gamegroup.util.ConnectAddress.*;
+
 /**
  * 暂时没接口
  * Created by ljy on 2018/3/8.
@@ -40,37 +42,37 @@ public interface ApiService {
      * @return
      */
     @Streaming
-    @POST(ConnectAddress.V1+"app/auth/sms_for_login/")
+    @POST(V1+"app/auth/sms_for_login/")
     Observable<BaseMessage> getCaptcha(@Body JSONObject jsonObject);
 
-    @POST(ConnectAddress.V1+"app/auth/login_by_sms/")
+    @POST(V1+"app/auth/login_by_sms/")
     Observable<BaseMessage> loginByCaptcha(@Body com.alibaba.fastjson.JSONObject jsonObject);
 
     /**
      * 获取用户信息
      */
-    @GET(ConnectAddress.V1+"app/user/get_info/")
+    @GET(V1+"app/user/get_info/")
     Observable<BaseMessage> getInfo();
 
     /**
      * 绑定手机号
      */
-    @PUT(ConnectAddress.V1+"app/user/bind_mobile/")
+    @PUT(V1+"app/user/bind_mobile/")
     Observable<BaseMessage> bindMobile(@Query("mobile") String mobile, @Query("sec_code") String sec_code);
     /**
      * 绑定真实姓名
      */
-    @PUT(ConnectAddress.V1+"app/user/bind_real_name/")
+    @PUT(V1+"app/user/bind_real_name/")
     Observable<BaseMessage> bindRealname(@Query("real_name") String real_name);
     /**
      * 绑定身份证号
      */
-    @PUT(ConnectAddress.V1+"app/user/bind_id_number/")
+    @PUT(V1+"app/user/bind_id_number/")
     Observable<BaseMessage> bindIdNumber(@Query("id_number") String id_number);
     /**
      * 绑定银行卡
      */
-    @PUT(ConnectAddress.V1+"app/user/bind_bank_card/")
+    @PUT(V1+"app/user/bind_bank_card/")
     Observable<BaseMessage> bindBankCard(@Query("bank_card") String bank_card);
 
     /**
@@ -79,31 +81,68 @@ public interface ApiService {
      * type "体现渠道 1:微信 2:支付宝 3:手机充值"
      * now only 1:微信
      */
-    @POST(ConnectAddress.V1 + "app/withdraw/")
+    @POST(V1 + "app/withdraw/")
     Observable<BaseMessage> goWithdrawal(@Body JSONObject parame);
 
     /**
      * 提现绑定微信号
      */
-    @GET(ConnectAddress.V1 + "app/user/bind_wx/")
+    @GET(V1 + "app/user/bind_wx/")
     Observable<BaseMessage> bindWeixin(@Query("code") String code);
 
     /**
      * 获取已接受任务
      */
-    @GET(ConnectAddress.V1 + "app/accepted_task/")
+    @GET(V1 + "app/accepted_task/")
     Observable<BaseMessage> acceptedTask(@Query("page") int page, @Query("per_page") int per_page);
 
     /**
      * 获取自己正在运行的任务
      */
-    @GET(ConnectAddress.V1 + "/app/accepted_task/run_task/")
+    @GET(V1 + "/app/accepted_task/run_task/")
     Observable<BaseMessage> returnTask();
 
     /**
      * 获取正在运行的任务
      */
-    @GET(ConnectAddress.V1 + "/app/release_task/")
+    @GET(V1 + "/app/release_task/")
     Observable<BaseMessage> releaseTask();
 
+
+    /**
+     * 获取正在运行的任务
+     * @param jsonObject
+     */
+    @GET(V1+"/app/auth/login_by_we_chat")
+    Observable<BaseMessage> LoginByWX(@Body com.alibaba.fastjson.JSONObject jsonObject);
+
+
+
+    /**
+     * 获取正在运行的任务
+     * @param jsonObject
+     */
+    @GET(V1+"/app/auth/login_by_qq")
+    Observable<BaseMessage> LoginByQQ(@Body com.alibaba.fastjson.JSONObject jsonObject);
+
+
+
+    @GET(V1+" /app/user/friend_count_and_award")
+    Observable<BaseMessage> FriendCountAndAward();
+
+
+
+
+//    /**
+//     * 邀请赚钱
+//     */
+//    @GET(V1+"/app/auth/login_by_we_chat")
+//    Observable<BaseMessage> askMakeMoney(@Body JSONObject jsonObject);
+    /**
+     * 用户提现记录
+     */
+    @GET(V1 + "app/withdraw/")
+    Observable<BaseMessage> goWithdrawal(@Query("page") int page, @Query("per_page") int per_page, @Query("start_time ") String start_time , @Query("end_time ") String end_time );
+
+
 }

+ 4 - 2
app/src/main/java/com/sheep/gamegroup/model/util/AddPuplicParameIntercept.java

@@ -1,7 +1,9 @@
 package com.sheep.gamegroup.model.util;
 
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+
+
+import com.sheep.gamegroup.SheepApp;
+import com.sheep.gamegroup.util.SpUtils;
 
 import java.io.IOException;
 

+ 19 - 0
app/src/main/java/com/sheep/gamegroup/presenter/AskGetMoneyContract.java

@@ -0,0 +1,19 @@
+package com.sheep.gamegroup.presenter;
+
+import com.sheep.gamegroup.IBase.IBasePresenter;
+import com.sheep.gamegroup.IBase.IBaseView;
+
+/**
+ * Created by Administrator on 2018/3/10.
+ */
+
+public interface AskGetMoneyContract {
+
+    interface Presenter extends IBasePresenter{
+
+    }
+
+    interface View extends IBaseView{
+
+    }
+}

+ 59 - 0
app/src/main/java/com/sheep/gamegroup/presenter/AskGetMoneyPresenter.java

@@ -0,0 +1,59 @@
+package com.sheep.gamegroup.presenter;
+
+import android.util.Log;
+
+import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.exception.ExceptionEngine;
+import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.util.Parmameter;
+
+import java.util.HashMap;
+
+import javax.inject.Inject;
+
+import rx.Observer;
+import rx.schedulers.Schedulers;
+
+/**
+ * Created by Administrator on 2018/3/10.
+ */
+
+public class AskGetMoneyPresenter implements AskGetMoneyContract.Presenter {
+    private AskGetMoneyContract.View view;
+    private ApiService apiService;
+
+    @Inject
+    public AskGetMoneyPresenter(AskGetMoneyContract.View view, ApiService apiService) {
+        this.view = view;
+        this.apiService = apiService;
+    }
+
+
+    @Override
+    public void getTask(HashMap<String, Object> map) {
+
+        apiService.FriendCountAndAward()
+                .subscribeOn(Schedulers.io())
+                .subscribe(new Observer<BaseMessage>() {
+                    @Override
+                    public void onCompleted() {
+                        Log.e("onCompleted--------","onCompleted");
+
+                    }
+
+                    @Override
+                    public void onError(Throwable throwable) {
+                        Log.e("onError--------","onError:"+throwable);
+                         view.NetError(-1,ExceptionEngine.handleException(throwable).getMessage());
+                    }
+
+                    @Override
+                    public void onNext(BaseMessage baseMessage) {
+
+                    }
+                });
+
+
+    }
+}

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/presenter/BindDataPresenter.java

@@ -1,10 +1,11 @@
 package com.sheep.gamegroup.presenter;
 
+import com.sheep.gamegroup.SheepApp;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.util.ExceptionHandle;
 import com.sheep.gamegroup.model.util.MySubscriber;
-import com.sheep.jiuyan.samllsheep.SheepApp;
+
 
 import javax.inject.Inject;
 

+ 3 - 2
app/src/main/java/com/sheep/gamegroup/presenter/HomePagePresenter.java

@@ -2,10 +2,11 @@ package com.sheep.gamegroup.presenter;
 
 import android.util.Log;
 
+import com.sheep.gamegroup.SheepApp;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+import com.sheep.gamegroup.util.SpUtils;
+
 
 import javax.inject.Inject;
 

+ 4 - 2
app/src/main/java/com/sheep/gamegroup/presenter/LoginContract.java

@@ -1,5 +1,7 @@
 package com.sheep.gamegroup.presenter;
 
+import com.sheep.gamegroup.IBase.IBaseView;
+
 /**
  * Created by Administrator on 2018/3/10.
  */
@@ -7,10 +9,10 @@ package com.sheep.gamegroup.presenter;
 public interface LoginContract {
 
     interface Presenter{
-
+        void logByAuther(int type,String access_token,String openid);
     }
 
-    interface View{
+    interface View extends IBaseView{
 
     }
 }

+ 62 - 0
app/src/main/java/com/sheep/gamegroup/presenter/LoginPresenter.java

@@ -1,9 +1,19 @@
 package com.sheep.gamegroup.presenter;
 
+import android.widget.Toast;
+
 import com.sheep.gamegroup.model.api.ApiService;
+import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.util.FastJsonUtils;
+
+import java.util.HashMap;
+import java.util.Map;
 
 import javax.inject.Inject;
 
+import rx.Observer;
+import rx.schedulers.Schedulers;
+
 /**
  * Created by Administrator on 2018/3/10.
  */
@@ -17,4 +27,56 @@ public class LoginPresenter implements LoginContract.Presenter {
         this.view = view;
         this.apiService = apiService;
     }
+
+
+    @Override
+    public void logByAuther(int type, String access_token, String openid) {
+        com.alibaba.fastjson.JSONObject j = new com.alibaba.fastjson.JSONObject();
+        j.put("code",access_token);
+        j.put("username",openid);
+        j.put("scope","");
+        if(type==1){
+            apiService.LoginByWX(j).subscribeOn(Schedulers.io())
+                    .subscribe(new Observer<BaseMessage>() {
+                        @Override
+                        public void onCompleted() {
+
+                        }
+
+                        @Override
+                        public void onError(Throwable throwable) {
+                            view.NetError(-1,throwable.getMessage().toString());
+                        }
+
+                        @Override
+                        public void onNext(BaseMessage baseMessage) {
+                            view.NetSuccess(1,baseMessage.getMsg());
+
+                        }
+                    });
+
+        }else{
+            apiService.LoginByQQ(j).subscribeOn(Schedulers.io())
+                    .subscribe(new Observer<BaseMessage>() {
+                        @Override
+                        public void onCompleted() {
+
+                        }
+
+                        @Override
+                        public void onError(Throwable throwable) {
+                            view.NetError(-1,throwable.getMessage().toString());
+                        }
+
+                        @Override
+                        public void onNext(BaseMessage baseMessage) {
+                            view.NetSuccess(1,baseMessage.getMsg());
+
+                        }
+                    });
+
+        }
+
+
+    }
 }

+ 3 - 2
app/src/main/java/com/sheep/gamegroup/presenter/PersonalCenterPresenter.java

@@ -2,10 +2,11 @@ package com.sheep.gamegroup.presenter;
 
 import android.util.Log;
 
+import com.sheep.gamegroup.SheepApp;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+import com.sheep.gamegroup.util.SpUtils;
+
 
 import javax.inject.Inject;
 

+ 3 - 1
app/src/main/java/com/sheep/gamegroup/presenter/PhoneContract.java

@@ -1,5 +1,7 @@
 package com.sheep.gamegroup.presenter;
 
+import com.sheep.gamegroup.exception.ApiException;
+
 import org.json.JSONException;
 
 /**
@@ -19,6 +21,6 @@ public interface PhoneContract {
 
         void returnLogindata(Object o);
 
-        void loginFail(Object o);
+        void loginFail(ApiException o);
     }
 }

+ 4 - 1
app/src/main/java/com/sheep/gamegroup/presenter/PhonePresenter.java

@@ -5,6 +5,7 @@ import android.util.Log;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.annotation.JSONField;
 import com.orhanobut.logger.Logger;
+import com.sheep.gamegroup.exception.ExceptionEngine;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseEntity;
 import com.sheep.gamegroup.model.entity.BaseMessage;
@@ -18,6 +19,7 @@ import java.util.Map;
 
 import javax.inject.Inject;
 
+import io.reactivex.android.schedulers.AndroidSchedulers;
 import rx.Observable;
 import rx.Observer;
 import rx.functions.Func0;
@@ -84,6 +86,7 @@ public class PhonePresenter implements PhoneContract.Presenter {
         com.alibaba.fastjson.JSONObject m = new com.alibaba.fastjson.JSONObject();
         m.put("account",telphone);
         m.put("sec_code",code);
+
         apiService.loginByCaptcha(m)
                 .subscribeOn(Schedulers.io())
                 .subscribe(new Observer<BaseMessage>() {
@@ -96,7 +99,7 @@ public class PhonePresenter implements PhoneContract.Presenter {
                     @Override
                     public void onError(Throwable throwable) {
                         Log.e("onError--------","onError:"+throwable);
-                        view.loginFail(null);
+                        view.loginFail(ExceptionEngine.handleException(throwable));
                     }
 
                     @Override

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/presenter/TryMakeMoneyPresenter.java

@@ -1,11 +1,12 @@
 package com.sheep.gamegroup.presenter;
 
+import com.sheep.gamegroup.SheepApp;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.RequestParameEty;
 import com.sheep.gamegroup.model.util.ExceptionHandle;
 import com.sheep.gamegroup.model.util.MySubscriber;
-import com.sheep.jiuyan.samllsheep.SheepApp;
+
 
 import javax.inject.Inject;
 

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/presenter/WithdrawalPresenter.java

@@ -1,11 +1,12 @@
 package com.sheep.gamegroup.presenter;
 
 import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.SheepApp;
 import com.sheep.gamegroup.model.api.ApiService;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.util.ExceptionHandle;
 import com.sheep.gamegroup.model.util.MySubscriber;
-import com.sheep.jiuyan.samllsheep.SheepApp;
+
 
 import javax.crypto.ExemptionMechanismException;
 import javax.inject.Inject;

+ 110 - 0
app/src/main/java/com/sheep/gamegroup/util/FastJsonUtils.java

@@ -0,0 +1,110 @@
+package com.sheep.gamegroup.util;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.JSONLibDataFormatSerializer;
+import com.alibaba.fastjson.serializer.SerializeConfig;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+
+import org.xutils.common.util.KeyValue;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * fastjson工具类
+ * @version:1.0.0
+ */
+public class FastJsonUtils{
+
+    private static final SerializeConfig config;
+
+    static {
+        config = new SerializeConfig();
+        config.put(java.util.Date.class, new JSONLibDataFormatSerializer()); // 使用和json-lib兼容的日期输出格式
+        config.put(java.sql.Date.class, new JSONLibDataFormatSerializer()); // 使用和json-lib兼容的日期输出格式
+    }
+
+    private static final SerializerFeature[] features = {SerializerFeature.WriteMapNullValue, // 输出空置字段
+            SerializerFeature.WriteNullListAsEmpty, // list字段如果为null,输出为[],而不是null
+            SerializerFeature.WriteNullNumberAsZero, // 数值字段如果为null,输出为0,而不是null
+            SerializerFeature.WriteNullBooleanAsFalse, // Boolean字段如果为null,输出为false,而不是null
+            SerializerFeature.WriteNullStringAsEmpty // 字符类型字段如果为null,输出为"",而不是null
+    };
+
+
+    public static String toJSONString(Object object) {
+        return JSON.toJSONString(object, config, features);
+    }
+
+    public static String toJSONNoFeatures(Object object) {
+        return JSON.toJSONString(object, config);
+    }
+
+
+
+    public static Object toBean(String text) {
+        return JSON.parse(text);
+    }
+
+    public static <T> T toBean(String text, Class<T> clazz) {
+        return JSON.parseObject(text, clazz);
+    }
+
+    // 转换为数组
+    public static <T> Object[] toArray(String text) {
+        return toArray(text, null);
+    }
+
+    // 转换为数组
+    public static <T> Object[] toArray(String text, Class<T> clazz) {
+        return JSON.parseArray(text, clazz).toArray();
+    }
+
+    // 转换为List
+    public static <T> List<T> toList(String text, Class<T> clazz) {
+        return JSON.parseArray(text, clazz);
+    }
+
+    /**
+     * 将javabean转化为序列化的json字符串
+     * @param keyvalue
+     * @return
+     */
+    public static Object beanToJson(KeyValue keyvalue) {
+        String textJson = JSON.toJSONString(keyvalue);
+        Object objectJson  = JSON.parse(textJson);
+        return objectJson;
+    }
+
+    /**
+     * 将string转化为序列化的json字符串
+     * @param
+     * @return
+     */
+    public static Object textToJson(String text) {
+        Object objectJson  = JSON.parse(text);
+        return objectJson;
+    }
+
+    /**
+     * json字符串转化为map
+     * @param s
+     * @return
+     */
+    public static Map stringToCollect(String s) {
+        Map m = JSONObject.parseObject(s);
+        return m;
+    }
+
+    /**
+     * 将map转化为string
+     * @param m
+     * @return
+     */
+    public static String collectToString(Map m) {
+        String s = JSONObject.toJSONString(m);
+        return s;
+    }
+
+}

+ 65 - 0
app/src/main/java/com/sheep/gamegroup/util/G.java

@@ -0,0 +1,65 @@
+package com.sheep.gamegroup.util;
+
+import android.content.Context;
+import android.view.Gravity;
+import android.view.ViewGroup;
+import android.widget.TextView;
+import android.widget.Toast;
+
+
+
+/**
+ * Created by Dlg on 2015/6/17.
+ */
+public class G {
+
+    private static Toast mToast;//全局的Toast
+    public static int HEIGHT = 1280;//屏幕高
+    public static int WIDTH = 720;//屏幕宽
+    public static float DENSITY = 2;//屏幕的Density
+
+    /**
+     * @param str
+     * @param defaultstr
+     * @return 如果str为null或者长度为零,返回defaultstr,否则返回str
+     */
+    public static final String getString(String str, String defaultstr) {
+        return str == null || str.length() < 1 ? defaultstr : str;
+    }
+
+
+    /**
+     * 返回像素值
+     *
+     * @param dp 将转换的dp值
+     * @return 返回像素植
+     */
+    public static int getRealPix(int dp) {
+        return (int) (dp * G.DENSITY);
+    }
+
+
+    /**
+     * 全局的Toast
+     *
+     * @param context
+     * @param msg      显示的msg,如果为null或者空表示取消显示
+     * @param duration 显示的时长
+     */
+    public static void showToast(Context context, String msg, int duration) {
+        if (mToast == null) {
+            mToast = Toast.makeText(context, msg, duration);
+            mToast.setGravity(Gravity.CENTER, 0, getRealPix(200));//居中靠下
+            if (mToast.getView() instanceof ViewGroup
+                    && ((ViewGroup) mToast.getView()).getChildAt(0) instanceof TextView) {
+                ((TextView) ((ViewGroup) mToast.getView()).getChildAt(0)).setSingleLine(false);
+            }
+        } else if (msg == null || msg.equals(""))
+            mToast.cancel();
+        else {
+            mToast.setText(msg);
+        }
+        mToast.show();
+    }
+
+}

+ 18 - 2
app/src/main/java/com/sheep/gamegroup/util/Jump2View.java

@@ -3,6 +3,7 @@ package com.sheep.gamegroup.util;
 import android.content.Context;
 import android.content.Intent;
 
+import com.sheep.gamegroup.view.activity.AskGetMoneyAct;
 import com.sheep.gamegroup.view.activity.AuthenticationAct;
 import com.sheep.gamegroup.view.activity.BindDataAct;
 import com.sheep.gamegroup.view.activity.BindOrChangeWeixinAct;
@@ -64,9 +65,8 @@ public class Jump2View {
     /**
      * 跳到手机登录页面
      * @param context
-     * @param o
      */
-    public void goPhoneLoginView(Context context, Object o){
+    public void goPhoneLoginView(Context context){
         Intent intent = new Intent(context, PhoneAct.class);
         context.startActivity(intent);
     }
@@ -121,6 +121,19 @@ public class Jump2View {
         context.startActivity(intent);
     }
 
+
+    /**
+     * 邀请赚钱
+     * @param context
+     * @param o
+     */
+    public void goAskGetMoney(Context context, Object o){
+        Intent intent = new Intent(context, AskGetMoneyAct.class);
+        context.startActivity(intent);
+    }
+
+
+
     /**
      * 跳到分享界面
      * @param context
@@ -152,4 +165,7 @@ public class Jump2View {
         context.startActivity(intent);
     }
 
+
+
+
 }

+ 11 - 0
app/src/main/java/com/sheep/gamegroup/util/Parmameter.java

@@ -0,0 +1,11 @@
+package com.sheep.gamegroup.util;
+
+/**
+ * Created by Administrator on 2018/3/22.
+ */
+
+public final  class Parmameter {
+    public static  final   String BUGLY_APPID  = "0dd9 98212c";
+
+
+}

+ 66 - 0
app/src/main/java/com/sheep/gamegroup/util/SpUtils.java

@@ -0,0 +1,66 @@
+package com.sheep.gamegroup.util;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.text.TextUtils;
+
+/**
+ * Created by kemllor on 2017/12/21.
+ */
+
+public class SpUtils {
+
+    public static boolean isLogin(Context context) {
+        SharedPreferences user = context.getSharedPreferences("user", Context.MODE_PRIVATE);
+        String wxOpenId = user.getString("wx_openId", "");
+        return !TextUtils.isEmpty(wxOpenId);
+    }
+
+    public static String getOpenId(Context context) {
+        SharedPreferences user = context.getSharedPreferences("user", Context.MODE_PRIVATE);
+        return user.getString("wx_openId", "");
+    }
+
+    public static void login(Context context, String openId) {
+        SharedPreferences user = context.getSharedPreferences("user", Context.MODE_PRIVATE);
+        SharedPreferences.Editor editor = user.edit();
+        editor.putString("wx_openId", openId);
+        editor.apply();
+    }
+
+
+    public static void setImagePath(Context context, String vaule) {
+        SharedPreferences user = context.getSharedPreferences("user", Context.MODE_PRIVATE);
+        SharedPreferences.Editor editor = user.edit();
+        editor.putString("imagepath", vaule);
+        editor.apply();
+    }
+
+
+    public static String getImagePath(Context context) {
+        SharedPreferences user = context.getSharedPreferences("user", Context.MODE_PRIVATE);
+        return user.getString("imagepath", "");
+    }
+
+
+
+
+
+    public static void saveAppToken(Context context, String vaule) {
+        SharedPreferences user = context.getSharedPreferences("user", Context.MODE_PRIVATE);
+        SharedPreferences.Editor editor = user.edit();
+        editor.putString("apptoken", vaule);
+        editor.apply();
+    }
+
+
+    public static String getAppToken(Context context) {
+        SharedPreferences user = context.getSharedPreferences("user", Context.MODE_PRIVATE);
+        return user.getString("apptoken", "");
+    }
+
+
+
+
+
+}

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/AccountAndSecurityAct.java

@@ -8,8 +8,8 @@ import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
 
 import butterknife.BindView;
 import butterknife.ButterKnife;

+ 24 - 5
app/src/main/java/com/sheep/gamegroup/view/activity/AskGetMoneyAct.java

@@ -5,12 +5,16 @@ import android.view.View;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
+import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.presenter.AskGetMoneyContract;
+import com.sheep.gamegroup.presenter.AskGetMoneyPresenter;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
 import com.umeng.socialize.ShareAction;
 import com.umeng.socialize.UMShareListener;
 import com.umeng.socialize.bean.SHARE_MEDIA;
 
+import javax.inject.Inject;
+
 import butterknife.BindView;
 import butterknife.ButterKnife;
 import butterknife.OnClick;
@@ -19,8 +23,7 @@ import butterknife.OnClick;
  * Created by Administrator on 2018/3/19.
  */
 
-public class AskGetMoneyAct extends BaseActivity  implements UMShareListener {
-
+public class AskGetMoneyAct extends BaseActivity implements UMShareListener ,AskGetMoneyContract.View {
 
     @BindView(R.id.tv_size)
     TextView tvSize;
@@ -35,10 +38,16 @@ public class AskGetMoneyAct extends BaseActivity  implements UMShareListener {
     @BindView(R.id.rl_link)
     RelativeLayout rlLink;
 
+    @Inject
+    AskGetMoneyPresenter  mPresenter;
+
     /**
      * 分享的链接地址
      */
     private  String  mShareLink;
+
+
+
     @Override
     protected int getLayoutId() {
         return R.layout.x_ask_getmoney_act_layout;
@@ -56,7 +65,7 @@ public class AskGetMoneyAct extends BaseActivity  implements UMShareListener {
 
     @Override
     public void initData() {
-
+        mPresenter.getTask(null);
     }
 
 
@@ -90,7 +99,7 @@ public class AskGetMoneyAct extends BaseActivity  implements UMShareListener {
 
     private  void  shareToQQ(){
         new ShareAction(AskGetMoneyAct.this)
-                .setPlatform(SHARE_MEDIA.QQ)//传入平台
+                .setPlatform(SHARE_MEDIA.QZONE)//传入平台
                 .withText(mShareLink)//分享内容
                 .setCallback(this)//回调监听器
                 .share();
@@ -129,4 +138,14 @@ public class AskGetMoneyAct extends BaseActivity  implements UMShareListener {
     public void onCancel(SHARE_MEDIA share_media) {
 
     }
+
+    @Override
+    public void NetSuccess(int code, String msg) {
+        
+    }
+
+    @Override
+    public void NetError(int code, String errorMsg) {
+        showToast(errorMsg);
+    }
 }

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/AskRewardAct.java

@@ -1,7 +1,7 @@
 package com.sheep.gamegroup.view.activity;
 
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
 
 /**
  * Created by Administrator on 2018/3/15.

+ 1 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/AuthenticationAct.java

@@ -1,8 +1,8 @@
 package com.sheep.gamegroup.view.activity;
 
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.presenter.AuthenticationContract;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
 
 /**
  * Created by ljy on 2018/3/17.

+ 5 - 5
app/src/main/java/com/sheep/gamegroup/view/activity/BindDataAct.java

@@ -9,14 +9,13 @@ import android.widget.LinearLayout;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.SheepApp;
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.di.components.DaggerBindDataComponent;
 import com.sheep.gamegroup.di.modules.BindDataModule;
 import com.sheep.gamegroup.presenter.BindDataContract;
 import com.sheep.gamegroup.presenter.BindDataPresenter;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
-import com.sheep.jiuyan.samllsheep.utils.G;
 
 import javax.inject.Inject;
 
@@ -59,14 +58,15 @@ public class BindDataAct extends BaseActivity implements BindDataContract.View {
 
     @Override
     public void upView(Object o) {
-        G.showToast("ok");
+        showToast("ok");
         finish();
 
     }
 
     @Override
     public void failView(Object o) {
-        G.showToast("error");
+        showToast("error");
+
     }
 
     @Override

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

@@ -7,13 +7,13 @@ import android.view.View;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.SheepApp;
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.di.components.DaggerBindOrChangeWeixinComponent;
 import com.sheep.gamegroup.di.modules.BindOrChangeWeixinModule;
 import com.sheep.gamegroup.presenter.BindOrChangeWeixinContract;
 import com.sheep.gamegroup.presenter.BindOrChangeWeixinPresenter;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
 
 import javax.inject.Inject;
 

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/FriendAndRewardAct.java

@@ -1,7 +1,8 @@
 package com.sheep.gamegroup.view.activity;
 
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
+
 
 /**
  * Created by Administrator on 2018/3/15.

+ 4 - 4
app/src/main/java/com/sheep/gamegroup/view/activity/HomePageAct.java

@@ -13,6 +13,8 @@ import android.widget.TextView;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.SheepApp;
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.di.components.DaggerHomePageComponent;
 import com.sheep.gamegroup.di.modules.HomePageModule;
 import com.sheep.gamegroup.model.entity.BaseMessage;
@@ -23,9 +25,6 @@ import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.MyDbManager;
 import com.sheep.gamegroup.util.MyListview;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
-import com.sheep.jiuyan.samllsheep.utils.G;
 
 import javax.inject.Inject;
 
@@ -125,6 +124,7 @@ public class HomePageAct extends BaseActivity implements HomePageContract.View{
                 Jump2View.getInstance().goTryplayView(activity, null);
                 break;
             case R.id.invitation_layout:
+                Jump2View.getInstance().goAskGetMoney(activity, null);
                 break;
             case R.id.lying_layout:
                 break;
@@ -151,7 +151,7 @@ public class HomePageAct extends BaseActivity implements HomePageContract.View{
 
     @Override
     public void failData2View(Object o) {
-        G.showToast("网络错误");
+        showToast("网络错误");
 
     }
 }

+ 81 - 66
app/src/main/java/com/sheep/gamegroup/view/activity/LoginAct.java

@@ -1,34 +1,30 @@
 package com.sheep.gamegroup.view.activity;
 
 import android.Manifest;
-import android.app.Activity;
 import android.content.Intent;
-import android.content.res.Resources;
 import android.os.Build;
 import android.os.Bundle;
 import android.support.v4.app.ActivityCompat;
 import android.view.View;
+import android.widget.ImageView;
 import android.widget.TextView;
-import android.widget.Toast;
 
+import com.sheep.gamegroup.SheepApp;
+import com.sheep.gamegroup.absBase.BaseUMActivity;
 import com.sheep.gamegroup.di.components.DaggerLoginComponent;
-import com.sheep.gamegroup.di.components.LoginComponent;
 import com.sheep.gamegroup.di.modules.LoginModule;
 import com.sheep.gamegroup.presenter.LoginContract;
-import com.sheep.gamegroup.util.ActivityManager;
+import com.sheep.gamegroup.presenter.LoginPresenter;
+import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
-import com.sheep.jiuyan.samllsheep.page.MainActivity;
-import com.sheep.jiuyan.samllsheep.wxapi.WXEntryActivity;
 import com.umeng.socialize.UMAuthListener;
 import com.umeng.socialize.UMShareAPI;
 import com.umeng.socialize.bean.SHARE_MEDIA;
-import com.umeng.socialize.utils.SocializeUtils;
-import com.uuzuche.lib_zxing.decoding.Intents;
 
 import java.util.Map;
 
+import javax.inject.Inject;
+
 import butterknife.BindView;
 import butterknife.ButterKnife;
 import butterknife.OnClick;
@@ -37,12 +33,17 @@ import butterknife.OnClick;
  * Created by ljy on 2018/3/8.
  */
 
-public class LoginAct extends BaseActivity implements LoginContract.View{
-    Activity activity;
-    @BindView(R.id.weixin_login_tv)
-    TextView weixinLoginTv;
+public class LoginAct extends BaseUMActivity implements LoginContract.View {
+
+    @Inject
+    LoginPresenter mPresenter;
     @BindView(R.id.tel_login_tv)
     TextView telLoginTv;
+    @BindView(R.id.iv_wx)
+    ImageView ivWx;
+    @BindView(R.id.iv_qq)
+    ImageView ivQq;
+
 
     @Override
     protected int getLayoutId() {
@@ -51,21 +52,19 @@ public class LoginAct extends BaseActivity implements LoginContract.View{
 
     @Override
     public void initView() {
-        ActivityManager.getInstance().pushActivity(this);
-        activity = this;
         DaggerLoginComponent.builder()
                 .netComponent(SheepApp.get(this).getNetComponent())
                 .loginModule(new LoginModule(this))
                 .build()
-        .inject(this);
-        setTvBg(R.id.weixin_login_tv);
+                .inject(this);
+
     }
 
 
-    private  void  requestPremiss(){
-        if(Build.VERSION.SDK_INT>=23){
-            String[] mPermissionList = new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.CALL_PHONE,Manifest.permission.READ_LOGS,Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_EXTERNAL_STORAGE,Manifest.permission.SET_DEBUG_APP,Manifest.permission.SYSTEM_ALERT_WINDOW,Manifest.permission.GET_ACCOUNTS,Manifest.permission.WRITE_APN_SETTINGS};
-            ActivityCompat.requestPermissions(this,mPermissionList,123);
+    private void requestPremiss() {
+        if (Build.VERSION.SDK_INT >= 23) {
+            String[] mPermissionList = new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.CALL_PHONE, Manifest.permission.READ_LOGS, Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.SET_DEBUG_APP, Manifest.permission.SYSTEM_ALERT_WINDOW, Manifest.permission.GET_ACCOUNTS, Manifest.permission.WRITE_APN_SETTINGS};
+            ActivityCompat.requestPermissions(this, mPermissionList, 123);
         }
     }
 
@@ -77,7 +76,6 @@ public class LoginAct extends BaseActivity implements LoginContract.View{
     }
 
 
-
     @Override
     public void initListener() {
 
@@ -89,87 +87,104 @@ public class LoginAct extends BaseActivity implements LoginContract.View{
     }
 
 
-    @OnClick({R.id.weixin_login_tv, R.id.tel_login_tv})
-    public void onViewClicked(View view) {
-
-        setTvBg(view.getId());
-        switch (view.getId()) {
-            case R.id.weixin_login_tv:
-                goWeixin();
-                break;
-            case R.id.tel_login_tv:
-                goTelLogin();
-                break;
-        }
-    }
-
-
 
 
     private void goTelLogin() {
-        Intent intent = new Intent(activity, PhoneAct.class);
+        Intent intent = new Intent(this, PhoneAct.class);
         startActivity(intent);
-//        finish();
+        finish();
     }
 
     private void goWeixin() {
         UMShareAPI.get(this).doOauthVerify(this, SHARE_MEDIA.WEIXIN, new UMAuthListener() {
             @Override
             public void onStart(SHARE_MEDIA platform) {
+            }
+
+            @Override
+            public void onComplete(SHARE_MEDIA platform, int action, Map<String, String> data) {
+                mPresenter.logByAuther(1,data.get("access_token"),data.get("openid"));
+            }
 
+            @Override
+            public void onError(SHARE_MEDIA platform, int action, Throwable t) {
+                showToast("微信授权失败");
+            }
+
+            @Override
+            public void onCancel(SHARE_MEDIA platform, int action) {
+
+
+            }
+        });
+
+    }
+
+
+    private void loginQQ() {
+        UMShareAPI.get(this).doOauthVerify(this, SHARE_MEDIA.QQ, new UMAuthListener() {
+            @Override
+            public void onStart(SHARE_MEDIA platform) {
+                 showProgress();
             }
 
             @Override
             public void onComplete(SHARE_MEDIA platform, int action, Map<String, String> data) {
+//                mPresenter.logByAuther(2,data.get("openid"));
+                mPresenter.logByAuther(2,data.get("access_token"),data.get("openid"));
 
             }
 
             @Override
             public void onError(SHARE_MEDIA platform, int action, Throwable t) {
-
+                showToast("QQ授权失败");
             }
 
             @Override
             public void onCancel(SHARE_MEDIA platform, int action) {
 
 
-
             }
         });
 
+
     }
+
+
     @Override
-    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-        super.onActivityResult(requestCode, resultCode, data);
+    public void NetSuccess(int code, String msg) {
+        showToast(msg);
+    }
 
+    @Override
+    public void NetError(int code, String errorMsg) {
+        showToast(errorMsg);
 
 
     }
 
-    /**
-     * 设置按钮背景
-     */
-    private void setTvBg(int select){
-        switch (select){
-            case R.id.weixin_login_tv:
-                weixinLoginTv.setBackgroundResource(R.drawable.sp_bg_transparency_line_white);
-                weixinLoginTv.setTextColor(getResources().getColor(R.color.white));
-                telLoginTv.setBackgroundColor(getResources().getColor(R.color.transparent));
-                telLoginTv.setTextColor(getResources().getColor(R.color.grgray));
-                break;
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        // TODO: add setContentView(...) invocation
+        ButterKnife.bind(this);
+    }
+
+    @OnClick({R.id.tel_login_tv, R.id.iv_wx, R.id.iv_qq})
+    public void onViewClicked(View view) {
+        switch (view.getId()) {
             case R.id.tel_login_tv:
-                telLoginTv.setBackgroundResource(R.drawable.sp_bg_transparency_line_white);
-                telLoginTv.setTextColor(getResources().getColor(R.color.white));
-                weixinLoginTv.setBackgroundColor(getResources().getColor(R.color.transparent));
-                weixinLoginTv.setTextColor(getResources().getColor(R.color.grgray));
+                goTelLogin();
+                break;
+            case R.id.iv_wx:
+                Jump2View.getInstance().goHomePageView(this,null);
+//                goWeixin();
                 break;
-            default:
-                weixinLoginTv.setBackgroundResource(R.drawable.sp_bg_transparency_line_white);
-                weixinLoginTv.setTextColor(getResources().getColor(R.color.white));
-                telLoginTv.setBackgroundColor(getResources().getColor(R.color.transparent));
-                telLoginTv.setTextColor(getResources().getColor(R.color.grgray));
+            case R.id.iv_qq:
+                loginQQ();
                 break;
         }
-
     }
 }

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/view/activity/PersionInfoAct.java

@@ -1,7 +1,8 @@
 package com.sheep.gamegroup.view.activity;
 
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
+
 
 /**
  * Created by Administrator on 2018/3/16.

+ 3 - 4
app/src/main/java/com/sheep/gamegroup/view/activity/PersonalCenterAct.java

@@ -13,6 +13,8 @@ import android.widget.Toast;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.SheepApp;
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.di.components.DaggerPersonalCenterComponent;
 import com.sheep.gamegroup.di.modules.PersonalCenterModule;
 import com.sheep.gamegroup.model.entity.BaseMessage;
@@ -22,9 +24,6 @@ import com.sheep.gamegroup.presenter.PersonalCenterPresenter;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.MyDbManager;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
-import com.sheep.jiuyan.samllsheep.utils.G;
 
 import org.xutils.ex.DbException;
 
@@ -136,6 +135,6 @@ public class PersonalCenterAct extends BaseActivity implements PersonalCenterCon
 
     @Override
     public void failData2View(Object o) {
-        G.showToast("网络错误");
+        showToast("网络错误");
     }
 }

+ 13 - 21
app/src/main/java/com/sheep/gamegroup/view/activity/PhoneAct.java

@@ -11,8 +11,11 @@ import android.widget.TextView;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.SheepApp;
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.di.components.DaggerPhoneComponent;
 import com.sheep.gamegroup.di.modules.PhoneModule;
+import com.sheep.gamegroup.exception.ApiException;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.LoginEntity;
 import com.sheep.gamegroup.model.entity.UserEntity;
@@ -23,15 +26,9 @@ import com.sheep.gamegroup.util.ActivityManager;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.MyDbManager;
 import com.sheep.gamegroup.util.SelfCountDownTimer;
+import com.sheep.gamegroup.util.SpUtils;
 import com.sheep.gamegroup.util.XXTEA;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
-import com.sheep.jiuyan.samllsheep.page.LoginActivity;
-import com.sheep.jiuyan.samllsheep.page.MainActivity;
-import com.sheep.jiuyan.samllsheep.page.SplashActivity;
-import com.sheep.jiuyan.samllsheep.utils.G;
-import com.sheep.jiuyan.samllsheep.utils.SpUtils;
 
 import org.xutils.ex.DbException;
 
@@ -113,7 +110,7 @@ public class PhoneAct extends BaseActivity implements PhoneContract.View {
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         // TODO: add setContentView(...) invocation
-        ButterKnife.bind(this);
+
         phoneEtAccount.setText("17628083502");
         phoneEtCode.setText("123456");
     }
@@ -139,22 +136,22 @@ public class PhoneAct extends BaseActivity implements PhoneContract.View {
 
     private boolean checkPhoneInput() {
         if (TextUtils.isEmpty(etPhone)) {
-            G.showToast(getString(R.string.input_your_phone));
+            showToast(getString(R.string.input_your_phone));
             return false;
         }
         if (etPhone.toString().length() != 11) {
-            G.showToast(getString(R.string.toast_warning_phone_number_size));
+            showToast(getString(R.string.toast_warning_phone_number_size));
             return false;
         }
         return true;
     }
     private boolean checkCodeInput() {
         if (TextUtils.isEmpty(etCode)) {
-            G.showToast(getString(R.string.input_your_captcha));
+            showToast(getString(R.string.input_your_captcha));
             return false;
         }
         if (etCode.toString().length() != 6) {
-            G.showToast(getString(R.string.toast_warning_phone_captcha_image_code_size));
+            showToast(getString(R.string.toast_warning_phone_captcha_image_code_size));
             return false;
         }
         return true;
@@ -212,7 +209,7 @@ public class PhoneAct extends BaseActivity implements PhoneContract.View {
             MyDbManager.getInstance().saveOrUpdateUser(loginEty.getUser());
             UserEntity userEntity = MyDbManager.getInstance().dbFindUser();
             Log.e("------userEntity",userEntity.getNickname()+"|"+userEntity.getMobile()+"");
-            G.showToast(userEntity.getNickname()+"|"+userEntity.getMobile());
+            showToast(userEntity.getNickname()+"|"+userEntity.getMobile());
         } catch (DbException e) {
             e.printStackTrace();
         }
@@ -223,16 +220,11 @@ public class PhoneAct extends BaseActivity implements PhoneContract.View {
     }
 
     @Override
-    public void loginFail(Object o) {
+    public void loginFail(ApiException o) {
         hideProgress();
-        G.showToast("登录失败" + "");
-//        testData();
+        showToast(o.getMessage());
     }
 
-    private void goMain() {
-        Intent intent = new Intent(activity, PersonalCenterPresenter.class);
-        startActivity(intent);
-    }
 
     private void testData(){
         try{
@@ -272,7 +264,7 @@ public class PhoneAct extends BaseActivity implements PhoneContract.View {
                 MyDbManager.getInstance().saveOrUpdateUser(loginEty.getUser());
                 UserEntity userEntity = MyDbManager.getInstance().dbFindUser();
                 Log.e("------userEntity",userEntity.getNickname()+"|"+userEntity.getMobile()+"");
-                G.showToast(userEntity.getNickname()+"|"+userEntity.getMobile());
+                showToast(userEntity.getNickname()+"|"+userEntity.getMobile());
             } catch (DbException e) {
                 e.printStackTrace();
             }

+ 5 - 5
app/src/main/java/com/sheep/gamegroup/view/activity/SplashAct.java

@@ -15,16 +15,16 @@ import android.text.TextUtils;
 import android.view.View;
 import android.widget.TextView;
 
+import com.readystatesoftware.chuck.internal.ui.MainActivity;
+import com.sheep.gamegroup.SheepApp;
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.di.components.DaggerSplashComponent;
 import com.sheep.gamegroup.di.modules.SplashModule;
 import com.sheep.gamegroup.presenter.SplashContract;
 import com.sheep.gamegroup.presenter.SplashPresenter;
+import com.sheep.gamegroup.util.SpUtils;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
-import com.sheep.jiuyan.samllsheep.page.LoginActivity;
-import com.sheep.jiuyan.samllsheep.page.MainActivity;
-import com.sheep.jiuyan.samllsheep.utils.SpUtils;
+
 
 import java.util.List;
 

+ 8 - 9
app/src/main/java/com/sheep/gamegroup/view/activity/TryMakeMoneyact.java

@@ -5,6 +5,8 @@ import android.os.Bundle;
 import android.support.v4.widget.SwipeRefreshLayout;
 import android.support.v7.widget.RecyclerView;
 
+import com.sheep.gamegroup.SheepApp;
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.di.components.DaggerTryMakeMoneyComponent;
 import com.sheep.gamegroup.di.modules.TryMakeMoneyModule;
 import com.sheep.gamegroup.model.entity.BaseMessage;
@@ -13,9 +15,6 @@ import com.sheep.gamegroup.presenter.TryMakeMoneyContract;
 import com.sheep.gamegroup.presenter.TryMakeMoneyPresenter;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
-import com.sheep.jiuyan.samllsheep.utils.G;
 
 import javax.inject.Inject;
 
@@ -92,15 +91,15 @@ public class TryMakeMoneyact extends BaseActivity implements TryMakeMoneyContrac
             BaseMessage baseMessage = (BaseMessage) o;
             switch (baseMessage.getCode()){
                 case 300://未查询到数据
-                    G.showToast(" 未查询到数据!");
+                    showToast(" 未查询到数据!");
                     break;
                 default:
-                    G.showToast(" 网络错误!");
+                    showToast(" 网络错误!");
                     break;
             }
         }catch (Exception e){
             e.printStackTrace();
-            G.showToast(" 网络错误!");
+            showToast(" 网络错误!");
         }
     }
 
@@ -116,15 +115,15 @@ public class TryMakeMoneyact extends BaseActivity implements TryMakeMoneyContrac
             BaseMessage baseMessage = (BaseMessage) o;
             switch (baseMessage.getCode()){
                 case 300://未查询到正在运行的任务
-                    G.showToast(" 未查询到正在运行的任务!");
+                    showToast(" 未查询到正在运行的任务!");
                     break;
                 default:
-                    G.showToast(" 网络错误!");
+                    showToast(" 网络错误!");
                     break;
             }
         }catch (Exception e){
             e.printStackTrace();
-            G.showToast(" 网络错误!");
+            showToast(" 网络错误!");
         }
     }
 }

+ 5 - 6
app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalAct.java

@@ -9,6 +9,8 @@ import android.widget.GridView;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSONObject;
+import com.sheep.gamegroup.SheepApp;
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.di.components.DaggerWithdrawalComponent;
 import com.sheep.gamegroup.di.modules.WithdrawalModule;
 import com.sheep.gamegroup.model.entity.BaseMessage;
@@ -18,9 +20,6 @@ import com.sheep.gamegroup.presenter.WithdrawalPresenter;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.view.adapter.WithdrawalAdapter;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
-import com.sheep.jiuyan.samllsheep.utils.G;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -113,7 +112,7 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
 //        String price1 = ((GridViewEntity)withdrawalGreidview.getSelectedItem()).getValue();
         String amount = ((GridViewEntity)listData.get(select)).getValue();
         if(TextUtils.isEmpty(amount)){
-            G.showToast("请选择金额");
+            showToast("请选择金额");
             return;
         }
 
@@ -156,12 +155,12 @@ public class WithdrawalAct extends BaseActivity implements WithdrawalContract.Vi
                     Jump2View.getInstance().goBindDataView(activity, baseMessage.getCode());
                     break;
                 default:
-                    G.showToast(" 网络错误!");
+                    showToast(" 网络错误!");
                     break;
             }
         }catch (Exception e){
             e.printStackTrace();
-            G.showToast(" 网络错误!");
+            showToast(" 网络错误!");
         }
     }
 

+ 3 - 2
app/src/main/java/com/sheep/gamegroup/view/activity/WithdrawalResultAct.java

@@ -5,13 +5,14 @@ import android.os.Bundle;
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import com.sheep.gamegroup.SheepApp;
+import com.sheep.gamegroup.absBase.BaseActivity;
 import com.sheep.gamegroup.di.components.DaggerWithdrawalResultComponent;
 import com.sheep.gamegroup.di.modules.WithdrawalResultModule;
 import com.sheep.gamegroup.presenter.WithdrawalResultContract;
 import com.sheep.gamegroup.presenter.WithdrawalResultPresenter;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.SheepApp;
-import com.sheep.jiuyan.samllsheep.base.BaseActivity;
+
 
 import javax.inject.Inject;
 

+ 2 - 1
app/src/main/java/com/sheep/gamegroup/view/adapter/WithdrawalAdapter.java

@@ -9,8 +9,9 @@ import android.widget.BaseAdapter;
 import android.widget.TextView;
 
 import com.sheep.gamegroup.model.entity.GridViewEntity;
+import com.sheep.gamegroup.util.G;
 import com.sheep.jiuyan.samllsheep.R;
-import com.sheep.jiuyan.samllsheep.utils.G;
+
 
 import java.util.List;
 

+ 3 - 0
app/src/main/java/com/sheep/gamegroup/view/customview/TextProgressBar.java

@@ -5,6 +5,8 @@ import android.graphics.Canvas;
 import android.graphics.Color;
 import android.graphics.Paint;
 import android.graphics.Rect;
+import android.os.Build;
+import android.support.annotation.RequiresApi;
 import android.util.AttributeSet;
 import android.widget.ProgressBar;
 
@@ -30,6 +32,7 @@ public class TextProgressBar extends ProgressBar {
         initText();
     }
 
+    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
     public TextProgressBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
         super(context, attrs, defStyleAttr, defStyleRes);
         initText();

+ 54 - 9
app/src/main/res/layout/login_act_layout.xml

@@ -10,14 +10,8 @@
         android:background="@mipmap/login_bg_img"
         style="@style/login_layout"
         android:layout_marginTop="@dimen/content_padding_80">
-        <TextView
-            android:id="@+id/weixin_login_tv"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="微信登录"
-            style="@style/login_btn"
-            android:layout_above="@+id/tel_login_tv"
-            android:focusedByDefault="true"/>
+
+
         <TextView
             android:id="@+id/tel_login_tv"
             android:layout_width="match_parent"
@@ -25,8 +19,59 @@
             android:text="手机号登录"
             android:layout_alignParentBottom="true"
             style="@style/login_btn"
+            android:textColor="@color/txt_white"
+            android:background="@drawable/sp_bg_transparency_line_white"
             android:layout_marginBottom="80dp"
-            android:layout_marginTop="@dimen/content_padding_10"/>
+            android:layout_marginTop="@dimen/content_padding_20"/>
+
+
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            android:layout_above="@+id/tel_login_tv"
+            android:layout_centerHorizontal="true"
+            >
+            <View
+                android:layout_width="10dp"
+                android:layout_height="1dp"
+                android:background="@color/txt_white"
+                android:layout_gravity="center_vertical"
+                ></View>
+
+            <ImageView
+                android:layout_marginLeft="15dp"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:background="@null"
+                android:src="@mipmap/x_ic_login_wx"
+                android:id="@+id/iv_wx"
+                />
+
+            <View
+                android:layout_marginLeft="15dp"
+                android:layout_marginRight="15dp"
+                android:layout_width="2dp"
+                android:layout_height="2dp"
+                android:background="@color/txt_white"
+                android:layout_gravity="center_vertical"
+                ></View>
+
+            <ImageView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:background="@null"
+                android:src="@mipmap/x_ic_login_qq"
+                android:id="@+id/iv_qq"
+                />
+            <View
+                android:layout_marginLeft="15dp"
+                android:layout_width="10dp"
+                android:layout_height="1dp"
+                android:background="@color/txt_white"
+                android:layout_gravity="center_vertical"
+                ></View>
+        </LinearLayout>
     </RelativeLayout>
 
 </RelativeLayout>

BIN=BIN
app/src/main/res/mipmap-hdpi/you_hui_wan_pop_bg.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/arrow_bottom.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/arrow_top.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/bg_bottom_line.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/bg_default_icon.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/bg_fail_tip.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/bg_green.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/bg_icon_corner.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/bg_rect.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/btn_back_normal.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/btn_clear.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/btn_query_condition_left_ing.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/btn_search.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/h1.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/icon_category_game.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/icon_category_play.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/icon_category_theme.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/icon_timer.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/line_left.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/line_right.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/main_segment1_selected.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/main_segment2_selected.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/main_segment3_selected.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/new_game1.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/new_game2.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/play_game.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/rank_1_bg.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/rank_1_img.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/rank_2_img.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/rank_3_img.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/rb_star_full.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/rb_star_half.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/tab_category.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/tab_order.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/tab_recommend.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/tab_selected_left.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/tab_selected_right.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/tab_sole.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/try_dialog_bg.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/try_dialog_x.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/x_ic_login_qq.png


BIN=BIN
app/src/main/res/mipmap-xhdpi/x_ic_login_wx.png


BIN=BIN
app/src/main/res/mipmap-xxhdpi/bg_default_icon.png


BIN=BIN
app/src/main/res/mipmap-xxhdpi/bg_green.png


BIN=BIN
app/src/main/res/mipmap-xxhdpi/bg_icon_corner.png


BIN=BIN
app/src/main/res/mipmap-xxhdpi/bg_rect.png


BIN=BIN
app/src/main/res/mipmap-xxhdpi/btn_back_normal.png


BIN=BIN
app/src/main/res/mipmap-xxhdpi/btn_clear.png


BIN=BIN
app/src/main/res/mipmap-xxhdpi/btn_search.png


+ 0 - 0
app/src/main/res/mipmap-xxhdpi/h1.png


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio