Commit 761d62a2 by Lee Munkyeong

協業実装

parent cdf16803
...@@ -108,6 +108,18 @@ public interface ABookCommConstants { ...@@ -108,6 +108,18 @@ public interface ABookCommConstants {
Integer COLLABORATION_START = 4; Integer COLLABORATION_START = 4;
Integer COLLABORATION_END = 5; Integer COLLABORATION_END = 5;
} }
interface COLLABORATION_TYPE {
Integer AUDIO = 0;
Integer CAMERA = 2;
Integer VIDEO = 3;
}
interface COLLABORATION_JOIN_FLG {
Integer CREATE = 0;
Integer JOIN = 1;
}
Integer GROUP_REQUEST_ALL = 0; Integer GROUP_REQUEST_ALL = 0;
} }
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
<uses-permission android:name="android.permission.CAMERA"/> <uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.FLASHLIGHT"/> <uses-permission android:name="android.permission.FLASHLIGHT"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<permission <permission
android:name="${applicationId}.permission.C2D_MESSAGE" android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature" /> android:protectionLevel="signature" />
......
...@@ -20,8 +20,10 @@ import android.net.NetworkInfo; ...@@ -20,8 +20,10 @@ import android.net.NetworkInfo;
import android.net.Uri; import android.net.Uri;
import android.net.wifi.WifiManager; import android.net.wifi.WifiManager;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.support.annotation.RequiresApi;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.view.Window; import android.view.Window;
...@@ -29,6 +31,7 @@ import android.webkit.CookieManager; ...@@ -29,6 +31,7 @@ import android.webkit.CookieManager;
import android.webkit.DownloadListener; import android.webkit.DownloadListener;
import android.webkit.JavascriptInterface; import android.webkit.JavascriptInterface;
import android.webkit.JsResult; import android.webkit.JsResult;
import android.webkit.PermissionRequest;
import android.webkit.ValueCallback; import android.webkit.ValueCallback;
import android.webkit.WebChromeClient; import android.webkit.WebChromeClient;
import android.webkit.WebSettings; import android.webkit.WebSettings;
...@@ -108,6 +111,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -108,6 +111,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private final String CHAT_PAGE_URL = "file:///android_asset/chat/public_new/chat.html"; private final String CHAT_PAGE_URL = "file:///android_asset/chat/public_new/chat.html";
private final String CHAT_ROOM_PAGE_URL = "file:///android_asset/chat/public_new/chat_room.html"; private final String CHAT_ROOM_PAGE_URL = "file:///android_asset/chat/public_new/chat_room.html";
private final String PICTURE_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_picture.html";
private final String VIDEO_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_video.html";
private final String VOICE_COLLABORATION_PAGE_URL = "file:///android_asset/chat/public_new/collaboration_voice.html";
private final String DEFAULT_CHECKSUM = "0000000000"; private final String DEFAULT_CHECKSUM = "0000000000";
//AISDevelop //AISDevelop
...@@ -126,6 +132,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -126,6 +132,9 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
private Integer shopMemberId; private Integer shopMemberId;
private String selectedUserIdList; private String selectedUserIdList;
// 0:協業生成, 1:協業参加
private Integer collaborationJoinFlg = 0;
public AlertDialog myAlertDialog; public AlertDialog myAlertDialog;
private ImageButton mOperationHomeButton; // ホームボタン private ImageButton mOperationHomeButton; // ホームボタン
...@@ -229,6 +238,12 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -229,6 +238,12 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
mChatWebView.setWebChromeClient(new FullscreenableChromeClient(this) { mChatWebView.setWebChromeClient(new FullscreenableChromeClient(this) {
@Override @Override
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public void onPermissionRequest(final PermissionRequest request) {
request.grant(request.getResources());
}
@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) { public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
boolean result = false; boolean result = false;
// 画像が選択された場合 // 画像が選択された場合
...@@ -1238,6 +1253,77 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -1238,6 +1253,77 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
} }
communicationLogic.updateArchiveDetial(resultJson.archiveDto); communicationLogic.updateArchiveDetial(resultJson.archiveDto);
} }
@JavascriptInterface
public void joinCollaboration(String collaborationType) {
collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.JOIN;
switch (Integer.parseInt(collaborationType)) {
case 0:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(VOICE_COLLABORATION_PAGE_URL);
}
});
break;
case 2:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(PICTURE_COLLABORATION_PAGE_URL);
}
});
break;
case 3:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(VIDEO_COLLABORATION_PAGE_URL);
}
});
break;
default:
break;
}
}
@JavascriptInterface
public void startCollaboration(String collaborationType) {
collaborationJoinFlg = ABookCommConstants.FLAG.COLLABORATION_JOIN_FLG.CREATE;
switch (Integer.parseInt(collaborationType)) {
case 0:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(VOICE_COLLABORATION_PAGE_URL);
}
});
break;
case 2:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(PICTURE_COLLABORATION_PAGE_URL);
}
});
break;
case 3:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(VIDEO_COLLABORATION_PAGE_URL);
}
});
break;
default:
break;
}
}
@JavascriptInterface
public String getCollaborationJoinFlg() {
return collaborationJoinFlg.toString();
}
} }
/** /**
...@@ -1291,6 +1377,37 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -1291,6 +1377,37 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
return result; return result;
} }
private void moveCollaborationScreen(Integer collaborationType) throws NetworkDisconnectedException, AcmsException {
switch (collaborationType) {
case 0:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(VOICE_COLLABORATION_PAGE_URL);
}
});
break;
case 2:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(PICTURE_COLLABORATION_PAGE_URL);
}
});
break;
case 3:
mChatWebView.post(new Runnable() {
@Override
public void run() {
mChatWebView.loadUrl(VIDEO_COLLABORATION_PAGE_URL);
}
});
break;
default:
break;
}
}
private boolean deleteFavoriteGroup(String groupId) throws NetworkDisconnectedException, AcmsException { private boolean deleteFavoriteGroup(String groupId) throws NetworkDisconnectedException, AcmsException {
boolean result = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter) boolean result = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter)
.deleteFavoriteGroup(sid, Integer.parseInt(groupId)); .deleteFavoriteGroup(sid, Integer.parseInt(groupId));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment