Commit fc58818a by Lee Munkyeong

Merge branch 'features/#434_video_play_in_room' into 'features/abcomm_sp6'

動画のフールスクリーンモード追加。

See merge request !97
parents 6a0918a8 ffe143bb
...@@ -565,7 +565,11 @@ public class GroupDao extends AbstractDao { ...@@ -565,7 +565,11 @@ public class GroupDao extends AbstractDao {
public List<GroupDto> getUserGroups() { public List<GroupDto> getUserGroups() {
return rawQueryGetDtoList("select * from m_group where user_group_flg = 1 ORDER BY group_name", null, GroupDto.class); return rawQueryGetDtoList("select * from m_group where user_group_flg = 1 ORDER BY group_name", null, GroupDto.class);
} }
public List<GroupDto> getMyGroups() {
return rawQueryGetDtoList("select * from m_group where group_id IN (select group_id from m_shop_member sm inner join r_shop_member_group rmg on sm.shop_member_id = rmg.shop_member_id where sm.self_flg = 1) ORDER BY group_name ASC", null, GroupDto.class);
}
/** /**
* ユーザが所属しているグループを返す(複数ある場合はどれか一つを返す。1グループに所属するサイネージで使用) * ユーザが所属しているグループを返す(複数ある場合はどれか一つを返す。1グループに所属するサイネージで使用)
* *
...@@ -616,6 +620,24 @@ public class GroupDao extends AbstractDao { ...@@ -616,6 +620,24 @@ public class GroupDao extends AbstractDao {
} }
} }
public void updateUserGroupList(List<Integer> groupIds) {
StringBuffer sql = new StringBuffer();
sql.append(" UPDATE m_group ");
sql.append(" SET user_group_flg = 1 ");
sql.append(" WHERE group_id = ? ");
try {
beginTransaction();
for (Integer groupId : groupIds) {
update(sql.toString(), new Object[] { groupId });
}
commit();
} catch (Exception e) {
rollback();
Logger.e("updateGroupList failed.", e);
throw new RuntimeException(e);
}
}
public void updateFavoriteGroupList(List<GroupDto> groupList) { public void updateFavoriteGroupList(List<GroupDto> groupList) {
StringBuffer sql = new StringBuffer(); StringBuffer sql = new StringBuffer();
sql.append(" UPDATE m_group "); sql.append(" UPDATE m_group ");
......
...@@ -189,7 +189,7 @@ public class ShopMemberDao extends AbstractDao { ...@@ -189,7 +189,7 @@ public class ShopMemberDao extends AbstractDao {
sql.append(" m_shop_member AS sm "); sql.append(" m_shop_member AS sm ");
sql.append(" INNER JOIN r_shop_member_group AS rsmg "); sql.append(" INNER JOIN r_shop_member_group AS rsmg ");
sql.append(" ON sm.shop_member_id = rsmg.shop_member_id "); sql.append(" ON sm.shop_member_id = rsmg.shop_member_id ");
sql.append(" WHERE rsmg.group_id IN (SELECT group_id FROM m_group WHERE user_group_flg = 1)"); sql.append(" WHERE rsmg.group_id IN (select group_id from m_shop_member sm inner join r_shop_member_group rmg on sm.shop_member_id = rmg.shop_member_id where sm.self_flg = 1)");
sql.append(" AND sm.self_flg != 1"); sql.append(" AND sm.self_flg != 1");
sql.append(" AND sm.shop_member_name LIKE '%"+shopMemberName+"%' "); sql.append(" AND sm.shop_member_name LIKE '%"+shopMemberName+"%' ");
sql.append(" ORDER BY sm.shop_member_name DESC "); sql.append(" ORDER BY sm.shop_member_name DESC ");
...@@ -208,7 +208,7 @@ public class ShopMemberDao extends AbstractDao { ...@@ -208,7 +208,7 @@ public class ShopMemberDao extends AbstractDao {
sql.append(" m_shop_member AS sm "); sql.append(" m_shop_member AS sm ");
sql.append(" INNER JOIN r_shop_member_group AS rsmg "); sql.append(" INNER JOIN r_shop_member_group AS rsmg ");
sql.append(" ON sm.shop_member_id = rsmg.shop_member_id "); sql.append(" ON sm.shop_member_id = rsmg.shop_member_id ");
sql.append(" WHERE rsmg.group_id IN (SELECT group_id FROM m_group WHERE user_group_flg = 1)"); sql.append(" WHERE rsmg.group_id IN (select group_id from m_shop_member sm inner join r_shop_member_group rmg on sm.shop_member_id = rmg.shop_member_id where sm.self_flg = 1)");
sql.append(" AND sm.self_flg != 1"); sql.append(" AND sm.self_flg != 1");
sql.append(" AND sm.shop_member_id NOT IN (SELECT shop_member_id FROM r_chat_room_shop_member WHERE chat_room_id = ?)"); sql.append(" AND sm.shop_member_id NOT IN (SELECT shop_member_id FROM r_chat_room_shop_member WHERE chat_room_id = ?)");
sql.append(" AND sm.shop_member_name LIKE '%"+shopMemberName+"%' "); sql.append(" AND sm.shop_member_name LIKE '%"+shopMemberName+"%' ");
......
...@@ -179,7 +179,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -179,7 +179,7 @@ public class CommunicationLogic extends AbstractLogic {
} }
public String getMyGroupUsers() { public String getMyGroupUsers() {
List<GroupDto> myGroupIds = groupDao.getUserGroups(); List<GroupDto> myGroupIds = groupDao.getMyGroups();
JSONArray myGroupUsersJson = new JSONArray(); JSONArray myGroupUsersJson = new JSONArray();
for (GroupDto groupDto : myGroupIds) { for (GroupDto groupDto : myGroupIds) {
JSONObject groupUserJson = new JSONObject(); JSONObject groupUserJson = new JSONObject();
...@@ -210,7 +210,7 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -210,7 +210,7 @@ public class CommunicationLogic extends AbstractLogic {
} }
public String getMyGroupUsersNotInRoom(Integer roomId) { public String getMyGroupUsersNotInRoom(Integer roomId) {
List<GroupDto> myGroupIds = groupDao.getUserGroups(); List<GroupDto> myGroupIds = groupDao.getMyGroups();
JSONArray myGroupUsersJson = new JSONArray(); JSONArray myGroupUsersJson = new JSONArray();
for (GroupDto groupDto : myGroupIds) { for (GroupDto groupDto : myGroupIds) {
JSONObject groupUserJson = new JSONObject(); JSONObject groupUserJson = new JSONObject();
...@@ -682,6 +682,10 @@ public class CommunicationLogic extends AbstractLogic { ...@@ -682,6 +682,10 @@ public class CommunicationLogic extends AbstractLogic {
shopMemberDao.insertShopMember(shopMemberDto); shopMemberDao.insertShopMember(shopMemberDto);
} }
public void updateMyGroup(List<Integer> groupIds) {
groupDao.updateUserGroupList(groupIds);
}
public void updateFavoriteUser(List<Integer> favoriteUserIds){ public void updateFavoriteUser(List<Integer> favoriteUserIds){
for (Integer favoriteUserId : favoriteUserIds) { for (Integer favoriteUserId : favoriteUserIds) {
ShopMemberDto favoriteUserDto= new ShopMemberDto(); ShopMemberDto favoriteUserDto= new ShopMemberDto();
......
...@@ -70,6 +70,7 @@ import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog; ...@@ -70,6 +70,7 @@ import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil; import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil; import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.view.FullscreenableChromeClient;
import jp.agentec.abook.abv.ui.viewer.activity.ParentWebViewActivity; import jp.agentec.abook.abv.ui.viewer.activity.ParentWebViewActivity;
import jp.agentec.adf.util.CollectionUtil; import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
...@@ -200,7 +201,8 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -200,7 +201,8 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
} }
} }
mChatWebView.setWebChromeClient(new WebChromeClient() { mChatWebView.setWebChromeClient(new FullscreenableChromeClient(this) {
@Override @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;
...@@ -1033,6 +1035,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity { ...@@ -1033,6 +1035,7 @@ public class ChatWebviewActivity extends ParentWebViewActivity {
MyInfoJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getMyInfo(sid); MyInfoJSON resultJson = AcmsClient.getInstance(ABVEnvironment.getInstance().networkAdapter).getMyInfo(sid);
if (resultJson.shopMemberDto != null) { if (resultJson.shopMemberDto != null) {
communicationLogic.insertMyInfo(resultJson.shopMemberDto); communicationLogic.insertMyInfo(resultJson.shopMemberDto);
communicationLogic.updateMyGroup(resultJson.shopMemberDto.groupIdList);
} }
} }
......
package jp.agentec.abook.abv.ui.home.view;
import android.app.Activity;
import android.content.Context;
import android.os.Build;
import android.support.v4.content.ContextCompat;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.WebChromeClient;
import android.widget.FrameLayout;
public class FullscreenableChromeClient extends WebChromeClient {
private Activity mActivity = null;
private View mCustomView;
private WebChromeClient.CustomViewCallback mCustomViewCallback;
private int mOriginalOrientation;
private FrameLayout mFullscreenContainer;
private static final FrameLayout.LayoutParams COVER_SCREEN_PARAMS = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
public FullscreenableChromeClient(Activity activity) {
this.mActivity = activity;
}
@Override
public void onShowCustomView(View view, CustomViewCallback callback) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
if (mCustomView != null) {
callback.onCustomViewHidden();
return;
}
mOriginalOrientation = mActivity.getRequestedOrientation();
FrameLayout decor = (FrameLayout) mActivity.getWindow().getDecorView();
mFullscreenContainer = new FullscreenHolder(mActivity);
mFullscreenContainer.addView(view, COVER_SCREEN_PARAMS);
decor.addView(mFullscreenContainer, COVER_SCREEN_PARAMS);
mCustomView = view;
setFullscreen(true);
mCustomViewCallback = callback;
}
super.onShowCustomView(view, callback);
}
@SuppressWarnings("deprecation")
@Override
public void onShowCustomView(View view, int requestedOrientation, WebChromeClient.CustomViewCallback callback) {
this.onShowCustomView(view, callback);
}
@Override
public void onHideCustomView() {
if (mCustomView == null) {
return;
}
setFullscreen(false);
FrameLayout decor = (FrameLayout) mActivity.getWindow().getDecorView();
decor.removeView(mFullscreenContainer);
mFullscreenContainer = null;
mCustomView = null;
mCustomViewCallback.onCustomViewHidden();
mActivity.setRequestedOrientation(mOriginalOrientation);
}
private void setFullscreen(boolean enabled) {
Window win = mActivity.getWindow();
WindowManager.LayoutParams winParams = win.getAttributes();
final int bits = WindowManager.LayoutParams.FLAG_FULLSCREEN;
if (enabled) {
winParams.flags |= bits;
} else {
winParams.flags &= ~bits;
if (mCustomView != null) {
mCustomView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
}
}
win.setAttributes(winParams);
}
private static class FullscreenHolder extends FrameLayout {
public FullscreenHolder(Context ctx) {
super(ctx);
setBackgroundColor(ContextCompat.getColor(ctx, android.R.color.black));
}
@Override
public boolean onTouchEvent(MotionEvent evt) {
return true;
}
}
}
\ No newline at end of file
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