涉及到用户操作的加上登录验证, 把评论点赞抽离成工具方法

This commit is contained in:
kehaoyuan
2017-06-28 18:06:36 +08:00
parent 957305d6f5
commit f960b07ee1
17 changed files with 546 additions and 499 deletions

View File

@ -0,0 +1,34 @@
package com.gh.common.util;
import android.content.Context;
import android.content.Intent;
import com.gh.gamecenter.LoginActivity;
/**
* Created by khy on 28/06/17.
*/
public class CheckLoginUtils {
public static void checkLogin(final Context context, OnLoggenInListener listener) {
String token = null;
if (token == null) {
DialogUtils.showWarningDialog(context, "登录提示", "需要登录才能使用该功能喔!", "取消", "快速登录",
new DialogUtils.ConfirmListener() {
@Override
public void onConfirm() {
Intent intent = LoginActivity.getIntent(context);
context.startActivity(intent);
}
}, null);
} else {
listener.onLoggedIn();
}
}
public interface OnLoggenInListener {
void onLoggedIn();
}
}