Commit 80de5327 by 刘鹏

1.dynamic模块,登录接入优先一键登录功能

parent 402ac5e5
......@@ -11,12 +11,12 @@ ext {
"m-user" : "0.0.60.91",
"m-home" : "0.0.22.52",
"m-im" : "0.0.18.34",
"m-dynamic" : "0.0.7.13",
"m-dynamic" : "0.0.7.15",
"m-article" : "0.0.0.6",
"m-muse" : "0.0.28.20",
"m-tests" : "0.0.24.10",
"m-course" : "0.0.42.14",
"m-course" : "0.0.42.16",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
......@@ -90,15 +90,15 @@ ext {
"m-confide" : "0.0.48.92",
"m-consultant" : "0.0.59.65",
"m-fm" : "0.0.23.5",
"m-fm" : "0.0.30.01",
"m-user" : "0.0.60.91",
"m-home" : "0.0.22.52",
"m-im" : "0.0.3.34",
"m-dynamic" : "0.0.1.7",
"m-dynamic" : "0.0.7.15",
"m-muse" : "0.0.20.7",
"m-tests" : "0.0.24.9",
"m-course" : "0.0.34.10",
"m-course" : "0.0.42.16",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.1",
......
......@@ -29,13 +29,14 @@ import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.config.YDLConstants;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.ui.ParcelableImage;
import com.ydl.ydlcommon.utils.StatusBarUtils;
import com.ydl.ydlcommon.view.dialog.ListDialog;
import com.ydl.ydlcommon.view.widgets.BorderCircleImageView;
import com.ydl.ydlcommon.view.widgets.MyNestedScrollView;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R;
import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.common.browsePictures.BrowsePicturesActivity;
import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.dialog.CancelFocusDialog;
......@@ -43,7 +44,6 @@ import com.yidianling.dynamic.event.BlackEvent;
import com.yidianling.dynamic.event.LoginStateEvent;
import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.model.MemberInfoBean;
import com.ydl.ydlcommon.ui.ParcelableImage;
import com.yidianling.dynamic.router.DynamicIn;
import com.yidianling.dynamic.trendList.TrendListInFragment;
import com.yidianling.user.api.event.UserLoginEvent;
......@@ -325,10 +325,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
if (v.getId()==R.id.members_title_back_iv){
onBackPressed();
}else if (v.getId()==R.id.members_title_top_right_tv){
boolean loginstate = DynamicIn.INSTANCE.isLogin();
if (false == loginstate) {
startActivity(DynamicIn.INSTANCE.loginWayIntent(this));
} else {
if (DynamicIn.INSTANCE.loginByOneKeyLogin(this, true)) {
RightSet();
}
}else if (v.getId()==R.id.members_trend_rel){
......@@ -336,10 +333,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
}else if (v.getId()==R.id.members_information_rel){
setTabSelection(1);
}else if (v.getId()==R.id.members_top_user_focus_ortion_rel){
if (DynamicIn.INSTANCE.isLogin() == false) {
startActivity(DynamicIn.INSTANCE.loginWayIntent(this));
// startActivity(new Intent(mContext, ChooseLoginWayActivity.class));
} else {
if (DynamicIn.INSTANCE.loginByOneKeyLogin(this, true)) {
if (shielding == false) {
if ("1".equals(focus_state)) {//1已关注,2未关注,4代表自己
String phone = DynamicIn.INSTANCE.getUserInfo().getPhone();
......@@ -360,12 +354,8 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
}
}
}else if (v.getId()==R.id.members_top_user_focus_iv){
if (DynamicIn.INSTANCE.isLogin() == false) {
startActivity(DynamicIn.INSTANCE.loginWayIntent(this));
// startActivity(new Intent(mContext, ChooseLoginWayActivity.class));
} else {
if (DynamicIn.INSTANCE.loginByOneKeyLogin(this,true)) {
Zan();
}
}else if (v.getId()== R.id.members_top_head_iv){
Intent intent = new Intent();
......@@ -686,13 +676,8 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
builder1.SetOnItemClickLister(new ListDialog.Builder.OnItemClickLister() {
@Override
public void onItemClick(Dialog dialog, View view, int position) {
// ToastUtil.toastShort(mContext, dialog_datas.get(position));
dialog.dismiss();
if (!DynamicIn.INSTANCE.isLogin()) {
//未登录则跳转登录页面
startActivity(DynamicIn.INSTANCE.loginWayIntent(MembersActivity.this));
// Intent intent = new Intent(mContext, ChooseLoginWayActivity.class);
// startActivity(intent);
if (!DynamicIn.INSTANCE.loginByOneKeyLogin(MembersActivity.this,true)) {
return;
}
Command.ReportWorry cmd = new Command.ReportWorry(Integer.valueOf(mem_id), Integer.valueOf(reportReasonsId.get(position)), 0, reportReasons.get(position), 2);
......
package com.yidianling.dynamic.router
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.support.v4.app.DialogFragment
import android.support.v7.app.AppCompatActivity
......@@ -172,4 +173,12 @@ object DynamicIn {
fun startCoursePlayPage(activity: Activity){
getCourseService().startCoursePlayPage(activity,1)
}
/**
* 调用优先使用一键登录,并返回调用时的登录状态,
* @param isOpenDialog true:一键登录使用弹窗展示 false:一键登录使用全屏模式
* @return true:已登录,不触发登录跳转,false:未登录,优先一键登录
* */
fun loginByOneKeyLogin(context: Context, isOpenDialog: Boolean) :Boolean{
return getUserService().loginByOneKeyLogin(context,isOpenDialog)
}
}
\ No newline at end of file
......@@ -98,12 +98,9 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment {
NewH5Activity.start(getActivity(), h5Params);
} else if (zjservice.is_online.equals("2")) {
if (!DynamicIn.INSTANCE.isLogin()) {
// OuterEmptyImp.gotoChooseLoginWay(getActivity());
startActivity(DynamicIn.INSTANCE.loginWayIntent(getActivity()));
if (!DynamicIn.INSTANCE.loginByOneKeyLogin(getActivity(),true)) {
return;
}
H5Params h5Params = new H5Params(DynamicConstants.Companion.getWWWXIADAN() + docid, null);
NewH5Activity.start(getActivity(), h5Params);
} else if (zjservice.is_online.equals("3")) {
......
......@@ -6,7 +6,6 @@ import android.view.View
import android.widget.LinearLayout
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydl_image.transform.GlideCircleTransform
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.router.IYDLRouterConstant
......@@ -186,7 +185,7 @@ class ThankHeadView(activity: Activity) : LinearLayout(activity) {
fun toPay(payId: String, money: Float) {
val userInfo = DynamicIn.getUserInfo()
if (userInfo == null || TextUtils.isEmpty(userInfo.uid)) {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MINE_LOGIN)
DynamicIn.loginByOneKeyLogin(activity,true)
return
}
//
......
......@@ -121,11 +121,7 @@ public class AllTopicFragment extends DynamicFragment {
adapterr.setmOnFocusClickLister(new AllTopicAdapter.OnFocusClickLister() {
@Override
public void onFocusClick(View view, int position) {
if (!DynamicIn.INSTANCE.isLogin()) {
startActivity(DynamicIn.INSTANCE.loginWayIntent(getActivity()));
// OuterEmptyImp.gotoChooseLoginWay(getActivity());
// startActivity(new Intent(getActivity(), ChooseLoginWayActivity.class));
} else {
if (DynamicIn.INSTANCE.loginByOneKeyLogin(getActivity(), true)) {
BuryPointUtils.getInstance().createMap()
.put("theme_name", mDatasr.get(position).getTopic_title())
.put("theme_ID", mDatasr.get(position).getTopic_id())
......
......@@ -342,9 +342,7 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
mTopicDetailVp.setCurrentItem(1);
setTabSelection(1);
} else if (view.getId() == R.id.publish_trend_btn) {
if (!DynamicIn.INSTANCE.isLogin()) {
startActivity(DynamicIn.INSTANCE.loginWayIntent(TopicDetailActivity.this));
} else {
if (DynamicIn.INSTANCE.loginByOneKeyLogin(TopicDetailActivity.this,true)) {
Intent intent = new Intent();
intent.setClass(TopicDetailActivity.this, PublishTrendActivity.class);
Bundle bundle = new Bundle();
......@@ -355,9 +353,7 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
startActivity(intent);
}
} else if (view.getId() == R.id.topic_detail_focus_tv) {
if (!DynamicIn.INSTANCE.isLogin()) {
startActivity(DynamicIn.INSTANCE.loginWayIntent(TopicDetailActivity.this));
} else {
if (DynamicIn.INSTANCE.loginByOneKeyLogin(TopicDetailActivity.this,true)) {
getPresenter().focusTopic(topicId);
}
} else if (view.getId() == R.id.topic_detail_users_rel) {
......
......@@ -289,10 +289,7 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV
}
private void doLikeAction(View view, int position, List<TrendsListBean.Trend> mDatas) {
if (!DynamicIn.INSTANCE.isLogin()) {
// OuterEmptyImp.gotoChooseLoginWay(getActivity());
startActivity(DynamicIn.INSTANCE.loginWayIntent(getActivity()));
} else {
if (DynamicIn.INSTANCE.loginByOneKeyLogin(getActivity(),true)) {
if (!isDoLikeAction) {
isDoLikeAction = true;
mPresenter.doLikeAction(view, position, Integer.valueOf(mDatas.get(position).id), mDatas);
......
......@@ -362,9 +362,7 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
private fun doLikeAction(view: View, position: Int, mDatas: List<TrendsListBean.Trend>) {
if (!DynamicIn.isLogin()) {
startActivity(DynamicIn.loginWayIntent(activity))
} else {
if (DynamicIn.loginByOneKeyLogin(activity,true)) {
if (!isDoLikeAction) {
isDoLikeAction = true
mPresenter!!.doLikeAction(
......@@ -467,10 +465,7 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
fun initClick() {
recommend_trend_add_iv.setOnClickListener {
if (!DynamicIn.isLogin()) {
startActivity(DynamicIn.loginWayIntent(activity))
LogUtil.d("start ChooseLoginWayActivity")
} else {
if (DynamicIn.loginByOneKeyLogin(activity,true)) {
val intent = Intent(activity.applicationContext, PublishTrendActivity::class.java)
val bundle = Bundle()
bundle.putString(DynamicConstants.PUBLISH_TYPE, "default_publish")
......
......@@ -921,11 +921,9 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
NewH5Activity.start(TrendsDetailActivity.this, new H5Params(data.getListenLinkUrl(), "开始倾诉"));
})
.setOnClickListener(R.id.text_chat, v -> {
if (!DynamicIn.INSTANCE.isLogin()) {
startActivity(DynamicIn.INSTANCE.loginWayIntent(TrendsDetailActivity.this));
// startActivity(new Intent(TrendsDetailActivity.this, ChooseLoginWayActivity.class));
return;
} else {
if (!DynamicIn.INSTANCE.loginByOneKeyLogin(TrendsDetailActivity.this,true)) {
return;
}else {
BuryPointUtils.getInstance().createMap()
.put("expert_entrance", "动态详情")
.put("expert_ID", data.getDoctor_id())
......@@ -935,10 +933,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
}
})
.setOnClickListener(R.id.iv_shang, v -> {
if (!DynamicIn.INSTANCE.isLogin()) {
//未登录则跳转登录页面
startActivity(DynamicIn.INSTANCE.loginWayIntent(TrendsDetailActivity.this));
// startActivity(new Intent(TrendsDetailActivity.this, ChooseLoginWayActivity.class));
if (!DynamicIn.INSTANCE.loginByOneKeyLogin(TrendsDetailActivity.this,true)) {
return;
}
BuryPointUtils.getInstance().createMap()
......@@ -1112,15 +1107,12 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
public void doClick(View v) {
if (v.getId() == R.id.trend_disscuss_send_tv) {
LogUtil.d("click send comment");
if (DynamicIn.INSTANCE.isLogin()) {
if (DynamicIn.INSTANCE.loginByOneKeyLogin(TrendsDetailActivity.this,true)) {
if (TextUtils.isEmpty(edCommentContent.getText().toString())) {
ToastUtil.toastShort("评论内容不能为空");
return;
}
sendComment(type, id, edCommentContent.getText().toString(), toContent, toUsername);
} else {
startActivity(DynamicIn.INSTANCE.loginWayIntent(TrendsDetailActivity.this));
// startActivity(new Intent(this, ChooseLoginWayActivity.class));
}
} else if (v.getId() == R.id.publish_emoji_iv) {
//点击发送表情
......@@ -1221,10 +1213,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
}
private void doLikeAction(int type, int id) {
if (!DynamicIn.INSTANCE.isLogin()) {
startActivity(DynamicIn.INSTANCE.loginWayIntent(TrendsDetailActivity.this));
// startActivity(new Intent(this, ChooseLoginWayActivity.class));
} else {
if (DynamicIn.INSTANCE.loginByOneKeyLogin(TrendsDetailActivity.this,true)) {
getPresenter().doLikeAction(type, id);
}
}
......@@ -1360,9 +1349,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
@Override
public void onItemClick(Dialog dialog, View view, int position) {
dialog.dismiss();
if (!DynamicIn.INSTANCE.isLogin()) {
//未登录则跳转登录页面
startActivity(DynamicIn.INSTANCE.loginWayIntent(TrendsDetailActivity.this));
if (!DynamicIn.INSTANCE.loginByOneKeyLogin(TrendsDetailActivity.this,true)) {
return;
}
getPresenter().report(trendId, ttype, Integer.valueOf(reportReasonsId.get(position)), answerId, answerContent);
......@@ -1557,20 +1544,9 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
String[] strs = realUrl.split("/");
strs = strs[strs.length - 1].split("&");
String containsId = strs[0];
if (!DynamicIn.INSTANCE.isLogin()) {
startActivity(DynamicIn.INSTANCE.loginWayIntent(TrendsDetailActivity.this));
if (!DynamicIn.INSTANCE.loginByOneKeyLogin(TrendsDetailActivity.this,true)) {
return;
}
// RetrofitUtils.fetchTestDetail(new Command.FetchTestDetailCommand(containsId))
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(testDetailBaseResponse -> {
//// OuterEmptyImp.jumpToTestAnswerActivity(this,testDetailBaseResponse.data);
// startActivity(DynamicIn.INSTANCE.testAnswerIntent(this));
//// TestAnswerActivity.Companion.start(this, testDetailBaseResponse.data),
// }, throwble -> {
// throwble.printStackTrace();
// });
DynamicIn.INSTANCE.testDetailH5(Integer.valueOf(containsId));
} else if (realUrl.contains("fm/detail")) {
//因为ios已经做了,就是这么判断的,所以后续改吧
......@@ -1627,14 +1603,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
YDLShareDialog dialog = YDLShareDialog.Companion.style3(this, mTrendBody.title, DynamicConstants.Companion.getTRENF_INFO_SHARE_H5() + trendId, mTrendBody.content, "http://static.ydlcdn.com/v1/images/logo320.png");
dialog.setCallBack(type -> {
if (3 == type) {
if (!DynamicIn.INSTANCE.isLogin()) {
//未登录则跳转登录页面
startActivity(DynamicIn.INSTANCE.loginWayIntent(TrendsDetailActivity.this));
return;
}
//举报
if (!DynamicIn.INSTANCE.isLogin()) {
startActivity(DynamicIn.INSTANCE.loginWayIntent(TrendsDetailActivity.this));
if (!DynamicIn.INSTANCE.loginByOneKeyLogin(TrendsDetailActivity.this,true)) {
return;
}
showReportReason(1, 0, null);
......
......@@ -257,8 +257,7 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
BuryPointUtils.getInstance().createMap()
.put("toptab_name", "关注")
.burryPoint("topTabClick");
if (!DynamicIn.INSTANCE.isLogin()) {
startActivity(DynamicIn.INSTANCE.loginWayIntent(getActivity()));
if (!DynamicIn.INSTANCE.loginByOneKeyLogin(getActivity(),true)) {
return;
}
BuryPointUtils.getInstance().trackViewScreen(getActivity(), "动态-关注", "com.cxzapp.yidianling.trends.trendList.TrendsListFragment");
......@@ -324,13 +323,8 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
} else if (view.getId() == R.id.item_focus_tv) {
vpContent.setCurrentItem(2);
} else if (view.getId() == R.id.publish_trend_btn) {
if (!DynamicIn.INSTANCE.isLogin()) {
startActivity(DynamicIn.INSTANCE.loginWayIntent(getActivity()));
} else {
if (DynamicIn.INSTANCE.loginByOneKeyLogin(getActivity(),true)) {
Intent intent = new Intent(getActivity().getApplicationContext(), PublishTrendActivity.class);
// Bundle bundle = new Bundle();
// bundle.putString(DynamicConstants.PUBLISH_TYPE, "default_publish");
// intent.putExtra("bundle", bundle);
//默认改为今日打卡
Bundle bundle = new Bundle();
bundle.putString(DynamicConstants.PUBLISH_TYPE, "topic_publish");
......
......@@ -248,9 +248,7 @@ public class TrendsContentListFragment extends BaseFragment implements ITrendsLi
}
private void doLikeAction(View view, int position, List<TrendsListBean.Trend> mDatas) {
if (!DynamicIn.INSTANCE.isLogin()) {
startActivity(DynamicIn.INSTANCE.loginWayIntent(getActivity()));
} else {
if (DynamicIn.INSTANCE.loginByOneKeyLogin(getActivity(),true)) {
if (!isDoLikeAction) {
isDoLikeAction = true;
mPresenter.doLikeAction(view, position, Integer.valueOf(mDatas.get(position).id), mDatas);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment