Quellcode durchsuchen

小绵羊授权游戏sdk添加添加账号与切换账号功能

zengjiebin vor 7 Jahren
Ursprung
Commit
ccf6178975

+ 1 - 1
app/build.gradle

@@ -23,7 +23,7 @@ android {
         flavorDimensions "versionCode"
     }
     greendao {
-        schemaVersion 12
+        schemaVersion 13
         targetGenDir 'src/main/java'
     }
 //    compileOptions{

+ 109 - 14
app/src/main/java/com/sheep/gamegroup/greendao/DDProviderHelper.java

@@ -12,6 +12,8 @@ import com.sheep.gamegroup.greendao.download.ProcessRecord;
 import com.sheep.gamegroup.greendao.download.ProcessRecordDao;
 import com.sheep.gamegroup.greendao.download.ScreenShotRecord;
 import com.sheep.gamegroup.greendao.download.ScreenShotRecordDao;
+import com.sheep.gamegroup.greendao.download.SdkLoginUser;
+import com.sheep.gamegroup.greendao.download.SdkLoginUserDao;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.DownloadUtil;
 import com.sheep.jiuyan.samllsheep.service.AutoCheckService;
@@ -77,7 +79,7 @@ public class DDProviderHelper {
                 .where(DownLoadInfoDao.Properties.MDownloadUrl.eq(info.getMDownloadUrl()))
                 .build()
                 .unique();
-        try{
+        try {
             if (downLoadInfo == null) {
                 infoDao.insert(info);
                 return true;
@@ -85,11 +87,12 @@ public class DDProviderHelper {
                 info.setMId(downLoadInfo.getMId());
                 infoDao.update(info);
             }
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
         }
         return false;
     }
+
     /**
      * 删除所有任务;
      *
@@ -205,7 +208,7 @@ public class DDProviderHelper {
     public DownLoadInfo updateDownloadPercent(Context ctx, double downloadedSize, String averageSpeed, int downloadTaskId, String downloadUrl, int state) {
         DownLoadInfo downloadTask = getDownloadTask(ctx, downloadUrl);
         if (downloadTask != null) {
-            int percent = (int) (downloadedSize * 100 / downloadTask.getMTotalSize() );
+            int percent = (int) (downloadedSize * 100 / downloadTask.getMTotalSize());
             downloadTask.setMPercent(percent);
             downloadTask.setAverageSpeed(averageSpeed);
             downloadTask.setMDownloadedSize(downloadedSize);
@@ -215,6 +218,7 @@ public class DDProviderHelper {
         }
         return downloadTask;
     }
+
     /**
      * 更新任务状态
      *
@@ -259,6 +263,7 @@ public class DDProviderHelper {
             return null;
         }
     }
+
     /**
      * 改变任务状态
      *
@@ -302,18 +307,22 @@ public class DDProviderHelper {
             }
         }
     }
+
     /**
      * 添加或更新记录
      * 添加成功返回true
+     *
      * @param context
      * @param newInfo
      */
     public boolean addOrUpdateProcessRecord(Context context, ProcessRecord newInfo) {
         return addOrUpdateProcessRecord(context, newInfo, null);
     }
+
     /**
      * 添加或更新记录
      * 添加成功返回true
+     *
      * @param context
      * @param newInfo
      */
@@ -324,8 +333,8 @@ public class DDProviderHelper {
                 .where(ProcessRecordDao.Properties.PackageName.eq(newInfo.getPackageName()), ProcessRecordDao.Properties.UserId.eq(newInfo.getUserId()))
                 .build()
                 .unique();
-        try{
-            if(action1 != null)
+        try {
+            if (action1 != null)
                 action1.call(lastInfo);
             if (lastInfo == null) {
                 infoDao.insert(newInfo);
@@ -334,11 +343,12 @@ public class DDProviderHelper {
                 newInfo.setId(lastInfo.getId());
                 infoDao.update(newInfo);
             }
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
         }
         return false;
     }
+
     /**
      * 根据包名获取进程运行的记录,5.0及其以下使用
      *
@@ -351,40 +361,45 @@ public class DDProviderHelper {
                 .where(ProcessRecordDao.Properties.PackageName.eq(packageName))
                 .build()
                 .unique();
-        return processRecord == null ? new ProcessRecord(): processRecord;
+        return processRecord == null ? new ProcessRecord() : processRecord;
     }
+
     /**
      * 添加记录
      * 添加成功返回true
+     *
      * @param context
      * @param newInfo
      */
     public boolean addAcceptTaskRecord(Context context, AcceptTaskRecord newInfo) {
-        try{
+        try {
             AcceptTaskRecordDao infoDao = getDaossion(context).getAcceptTaskRecordDao();
             infoDao.insert(newInfo);
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
             return false;
         }
         return true;
     }
+
     /**
      * 更新记录
      * 添加成功返回true
+     *
      * @param context
      * @param newInfo
      */
     public boolean updateAcceptTaskRecord(Context context, AcceptTaskRecord newInfo) {
-        try{
+        try {
             AcceptTaskRecordDao infoDao = getDaossion(context).getAcceptTaskRecordDao();
             infoDao.update(newInfo);
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
             return false;
         }
         return true;
     }
+
     /**
      * 根据包名获取接受的自动审核任务的记录,5.1及其以上使用
      *
@@ -398,13 +413,14 @@ public class DDProviderHelper {
                 .build()
                 .unique();
     }
+
     /**
      * 删除用户的任务记录数据
      *
      * @param context
      */
     public void deleteTaskRecord(Context context) {
-        if(AutoCheckService.IS_USE_THIS_SERVICE){
+        if (AutoCheckService.IS_USE_THIS_SERVICE) {
             ProcessRecordDao processRecordDao = getDaossion(context).getProcessRecordDao();
             processRecordDao.deleteAll();
         } else {
@@ -412,22 +428,25 @@ public class DDProviderHelper {
             acceptTaskRecordDao.deleteAll();
         }
     }
+
     /**
      * 添加截图记录
      * 添加成功返回true
+     *
      * @param context
      * @param newInfo
      */
     public boolean addScreenShotRecord(Context context, ScreenShotRecord newInfo) {
-        try{
+        try {
             ScreenShotRecordDao infoDao = getDaossion(context).getScreenShotRecordDao();
             infoDao.insert(newInfo);
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
             return false;
         }
         return true;
     }
+
     /**
      * 获取对应包名下的截图列表
      *
@@ -441,6 +460,7 @@ public class DDProviderHelper {
                 .build()
                 .list();
     }
+
     /**
      * 是否监听到该截图
      *
@@ -454,4 +474,79 @@ public class DDProviderHelper {
                 .build()
                 .unique();
     }
+
+    /**
+     * 获取对应服务器下所有登录过的用户列表
+     *
+     * @param ctx
+     */
+    public List<SdkLoginUser> getSdkLoginUserList(Context ctx, String serviceName) {
+        return getDaossion(ctx)
+                .getSdkLoginUserDao()
+                .queryBuilder()
+                .where(SdkLoginUserDao.Properties.ServiceName.eq(serviceName))
+                .build()
+                .list();
+    }
+
+    /**
+     * 添加或更新记录
+     * 添加成功返回true
+     *
+     * @param context
+     * @param newInfo
+     */
+    public boolean addOrUpdateSdkLoginUser(Context context, SdkLoginUser newInfo, Action1<SdkLoginUser> action1) {
+        SdkLoginUserDao infoDao = getDaossion(context).getSdkLoginUserDao();
+        SdkLoginUser lastInfo = infoDao
+                .queryBuilder()
+                .where(SdkLoginUserDao.Properties.ServiceName.eq(newInfo.getServiceName()), SdkLoginUserDao.Properties.Token.eq(newInfo.getToken()))
+                .build()
+                .unique();
+        try {
+            if (action1 != null)
+                action1.call(lastInfo);
+            if (lastInfo == null) {
+                infoDao.insert(newInfo);
+                return true;
+            } else {
+                newInfo.setId(lastInfo.getId());
+                infoDao.update(newInfo);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return false;
+    }
+
+    /**
+     * 添加或更新记录
+     * 添加成功返回true
+     *
+     * @param context
+     * @param oldInfo
+     */
+    public boolean deleteSdkLoginUser(Context context, SdkLoginUser oldInfo) {
+        if (oldInfo != null) {
+            SdkLoginUserDao loadInfoDao = getDaossion(context).getSdkLoginUserDao();
+            try {
+                loadInfoDao.delete(oldInfo);
+                return true;
+            } catch (Exception e) {
+                e.printStackTrace();
+                try {
+                    SdkLoginUser loadInfo = loadInfoDao.queryBuilder()
+                            .where(SdkLoginUserDao.Properties.ServiceName.eq(oldInfo.getServiceName()), SdkLoginUserDao.Properties.Token.eq(oldInfo.getToken()))
+                            .build()
+                            .unique();
+                    loadInfoDao.delete(loadInfo);
+                    return true;
+                } catch (Exception e2) {
+                    e2.printStackTrace();
+                }
+                return false;
+            }
+        }
+        return false;
+    }
 }

+ 5 - 2
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoMaster.java

@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 /**
- * Master of DAO (schema version 12): knows all DAOs.
+ * Master of DAO (schema version 13): knows all DAOs.
  */
 public class DaoMaster extends AbstractDaoMaster {
-    public static final int SCHEMA_VERSION = 12;
+    public static final int SCHEMA_VERSION = 13;
 
     /** Creates underlying database table using DAOs. */
     public static void createAllTables(Database db, boolean ifNotExists) {
@@ -26,6 +26,7 @@ public class DaoMaster extends AbstractDaoMaster {
         DownLoadInfoDao.createTable(db, ifNotExists);
         ProcessRecordDao.createTable(db, ifNotExists);
         ScreenShotRecordDao.createTable(db, ifNotExists);
+        SdkLoginUserDao.createTable(db, ifNotExists);
     }
 
     /** Drops underlying database table using DAOs. */
@@ -35,6 +36,7 @@ public class DaoMaster extends AbstractDaoMaster {
         DownLoadInfoDao.dropTable(db, ifExists);
         ProcessRecordDao.dropTable(db, ifExists);
         ScreenShotRecordDao.dropTable(db, ifExists);
+        SdkLoginUserDao.dropTable(db, ifExists);
     }
 
     /**
@@ -58,6 +60,7 @@ public class DaoMaster extends AbstractDaoMaster {
         registerDaoClass(DownLoadInfoDao.class);
         registerDaoClass(ProcessRecordDao.class);
         registerDaoClass(ScreenShotRecordDao.class);
+        registerDaoClass(SdkLoginUserDao.class);
     }
 
     public DaoSession newSession() {

+ 14 - 0
app/src/main/java/com/sheep/gamegroup/greendao/download/DaoSession.java

@@ -13,12 +13,14 @@ 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.SdkLoginUser;
 
 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.SdkLoginUserDao;
 
 // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
 
@@ -34,12 +36,14 @@ public class DaoSession extends AbstractDaoSession {
     private final DaoConfig downLoadInfoDaoConfig;
     private final DaoConfig processRecordDaoConfig;
     private final DaoConfig screenShotRecordDaoConfig;
+    private final DaoConfig sdkLoginUserDaoConfig;
 
     private final AcceptTaskRecordDao acceptTaskRecordDao;
     private final AppdownloadBeanDao appdownloadBeanDao;
     private final DownLoadInfoDao downLoadInfoDao;
     private final ProcessRecordDao processRecordDao;
     private final ScreenShotRecordDao screenShotRecordDao;
+    private final SdkLoginUserDao sdkLoginUserDao;
 
     public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
             daoConfigMap) {
@@ -60,17 +64,22 @@ public class DaoSession extends AbstractDaoSession {
         screenShotRecordDaoConfig = daoConfigMap.get(ScreenShotRecordDao.class).clone();
         screenShotRecordDaoConfig.initIdentityScope(type);
 
+        sdkLoginUserDaoConfig = daoConfigMap.get(SdkLoginUserDao.class).clone();
+        sdkLoginUserDaoConfig.initIdentityScope(type);
+
         acceptTaskRecordDao = new AcceptTaskRecordDao(acceptTaskRecordDaoConfig, this);
         appdownloadBeanDao = new AppdownloadBeanDao(appdownloadBeanDaoConfig, this);
         downLoadInfoDao = new DownLoadInfoDao(downLoadInfoDaoConfig, this);
         processRecordDao = new ProcessRecordDao(processRecordDaoConfig, this);
         screenShotRecordDao = new ScreenShotRecordDao(screenShotRecordDaoConfig, this);
+        sdkLoginUserDao = new SdkLoginUserDao(sdkLoginUserDaoConfig, this);
 
         registerDao(AcceptTaskRecord.class, acceptTaskRecordDao);
         registerDao(AppdownloadBean.class, appdownloadBeanDao);
         registerDao(DownLoadInfo.class, downLoadInfoDao);
         registerDao(ProcessRecord.class, processRecordDao);
         registerDao(ScreenShotRecord.class, screenShotRecordDao);
+        registerDao(SdkLoginUser.class, sdkLoginUserDao);
     }
     
     public void clear() {
@@ -79,6 +88,7 @@ public class DaoSession extends AbstractDaoSession {
         downLoadInfoDaoConfig.clearIdentityScope();
         processRecordDaoConfig.clearIdentityScope();
         screenShotRecordDaoConfig.clearIdentityScope();
+        sdkLoginUserDaoConfig.clearIdentityScope();
     }
 
     public AcceptTaskRecordDao getAcceptTaskRecordDao() {
@@ -101,4 +111,8 @@ public class DaoSession extends AbstractDaoSession {
         return screenShotRecordDao;
     }
 
+    public SdkLoginUserDao getSdkLoginUserDao() {
+        return sdkLoginUserDao;
+    }
+
 }

+ 79 - 0
app/src/main/java/com/sheep/gamegroup/greendao/download/SdkLoginUser.java

@@ -0,0 +1,79 @@
+package com.sheep.gamegroup.greendao.download;
+
+import org.greenrobot.greendao.annotation.Entity;
+import org.greenrobot.greendao.annotation.Id;
+import org.greenrobot.greendao.annotation.Property;
+import org.greenrobot.greendao.annotation.Generated;
+
+/**
+ * Created by realicing on 2018/10/24.
+ * realicing@sina.com
+ * 游戏sdk授权登录用到的用户信息
+ */
+@Entity
+public class SdkLoginUser {
+    /**
+     * id,
+     */
+    @Id(autoincrement = true)
+    private Long id;
+    @Property(nameInDb = "token")
+    private String token;
+    @Property(nameInDb = "nickname")
+    private String nickname;
+    @Property(nameInDb = "invitation_code")
+    private String invitation_code;
+    @Property(nameInDb = "avatar")
+    private String avatar;
+    @Property(nameInDb = "service_name")
+    private String serviceName;
+    public String getServiceName() {
+        return this.serviceName;
+    }
+    public void setServiceName(String serviceName) {
+        this.serviceName = serviceName;
+    }
+    public String getAvatar() {
+        return this.avatar;
+    }
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+    public String getInvitation_code() {
+        return this.invitation_code;
+    }
+    public void setInvitation_code(String invitation_code) {
+        this.invitation_code = invitation_code;
+    }
+    public String getNickname() {
+        return this.nickname;
+    }
+    public void setNickname(String nickname) {
+        this.nickname = nickname;
+    }
+    public String getToken() {
+        return this.token;
+    }
+    public void setToken(String token) {
+        this.token = token;
+    }
+    public Long getId() {
+        return this.id;
+    }
+    public void setId(Long id) {
+        this.id = id;
+    }
+    @Generated(hash = 1057909451)
+    public SdkLoginUser(Long id, String token, String nickname,
+            String invitation_code, String avatar, String serviceName) {
+        this.id = id;
+        this.token = token;
+        this.nickname = nickname;
+        this.invitation_code = invitation_code;
+        this.avatar = avatar;
+        this.serviceName = serviceName;
+    }
+    @Generated(hash = 1869962748)
+    public SdkLoginUser() {
+    }
+}

+ 13 - 6
app/src/main/java/com/sheep/gamegroup/model/api/ApiService.java

@@ -1022,12 +1022,6 @@ public interface ApiService {
     @GET("app/find/{id}")
     Observable<BaseMessage> playGameDetail(@Path("id") int id);
     /**
-     * 请求授权
-     * @return
-     */
-    @GET("app/sdk/{game_key}")
-    Observable<BaseMessage> verifactionAuth(@Path("game_key") String game_key);
-    /**
      * 判断是否是第一次运行的设备
      * @return
      */
@@ -1068,6 +1062,19 @@ public interface ApiService {
      */
     @POST("app/mobile_point/recharge")
     Observable<BaseMessage> rechargeCMCC(@Body JSONObject jsonObject);
+
+
+
+
+
+//---------------------------下面是sdk相关接口-------------------------------------
+
+    /**
+     * 请求授权
+     * @return
+     */
+    @GET("app/sdk/{game_key}")
+    Observable<BaseMessage> verificationAuth(@Header("Authorization") String token, @Path("game_key") String game_key);
     /**
      * 绵羊币支付订单查询接口
      */

+ 31 - 10
app/src/main/java/com/sheep/gamegroup/util/CertificationUtil.java

@@ -8,14 +8,17 @@ import android.os.Looper;
 import android.text.TextUtils;
 import android.util.Log;
 
+import com.sheep.gamegroup.greendao.DDProviderHelper;
+import com.sheep.gamegroup.greendao.download.SdkLoginUser;
 import com.sheep.gamegroup.model.entity.BaseMessage;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 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.SpUtils;
 
 import rx.android.schedulers.AndroidSchedulers;
+import rx.functions.Action1;
 import rx.schedulers.Schedulers;
 
 /**
@@ -52,22 +55,22 @@ public class CertificationUtil {
     /**
      * 跳转回,游戏
      */
-    public void doCertification(Context context, String packgeName, String ext){
+    public void doCertification(final Context context, String token, String packageName, String ext){
         try {
-            Log.e("game_-packgename---"+packgeName,"");
+            Log.e("game_-packgename---"+packageName,"");
             Intent intent = new Intent();
-            intent.setClassName(packgeName, "com.kfzs.duanduan.data.observer.helper.WhistleActivity");
+            intent.setClassName(packageName, "com.kfzs.duanduan.data.observer.helper.WhistleActivity");
             intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
             intent.putExtra(context.getString(R.string.kfzs_duanduan_datashare_certification_key), SheepApp.getInstance().getGameCode());
 
             if (TextUtils.isEmpty(ext)) {
                 intent.putExtra(context.getString(R.string.kfzs_duanduan_datashare_package_extras), "");
-                intent.putExtra(context.getString(R.string.kfzs_duanduan_datashare_certification_token), SpUtils.getToken(context));
+                intent.putExtra(context.getString(R.string.kfzs_duanduan_datashare_certification_token), token);
             } else if("delete".equals(ext)){
                 intent.putExtra(context.getString(R.string.kfzs_duanduan_datashare_certification_cancel), "delete");
             }else  {
                 intent.putExtra(context.getString(R.string.kfzs_duanduan_datashare_package_extras), ext);
-                intent.putExtra(context.getString(R.string.kfzs_duanduan_datashare_certification_token), SpUtils.getToken(context));
+                intent.putExtra(context.getString(R.string.kfzs_duanduan_datashare_certification_token), token);
             }
             context.startActivity(intent);
             showCertificationErrorAndExitApp("", 100);
@@ -77,11 +80,11 @@ public class CertificationUtil {
         }
     }
     /**
-     *验证获取数据
+     * 验证获取数据
      */
-    public void authCerticicationCode(final Context context){
+    public void authCertificationCode(final Context context, final String token){
         ViewUtil.newInstance().showProgress((Activity) context);
-        SheepApp.getInstance().getNetComponent().getApiService().verifactionAuth(SheepApp.getInstance().getGameCode())
+        SheepApp.getInstance().getNetComponent().getApiService().verificationAuth(token, SheepApp.getInstance().getGameCode())
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new SheepSubscriber<BaseMessage>(SheepApp.getInstance()) {
@@ -90,7 +93,7 @@ public class CertificationUtil {
                         ViewUtil.newInstance().hideProgress((Activity) context);
                         if(baseMessage != null && baseMessage.getData() != null){
                             Log.e("data-------","");
-                            doCertification(context, SheepApp.getInstance().getGamePackgeName(), baseMessage.getData()+"");
+                            doCertification(context, token,  SheepApp.getInstance().getGamePackgeName(), baseMessage.getData()+"");
                         }else {
                             CertificationUtil.newInstance().showCertificationErrorAndExitApp("请求授权错误 " + (baseMessage == null ? "无数据" : baseMessage.getMsg()),1000);
                         }
@@ -104,4 +107,22 @@ public class CertificationUtil {
                     }
                 });
     }
+
+    //保存当前登录用户信息到游戏sdk用户登录列表所有数据库中
+    public void addCurUserToSdkLoginUser() {
+        CommonUtil.getInstance().callActionWithUserInfo(new Action1<UserEntity>() {
+            @Override
+            public void call(UserEntity userEntity) {
+                if(userEntity != null){
+                    SdkLoginUser newSdkLoginUser = new SdkLoginUser();
+                    newSdkLoginUser.setAvatar(userEntity.getAvatar());
+                    newSdkLoginUser.setToken(SpUtils.getToken(SheepApp.getInstance()));
+                    newSdkLoginUser.setInvitation_code(userEntity.getInvitation_code());
+                    newSdkLoginUser.setNickname(userEntity.getNickname());
+                    newSdkLoginUser.setServiceName(SheepApp.getInstance().getConnectAddress().name());
+                    DDProviderHelper.getInstance().addOrUpdateSdkLoginUser(SheepApp.getInstance(), newSdkLoginUser, null);
+                }
+            }
+        });
+    }
 }

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

@@ -12,6 +12,7 @@ import com.sheep.gamegroup.statistics.AppStatistics;
 import com.sheep.gamegroup.statistics.AppStatisticsConfig;
 import com.sheep.gamegroup.view.activity.ActPay;
 import com.sheep.gamegroup.view.activity.ChangeTelAct;
+import com.sheep.gamegroup.view.activity.GameCertificationActivity;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 
 import java.util.HashMap;
@@ -32,7 +33,7 @@ public class UMConfigUtils {
     public static final String LOGIN_TYPE = "sheep_login_type";
     //判断act是不是不需要统计的act
     public static boolean isNotNeedAct(Activity activity) {
-        return activity instanceof ActPay;
+        return activity instanceof ActPay || activity instanceof GameCertificationActivity;
     }
 
     //统计点击次数需要的子subtype

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

@@ -194,7 +194,8 @@ public class ActBindMobileRegister extends BaseActivity {
                         if(TextUtils.isEmpty(SheepApp.getInstance().getGameCode())){
                             Jump2View.getInstance().checkCommendApp(activity, EntityUtils.getUserCode(loginEty));
                         }else {
-                            CertificationUtil.newInstance().authCerticicationCode(activity);
+                            CertificationUtil.newInstance().addCurUserToSdkLoginUser();
+                            CertificationUtil.newInstance().authCertificationCode(activity, SpUtils.getToken(SheepApp.getInstance()));
                         }
                         TestUtil.saveUser(loginEty);
                     }

+ 107 - 35
app/src/main/java/com/sheep/gamegroup/view/activity/GameCertificationActivity.java

@@ -3,24 +3,34 @@ package com.sheep.gamegroup.view.activity;
 import android.app.Activity;
 import android.os.Bundle;
 import android.os.Handler;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
 import android.view.View;
 import android.widget.ImageView;
 import android.widget.TextView;
 
+import com.kfzs.appstore.utils.adapter.recyclerview.RecyclerViewAdapter;
+import com.kfzs.appstore.utils.adapter.recyclerview.ViewHolder;
 import com.sheep.gamegroup.absBase.BaseActivity;
+import com.sheep.gamegroup.greendao.DDProviderHelper;
+import com.sheep.gamegroup.greendao.download.SdkLoginUser;
 import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.util.CertificationUtil;
 import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.GlideImageLoader;
 import com.sheep.gamegroup.util.Jump2View;
+import com.sheep.gamegroup.util.ListUtil;
+import com.sheep.gamegroup.util.ViewUtil;
 import com.sheep.gamegroup.view.customview.TextProgressBar;
 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 java.util.List;
+
 import butterknife.BindView;
 import butterknife.OnClick;
 import rx.functions.Action1;
@@ -32,29 +42,31 @@ import rx.functions.Action1;
 
 public class GameCertificationActivity extends BaseActivity {
 
+    @BindView(R.id.sdk_arrow)
+    ImageView sdk_arrow;
     @BindView(R.id.icon_iv)
     ImageView icon_iv;
     @BindView(R.id.app_name_tv)
     TextView app_name_tv;
-    @BindView(R.id.name_tv)
-    TextView name_tv;
-    @BindView(R.id.invite_num_tv)
-    TextView invite_num_tv;
-    @BindView(R.id.user_icon_iv)
-    ImageView user_icon_iv;
+    @BindView(R.id.sdk_user_name)
+    TextView sdk_user_name;
+    @BindView(R.id.sdk_user_code)
+    TextView sdk_user_code;
+    @BindView(R.id.sdk_user_iv)
+    ImageView sdk_user_iv;
+    @BindView(R.id.sdk_change_user_list)
+    RecyclerView sdk_change_user_list;
     @BindView(R.id.loading_view_img)
     View loading_view_img;
     @BindView(R.id.change_account_tv)
     TextView change_account_tv;
     @BindView(R.id.change_commit)
     TextView change_commit;
-    @BindView(R.id.empty_view)
-    View empty_view;
 
     private Activity activity;
     private Bundle extras;
-    private  UserEntity userEntity;
-    private String packgeName;
+    private UserEntity userEntity;
+    private String packageName;
     private TextProgressBar textProgressBar;
     private boolean isChangeAccount;
 
@@ -70,7 +82,51 @@ public class GameCertificationActivity extends BaseActivity {
         textProgressBar.setVisibility(View.VISIBLE);
         TitleBarUtils.getInstance().setTitle(activity, "授权登录")
                 .setTitleListen(activity, 0, null);
+        sdk_change_user_list.setVisibility(View.GONE);
+    }
+
+    private List<SdkLoginUser> userList = ListUtil.emptyList();
+
+    @Override
+    public void initListener() {
+        sdk_change_user_list.setLayoutManager(new LinearLayoutManager(this));
+        sdk_change_user_list.setHasFixedSize(true);
+        sdk_change_user_list.setNestedScrollingEnabled(false);
+        sdk_change_user_list.setAdapter(new RecyclerViewAdapter<SdkLoginUser>(this, R.layout.include_item_sdk_user, userList) {
+            @Override
+            public void convert(ViewHolder viewHolder, final SdkLoginUser item, final int position) {
+                ImageView item_sdk_arrow = viewHolder.itemView.findViewById(R.id.item_sdk_arrow);
+                ImageView item_sdk_user_iv = viewHolder.itemView.findViewById(R.id.item_sdk_user_iv);
+                TextView item_sdk_user_name = viewHolder.itemView.findViewById(R.id.item_sdk_user_name);
+                TextView item_sdk_user_code = viewHolder.itemView.findViewById(R.id.item_sdk_user_code);
+                View item_sdk_user_line = viewHolder.itemView.findViewById(R.id.item_sdk_user_line);
+                ViewUtil.setVisibility2(item_sdk_user_line, position != 0);
+                ViewUtil.setText(item_sdk_user_name, item.getNickname());
+                ViewUtil.setText(item_sdk_user_code, item.getInvitation_code());
+                GlideImageLoader.setAvatar(item_sdk_user_iv, item.getAvatar());
+                item_sdk_arrow.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        DDProviderHelper.getInstance().deleteSdkLoginUser(SheepApp.getInstance(), item);
+                        try {
+                            userList.remove(position);
+                            sdk_change_user_list.getAdapter().notifyDataSetChanged();
+                            ViewUtil.setVisibility(sdk_change_user_list, !userList.isEmpty() && isUserListOpen);
+                            ViewUtil.setVisibility2(sdk_arrow, !userList.isEmpty());
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                });
 
+                viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        CertificationUtil.newInstance().authCertificationCode(activity, item.getToken());
+                    }
+                });
+            }
+        });
     }
 
     public void initData() {
@@ -78,27 +134,43 @@ public class GameCertificationActivity extends BaseActivity {
         userEntity = DataUtil.getInstance().getUserEntity();
         if (extras != null) {
             SheepApp.getInstance().setGameCode(extras.getString(getString(R.string.kfzs_duanduan_datashare_game_code), ""));
-            packgeName = extras.getString(getString(R.string.kfzs_duanduan_datashare_package_name), "");
-            SheepApp.getInstance().setGamePackgeName(packgeName);
-            if(TextUtils.isEmpty(SheepApp.getInstance().getGameCode()) || TextUtils.isEmpty(packgeName)){
-                CertificationUtil.newInstance().showCertificationErrorAndExitApp("",2000);
+            packageName = extras.getString(getString(R.string.kfzs_duanduan_datashare_package_name), "");
+            SheepApp.getInstance().setGamePackgeName(packageName);
+            if (TextUtils.isEmpty(SheepApp.getInstance().getGameCode()) || TextUtils.isEmpty(packageName)) {
+                CertificationUtil.newInstance().showCertificationErrorAndExitApp("", 2000);
                 return;
             }
             hasToken();
         } else {
-            CertificationUtil.newInstance().showCertificationErrorAndExitApp("",2000);
+            CertificationUtil.newInstance().showCertificationErrorAndExitApp("", 2000);
         }
+        //获取登录过的用户列表
+        userList.addAll(DDProviderHelper.getInstance().getSdkLoginUserList(activity, SheepApp.getInstance().getConnectAddress().name()));
+        sdk_change_user_list.getAdapter().notifyDataSetChanged();
+        ViewUtil.setVisibility2(sdk_arrow, !userList.isEmpty());
     }
 
-    @OnClick({R.id.icon_iv, R.id.change_account_tv, R.id.change_commit})
+    //是否展开登录用户列表
+    private boolean isUserListOpen = false;
+
+    @OnClick({R.id.icon_iv, R.id.change_account_tv, R.id.change_commit, R.id.sdk_arrow})
     public void onViewClicked(View view) {
         switch (view.getId()) {
+            case R.id.sdk_arrow:
+                if (isUserListOpen) {//展开
+                    sdk_arrow.setRotation(0);
+                } else {
+                    sdk_arrow.setRotation(180);
+                }
+                isUserListOpen = !isUserListOpen;
+                ViewUtil.setVisibility(sdk_change_user_list, isUserListOpen);
+                break;
             case R.id.icon_iv:
                 textProgressBar.setVisibility(View.GONE);
                 break;
             case R.id.change_account_tv:
                 isChangeAccount = true;
-                Jump2View.getInstance().goLoginView(activity,SheepApp.getInstance().getGameCode());
+                Jump2View.getInstance().goLoginView(activity, SheepApp.getInstance().getGameCode());
                 break;
             case R.id.change_commit:
                 commitChange();
@@ -113,52 +185,52 @@ public class GameCertificationActivity extends BaseActivity {
         new Handler().postDelayed(new Runnable() {
             @Override
             public void run() {
-                if(!isChangeAccount)
-                    CertificationUtil.newInstance().authCerticicationCode(activity);
+                if (!isChangeAccount)
+                    CertificationUtil.newInstance().authCertificationCode(activity, SpUtils.getToken(SheepApp.getInstance()));
             }
-        },3000);
+        }, 3000);
     }
 
     /**
      * 是否登录
      * 请求授权
      */
-    private void hasToken(){
+    private void hasToken() {
         String token = SpUtils.getToken(SheepApp.getInstance());
-        if(TextUtils.isEmpty(token)){
-            Jump2View.getInstance().goLoginView(activity,SheepApp.getInstance().getGameCode());
-        }else {
-            if(userEntity == null){
+        if (TextUtils.isEmpty(token)) {
+            Jump2View.getInstance().goLoginView(activity, SheepApp.getInstance().getGameCode());
+        } else {
+            if (userEntity == null) {
                 CommonUtil.getInstance().updateUserInfo(new Action1<UserEntity>() {
                     @Override
                     public void call(UserEntity userEntity) {
-                        if(userEntity == null){
-                            Jump2View.getInstance().goLoginView(activity,SheepApp.getInstance().getGameCode());
-                        }else {
+                        if (userEntity == null) {
+                            Jump2View.getInstance().goLoginView(activity, SheepApp.getInstance().getGameCode());
+                        } else {
                             initWidget();
                         }
                     }
                 });
-            }else {
+            } else {
                 initWidget();
             }
 
         }
     }
+
     /**
      * 赋值
      */
-    private void initWidget(){
-        empty_view.setVisibility(View.GONE);
-        name_tv.setText(userEntity.getNickname());
-        invite_num_tv.setText(userEntity.getInvitation_code()+"");
-        GlideImageLoader.setAvatar(user_icon_iv, userEntity.getAvatar());
+    private void initWidget() {
+        ViewUtil.setText(sdk_user_name, userEntity.getNickname());
+        ViewUtil.setText(sdk_user_code, userEntity.getInvitation_code());
+        GlideImageLoader.setAvatar(sdk_user_iv, userEntity.getAvatar());
     }
 
     @Override
     public void onBackPressed() {
         super.onBackPressed();
-        if (!TextUtils.isEmpty(SheepApp.getInstance().getGamePackgeName())){
+        if (!TextUtils.isEmpty(SheepApp.getInstance().getGamePackgeName())) {
             SheepApp.getInstance().setGameFlag(true);
         }
     }

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

@@ -16,8 +16,11 @@ import com.alibaba.fastjson.JSONObject;
 import com.sheep.gamegroup.absBase.BaseUMActivity;
 import com.sheep.gamegroup.di.components.DaggerLoginComponent;
 import com.sheep.gamegroup.di.modules.LoginModule;
+import com.sheep.gamegroup.greendao.DDProviderHelper;
+import com.sheep.gamegroup.greendao.download.SdkLoginUser;
 import com.sheep.gamegroup.model.entity.BaseMessage;
 import com.sheep.gamegroup.model.entity.LoginEntity;
+import com.sheep.gamegroup.model.entity.UserEntity;
 import com.sheep.gamegroup.model.util.EntityUtils;
 import com.sheep.gamegroup.model.util.SheepSubscriber;
 import com.sheep.gamegroup.presenter.LoginContract;
@@ -25,6 +28,7 @@ import com.sheep.gamegroup.presenter.LoginPresenter;
 import com.sheep.gamegroup.util.ActivityManager;
 import com.sheep.gamegroup.util.CertificationUtil;
 import com.sheep.gamegroup.util.ChannelContent;
+import com.sheep.gamegroup.util.CommonUtil;
 import com.sheep.gamegroup.util.DataUtil;
 import com.sheep.gamegroup.util.Jump2View;
 import com.sheep.gamegroup.util.PreferenceUtils;
@@ -261,7 +265,8 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
         if(TextUtils.isEmpty(SheepApp.getInstance().getGameCode())){
             Jump2View.getInstance().checkCommendApp(this, invitation_code);
         }else {
-            CertificationUtil.newInstance().authCerticicationCode(activity);
+            CertificationUtil.newInstance().addCurUserToSdkLoginUser();
+            CertificationUtil.newInstance().authCertificationCode(activity, SpUtils.getToken(SheepApp.getInstance()));
         }
 
 
@@ -366,7 +371,8 @@ public class LoginAct extends BaseUMActivity implements LoginContract.View {
                         if(TextUtils.isEmpty(SheepApp.getInstance().getGameCode())){
                             Jump2View.getInstance().checkCommendApp(activity, EntityUtils.getUserCode(loginEty));
                         }else {
-                            CertificationUtil.newInstance().authCerticicationCode(activity);
+                            CertificationUtil.newInstance().addCurUserToSdkLoginUser();
+                            CertificationUtil.newInstance().authCertificationCode(activity, SpUtils.getToken(SheepApp.getInstance()));
                         }
                         TestUtil.saveUser(loginEty);
 

+ 1 - 1
app/src/main/java/com/sheep/jiuyan/samllsheep/SheepApp.java

@@ -402,7 +402,7 @@ public class SheepApp extends MultiDexApplication {
         public void onActivityDestroyed(Activity activity) {
             if (!TextUtils.isEmpty(gamePackgeName) && isGameFlag() && (activity instanceof GameCertificationActivity || activity instanceof LoginAct)) {
                 setGameFlag(false);
-                CertificationUtil.newInstance().doCertification(activity, gamePackgeName, "delete");
+                CertificationUtil.newInstance().doCertification(activity, null, gamePackgeName, "delete");
             }
             if (mActivityCount == 0) {
                 LogUtil.println("SheepApp onActivityDestroyed", activity.getClass().getSimpleName(), mActivityCount);

+ 91 - 126
app/src/main/res/layout/act_game_certification.xml

@@ -1,145 +1,110 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:orientation="vertical">
+    android:background="#F5F5F5">
 
     <include layout="@layout/title" />
 
-    <ScrollView
+    <android.support.v4.widget.NestedScrollView
         android:layout_width="match_parent"
         android:layout_height="match_parent"
+        android:layout_marginTop="?attr/actionBarSize"
+        android:layout_marginBottom="94dp"
         android:scrollbars="none">
 
-        <LinearLayout
+        <android.support.constraint.ConstraintLayout
             android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:orientation="vertical">
+            android:layout_height="match_parent">
+            <ImageView
+                android:id="@+id/icon_iv"
+                android:layout_width="@dimen/view_size_90"
+                android:layout_height="@dimen/view_size_90"
+                android:src="@mipmap/icon"
+                android:layout_marginTop="64dp"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent" />
+
+            <TextView
+                android:id="@+id/app_name_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="14dp"
+                android:text="小绵羊授权登录"
+                android:textColor="@color/black"
+                android:textSize="@dimen/text_size_16"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/icon_iv" />
 
             <include
-                android:id="@+id/empty_view"
-                layout="@layout/empty_view"
+                android:id="@+id/sdk_change_user"
+                layout="@layout/include_sdk_user"
                 android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_below="@+id/check_net_ll"
-                android:visibility="gone" />
-
-            <android.support.constraint.ConstraintLayout
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:layout_marginTop="@dimen/content_padding_30"
+                android:layout_height="52dp"
+                android:layout_marginTop="63dp"
                 android:background="@color/white"
-                android:paddingBottom="@dimen/content_padding_15">
-
-                <ImageView
-                    android:id="@+id/icon_iv"
-                    android:layout_width="@dimen/view_size_90"
-                    android:layout_height="@dimen/view_size_90"
-                    android:layout_marginBottom="@dimen/content_padding_9"
-                    android:src="@mipmap/icon"
-                    app:layout_constraintBottom_toTopOf="@+id/app_name_tv"
-                    app:layout_constraintEnd_toEndOf="parent"
-                    app:layout_constraintStart_toStartOf="parent" />
-
-                <TextView
-                    android:id="@+id/app_name_tv"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginBottom="@dimen/content_padding_40"
-                    android:text="小绵羊授权登录"
-                    android:textColor="@color/black"
-                    android:textSize="@dimen/text_size_16"
-                    app:layout_constraintBottom_toTopOf="@+id/user_icon_iv"
-                    app:layout_constraintEnd_toEndOf="parent"
-                    app:layout_constraintStart_toStartOf="parent" />
-
-
-                <TextView
-                    android:id="@+id/name_tv"
-                    style="@style/txt_style_15_black"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginLeft="@dimen/content_padding_30"
-                    android:layout_marginTop="@dimen/content_padding_5"
-                    android:text=""
-                    app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toTopOf="@+id/user_icon_iv" />
-
-                <TextView
-                    android:id="@+id/invite_num_tv"
-                    style="@style/txt_style_15_black"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginLeft="@dimen/content_padding_30"
-                    android:layout_marginBottom="@dimen/content_padding_5"
-                    android:text=""
-                    app:layout_constraintBottom_toBottomOf="@+id/user_icon_iv"
-                    app:layout_constraintStart_toStartOf="parent" />
-
-                <ImageView
-                    android:id="@+id/user_icon_iv"
-                    android:layout_width="55dp"
-                    android:layout_height="55dp"
-                    android:layout_alignParentRight="true"
-                    android:layout_marginRight="@dimen/content_padding_30"
-                    android:paddingTop="@dimen/content_padding_3"
-                    android:src="@mipmap/icon"
-                    app:layout_constraintBottom_toBottomOf="parent"
-                    app:layout_constraintEnd_toEndOf="parent"
-                    app:layout_constraintTop_toTopOf="parent" />
-
-                <View
-                    android:layout_width="match_parent"
-                    android:layout_height="1px"
-                    android:layout_marginTop="@dimen/content_padding_5"
-                    android:background="@color/gray_5"
-                    app:layout_constraintTop_toBottomOf="@+id/user_icon_iv" />
-
-                <View
-                    android:layout_width="match_parent"
-                    android:layout_height="1px"
-                    android:layout_marginBottom="@dimen/content_padding_5"
-                    android:background="@color/gray_5"
-                    app:layout_constraintBottom_toTopOf="@+id/user_icon_iv" />
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/app_name_tv" />
 
-                <TextView
-                    android:id="@+id/change_account_tv"
-                    style="@style/txt_style_15_black"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginLeft="@dimen/content_padding_30"
-                    android:layout_marginTop="@dimen/content_padding_20"
-                    android:layout_marginBottom="@dimen/content_padding_5"
-                    android:text="切换账号"
-                    android:textColor="#36A5ED"
-                    android:textSize="18sp"
-                    app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toBottomOf="@+id/user_icon_iv" />
-
-
-                <com.github.ybq.android.spinkit.SpinKitView
-                    android:id="@+id/loading_view_img"
-                    style="@style/SpinKitView.Large.ThreeBounce"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:visibility="invisible"
-                    android:layout_marginTop="@dimen/content_padding_20"
-                    app:SpinKit_Color="@color/colorAccent"
-                    app:layout_constraintEnd_toEndOf="parent"
-                    app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toBottomOf="@+id/change_account_tv" />
-
-                <TextView
-                    android:id="@+id/change_commit"
-                    style="@style/style_button"
-                    android:text="授权登录"
-                    app:layout_constraintEnd_toEndOf="parent"
-                    app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toBottomOf="@+id/loading_view_img" />
-            </android.support.constraint.ConstraintLayout>
-        </LinearLayout>
-    </ScrollView>
+            <View
+                android:id="@+id/sdk_change_user_line"
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                app:layout_constraintTop_toBottomOf="@+id/sdk_change_user" />
 
+            <android.support.v7.widget.RecyclerView
+                android:id="@+id/sdk_change_user_list"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@color/white"
+                app:layout_constraintTop_toBottomOf="@+id/sdk_change_user_line" />
 
-</LinearLayout>
+            <TextView
+                android:id="@+id/change_account_tv"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="1dp"
+                android:background="@color/white"
+                android:paddingStart="35dp"
+                android:paddingTop="22dp"
+                android:paddingEnd="35dp"
+                android:paddingBottom="22dp"
+                android:text="添加账号"
+                android:textColor="#36A5ED"
+                android:textSize="14sp"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/sdk_change_user_list"
+                app:layout_constraintBottom_toBottomOf="parent"/>
+
+        </android.support.constraint.ConstraintLayout>
+
+    </android.support.v4.widget.NestedScrollView>
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="94dp"
+        android:layout_alignParentBottom="true"
+        android:background="#F5F5F5"/>
+    <TextView
+        android:id="@+id/change_commit"
+        style="@style/style_button_full"
+        android:layout_height="36dp"
+        android:layout_alignParentBottom="true"
+        android:layout_marginStart="36dp"
+        android:layout_marginEnd="36dp"
+        android:layout_marginBottom="29dp"
+        android:text="授权登录" />
+
+    <com.github.ybq.android.spinkit.SpinKitView
+        android:id="@+id/loading_view_img"
+        style="@style/SpinKitView.Large.ThreeBounce"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_above="@+id/change_commit"
+        android:layout_centerHorizontal="true"
+        android:visibility="invisible"
+        app:SpinKit_Color="@color/colorAccent" />
+</RelativeLayout>

+ 74 - 0
app/src/main/res/layout/include_item_sdk_user.xml

@@ -0,0 +1,74 @@
+<?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="52dp"
+    android:background="@color/white">
+
+    <ImageView
+        android:id="@+id/item_sdk_arrow"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:paddingStart="10dp"
+        android:layout_alignParentEnd="true"
+        android:paddingEnd="27dp"
+        android:scaleType="fitCenter"
+        android:src="@mipmap/x" />
+
+    <ImageView
+        android:id="@+id/item_sdk_user_iv"
+        android:layout_width="44dp"
+        android:layout_height="44dp"
+        android:layout_centerVertical="true"
+        android:layout_toStartOf="@+id/item_sdk_arrow"
+        android:paddingTop="8dp"
+        android:paddingBottom="8dp"
+        android:src="@drawable/loading_01" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginStart="35dp"
+        android:layout_marginEnd="35dp"
+        android:layout_toStartOf="@+id/item_sdk_user_iv"
+        android:gravity="center_vertical"
+        android:orientation="vertical">
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1" />
+
+        <TextView
+            android:id="@+id/item_sdk_user_name"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="账号"
+            android:textColor="#000000"
+            android:textSize="14sp" />
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1" />
+
+        <TextView
+            android:id="@+id/item_sdk_user_code"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="绵羊号"
+            android:textColor="#999999"
+            android:textSize="12sp" />
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1" />
+    </LinearLayout>
+
+    <View
+        android:id="@+id/item_sdk_user_line"
+        android:layout_width="match_parent"
+        android:layout_height="1px"
+        android:visibility="invisible"
+        android:background="#F5F5F5"/>
+</RelativeLayout>

+ 75 - 0
app/src/main/res/layout/include_sdk_user.xml

@@ -0,0 +1,75 @@
+<?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="52dp"
+    android:background="@color/white">
+
+    <ImageView
+        android:id="@+id/sdk_arrow"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_alignParentEnd="true"
+        android:layout_marginEnd="17dp"
+        android:paddingStart="10dp"
+        android:paddingEnd="10dp"
+        android:scaleType="fitCenter"
+        android:src="@mipmap/arrow_down" />
+
+    <ImageView
+        android:id="@+id/sdk_user_iv"
+        android:layout_width="44dp"
+        android:layout_height="44dp"
+        android:layout_centerVertical="true"
+        android:layout_toStartOf="@+id/sdk_arrow"
+        android:paddingTop="8dp"
+        android:paddingBottom="8dp"
+        android:src="@drawable/loading_01" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginStart="35dp"
+        android:layout_marginEnd="35dp"
+        android:layout_toStartOf="@+id/sdk_user_iv"
+        android:gravity="center_vertical"
+        android:orientation="vertical">
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1" />
+
+        <TextView
+            android:id="@+id/sdk_user_name"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="账号"
+            android:textColor="#000000"
+            android:textSize="14sp" />
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1" />
+
+        <TextView
+            android:id="@+id/sdk_user_code"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="绵羊号"
+            android:textColor="#999999"
+            android:textSize="12sp" />
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1" />
+    </LinearLayout>
+
+    <View
+        android:id="@+id/sdk_user_line"
+        android:layout_width="match_parent"
+        android:layout_height="1px"
+        android:background="#F5F5F5"
+        android:visibility="invisible" />
+</RelativeLayout>

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


+ 7 - 0
app/src/main/res/values/dd_styles.xml

@@ -33,6 +33,13 @@
         <item name="android:layout_margin">@dimen/dp_10</item>
         <item name="android:textSize">@dimen/text_size_15</item>
     </style>
+    <style name="style_button_full" parent="button">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:gravity">center</item>
+        <item name="android:background">@drawable/selector_button_full_main</item>
+        <item name="android:textColor">@color/btn_color_main</item>
+        <item name="android:textSize">@dimen/text_size_15</item>
+    </style>
 
     <style name="style_button_find">
         <item name="android:layout_width">@dimen/find_bt_with</item>