提交 352a6c39 authored 作者: 汪显鹏's avatar 汪显鹏

瞩目SDK 第二次提交

上级 47b14e56
流水线 #229 已失败 于阶段
......@@ -73,7 +73,7 @@ public class MainActivity extends Activity implements Constants, ZHUMUMeetingSer
sdk.initSDK(this, APP_KEY, APP_SECRET, WEB_DOMAIN, this);
// }
if(sdk.isInitialized()) {
if (sdk.isInitialized()) {
registerMeetingServiceListener();
}
}
......@@ -82,9 +82,9 @@ public class MainActivity extends Activity implements Constants, ZHUMUMeetingSer
viewTabWelcome = findViewById(R.id.viewTabWelcome);
viewTabMeeting = findViewById(R.id.viewTabMeeting);
viewTabPage2 = findViewById(R.id.viewTabPage2);
btnTabWelcome = (Button)findViewById(R.id.btnTabWelcome);
btnTabMeeting = (Button)findViewById(R.id.btnTabMeeting);
btnTabPage2 = (Button)findViewById(R.id.btnTabPage2);
btnTabWelcome = (Button) findViewById(R.id.btnTabWelcome);
btnTabMeeting = (Button) findViewById(R.id.btnTabMeeting);
btnTabPage2 = (Button) findViewById(R.id.btnTabPage2);
selectTab(TAB_WELCOME);
......@@ -108,32 +108,32 @@ public class MainActivity extends Activity implements Constants, ZHUMUMeetingSer
}
private void selectTab(int tabId) {
if(tabId == TAB_WELCOME) {
if (tabId == TAB_WELCOME) {
viewTabWelcome.setVisibility(View.VISIBLE);
viewTabMeeting.setVisibility(View.GONE);
viewTabPage2.setVisibility(View.GONE);
btnTabWelcome.setSelected(true);
btnTabMeeting.setSelected(false);
btnTabPage2.setSelected(false);
} else if(tabId == TAB_PAGE_2) {
} else if (tabId == TAB_PAGE_2) {
viewTabWelcome.setVisibility(View.GONE);
viewTabMeeting.setVisibility(View.GONE);
viewTabPage2.setVisibility(View.VISIBLE);
btnTabWelcome.setSelected(false);
btnTabMeeting.setSelected(false);
btnTabPage2.setSelected(true);
} else if(tabId == TAB_MEETING) {
} else if (tabId == TAB_MEETING) {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
if(!sdk.isInitialized()) {
if (!sdk.isInitialized()) {
Toast.makeText(this, "ZHUMUSDK has not been initialized successfully", Toast.LENGTH_LONG).show();
return;
}
ZHUMUMeetingService meetingService = sdk.getMeetingService();
if(meetingService == null)
if (meetingService == null)
return;
if(meetingService.getMeetingStatus() .equals(ZHUMUMeetingStatus.MEETING_STATUS_IDLE) ){
if (meetingService.getMeetingStatus().equals(ZHUMUMeetingStatus.MEETING_STATUS_IDLE)) {
viewTabWelcome.setVisibility(View.GONE);
viewTabPage2.setVisibility(View.GONE);
......@@ -156,11 +156,11 @@ public class MainActivity extends Activity implements Constants, ZHUMUMeetingSer
super.onNewIntent(intent);
// disable animation
overridePendingTransition(0,0);
overridePendingTransition(0, 0);
String action = intent.getAction();
if(ACTION_RETURN_FROM_MEETING.equals(action)) {
if (ACTION_RETURN_FROM_MEETING.equals(action)) {
int tabId = intent.getIntExtra(EXTRA_TAB_ID, TAB_WELCOME);
selectTab(tabId);
}
......@@ -170,7 +170,7 @@ public class MainActivity extends Activity implements Constants, ZHUMUMeetingSer
public void onZHUMUSdkInitializeResult(int errorCode, int internalErrorCode) {
Log.i(TAG, "onZHUMUSdkInitializeResult, errorCode=" + errorCode + ", internalErrorCode=" + internalErrorCode);
if(errorCode != ZHUMUError.ERROR_SUCCESS) {
if (errorCode != ZHUMUError.ERROR_SUCCESS) {
Toast.makeText(this, "Failed to initialize ZHUMUSDK. Error: " + errorCode + ", internalErrorCode=" + internalErrorCode, Toast.LENGTH_LONG);
} else {
Toast.makeText(this, "Initialize ZHUMUSDK successfully.", Toast.LENGTH_LONG).show();
......@@ -182,7 +182,7 @@ public class MainActivity extends Activity implements Constants, ZHUMUMeetingSer
private void registerMeetingServiceListener() {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
ZHUMUMeetingService meetingService = sdk.getMeetingService();
if(meetingService != null) {
if (meetingService != null) {
meetingService.addListener(this);
}
}
......@@ -191,7 +191,7 @@ public class MainActivity extends Activity implements Constants, ZHUMUMeetingSer
protected void onDestroy() {
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
if(sdk.isInitialized()) {
if (sdk.isInitialized()) {
ZHUMUMeetingService meetingService = sdk.getMeetingService();
meetingService.removeListener(this);
}
......@@ -203,12 +203,12 @@ public class MainActivity extends Activity implements Constants, ZHUMUMeetingSer
ZHUMUSdk sdk = ZHUMUSdk.getInstance();
if(!sdk.isInitialized()) {
if (!sdk.isInitialized()) {
Toast.makeText(this, "ZHUMUSDK has not been initialized successfully", Toast.LENGTH_LONG).show();
return;
}
if(meet_num == null) {
if (meet_num == null) {
Toast.makeText(this, "MEETING_ID in Constants can not be NULL", Toast.LENGTH_LONG).show();
return;
}
......@@ -227,8 +227,8 @@ public class MainActivity extends Activity implements Constants, ZHUMUMeetingSer
}
private Meeting getMeeting(String strResult){
try{
private Meeting getMeeting(String strResult) {
try {
JSONObject jsonObject = new JSONObject(strResult.toString());
int code = jsonObject.getInt("code");
int zcode = jsonObject.getInt("zcode");
......@@ -265,7 +265,7 @@ public class MainActivity extends Activity implements Constants, ZHUMUMeetingSer
meet.setAccounttype(accounttype);
meet.setToken(token);
return meet;
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
return null;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论