Skip to content

Commit

Permalink
Merge branch 'master' into web_sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Li-zx authored Nov 16, 2020
2 parents 4cfd4e8 + 678d838 commit fd8cf63
Show file tree
Hide file tree
Showing 84 changed files with 3,780 additions and 851 deletions.
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**


### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/

### VS Code ###
.vscode/
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
1. [Error Code](开发文档/错误码/error_code.md)

## Sample code
1. [运行iOS SampleCode](SampleCode/iOS/NEMeetingDemo/README.md)
1. [运行iOS SampleCode](SampleCode/iOS/README.md)
2. [运行Android SampleCode](SampleCode/Android/README.md)
3. [运行Windows&macOS SampleCode](SampleCode/Windows_macOS/README.md)
4. [运行Web SampleCode](SampleCode/Web/README.md)

## SDK进阶

1. [NIM复用](开发文档/SDK进阶/NIM复用.md)
2. [会议私有化部署](开发文档/SDK进阶/会议私有化部署.md)
Binary file added SampleCode/.DS_Store
Binary file not shown.
16 changes: 8 additions & 8 deletions SampleCode/Android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ android {

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//app demo dependencies

//Demo依赖
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.squareup.okhttp3:okhttp:4.7.2'
Expand All @@ -55,16 +56,15 @@ dependencies {
implementation "androidx.navigation:navigation-fragment-ktx:2.3.0"
implementation "androidx.navigation:navigation-ui-ktx:2.3.0"
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'

//meeting
implementation 'com.netease.yunxin:meetinglib:1.2.6'
//nim
implementation 'com.netease.nimlib:basesdk:7.6.0'

//third party
implementation 'com.manu:MDatePicker:1.0.1'
implementation 'com.kyleduo.switchbutton:library:2.0.2'

//NEMeeting-SDK
implementation 'com.netease.yunxin:meetinglib:1.3.1'

//NIM-SDK, 如果单独接入了云信NIM,则可根据需要进行依赖声明。正常情况下不用声明
implementation 'com.netease.nimlib:basesdk:7.6.0'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
Expand Down
17 changes: 15 additions & 2 deletions SampleCode/Android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,32 @@
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:launchMode="singleTask"
android:resizeableActivity="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="meeting.netease.im"
android:scheme="nemeetingdemo" />
</intent-filter>

</activity>
<activity
android:name=".MeetingSettingsActivity"
android:label="会议设置" />
<activity
android:name=".nim.NIMLoginActivity"
android:label="IM登录" />
android:name=".AppSettingsActivity"
android:label="应用设置" />
</application>
<!--日历-->
<uses-permission android:name="android.permission.READ_CALENDAR" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (c) 2014-2020 NetEase, Inc.
* All right reserved.
*/

package com.netease.meetinglib.demo;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.PreferenceFragmentCompat;

import com.netease.meetinglib.demo.utils.SPUtils;

public class AppSettingsActivity extends AppCompatActivity {

public static void start(Context context) {
Intent starter = new Intent(context, AppSettingsActivity.class);
context.startActivity(starter);
}

@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

FrameLayout frameLayout = new FrameLayout(this);
frameLayout.setId(View.generateViewId());
setContentView(frameLayout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

getSupportFragmentManager()
.beginTransaction()
.replace(frameLayout.getId(), new AppSettingsFragment())
.commit();
}

public static class AppSettingsFragment extends PreferenceFragmentCompat {

@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
getPreferenceManager().setSharedPreferencesName(SPUtils.SP_FILE);
setPreferencesFromResource(R.xml.app_settings, rootKey);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
Expand All @@ -21,6 +24,7 @@

import com.netease.meetinglib.demo.base.BaseActivity;
import com.netease.meetinglib.demo.databinding.ActivityMainBinding;
import com.netease.meetinglib.demo.log.LogUtil;
import com.netease.meetinglib.demo.viewmodel.MainViewModel;
import com.netease.meetinglib.sdk.NEMeetingInfo;
import com.netease.meetinglib.sdk.NEMeetingMenuItem;
Expand All @@ -47,6 +51,7 @@ protected void onRestart() {
if (meetingService != null && meetingService.getMeetingStatus()
== NEMeetingStatus.MEETING_STATUS_INMEETING) {
meetingService.returnToMeeting(this);
LogUtil.log(TAG, "onRestart returnToMeeting");
}
}

Expand All @@ -58,6 +63,7 @@ protected void initView() {
if (meetingService != null && meetingService.getMeetingStatus()
== NEMeetingStatus.MEETING_STATUS_INMEETING) {
meetingService.returnToMeeting(this);
LogUtil.log(TAG, "initView returnToMeeting");
finish();
return;
}
Expand Down Expand Up @@ -105,7 +111,7 @@ private void requestPermissions() {
});
}

private void onInitialized(int total) {
private void onInitialized(int initializeIndex) {
mViewModel.setOnInjectedMenuItemClickListener(new OnCustomMenuListener());
mViewModel.setOnControlCustomMenuItemClickListener(new OnControlCustomMenuListener());
mViewModel.registerControlListener(controlListener);
Expand Down Expand Up @@ -134,7 +140,7 @@ public void onInjectedMenuItemClick(Context context, NEMeetingMenuItem menuItem,
});
break;
default:
Toast.makeText(context, "点击事件Id:" + menuItem.itemId + "#点击事件tittle:" + menuItem.itemId, Toast.LENGTH_SHORT).show();
Toast.makeText(context, "点击事件Id:" + menuItem.itemId + "#点击事件title:" + menuItem.itemId, Toast.LENGTH_SHORT).show();
break;

}
Expand All @@ -157,6 +163,24 @@ public void onShareMenuItemClick(NEControlMenuItem menuItem, NEMeetingInfo meeti

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
return super.onCreateOptionsMenu(menu);
}

@Override
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
int itemId = item.getItemId();
switch (itemId) {
case R.id.app_settings:
AppSettingsActivity.start(this);
break;
default:
return super.onOptionsItemSelected(item);
}
return true;
}

@Override
public boolean onSupportNavigateUp() {
Expand All @@ -170,7 +194,7 @@ void setupMeetingMinimizedLayout() {
}

private void toggleMeetingMinimizedView(boolean show) {
Log.i(TAG, "toggleMeetingMinimizedView: " + show + "==" + binding.meetingMinimizedLayout.getX());
LogUtil.log(TAG, "toggleMeetingMinimizedView: " + show + "==" + binding.meetingMinimizedLayout.getX());
int dx = getResources().getDimensionPixelSize(R.dimen.meeting_minimized_layout_size);
if (show) {
mViewModel.getMeetingTimeLiveData().observe(this, this::updateMeetingTime);
Expand All @@ -188,6 +212,22 @@ private void updateMeetingTime(String timeText) {
binding.meetingTime.setText(timeText);
}

@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
String deepLink = intent.getDataString();
ssoLogin(deepLink);
}

private void ssoLogin(String deepLink){
if(!TextUtils.isEmpty(deepLink)) {
String ssoToken = Uri.parse(deepLink).getQueryParameter("ssoToken");
if(!TextUtils.isEmpty(ssoToken)){
SdkAuthenticator.getInstance().loginWithSSO(ssoToken);
}
}
}

@Override
protected void onDestroy() {
super.onDestroy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import android.app.Application;

import com.netease.meetinglib.demo.log.LogUtil;
import com.netease.meetinglib.demo.nim.NIMInitializer;

public class MeetingApplication extends Application {
private static MeetingApplication instance;
Expand All @@ -15,6 +17,8 @@ public class MeetingApplication extends Application {
public void onCreate() {
super.onCreate();
instance = this;
LogUtil.init(this);
NIMInitializer.getInstance().startInitialize(this);
SdkAuthenticator.getInstance().initialize(this);
SdkInitializer.getInstance().startInitialize(this);
}
Expand Down
Loading

0 comments on commit fd8cf63

Please sign in to comment.