[Modify]修復測試提的bug
This commit is contained in:
@@ -287,8 +287,6 @@ dependencies {
|
||||
//wheelView
|
||||
implementation 'com.contrarywind:wheelview:4.1.0'
|
||||
|
||||
implementation 'com.facebook.android:facebook-login:latest.release'
|
||||
|
||||
}
|
||||
|
||||
channel {
|
||||
|
@@ -296,9 +296,9 @@ public class MessageView extends FrameLayout {
|
||||
sysIconHeight = Utils.dip2px(context, 14);
|
||||
smallFace = Utils.dip2px(context, 22);
|
||||
bigFace = Utils.dip2px(context, 30);
|
||||
//經驗等級圖片後臺已經更換尺寸了,公屏同步下,尺寸是26:20
|
||||
expLevelHeight = Utils.dip2px(context, 20);
|
||||
expLevelWidth = expLevelHeight * 26 / 20;//expLevelHeight * 114 / 45
|
||||
//經驗等級圖片後臺已經更換尺寸了,公屏同步下,尺寸是36:18
|
||||
expLevelHeight = Utils.dip2px(context, 18);
|
||||
expLevelWidth = expLevelHeight * 36 / 18;//expLevelHeight * 114 / 45
|
||||
giftLength = Utils.dip2px(context, 35);
|
||||
// 內容區域
|
||||
layoutManger = new LinearLayoutManager(context, RecyclerView.VERTICAL, false);
|
||||
|
@@ -72,7 +72,8 @@ class RoomEffectBoxView @JvmOverloads constructor(
|
||||
private val mCarEffectList: MutableList<CarInfo?> by lazy { ArrayList() }
|
||||
|
||||
//頂部飄屏總展示時間
|
||||
private val SHOW_TIME = 4000
|
||||
private val SHOW_TIME = 4500
|
||||
private val CLOSE_TIME = 5000
|
||||
|
||||
//頂部飄屏周期
|
||||
private val PERIOD = 1000
|
||||
@@ -345,9 +346,15 @@ class RoomEffectBoxView @JvmOverloads constructor(
|
||||
binding.flBoxNotify.addView(textView)
|
||||
textView.startAnimation(animationBox)
|
||||
binding.flBoxNotify.postDelayed(
|
||||
{ binding.flBoxNotify.removeView(textView) },
|
||||
{
|
||||
animationBox = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify_close)
|
||||
textView.startAnimation(animationBox)
|
||||
},
|
||||
SHOW_TIME.toLong()
|
||||
)
|
||||
binding.flBoxNotify.postDelayed({
|
||||
binding.flBoxNotify.removeView(textView)
|
||||
}, CLOSE_TIME.toLong())
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -77,7 +77,8 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
private val mCarEffectList: MutableList<CarInfo?> by lazy { ArrayList() }
|
||||
|
||||
//頂部飄屏總展示時間
|
||||
private val SHOW_TIME = 4000
|
||||
private val SHOW_TIME = 4500
|
||||
private val CLOSE_TIME = 5000
|
||||
|
||||
//頂部飄屏周期
|
||||
private val PERIOD = 1000
|
||||
@@ -790,11 +791,15 @@ class RoomEffectView @JvmOverloads constructor(
|
||||
textView.startAnimation(animationPlay)
|
||||
binding.flPlayNotify.postDelayed(
|
||||
{
|
||||
binding.flPlayNotify.removeView(textView)
|
||||
isPlayAnim = false
|
||||
animationPlay = AnimationUtils.loadAnimation(mContext, R.anim.anim_box_notify_close)
|
||||
textView.startAnimation(animationPlay)
|
||||
},
|
||||
SHOW_TIME.toLong()
|
||||
)
|
||||
binding.flPlayNotify.postDelayed({
|
||||
binding.flPlayNotify.removeView(textView)
|
||||
isPlayAnim = false
|
||||
}, CLOSE_TIME.toLong())
|
||||
}
|
||||
|
||||
private fun showBoxNotifyBySVGA(roomPlayBean: RoomPlayBean) {
|
||||
|
@@ -40,10 +40,6 @@ class DecorationViewModel : BaseViewModel() {
|
||||
block = {
|
||||
_decorationInfoListLiveData.value =
|
||||
ListResult.success(DecorationModel.getDecorationInfoList(dressType), 1)
|
||||
},
|
||||
onError = {
|
||||
it.message.toast()
|
||||
_decorationInfoListLiveData.value = ListResult.failed(1)
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -54,7 +50,7 @@ class DecorationViewModel : BaseViewModel() {
|
||||
block = {
|
||||
DecorationModel.buyDecoration(dressType, dressId)
|
||||
ResUtil.getString(R.string.decoration_viewmodel_decorationviewmodel_01).toast()
|
||||
},
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
@@ -10,8 +10,6 @@ import android.text.method.LinkMovementMethod;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.CookieSyncManager;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.TextView;
|
||||
|
||||
@@ -23,12 +21,12 @@ import com.facebook.CallbackManager;
|
||||
import com.facebook.FacebookCallback;
|
||||
import com.facebook.FacebookException;
|
||||
import com.facebook.GraphRequest;
|
||||
import com.facebook.GraphResponse;
|
||||
import com.facebook.Profile;
|
||||
import com.facebook.login.LoginManager;
|
||||
import com.facebook.login.LoginResult;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
import com.netease.nim.uikit.StatusBarUtil;
|
||||
import com.netease.nim.uikit.common.util.log.LogUtil;
|
||||
import com.tongdaxing.erban.upgrade.AppUpgradeHelper;
|
||||
import com.trello.rxlifecycle3.android.ActivityEvent;
|
||||
import com.yizhuan.erban.MainActivity;
|
||||
@@ -49,12 +47,14 @@ import com.yizhuan.xchat_android_core.auth.event.LoginReportEvent;
|
||||
import com.yizhuan.xchat_android_library.common.SpConstants;
|
||||
import com.yizhuan.xchat_android_library.common.util.SPUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.AppMetaDataUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.DeviceUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.constant.PackageNameConstants;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -65,6 +65,7 @@ import io.reactivex.disposables.Disposable;
|
||||
public class LoginActivity extends BaseActivity implements View.OnClickListener {
|
||||
|
||||
private static final String NEED_CHECKED_PROTOCOL = "need_checked_protocol";
|
||||
private static final String TAG = "LoginActivity";
|
||||
protected CheckBox tvProtocol;
|
||||
private TextView tvProtocolHint;
|
||||
|
||||
@@ -93,22 +94,17 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
LoginManager.getInstance().registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
|
||||
@Override
|
||||
public void onSuccess(LoginResult loginResult) {
|
||||
SingleToastUtil.showToast("成功");
|
||||
getFbLoginInfo(loginResult.getAccessToken());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
SingleToastUtil.showToast("cancel");
|
||||
CookieSyncManager.createInstance(LoginActivity.this);
|
||||
CookieManager cookieManager = CookieManager.getInstance();
|
||||
cookieManager.removeAllCookie();
|
||||
CookieSyncManager.getInstance().sync();
|
||||
LogUtil.i(TAG, "Meta login canceled");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(FacebookException error) {
|
||||
SingleToastUtil.showToast("error");
|
||||
LogUtil.e(TAG, "Meta login failed error:" + error.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -117,22 +113,31 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
* 获取Facebook个人信息
|
||||
*/
|
||||
public void getFbLoginInfo(AccessToken accessToken) {
|
||||
GraphRequest request = GraphRequest.newMeRequest(accessToken, new GraphRequest.GraphJSONObjectCallback() {
|
||||
@Override
|
||||
public void onCompleted(JSONObject object, GraphResponse response) {
|
||||
if (object != null) {
|
||||
String id = object.optString("id");
|
||||
String name = object.optString("name");
|
||||
String gender = object.optString("gender"); //性别
|
||||
String email = object.optString("email");
|
||||
//获取用户头像
|
||||
JSONObject object_pic = object.optJSONObject("picture");
|
||||
JSONObject object_data = object_pic.optJSONObject("data");
|
||||
String photo = object_data.optString("url");
|
||||
//获取地域信息
|
||||
String locale = object.optString("locale"); //zh_CN 代表中文简体
|
||||
// getP().doLoginByOauth(id, name, photo, "2");
|
||||
}
|
||||
GraphRequest request = GraphRequest.newMeRequest(accessToken, (object, response) -> {
|
||||
if (object != null) {
|
||||
AuthModel.get().facebookLogin(object)
|
||||
.compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
.subscribe(new SingleObserver<String>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
reportLoginResult(IReportConstants.ONE, IReportConstants.ONE, "");
|
||||
HashMap<String, Object> map = new HashMap<>(2);
|
||||
map.put(FirebaseAnalytics.Param.METHOD, getString(R.string.login_facebook));
|
||||
ReportManager.get().reportEvent(FirebaseAnalytics.Event.LOGIN, map);
|
||||
ReportManager.get().reportAdjustEvent(IReportConstants.ADJUST_LOGIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
reportLoginResult(IReportConstants.ONE, IReportConstants.ZERO, e.getMessage());
|
||||
dealWithLoginError(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -246,42 +251,20 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
|
||||
switch (v.getId()) {
|
||||
case R.id.cs_facebook:
|
||||
//是否安装客户端
|
||||
if (!DeviceUtils.isAppInstalled(this, PackageNameConstants.FACEBOOK_NAME)) {
|
||||
SingleToastUtil.showToast(ResUtil.getString(com.yizhuan.xchat_android_core.R.string.xchat_android_core_auth_authmodel_03));
|
||||
return;
|
||||
}
|
||||
reportLoginType(IReportConstants.ONE);
|
||||
//判断当前token,如果不为空,则已经获取过权限,否则读取权限走registerCallback回调
|
||||
AccessToken accessToken = AccessToken.getCurrentAccessToken();
|
||||
Profile profile = Profile.getCurrentProfile();
|
||||
if (accessToken == null || accessToken.isExpired() || profile == null) {
|
||||
LoginManager.getInstance().logInWithReadPermissions(this, List.of("public_profile, email, user_birthday, user_friends"));
|
||||
LoginManager.getInstance().logInWithReadPermissions(this, List.of("public_profile"));
|
||||
} else {
|
||||
getFbLoginInfo(accessToken);
|
||||
}
|
||||
|
||||
// reportLoginType(IReportConstants.ONE);
|
||||
// getDialogManager().showProgressDialog(this);
|
||||
// AuthModel.get().facebookLogin()
|
||||
// .compose(bindUntilEvent(ActivityEvent.DESTROY))
|
||||
// .subscribe(new SingleObserver<String>() {
|
||||
// @Override
|
||||
// public void onSubscribe(Disposable d) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onSuccess(String result) {
|
||||
// reportLoginResult(IReportConstants.ONE, IReportConstants.ONE, "");
|
||||
// HashMap<String, Object> map = new HashMap<>(2);
|
||||
// map.put(FirebaseAnalytics.Param.METHOD, getString(R.string.login_facebook));
|
||||
// ReportManager.get().reportEvent(FirebaseAnalytics.Event.LOGIN, map);
|
||||
// ReportManager.get().reportAdjustEvent(IReportConstants.ADJUST_LOGIN);
|
||||
// getDialogManager().dismissDialog();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onError(Throwable e) {
|
||||
// reportLoginResult(IReportConstants.ONE, IReportConstants.ZERO, e.getMessage());
|
||||
// getDialogManager().dismissDialog();
|
||||
// dealWithLoginError(e);
|
||||
// }
|
||||
// });
|
||||
break;
|
||||
case R.id.cs_line:
|
||||
reportLoginType(IReportConstants.TWO);
|
||||
@@ -418,6 +401,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
LoginManager.getInstance().unregisterCallback(callbackManager);
|
||||
EventBus.getDefault().unregister(this);
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="500"
|
||||
android:fromXDelta="100%p"
|
||||
android:interpolator="@android:anim/accelerate_interpolator"
|
||||
android:toXDelta="0" />
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<translate
|
||||
android:duration="500"
|
||||
android:fromXDelta="100%p"
|
||||
android:toXDelta="0"/>
|
||||
<alpha
|
||||
android:duration="500"
|
||||
android:fromAlpha="0.0"
|
||||
android:toAlpha="1.0"/>
|
||||
</set>
|
11
app/src/main/res/anim/anim_box_notify_close.xml
Normal file
11
app/src/main/res/anim/anim_box_notify_close.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<translate
|
||||
android:duration="500"
|
||||
android:fromXDelta="0"
|
||||
android:toXDelta="-100%p"/>
|
||||
<alpha
|
||||
android:duration="500"
|
||||
android:fromAlpha="1.0"
|
||||
android:toAlpha="0.0"/>
|
||||
</set>
|
@@ -263,8 +263,8 @@
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:visibility="visible"
|
||||
tools:src="@mipmap/ic_user_level" />
|
||||
|
||||
@@ -272,12 +272,11 @@
|
||||
android:id="@+id/iv_user_charm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:visibility="visible"
|
||||
tools:src="@drawable/ic_user_charm_level" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/in_official_mask"
|
||||
android:layout_width="wrap_content"
|
||||
|
@@ -79,20 +79,18 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="@dimen/dp_19"
|
||||
android:layout_height="@dimen/dp_19"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_charm_level"
|
||||
android:layout_width="@dimen/dp_19"
|
||||
android:layout_height="@dimen/dp_19"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -179,7 +179,7 @@
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
|
@@ -60,20 +60,18 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_charm_level"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -60,20 +60,18 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_charm_level"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -58,20 +58,18 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_charm_level"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -108,20 +108,20 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_charm_level"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="@dimen/dp_15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:scaleType="fitXY"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -80,20 +80,18 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="@dimen/dp_19"
|
||||
android:layout_height="@dimen/dp_19"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_charm_level"
|
||||
android:layout_width="@dimen/dp_19"
|
||||
android:layout_height="@dimen/dp_19"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -196,18 +196,18 @@
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="17dp"
|
||||
android:layout_marginEnd="@dimen/dp_3"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:visibility="visible"
|
||||
tools:src="@mipmap/ic_user_level" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_charm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="17dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:visibility="visible"
|
||||
tools:src="@drawable/ic_user_charm_level" />
|
||||
|
||||
@@ -215,13 +215,15 @@
|
||||
android:id="@+id/tv_101"
|
||||
visible="@{userInfo.userInfoSkillVo.liveTag}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="15dp"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/tag_101"
|
||||
android:adjustViewBounds="true"
|
||||
android:gravity="center"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="10sp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
tools:ignore="SmallSp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@@ -103,9 +103,7 @@
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:minWidth="@dimen/dp_25"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
@@ -114,9 +112,7 @@
|
||||
android:id="@+id/iv_charm_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:minWidth="@dimen/dp_25"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -97,9 +97,7 @@
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:minWidth="@dimen/dp_25"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
@@ -108,9 +106,7 @@
|
||||
android:id="@+id/iv_charm_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:minWidth="@dimen/dp_25"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -106,20 +106,18 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_charm_level"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -60,13 +60,12 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/ic_mark_limit" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_user_card_wear"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:scaleType="fitXY"
|
||||
android:adjustViewBounds="true"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_used"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@@ -103,20 +103,18 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_charm_level"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -105,20 +105,19 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_charm_level"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -72,7 +72,6 @@
|
||||
android:id="@+id/iv_noble_level"
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="17dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:visibility="gone"
|
||||
app:layout_flexShrink="0"
|
||||
tools:src="@mipmap/ic_user_level_king"
|
||||
@@ -80,10 +79,9 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="@dimen/dp_19"
|
||||
android:layout_height="@dimen/dp_19"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
app:layout_flexShrink="0"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
@@ -91,10 +89,9 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_charm_level"
|
||||
android:layout_width="@dimen/dp_19"
|
||||
android:layout_height="@dimen/dp_19"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
app:layout_flexShrink="0"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
|
@@ -103,14 +103,14 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:layout_toEndOf="@+id/iv_noble_level"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
@@ -4311,7 +4311,7 @@
|
||||
<string name="layout_item_member_01">小澀瑤小澀瑤小澀瑤</string>
|
||||
<string name="layout_item_member_02">什麽鬼</string>
|
||||
<string name="layout_item_member_03">所屬公所屬公會昵稱會昵稱</string>
|
||||
<string name="layout_item_search_admin_01">女神沒有大長腿啊啊啊</string>
|
||||
<string name="layout_item_search_admin_01">女神沒有大長腿啊啊啊阿薩大廈健康的殺害的</string>
|
||||
<string name="layout_item_search_admin_02">設置為超管</string>
|
||||
<string name="layout_item_single_room_income_01">忘忘忘忘憂閣憂閣憂閣憂閣</string>
|
||||
<string name="layout_item_vip_auth_01">專屬銘牌</string>
|
||||
|
@@ -80,7 +80,6 @@
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/ic_user_official_13dp"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_vip_icon"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_nick" />
|
||||
@@ -89,9 +88,8 @@
|
||||
android:id="@+id/iv_user_charm_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/ic_user_new_13dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_user_wealth_level"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_user_wealth_level"
|
||||
@@ -101,7 +99,7 @@
|
||||
android:id="@+id/ll_official_mask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_user_wealth_level"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_user_charm_level"
|
||||
@@ -135,7 +133,7 @@
|
||||
android:includeFontPadding="false"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11dp"
|
||||
android:textSize="@dimen/sp_11"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_official_mask"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_official_mask"
|
||||
@@ -143,6 +141,7 @@
|
||||
tools:text="@string/layout_layout_dy_nick_detail_02" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
|
@@ -75,9 +75,9 @@
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="17dp"
|
||||
android:layout_height="18dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
@@ -85,12 +85,13 @@
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_charm_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="17dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_height="18dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
@@ -26,6 +26,10 @@
|
||||
android:layout_marginStart="6dp"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="18sp"
|
||||
android:maxWidth="160dp"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:singleLine="true"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_avatar"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_avatar"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
|
@@ -341,7 +341,8 @@
|
||||
<com.yizhuan.erban.avroom.anotherroompk.RoomPKBoardView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/micro_view"
|
||||
android:layout_below="@id/contribute_list"
|
||||
android:layout_marginTop="80dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:visibility="@{(roomInfo.roomModeType==7) ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
|
@@ -91,19 +91,19 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="15dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_charm"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginStart="5dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -81,20 +81,18 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_charm_level"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -81,20 +81,18 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_user_level"
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_charm_level"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:adjustViewBounds="true"
|
||||
android:visibility="gone"
|
||||
tools:src="@mipmap/ic_user_level"
|
||||
tools:visibility="visible" />
|
||||
|
@@ -56,11 +56,11 @@ import com.yizhuan.xchat_android_library.utils.constant.PackageNameConstants;
|
||||
import com.yizhuan.xchat_android_library.utils.json.JsonUtils;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cn.sharesdk.facebook.Facebook;
|
||||
import cn.sharesdk.framework.Platform;
|
||||
import cn.sharesdk.framework.PlatformActionListener;
|
||||
import cn.sharesdk.framework.ShareSDK;
|
||||
@@ -220,13 +220,13 @@ public class AuthModel extends BaseModel implements IAuthModel {
|
||||
return Single.error(new Throwable(""));//没有账号信息
|
||||
}
|
||||
return requestTicket().flatMap(ticketResult -> {
|
||||
if (!ticketResult.isSuccess()) {
|
||||
return Single.error(new Throwable(ticketResult.getMessage()));
|
||||
}
|
||||
ticketInfo = ticketResult.getData();
|
||||
DemoCache.saveTicketInfo(ticketInfo);
|
||||
return Single.just(ResUtil.getString(R.string.xchat_android_core_auth_authmodel_01));
|
||||
})
|
||||
if (!ticketResult.isSuccess()) {
|
||||
return Single.error(new Throwable(ticketResult.getMessage()));
|
||||
}
|
||||
ticketInfo = ticketResult.getData();
|
||||
DemoCache.saveTicketInfo(ticketInfo);
|
||||
return Single.just(ResUtil.getString(R.string.xchat_android_core_auth_authmodel_01));
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.flatMap((Function<String, SingleSource<String>>) s -> {
|
||||
@@ -253,62 +253,62 @@ public class AuthModel extends BaseModel implements IAuthModel {
|
||||
@Override
|
||||
public Single<String> login(String phoneAreaCode, String account, String password, String code, String yiDunToken, String shuMeiDeviceId) {
|
||||
return Single.create((SingleOnSubscribe<String>) emitter -> {
|
||||
//获取登录信息
|
||||
try {
|
||||
LoginResult loginResult = api.login(
|
||||
phoneAreaCode,
|
||||
DESUtils.DESAndBase64(account),
|
||||
VersionUtil.getLocalName(BasicConfig.INSTANCE.getAppContext()),
|
||||
"erban-client",
|
||||
DESUtils.DESAndBase64(account),
|
||||
DESAndBase64(password),
|
||||
"password",
|
||||
"uyzjdhds",
|
||||
code,
|
||||
yiDunToken,
|
||||
shuMeiDeviceId
|
||||
).blockingGet();
|
||||
if (!loginResult.isSuccess()) {
|
||||
if (loginResult.getCode() == CODE_BAN_ACCOUNT || loginResult.getCode() == CODE_BAN_DEVICE) {
|
||||
emitter.onError(new BanAccountException(loginResult.getReason(), loginResult.getDate()));
|
||||
} else if (loginResult.getCode() == CODE_ACCOUNT_CANCEL) {
|
||||
emitter.onError(new AccountCancelException(loginResult.getMessage(), loginResult.getErbanNo(), loginResult.getCancelDate()));
|
||||
} else if (loginResult.getCode() == SUPER_CODE_SHOW_CODE) {
|
||||
//是否是超管
|
||||
if (loginResult.getSuperCodeVerify() == 1) {
|
||||
emitter.onError(new IsSuperAdminException(loginResult.getMessage()));
|
||||
} else {
|
||||
emitter.onError(new Throwable(loginResult.getMessage()));
|
||||
//获取登录信息
|
||||
try {
|
||||
LoginResult loginResult = api.login(
|
||||
phoneAreaCode,
|
||||
DESUtils.DESAndBase64(account),
|
||||
VersionUtil.getLocalName(BasicConfig.INSTANCE.getAppContext()),
|
||||
"erban-client",
|
||||
DESUtils.DESAndBase64(account),
|
||||
DESAndBase64(password),
|
||||
"password",
|
||||
"uyzjdhds",
|
||||
code,
|
||||
yiDunToken,
|
||||
shuMeiDeviceId
|
||||
).blockingGet();
|
||||
if (!loginResult.isSuccess()) {
|
||||
if (loginResult.getCode() == CODE_BAN_ACCOUNT || loginResult.getCode() == CODE_BAN_DEVICE) {
|
||||
emitter.onError(new BanAccountException(loginResult.getReason(), loginResult.getDate()));
|
||||
} else if (loginResult.getCode() == CODE_ACCOUNT_CANCEL) {
|
||||
emitter.onError(new AccountCancelException(loginResult.getMessage(), loginResult.getErbanNo(), loginResult.getCancelDate()));
|
||||
} else if (loginResult.getCode() == SUPER_CODE_SHOW_CODE) {
|
||||
//是否是超管
|
||||
if (loginResult.getSuperCodeVerify() == 1) {
|
||||
emitter.onError(new IsSuperAdminException(loginResult.getMessage()));
|
||||
} else {
|
||||
emitter.onError(new Throwable(loginResult.getMessage()));
|
||||
}
|
||||
} else {
|
||||
emitter.onError(new Throwable(loginResult.getMessage()));
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
emitter.onError(new Throwable(loginResult.getMessage()));
|
||||
currentAccountInfo = loginResult.getData();
|
||||
DemoCache.saveCurrentAccountInfo(currentAccountInfo);
|
||||
//成功获取到uid后,就通知首页刷新审核中状态的数据
|
||||
EventBus.getDefault().post(new GetCurrentUidEvent(true));
|
||||
} catch (Exception e) {
|
||||
emitter.onError(new Throwable(OldHttpErrorHandleUtil.handle(e)));
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
currentAccountInfo = loginResult.getData();
|
||||
DemoCache.saveCurrentAccountInfo(currentAccountInfo);
|
||||
//成功获取到uid后,就通知首页刷新审核中状态的数据
|
||||
EventBus.getDefault().post(new GetCurrentUidEvent(true));
|
||||
} catch (Exception e) {
|
||||
emitter.onError(new Throwable(OldHttpErrorHandleUtil.handle(e)));
|
||||
return;
|
||||
}
|
||||
//获取tick
|
||||
try {
|
||||
TicketResult ticketResult = requestTicket().blockingGet();
|
||||
if (!ticketResult.isSuccess()) {
|
||||
emitter.onError(new Throwable(ticketResult.getMessage()));
|
||||
return;
|
||||
}
|
||||
ticketInfo = ticketResult.getData();
|
||||
DemoCache.saveTicketInfo(ticketInfo);
|
||||
//获取tick
|
||||
try {
|
||||
TicketResult ticketResult = requestTicket().blockingGet();
|
||||
if (!ticketResult.isSuccess()) {
|
||||
emitter.onError(new Throwable(ticketResult.getMessage()));
|
||||
return;
|
||||
}
|
||||
ticketInfo = ticketResult.getData();
|
||||
DemoCache.saveTicketInfo(ticketInfo);
|
||||
|
||||
} catch (Exception e) {
|
||||
emitter.onError(new Throwable(OldHttpErrorHandleUtil.handle(e)));
|
||||
return;
|
||||
}
|
||||
emitter.onSuccess(ResUtil.getString(R.string.xchat_android_core_auth_authmodel_02));
|
||||
})
|
||||
} catch (Exception e) {
|
||||
emitter.onError(new Throwable(OldHttpErrorHandleUtil.handle(e)));
|
||||
return;
|
||||
}
|
||||
emitter.onSuccess(ResUtil.getString(R.string.xchat_android_core_auth_authmodel_02));
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.flatMap(new Function<String, SingleSource<String>>() {
|
||||
@@ -332,51 +332,26 @@ public class AuthModel extends BaseModel implements IAuthModel {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Single<String> facebookLogin() {
|
||||
return Single.create((SingleOnSubscribe<Platform>) e -> {
|
||||
facebook = ShareSDK.getPlatform(Facebook.NAME);
|
||||
//是否安装客户端
|
||||
if (!DeviceUtils.isAppInstalled(getContext(), PackageNameConstants.FACEBOOK_NAME)) {
|
||||
e.onError(new Throwable(ResUtil.getString(R.string.xchat_android_core_auth_authmodel_03)));
|
||||
return;
|
||||
}
|
||||
if (facebook.isAuthValid()) {
|
||||
facebook.removeAccount(true);
|
||||
}
|
||||
facebook.setPlatformActionListener(new PlatformActionListener() {
|
||||
@Override
|
||||
public void onComplete(final Platform platform, int i, HashMap<String, Object> hashMap) {
|
||||
if (i == Platform.ACTION_USER_INFOR) {
|
||||
String openid = platform.getDb().getUserId();
|
||||
String unionid = platform.getDb().get("unionid");
|
||||
Logger.i(platform.getDb().getUserGender() + "----openid" + openid + "unionid" + unionid + platform.getDb().getUserIcon());
|
||||
thirdUserInfo = new ThirdUserInfo();
|
||||
thirdUserInfo.setType(ThirdUserInfo.TYPE_FACEBOOK);
|
||||
thirdUserInfo.setPlatform("Facebook");
|
||||
thirdUserInfo.setUserName(platform.getDb().getUserName());
|
||||
thirdUserInfo.setUserGender(platform.getDb().getUserGender());
|
||||
thirdUserInfo.setUserIcon(platform.getDb().getUserIcon());
|
||||
e.onSuccess(platform);
|
||||
}
|
||||
}
|
||||
public Single<String> facebookLogin(JSONObject object) {
|
||||
return Single.create((SingleOnSubscribe<JSONObject>) e -> {
|
||||
String name = object.optString("name");
|
||||
String gender = object.optString("gender"); //性别
|
||||
//获取用户头像
|
||||
JSONObject object_pic = object.optJSONObject("picture");
|
||||
JSONObject object_data = object_pic.optJSONObject("data");
|
||||
String photo = object_data.optString("url");
|
||||
|
||||
@Override
|
||||
public void onError(Platform platform, int i, Throwable throwable) {
|
||||
e.onError(new Throwable(ResUtil.getString(R.string.xchat_android_core_auth_authmodel_04) + i));
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(Platform platform, int i) {
|
||||
e.onError(new Throwable(ResUtil.getString(R.string.xchat_android_core_auth_authmodel_05)));
|
||||
}
|
||||
});
|
||||
facebook.SSOSetting(false);
|
||||
facebook.showUser(null);
|
||||
thirdUserInfo = new ThirdUserInfo();
|
||||
thirdUserInfo.setType(ThirdUserInfo.TYPE_FACEBOOK);
|
||||
thirdUserInfo.setPlatform("Facebook");
|
||||
thirdUserInfo.setUserName(name);
|
||||
thirdUserInfo.setUserGender(gender);
|
||||
thirdUserInfo.setUserIcon(photo);
|
||||
e.onSuccess(object);
|
||||
})
|
||||
.flatMap(platform -> {
|
||||
String openid = platform.getDb().getUserId();
|
||||
String unionid = platform.getDb().getUserId();
|
||||
String openid = platform.optString("id");
|
||||
String unionid = platform.optString("id");
|
||||
String avatar = thirdUserInfo.getUserIcon();
|
||||
if (avatar != null && avatar.equals("null")) {
|
||||
avatar = null;
|
||||
|
@@ -1,8 +1,11 @@
|
||||
package com.yizhuan.xchat_android_core.auth;
|
||||
|
||||
import com.facebook.CallbackManager;
|
||||
import com.yizhuan.xchat_android_core.auth.entity.ThirdUserInfo;
|
||||
import com.yizhuan.xchat_android_core.base.IModel;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
||||
public interface IAuthModel extends IModel {
|
||||
@@ -57,7 +60,7 @@ public interface IAuthModel extends IModel {
|
||||
*/
|
||||
Single<String> login(String phoneAreaCode, String account, String password, String code, String yiDunToken, String shuMeiDeviceId);
|
||||
|
||||
Single<String> facebookLogin();
|
||||
Single<String> facebookLogin(JSONObject object);
|
||||
|
||||
Single<String> lineLogin();
|
||||
|
||||
|
@@ -201,7 +201,7 @@
|
||||
<string name="xchat_android_core_auth_authmodel_032">IM登錄成功</string>
|
||||
<string name="xchat_android_core_auth_authmodel_033">IM登錄成功</string>
|
||||
<string name="xchat_android_core_auth_authmodel_034">失敗錯誤碼:</string>
|
||||
<string name="xchat_android_core_auth_authmodel_035">IM登錄失敗錯誤碼:</string>
|
||||
<string name="xchat_android_core_auth_authmodel_035">網絡異常,請切換網絡后重試:</string>
|
||||
<string name="xchat_android_core_auth_authmodel_036">IM登錄失敗異常信息:</string>
|
||||
<string name="auth_exception_oldmemberexception_01">不存在對應賬號</string>
|
||||
<string name="xchat_android_core_base_basemodel_01">未知錯誤!</string>
|
||||
|
@@ -141,6 +141,8 @@ dependencies {
|
||||
|
||||
api 'com.umeng.sdk:utdid:1.1.5.3'
|
||||
|
||||
api 'com.facebook.android:facebook-login:latest.release'
|
||||
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
Reference in New Issue
Block a user