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

瞩目SDK 第二次提交

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