登录界面修改完成
This commit is contained in:
@@ -40,6 +40,7 @@ import android.widget.VideoView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@@ -117,11 +118,12 @@ import java.util.TimerTask;
|
||||
@Route(path = RouteUtil.PATH_ENTRY)
|
||||
public class EntryActivity extends AppCompatActivity {
|
||||
|
||||
private VideoView video_view;
|
||||
private ImageView btn_phone, btn_line, btn_twitter;
|
||||
// private VideoView video_view;
|
||||
private View btn_phone, btn_line;
|
||||
private TextView btn_tip, btn_tip1, tv_customer;
|
||||
private TwitterLoginButton tt_login_button;
|
||||
private LinearLayout btn_google, googleLayout;
|
||||
// private TwitterLoginButton tt_login_button;
|
||||
private View btn_google;
|
||||
private Group googleLayout,webViewLayout;
|
||||
public static Activity activity;
|
||||
private static String mLoginType = Constants.MOB_PHONE;//登录方式
|
||||
public String mPromoCode = "", UserID = "";//推广码
|
||||
@@ -130,8 +132,8 @@ public class EntryActivity extends AppCompatActivity {
|
||||
private static boolean mFirstLogin;//是否是第一次登录
|
||||
private static boolean mShowInvite;//显示邀请码弹窗
|
||||
private static Context Contexts;
|
||||
private ImageView img_view;
|
||||
private LinearLayout lt_btn_twitter, lt_btn_facebook, lt_customer;
|
||||
// private ImageView img_view;
|
||||
private View lt_btn_facebook;
|
||||
private String kefuUrl = "";
|
||||
private boolean mBtnClick = false;
|
||||
private Dialog loginLoadingDialog;
|
||||
@@ -140,7 +142,6 @@ public class EntryActivity extends AppCompatActivity {
|
||||
|
||||
private WebView webview;
|
||||
private WebSettings webSettings;
|
||||
private View webViewLayout;
|
||||
private View webBack;
|
||||
|
||||
|
||||
@@ -201,7 +202,7 @@ public class EntryActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_entry);
|
||||
setContentView(R.layout.activity_entry2);
|
||||
if (getIntent().getBooleanExtra("forwardEntry", false)) {
|
||||
IMLoginManager.get(this).logout(this);
|
||||
ToastUtil.show(R.string.login_invalid);
|
||||
@@ -221,20 +222,20 @@ public class EntryActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
lt_btn_facebook = findViewById(R.id.lt_btn_facebook);
|
||||
lt_btn_twitter = findViewById(R.id.lt_btn_twitter);
|
||||
// lt_btn_twitter = findViewById(R.id.lt_btn_twitter);
|
||||
btn_tip = findViewById(R.id.btn_tip);
|
||||
btn_tip1 = findViewById(R.id.btn_tip1);
|
||||
|
||||
img_view = findViewById(R.id.img_view);
|
||||
// img_view = findViewById(R.id.img_view);
|
||||
|
||||
btn_google = findViewById(R.id.btn_google);
|
||||
btn_twitter = findViewById(R.id.btn_twitter);
|
||||
tt_login_button = findViewById(R.id.tt_login_button);
|
||||
// btn_twitter = findViewById(R.id.btn_twitter);
|
||||
// tt_login_button = findViewById(R.id.tt_login_button);
|
||||
|
||||
tv_customer = findViewById(R.id.tv_customer);
|
||||
btn_phone = findViewById(R.id.btn_phone);
|
||||
btn_line = findViewById(R.id.btn_line);
|
||||
lt_customer = findViewById(R.id.lt_customer);
|
||||
// btn_line = findViewById(R.id.btn_line);
|
||||
|
||||
|
||||
btn_tip.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
|
||||
btn_tip.getPaint().setAntiAlias(true);
|
||||
@@ -274,26 +275,26 @@ public class EntryActivity extends AppCompatActivity {
|
||||
|
||||
getPromoCode();
|
||||
getUuidDevice();
|
||||
video_view = findViewById(R.id.video_view);
|
||||
video_view.setVideoPath(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.login_video) + "");
|
||||
video_view.start();
|
||||
video_view.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
||||
|
||||
@Override
|
||||
public void onCompletion(MediaPlayer mp) {
|
||||
video_view.setVideoPath(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.login_video) + "");
|
||||
video_view.start();
|
||||
}
|
||||
});
|
||||
video_view.setOnErrorListener(new MediaPlayer.OnErrorListener() {
|
||||
@Override
|
||||
public boolean onError(MediaPlayer mp, int what, int extra) {
|
||||
video_view.stopPlayback(); //播放异常,则停止播放,防止弹窗使界面阻塞
|
||||
img_view.setVisibility(View.VISIBLE);
|
||||
video_view.setVisibility(View.GONE);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
// video_view = findViewById(R.id.video_view);
|
||||
// video_view.setVideoPath(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.login_video) + "");
|
||||
// video_view.start();
|
||||
// video_view.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
|
||||
//
|
||||
// @Override
|
||||
// public void onCompletion(MediaPlayer mp) {
|
||||
// video_view.setVideoPath(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.login_video) + "");
|
||||
// video_view.start();
|
||||
// }
|
||||
// });
|
||||
// video_view.setOnErrorListener(new MediaPlayer.OnErrorListener() {
|
||||
// @Override
|
||||
// public boolean onError(MediaPlayer mp, int what, int extra) {
|
||||
// video_view.stopPlayback(); //播放异常,则停止播放,防止弹窗使界面阻塞
|
||||
// img_view.setVisibility(View.VISIBLE);
|
||||
// video_view.setVisibility(View.GONE);
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
|
||||
lt_btn_facebook.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -334,59 +335,58 @@ public class EntryActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
lt_btn_twitter.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (isBtnClick()) {
|
||||
return;
|
||||
}
|
||||
verfiy(3);
|
||||
}
|
||||
});
|
||||
// lt_btn_twitter.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// if (isBtnClick()) {
|
||||
// return;
|
||||
// }
|
||||
// verfiy(3);
|
||||
// }
|
||||
// });
|
||||
|
||||
tt_login_button.setCallback(new Callback<TwitterSession>() {
|
||||
@Override
|
||||
public void success(Result<TwitterSession> result) {
|
||||
// Do something with result, which provides a TwitterSession for making API calls
|
||||
//result里面包含了用户的信息,我们可以从中取出token,tokenSecret
|
||||
//(如果我们有自己的后台服务器,发送这两个到我们自己的后台,后台再去验证)
|
||||
TwitterAuthToken authToken = result.data.getAuthToken();
|
||||
String token = authToken.token;
|
||||
String appId = "24315541";
|
||||
String tokenSecret = authToken.secret;
|
||||
|
||||
final String userName = result.data.getUserName();
|
||||
|
||||
LoginData data = new LoginData();
|
||||
data.setAvatar("");
|
||||
data.setNickName(userName);
|
||||
data.setOpenID(token);
|
||||
data.setType("twitter");
|
||||
|
||||
loginBuyThird(data);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failure(TwitterException exception) {
|
||||
Log.i("Log", "TwitterException = " + exception);
|
||||
ToastUtil.show(getResources().getString(R.string.user_login_outtime));
|
||||
}
|
||||
});
|
||||
findViewById(R.id.btn_line).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (isBtnClick()) {
|
||||
return;
|
||||
}
|
||||
verfiy(4);
|
||||
}
|
||||
});
|
||||
// tt_login_button.setCallback(new Callback<TwitterSession>() {
|
||||
// @Override
|
||||
// public void success(Result<TwitterSession> result) {
|
||||
// // Do something with result, which provides a TwitterSession for making API calls
|
||||
// //result里面包含了用户的信息,我们可以从中取出token,tokenSecret
|
||||
// //(如果我们有自己的后台服务器,发送这两个到我们自己的后台,后台再去验证)
|
||||
// TwitterAuthToken authToken = result.data.getAuthToken();
|
||||
// String token = authToken.token;
|
||||
// String appId = "24315541";
|
||||
// String tokenSecret = authToken.secret;
|
||||
//
|
||||
// final String userName = result.data.getUserName();
|
||||
//
|
||||
// LoginData data = new LoginData();
|
||||
// data.setAvatar("");
|
||||
// data.setNickName(userName);
|
||||
// data.setOpenID(token);
|
||||
// data.setType("twitter");
|
||||
//
|
||||
// loginBuyThird(data);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void failure(TwitterException exception) {
|
||||
// Log.i("Log", "TwitterException = " + exception);
|
||||
// ToastUtil.show(getResources().getString(R.string.user_login_outtime));
|
||||
// }
|
||||
// });
|
||||
// findViewById(R.id.btn_line).setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// if (isBtnClick()) {
|
||||
// return;
|
||||
// }
|
||||
// verfiy(4);
|
||||
// }
|
||||
// });
|
||||
|
||||
getUrl();
|
||||
|
||||
lt_customer.setOnClickListener(new View.OnClickListener() {
|
||||
tv_customer.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (!"".equals(kefuUrl)) {
|
||||
@@ -437,18 +437,18 @@ public class EntryActivity extends AppCompatActivity {
|
||||
} else if (loginType == 2) {
|
||||
startActivityForResult(googleUtils.getIntent(), 1002);
|
||||
} else if (loginType == 3) {
|
||||
tt_login_button.performClick();
|
||||
// tt_login_button.performClick();
|
||||
} else if (loginType == 4) {
|
||||
try {
|
||||
// App-to-app login
|
||||
Intent loginIntent = LineLoginApi.getLoginIntent(findViewById(R.id.btn_line).getContext(), "2006124380", new LineAuthenticationParams.Builder().scopes(Arrays.asList(Scope.PROFILE))
|
||||
// .nonce("<a randomly-generated string>") // nonce can be used to improve security
|
||||
.build());
|
||||
startActivityForResult(loginIntent, 1001);
|
||||
} catch (Exception e) {
|
||||
Log.e("ERROR", e.toString());
|
||||
ToastUtil.show(getResources().getString(R.string.user_login_outtime));
|
||||
}
|
||||
// try {
|
||||
// // App-to-app login
|
||||
// Intent loginIntent = LineLoginApi.getLoginIntent(findViewById(R.id.btn_line).getContext(), "2006124380", new LineAuthenticationParams.Builder().scopes(Arrays.asList(Scope.PROFILE))
|
||||
// // .nonce("<a randomly-generated string>") // nonce can be used to improve security
|
||||
// .build());
|
||||
// startActivityForResult(loginIntent, 1001);
|
||||
// } catch (Exception e) {
|
||||
// Log.e("ERROR", e.toString());
|
||||
// ToastUtil.show(getResources().getString(R.string.user_login_outtime));
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -564,7 +564,7 @@ public class EntryActivity extends AppCompatActivity {
|
||||
} else if (requestCode == 1002) {//google登录
|
||||
handleSignInResult(data);
|
||||
} else {
|
||||
tt_login_button.onActivityResult(requestCode, resultCode, data);//twitter登录回调
|
||||
// tt_login_button.onActivityResult(requestCode, resultCode, data);//twitter登录回调
|
||||
callbackManager.onActivityResult(requestCode, resultCode, data);//facebook登录回调
|
||||
}
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
@@ -656,7 +656,7 @@ public class EntryActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
video_view.start();
|
||||
// video_view.start();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.DateFormatUtil;
|
||||
import com.yunbao.common.utils.DebugUtils;
|
||||
import com.yunbao.common.utils.DeviceUtils;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
@@ -109,8 +110,13 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.Message;
|
||||
|
||||
|
||||
/**
|
||||
* 消息中心
|
||||
@@ -588,10 +594,10 @@ public class MainMessageViewHolder2 extends AbsMainHomeChildViewHolder {
|
||||
if (TextUtils.isEmpty(userBean.getNum()) || TextUtils.equals("0", userBean.getNum())) {
|
||||
textNewsNotice.setVisibility(View.GONE);
|
||||
} else {
|
||||
Log.i("官方通知", "请求消息:" + SudJsonUtils.toJson(userBean));
|
||||
textNewsNotice.setVisibility(View.VISIBLE);
|
||||
officialDate.setText(userBean.getLastDate());
|
||||
officialContent.setText(userBean.getContent());
|
||||
setChatApt(userBean.getType(),officialDate,officialContent);
|
||||
// officialDate.setText(userBean.getLastDate());
|
||||
// officialContent.setText(userBean.getContent());
|
||||
// int numberInt = Integer.parseInt(userBean.getNum());
|
||||
// if (numberInt > 99) {
|
||||
// textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
@@ -683,6 +689,12 @@ public class MainMessageViewHolder2 extends AbsMainHomeChildViewHolder {
|
||||
});
|
||||
}
|
||||
|
||||
//不是IM消息
|
||||
private void setChatApt(String type,TextView timeTV,TextView contentTv) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 系統消息獲取
|
||||
*/
|
||||
@@ -777,11 +789,9 @@ public class MainMessageViewHolder2 extends AbsMainHomeChildViewHolder {
|
||||
textNewsNotice.setText("");
|
||||
} else {
|
||||
// String number = textNewsNotice.getText().toString().trim();
|
||||
Log.i("官方通知", "官方通知:" + model.toString());
|
||||
textNewsNotice.setVisibility(View.VISIBLE);
|
||||
officialDate.setText(model.getAddtime());
|
||||
officialContent.setText(model.getContent());
|
||||
|
||||
textNewsNotice.setVisibility(View.VISIBLE);
|
||||
setChatApt(model.getType(),officialDate,officialContent);
|
||||
// int numberInt = Integer.parseInt(number) + 1;
|
||||
// if (numberInt > 99) {
|
||||
// textNewsNotice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 9);
|
||||
|
||||
BIN
main/src/main/res/mipmap-xxxhdpi/bg_yola_login.png
Normal file
BIN
main/src/main/res/mipmap-xxxhdpi/bg_yola_login.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 MiB |
BIN
main/src/main/res/mipmap-xxxhdpi/bg_yola_login_count.png
Normal file
BIN
main/src/main/res/mipmap-xxxhdpi/bg_yola_login_count.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
main/src/main/res/mipmap-xxxhdpi/bg_yola_login_face.png
Normal file
BIN
main/src/main/res/mipmap-xxxhdpi/bg_yola_login_face.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
main/src/main/res/mipmap-xxxhdpi/bg_yola_login_google.png
Normal file
BIN
main/src/main/res/mipmap-xxxhdpi/bg_yola_login_google.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Reference in New Issue
Block a user