Commit b2e86c83 by Lee Munkyeong

Merge branch 'communication/develop' of…

Merge branch 'communication/develop' of https://gitlab.agentec.jp/abook_android/abook_check into communication/feature/finish_all_collaboration
parents d055a103 a50b86be
......@@ -124,7 +124,7 @@ public class OperationDao extends AbstractDao {
* @return
*/
public List<OperationDto> getAllOperation() {
return rawQueryGetDtoList("select tp.*, rpc.content_id from t_operation AS tp left outer join r_operation_content AS rpc on tp.operation_id = rpc.operation_id ORDER BY operation_id DESC", null, OperationDto.class);
return rawQueryGetDtoList("select tp.*, rpc.content_id from t_operation AS tp left outer join r_operation_content AS rpc on tp.operation_id = rpc.operation_id AND rpc.operation_content_flg = 1 ORDER BY operation_id DESC", null, OperationDto.class);
}
public List<OperationDto> getLatestOperations() {
......
Subproject commit e23b43b521be6cebe40acc0857528aa01fa9de2a
Subproject commit 76f2642396962fb9b6e8bb35a2aaa8a9949075d0
......@@ -1478,8 +1478,8 @@
<string name="msg_error_chat_room_name_too_long">ルーム名は文字列20字以内に入力してください。</string>
<string name="msg_error_chat_name_has_invalid_character">特殊文字 ;/?:@&amp;=+$,-_.!~*\'()#\\\"` はルーム名に含めることができません。</string>
<string name="msg_error_chat_room_sc_forbidden">認証に失敗しました。再度ログインが必要です。</string>
<string name="msg_error_already_exist_same_room">同じルームが既に存在します。</string>
<string name="msg_confirm_send_host_change">ホスト権限を渡しますか?</string>
<string name="msg_error_already_exist_same_room">同じルームが既に存在します。\n入室しますか</string>
<string name="msg_confirm_send_host_change">ホスト権限変更の依頼があります。変更しますか?</string>
<string name="msg_confirm_share_image">キャプチャーした写真を共有しますか?</string>
<string name="msg_invite_collaboration">協業に招待されました。</string>
<!-- 連続作業 -->
......
......@@ -237,7 +237,7 @@
<string name="L120">서버와의 통신에 실패하였습니다.</string>
<string name="L121">다시 시작할 수 없습니다.</string>
<string name="L122">현재 이 기능은 Android 버전 앱에서 \n 대응하고 있지 않습니다.</string>
<string name="L123">표시가 제한된 컨츠 입니다.\n로그인 패스워드를 입력해 주세요.</string>
<string name="L123">표시가 제한된 컨츠 입니다.\n로그인 패스워드를 입력해 주세요.</string>
<string name="L124">시스템에러가 발생하였습니다.앱을 리로드합니다.</string>
<string name="C_E_SYSTEM_0001">예기치 않은 오류가 발생하였습니다.</string>
......@@ -1485,7 +1485,7 @@
<string name="msg_error_chat_name_has_invalid_character">특수문자 ;/?:@&amp;=+$,-_.!~*\'()#\\\"` 는 방 제목에 포함될 수 없습니다.</string>
<string name="msg_error_chat_room_sc_forbidden">사용자 정보를 확인할 수 없습니다. 다시 로그인하시기 바랍니다.</string>
<string name="msg_error_all_process_delete">모두 삭제 송신에 실패하였습니다.</string>
<string name="msg_error_already_exist_same_room">동일한 채팅방이 이미 존재합니다.</string>
<string name="msg_error_already_exist_same_room">동일한 채팅방이 이미 존재합니다.\n 입장하시겠습니까?</string>
<string name="msg_ozd_file_could_not_opened">장표 파일을 열 수 없습니다.</string>
<string name="msg_confirm_send_host_change">방장 권한을 전달 받으시겠습니까?</string>
<string name="msg_confirm_share_image">캡쳐한 사진을 공유 하시겠습니까?</string>
......
......@@ -1482,7 +1482,7 @@
<string name="msg_error_chat_name_has_invalid_character">The character ;/?:@&amp;=+$,-_.!~*\'()#\\\"` cannot be included in the roomname.</string>
<string name="msg_error_chat_room_sc_forbidden">Failed to authenticate. Please login again.</string>
<string name="msg_error_all_process_delete">Failed to send all deletes.</string>
<string name="msg_error_already_exist_same_room">Already exist same room.</string>
<string name="msg_error_already_exist_same_room">Already exist same room.\n do you want enter exist room?</string>
<string name="msg_ozd_file_could_not_opened">Report file could not opened.</string>
<string name="msg_confirm_send_host_change">Do you want to receive host permissions?</string>
<string name="msg_confirm_share_image">Do you want to share captured image?</string>
......
......@@ -3,7 +3,7 @@
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*,!code/removal/advanced,!method/inlining/short,!method/inlining/unique,!method/removal/*,!method/marking/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
......
......@@ -20,7 +20,7 @@
<shape android:shape="rectangle">
<solid android:color="@android:color/white" />
<corners android:radius="1dp" />
<stroke android:width="1dp" android:color="@android:color/white" />
<stroke android:width="0.5dp" android:color="@android:color/black" />
<padding
android:bottom="7dp"
android:left="7dp"
......
......@@ -11,9 +11,8 @@
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_weight="10"
android:orientation="vertical">
<LinearLayout
......
......@@ -127,5 +127,7 @@
<ListView
android:id="@+id/lv_push_message"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:divider="@color/line"
android:dividerHeight="1px"/>
</LinearLayout>
\ No newline at end of file
......@@ -12,7 +12,7 @@
android:background="@color/app_color"
android:minHeight="50dp" >
<Button
<ImageButton
android:id="@+id/closeBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -22,7 +22,7 @@
android:background="@drawable/btn_close"
android:contentDescription="@string/cont_desc" />
<Button
<ImageButton
android:id="@+id/btn_link_original_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -79,7 +79,7 @@
android:background="@drawable/btn_remote_start"
android:visibility="gone" />
<Button
<ImageButton
android:id="@+id/btn_history_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -95,7 +95,7 @@
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/menuLayout"
android:layout_marginRight="10dp" >
<Button
<ImageButton
android:id="@+id/btnWebBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -103,7 +103,7 @@
android:background="@drawable/btn_history_back"
android:contentDescription="@string/cont_desc" />
<Button
<ImageButton
android:id="@+id/btnWebForward"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
......@@ -8,7 +8,7 @@
<Button
android:id="@+id/btn_show_list_view"
android:layout_width="wrap_content"
android:layout_width="60dp"
android:layout_height="wrap_content"
android:background="@drawable/btn_show_list" />
......
......@@ -203,7 +203,7 @@
<ToggleButton
android:id="@+id/tbtn_slide"
android:layout_width="wrap_content"
android:layout_width="60dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/RelativeLayout2"
......@@ -215,7 +215,7 @@
<ToggleButton
android:id="@+id/tbtn_marking"
android:layout_width="wrap_content"
android:layout_width="60dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/tbtn_slide"
......
......@@ -170,7 +170,8 @@
android:layout_height="30dp"
android:layout_gravity="center"
android:background="@drawable/operation_radius_frame"
android:text="@string/save" />
android:text="@string/save"
android:textColor="@android:color/white"/>
<Button
android:id="@+id/pause_save"
......@@ -179,7 +180,8 @@
android:layout_gravity="center"
android:background="@drawable/operation_radius_frame"
android:text="@string/pause"
android:visibility="gone" />
android:visibility="gone"
android:textColor="@android:color/white"/>
<Button
android:id="@+id/restart_save"
......@@ -188,7 +190,8 @@
android:layout_gravity="center"
android:background="@drawable/operation_radius_frame"
android:text="@string/restart"
android:visibility="gone" />
android:visibility="gone"
android:textColor="@android:color/white"/>
<Button
android:id="@+id/open_content"
......@@ -197,7 +200,8 @@
android:layout_gravity="center"
android:background="@drawable/operation_radius_frame"
android:text="@string/open"
android:visibility="gone" />
android:visibility="gone"
android:textColor="@android:color/white"/>
<Button
android:id="@+id/delete_content"
......@@ -229,7 +233,8 @@
android:layout_marginTop="18dp"
android:background="@drawable/operation_radius_frame"
android:text="@string/content_update"
android:visibility="gone" />
android:visibility="gone"
android:textColor="@android:color/white" />
</LinearLayout>
......
......@@ -50,7 +50,7 @@
android:text="@string/save"
android:visibility="gone" />
<Button
<ImageButton
android:id="@+id/memo_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
......@@ -38,6 +38,8 @@
<ListView
android:id="@+id/lv_operation_select"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:divider="@color/line"
android:dividerHeight="1px"/>
</LinearLayout>
\ No newline at end of file
......@@ -126,5 +126,7 @@
<ListView
android:id="@+id/lv_push_message"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:divider="@color/line"
android:dividerHeight="1px"/>
</LinearLayout>
\ No newline at end of file
......@@ -234,7 +234,9 @@
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
android:visibility="gone"
android:divider="@color/line"
android:dividerHeight="1px"/>
</LinearLayout>
\ No newline at end of file
......@@ -69,6 +69,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
Integer insertId = 0;
Integer messageType = 0;
Integer messageId = 0;
String roomType = "";
Log.d(TAG,"tempMsg : "+ tempMsg);
......@@ -97,6 +98,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
}
if (pushMsg.contains(INVITE_COLLABORATION)) {
roomType = Integer.toString(json.getInt("roomType"));
String[] inviteMessage = pushMsg.split("<::split>");
tempMsg = getString(R.string.msg_invite_collaboration);
Intent pushMsgDialog = new Intent(ABVFcmListenerService.this, ShowPushMessageDailogActivity.class);
......@@ -107,6 +109,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendLoginId, pushSendLoginId); // sendLoginId
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.pushSendDate, pushSendDate);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.collaborationType, inviteMessage[1]);
pushMsgDialog.putExtra(AppDefType.ChatPushMessageKey.roomType, roomType);
startActivity(pushMsgDialog);
return;
}
......
......@@ -1029,9 +1029,13 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
mPushMessageSendDialog.findViewById(R.id.back_btn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mFixPushMessageListView.getVisibility() == View.VISIBLE) { //定型文表示状態
showSendPushMessgeView(true);
} else { //送信画面表示状態
showOperationSelectDialog();
mPushMessageSendDialog.dismiss();
}
}
});
mPushMessageSendDialog.findViewById(R.id.close_btn).setOnClickListener(new View.OnClickListener() {
......@@ -1086,8 +1090,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
private void showSendPushMessgeView(boolean sendPushMessageViewFlg) {
if (sendPushMessageViewFlg) {
mFixPushMessageListView.setVisibility(View.GONE);
mPushMessageSendDialog.findViewById(R.id.back_btn).setVisibility(View.GONE);
mPushMessageSendDialog.findViewById(R.id.push_send_layout).setVisibility(View.VISIBLE);
mPushMessageSendDialog.findViewById(R.id.close_btn).setVisibility(View.VISIBLE);
EditText messageEditText = (EditText) mPushMessageSendDialog.findViewById(R.id.message);
......
......@@ -71,6 +71,7 @@ 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.PatternStringUtil;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
......@@ -147,11 +148,17 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected String mEnablePhotoEdit; //最初ファイルをアップロードする時、Webからもらう編集可能可否のパラメタ 0:編集する。 1:編集しない。
protected PhotoEditActivity mPhotoEditDialog;
protected boolean isCollaboration = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ChatWebViewActivity chatWebViewActivity = ActivityHandlingHelper.getInstance().getActivity(ChatWebViewActivity.class);
if (chatWebViewActivity != null && chatWebViewActivity.isInPictureInPictureMode()) {
isCollaboration = true;
}
Intent intent = getIntent();
contentId = intent.getLongExtra(ABookKeys.CONTENT_ID, 0);
contentType = intent.getStringExtra(ABookKeys.CONTENT_TYPE);
......@@ -462,7 +469,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
params.addRule(RelativeLayout.CENTER_VERTICAL);
params.rightMargin = (int) (getResources().getDisplayMetrics().density * 5);
subMenuBtn.setLayoutParams(params);
if (isCollaboration) {
exitMeetingBtn.setVisibility(View.GONE);
} else {
exitMeetingBtn.setVisibility(View.VISIBLE);
}
// if (helpButton != null && helpButton.getVisibility() == View.VISIBLE) {
// helpButton.setLayoutParams(params);
......
......@@ -115,7 +115,9 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
final ABookAlertDialog alertDialog = AlertDialogUtil.createAlertDialog(ShowPushMessageDailogActivity.this, getRString(R.string.app_name), getIntent().getExtras().getString(PushMessageKey.message));
Bundle extras = getIntent().getExtras();
Long roomId = extras.getLong(AppDefType.ChatPushMessageKey.roomId, 0);
if (roomId != 0) {
if (roomId == 0) {
alertDialog.setPositiveButton(R.string.ok, null);
} else {
alertDialog.setPositiveButton(R.string.move, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
......@@ -127,25 +129,26 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
String pushSendLoginId = extras.getString(AppDefType.ChatPushMessageKey.pushSendLoginId);
long pushSendDate = extras.getLong(AppDefType.ChatPushMessageKey.pushSendDate);
String collaborationType = extras.getString(AppDefType.ChatPushMessageKey.collaborationType);
String roomType = extras.getString(AppDefType.ChatPushMessageKey.roomType);
if (roomId > 0 && !StringUtil.isNullOrEmpty(roomName)) {
List<PushMessageDto> pushMessageDtoList = AbstractLogic.getLogic(PushMessageLogic.class).getAllPushMessageList();
Logger.d("pushSendDate","pushSendDate : " + pushSendDate);
Logger.d("pushSendDate", "pushSendDate : " + pushSendDate);
String pushSendDateDate = DateTimeUtil.toString(new Date(pushSendDate), DateTimeFormat.yyyyMMddHHmmssSSS_none);
Logger.d("pushSendDate","pushSendDateDate : " + pushSendDateDate);
Logger.d("pushSendDate", "pushSendDateDate : " + pushSendDateDate);
String pushSendDateDate2 = DateTimeUtil.toString(DateTimeUtil.toDate(pushSendDateDate, DateTimeFormat.yyyyMMddHHmmssSSS_none), DateTimeFormat.yyyyMMddHHmmssSSS_none);
Logger.d("pushSendDate","pushSendDateDate2 : " + pushSendDateDate2);
Logger.d("pushSendDate", "pushSendDateDate2 : " + pushSendDateDate2);
for (int i=0; i < pushMessageDtoList.size() - 1; i++) {
for (int i = 0; i < pushMessageDtoList.size() - 1; i++) {
String tempDate = DateTimeUtil.toString(pushMessageDtoList.get(i).pushSendDate, DateTimeFormat.yyyyMMddHHmmssSSS_none);
Logger.d("tempDate","date : " + tempDate);
Logger.d("tempDate", "date : " + tempDate);
}
if (StringUtil.isNullOrEmpty(collaborationType)) {
ActivityHandlingHelper.getInstance().startChatWebViewActivity(roomId, roomName);
} else {
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId, roomName, collaborationType);
ActivityHandlingHelper.getInstance().startChatWebViewActivityWithCollaboration(roomId, roomName, collaborationType, roomType);
}
}
}
......@@ -159,8 +162,6 @@ public class ShowPushMessageDailogActivity extends ABVUIActivity {
finish();
}
});
} else {
alertDialog.setPositiveButton(R.string.ok, null);
}
alertDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
......
......@@ -144,5 +144,6 @@ public interface AppDefType {
String pushSendLoginId = "pushSendLoginId";
String pushSendDate = "pushSendDate";
String collaborationType = "collaborationType";
String roomType = "roomType";
}
}
......@@ -31,7 +31,7 @@ public class ABVBatchSyncView extends ProgressDialog {
private boolean isDestroy = false;
public ABVBatchSyncView(Context context) {
super(context);
super(context, R.style.MyDialogTheme);
mOperationListActivity = (OperationListActivity)context;
init();
isDestroy = false;
......
......@@ -96,7 +96,7 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
mAllSaveButton.setVisibility(View.GONE);
setOnButtonEvent();
settingBottomToolbar();
refreshCollaborationUI();
}
// 下辺のツールバー設定
......@@ -506,25 +506,39 @@ public class OperationRelatedContentActivity extends ABVUIActivity {
});
}
@Override
public void onResume() {
Logger.i(TAG, "onResume:start");
super.onResume();
private void refreshCollaborationUI() {
if (isCollaboration) {
activityHandlingHelper.removeContentViewActivity(activityHandlingHelper.getContentViewActivity());
hideBottomToolbar();
if (!isCollaborationOwner) {
if (isCollaborationOwner) {
closeProgressPopup();
showContentList();
} else {
showProgressPopup();
hideContentList();
}
} else {
closeProgressPopup();
showBottomToolbar();
showContentList();
}
}
@Override
public void onResume() {
Logger.i(TAG, "onResume:start");
super.onResume();
showOperationRelatedContentList();
}
@Override
protected void onNewIntent(Intent intent) {
isCollaboration = intent.getBooleanExtra("isCollaboration", false);
isCollaborationOwner = intent.getBooleanExtra("isCollaborationOwner", false);
refreshCollaborationUI();
super.onNewIntent(intent);
}
// 設定画面へ遷移
public void onClickSetting(View v) {
showSetting();
......
......@@ -398,9 +398,17 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
}
}
}
if (!StringUtil.equalsAny(contentType,
ContentJSON.KEY_HTML_TYPE, ContentJSON.KEY_LINK_TYPE, ContentJSON.KEY_ENQUETE_TYPE, ContentJSON.KEY_EXAM_TYPE,
ContentJSON.KEY_PANO_MOVIE_TYPE, ContentJSON.KEY_PANO_IMAGE_TYPE, ContentJSON.KEY_OBJECTVR_TYPE)) {
if (!StringUtil.equalsAny(
contentType,
ContentJSON.KEY_HTML_TYPE,
ContentJSON.KEY_LINK_TYPE,
ContentJSON.KEY_ENQUETE_TYPE,
ContentJSON.KEY_EXAM_TYPE,
ContentJSON.KEY_PANO_MOVIE_TYPE,
ContentJSON.KEY_PANO_IMAGE_TYPE,
ContentJSON.KEY_OBJECTVR_TYPE)
) {
context.startActivity(intent);
}
}
......@@ -1926,7 +1934,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
this.previousOfSettingActivity2 = activity;
}
public void startChatWebViewActivityWithCollaboration(Long roomId, String roomName, String collaborationType) {
public void startChatWebViewActivityWithCollaboration(Long roomId, String roomName, String collaborationType, String roomType) {
String className = ChatWebViewActivity.class.getName();
boolean isNormalSize = (mContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL;
Intent intent = new Intent();
......@@ -1940,7 +1948,7 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
intent.putExtra("shopName", shopName);
intent.putExtra("roomId", roomId);
intent.putExtra("roomName", roomName);
intent.putExtra("roomType", roomType);
intent.setClassName(mContext.getPackageName(), className);
Activity activity2 = null;
......
package jp.agentec.abook.abv.ui.home.helper;
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import android.opengl.EGL14;
import android.opengl.EGLExt;
import android.opengl.EGLConfig;
import android.opengl.EGLContext;
import android.opengl.EGLDisplay;
import android.opengl.EGLSurface;
import android.util.Log;
import android.view.Surface;
/**
* Holds state associated with a Surface used for MediaCodec encoder input.
* <p>
* The constructor takes a Surface obtained from MediaCodec.createInputSurface(), and uses that
* to create an EGL window surface. Calls to eglSwapBuffers() cause a frame of data to be sent
* to the video encoder.
*/
class InputSurface {
private static final String TAG = "InputSurface";
private static final boolean VERBOSE = true;
private static final int EGL_RECORDABLE_ANDROID = 0x3142;
private static final int EGL_OPENGL_ES2_BIT = 4;
private EGLDisplay mEGLDisplay;
private EGLContext mEGLContext;
private EGLSurface mEGLSurface;
private Surface mSurface;
/**
* Creates an InputSurface from a Surface.
*/
public InputSurface(Surface surface) {
if (surface == null) {
throw new NullPointerException();
}
mSurface = surface;
eglSetup();
}
/**
* Prepares EGL. We want a GLES 2.0 context and a surface that supports recording.
*/
private void eglSetup() {
mEGLDisplay = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY);
if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) {
throw new RuntimeException("unable to get EGL14 display");
}
int[] version = new int[2];
if (!EGL14.eglInitialize(mEGLDisplay, version, 0, version, 1)) {
mEGLDisplay = null;
throw new RuntimeException("unable to initialize EGL14");
}
// Configure EGL for pbuffer and OpenGL ES 2.0. We want enough RGB bits
// to be able to tell if the frame is reasonable.
int[] attribList = {
EGL14.EGL_RED_SIZE, 8,
EGL14.EGL_GREEN_SIZE, 8,
EGL14.EGL_BLUE_SIZE, 8,
EGL14.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_RECORDABLE_ANDROID, 1,
EGL14.EGL_NONE
};
EGLConfig[] configs = new EGLConfig[1];
int[] numConfigs = new int[1];
if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, configs, 0, configs.length,
numConfigs, 0)) {
throw new RuntimeException("unable to find RGB888+recordable ES2 EGL config");
}
// Configure context for OpenGL ES 2.0.
int[] attrib_list = {
EGL14.EGL_CONTEXT_CLIENT_VERSION, 2,
EGL14.EGL_NONE
};
mEGLContext = EGL14.eglCreateContext(mEGLDisplay, configs[0], EGL14.EGL_NO_CONTEXT,
attrib_list, 0);
checkEglError("eglCreateContext");
if (mEGLContext == null) {
throw new RuntimeException("null context");
}
// Create a window surface, and attach it to the Surface we received.
int[] surfaceAttribs = {
EGL14.EGL_NONE
};
mEGLSurface = EGL14.eglCreateWindowSurface(mEGLDisplay, configs[0], mSurface,
surfaceAttribs, 0);
checkEglError("eglCreateWindowSurface");
if (mEGLSurface == null) {
throw new RuntimeException("surface was null");
}
}
/**
* Discard all resources held by this class, notably the EGL context. Also releases the
* Surface that was passed to our constructor.
*/
public void release() {
if (EGL14.eglGetCurrentContext().equals(mEGLContext)) {
// Clear the current context and surface to ensure they are discarded immediately.
EGL14.eglMakeCurrent(mEGLDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE,
EGL14.EGL_NO_CONTEXT);
}
EGL14.eglDestroySurface(mEGLDisplay, mEGLSurface);
EGL14.eglDestroyContext(mEGLDisplay, mEGLContext);
//EGL14.eglTerminate(mEGLDisplay);
mSurface.release();
// null everything out so future attempts to use this object will cause an NPE
mEGLDisplay = null;
mEGLContext = null;
mEGLSurface = null;
mSurface = null;
}
/**
* Makes our EGL context and surface current.
*/
public void makeCurrent() {
if (!EGL14.eglMakeCurrent(mEGLDisplay, mEGLSurface, mEGLSurface, mEGLContext)) {
throw new RuntimeException("eglMakeCurrent failed");
}
}
/**
* Calls eglSwapBuffers. Use this to "publish" the current frame.
*/
public boolean swapBuffers() {
return EGL14.eglSwapBuffers(mEGLDisplay, mEGLSurface);
}
/**
* Returns the Surface that the MediaCodec receives buffers from.
*/
public Surface getSurface() {
return mSurface;
}
/**
* Sends the presentation time stamp to EGL. Time is expressed in nanoseconds.
*/
public void setPresentationTime(long nsecs) {
EGLExt.eglPresentationTimeANDROID(mEGLDisplay, mEGLSurface, nsecs);
}
/**
* Checks for EGL errors.
*/
private void checkEglError(String msg) {
boolean failed = false;
int error;
while ((error = EGL14.eglGetError()) != EGL14.EGL_SUCCESS) {
Log.e(TAG, msg + ": EGL error: 0x" + Integer.toHexString(error));
failed = true;
}
if (failed) {
throw new RuntimeException("EGL error encountered (see log)");
}
}
}
package jp.agentec.abook.abv.ui.home.helper;
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import android.graphics.SurfaceTexture;
import android.opengl.GLES11Ext;
import android.opengl.GLES20;
import android.opengl.GLSurfaceView;
import android.opengl.Matrix;
import android.util.Log;
/**
* Code for rendering a texture onto a surface using OpenGL ES 2.0.
*/
class TextureRender {
private static final String TAG = "TextureRender";
private static final int FLOAT_SIZE_BYTES = 4;
private static final int TRIANGLE_VERTICES_DATA_STRIDE_BYTES = 5 * FLOAT_SIZE_BYTES;
private static final int TRIANGLE_VERTICES_DATA_POS_OFFSET = 0;
private static final int TRIANGLE_VERTICES_DATA_UV_OFFSET = 3;
private final float[] mTriangleVerticesData = {
// X, Y, Z, U, V
-1.0f, -1.0f, 0, 0.f, 0.f,
1.0f, -1.0f, 0, 1.f, 0.f,
-1.0f, 1.0f, 0, 0.f, 1.f,
1.0f, 1.0f, 0, 1.f, 1.f,
};
private FloatBuffer mTriangleVertices;
private static final String VERTEX_SHADER =
"uniform mat4 uMVPMatrix;\n" +
"uniform mat4 uSTMatrix;\n" +
"attribute vec4 aPosition;\n" +
"attribute vec4 aTextureCoord;\n" +
"varying vec2 vTextureCoord;\n" +
"void main() {\n" +
" gl_Position = uMVPMatrix * aPosition;\n" +
" vTextureCoord = (uSTMatrix * aTextureCoord).xy;\n" +
"}\n";
private static final String FRAGMENT_SHADER =
"#extension GL_OES_EGL_image_external : require\n" +
"precision mediump float;\n" + // highp here doesn't seem to matter
"varying vec2 vTextureCoord;\n" +
"uniform samplerExternalOES sTexture;\n" +
"void main() {\n" +
" gl_FragColor = texture2D(sTexture, vTextureCoord);\n" +
"}\n";
private float[] mMVPMatrix = new float[16];
private float[] mSTMatrix = new float[16];
private int mProgram;
private int mTextureID = -12345;
private int muMVPMatrixHandle;
private int muSTMatrixHandle;
private int maPositionHandle;
private int maTextureHandle;
public TextureRender() {
mTriangleVertices = ByteBuffer.allocateDirect(
mTriangleVerticesData.length * FLOAT_SIZE_BYTES)
.order(ByteOrder.nativeOrder()).asFloatBuffer();
mTriangleVertices.put(mTriangleVerticesData).position(0);
Matrix.setIdentityM(mSTMatrix, 0);
}
public int getTextureId() {
return mTextureID;
}
public void drawFrame(SurfaceTexture st) {
checkGlError("onDrawFrame start");
st.getTransformMatrix(mSTMatrix);
GLES20.glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
GLES20.glClear(GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
GLES20.glUseProgram(mProgram);
checkGlError("glUseProgram");
GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, mTextureID);
mTriangleVertices.position(TRIANGLE_VERTICES_DATA_POS_OFFSET);
GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false,
TRIANGLE_VERTICES_DATA_STRIDE_BYTES, mTriangleVertices);
checkGlError("glVertexAttribPointer maPosition");
GLES20.glEnableVertexAttribArray(maPositionHandle);
checkGlError("glEnableVertexAttribArray maPositionHandle");
mTriangleVertices.position(TRIANGLE_VERTICES_DATA_UV_OFFSET);
GLES20.glVertexAttribPointer(maTextureHandle, 2, GLES20.GL_FLOAT, false,
TRIANGLE_VERTICES_DATA_STRIDE_BYTES, mTriangleVertices);
checkGlError("glVertexAttribPointer maTextureHandle");
GLES20.glEnableVertexAttribArray(maTextureHandle);
checkGlError("glEnableVertexAttribArray maTextureHandle");
Matrix.setIdentityM(mMVPMatrix, 0);
GLES20.glUniformMatrix4fv(muMVPMatrixHandle, 1, false, mMVPMatrix, 0);
GLES20.glUniformMatrix4fv(muSTMatrixHandle, 1, false, mSTMatrix, 0);
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
checkGlError("glDrawArrays");
GLES20.glFinish();
}
/**
* Initializes GL state. Call this after the EGL surface has been created and made current.
*/
public void surfaceCreated() {
mProgram = createProgram(VERTEX_SHADER, FRAGMENT_SHADER);
if (mProgram == 0) {
throw new RuntimeException("failed creating program");
}
maPositionHandle = GLES20.glGetAttribLocation(mProgram, "aPosition");
checkGlError("glGetAttribLocation aPosition");
if (maPositionHandle == -1) {
throw new RuntimeException("Could not get attrib location for aPosition");
}
maTextureHandle = GLES20.glGetAttribLocation(mProgram, "aTextureCoord");
checkGlError("glGetAttribLocation aTextureCoord");
if (maTextureHandle == -1) {
throw new RuntimeException("Could not get attrib location for aTextureCoord");
}
muMVPMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uMVPMatrix");
checkGlError("glGetUniformLocation uMVPMatrix");
if (muMVPMatrixHandle == -1) {
throw new RuntimeException("Could not get attrib location for uMVPMatrix");
}
muSTMatrixHandle = GLES20.glGetUniformLocation(mProgram, "uSTMatrix");
checkGlError("glGetUniformLocation uSTMatrix");
if (muSTMatrixHandle == -1) {
throw new RuntimeException("Could not get attrib location for uSTMatrix");
}
int[] textures = new int[1];
GLES20.glGenTextures(1, textures, 0);
mTextureID = textures[0];
GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, mTextureID);
checkGlError("glBindTexture mTextureID");
GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER,
GLES20.GL_NEAREST);
GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER,
GLES20.GL_LINEAR);
GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S,
GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T,
GLES20.GL_CLAMP_TO_EDGE);
checkGlError("glTexParameter");
}
/**
* Replaces the fragment shader.
*/
public void changeFragmentShader(String fragmentShader) {
GLES20.glDeleteProgram(mProgram);
mProgram = createProgram(VERTEX_SHADER, fragmentShader);
if (mProgram == 0) {
throw new RuntimeException("failed creating program");
}
}
private int loadShader(int shaderType, String source) {
int shader = GLES20.glCreateShader(shaderType);
checkGlError("glCreateShader type=" + shaderType);
GLES20.glShaderSource(shader, source);
GLES20.glCompileShader(shader);
int[] compiled = new int[1];
GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0);
if (compiled[0] == 0) {
Log.e(TAG, "Could not compile shader " + shaderType + ":");
Log.e(TAG, " " + GLES20.glGetShaderInfoLog(shader));
GLES20.glDeleteShader(shader);
shader = 0;
}
return shader;
}
private int createProgram(String vertexSource, String fragmentSource) {
int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
if (vertexShader == 0) {
return 0;
}
int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
if (pixelShader == 0) {
return 0;
}
int program = GLES20.glCreateProgram();
checkGlError("glCreateProgram");
if (program == 0) {
Log.e(TAG, "Could not create program");
}
GLES20.glAttachShader(program, vertexShader);
checkGlError("glAttachShader");
GLES20.glAttachShader(program, pixelShader);
checkGlError("glAttachShader");
GLES20.glLinkProgram(program);
int[] linkStatus = new int[1];
GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
if (linkStatus[0] != GLES20.GL_TRUE) {
Log.e(TAG, "Could not link program: ");
Log.e(TAG, GLES20.glGetProgramInfoLog(program));
GLES20.glDeleteProgram(program);
program = 0;
}
return program;
}
public void checkGlError(String op) {
int error;
while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
Log.e(TAG, op + ": glError " + error);
throw new RuntimeException(op + ": glError " + error);
}
}
}
......@@ -3,7 +3,11 @@ package jp.agentec.abook.abv.ui.home.view;
import jp.agentec.abook.abv.launcher.android.R;
import android.content.Context;
import android.graphics.Color;
import android.view.Gravity;
import android.widget.Button;
import android.widget.TextView;
/**
* パンくず履歴用のボタン
......@@ -16,10 +20,12 @@ public class BreadCrumbButton extends Button {
super(context);
}
public BreadCrumbButton(Context context, String name) {
super(context);
super(context, null, R.style.ButtonABookDark);
this.name = name;
setText(name);
//画面表示調整のため、最後に空白を追加する。
setText(name + " ");
setTextColor(Color.BLACK);
setGravity(Gravity.CENTER_VERTICAL);
setBackgroundResource(R.drawable.btn_breadcrumbs);
setPadding(10, 0, 40, 0);
}
......
......@@ -76,6 +76,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Stack;
import java.util.concurrent.ConcurrentHashMap;
import jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON;
......@@ -118,6 +119,7 @@ import jp.agentec.abook.abv.cl.util.ContentLogUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.launcher.android.R.id;
import jp.agentec.abook.abv.ui.common.activity.ABVAuthenticatedActivity;
import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppColor;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
......@@ -135,6 +137,7 @@ import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.common.view.ABVEditText;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.common.vo.Size;
import jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.Interface.MovePageInterface;
......@@ -333,6 +336,8 @@ public class ContentViewActivity extends ABVContentViewActivity {
// 移動・タップモードのフラグ
public boolean mMoveTaskFlg = false;
/**
* スクロールステータス
*/
......@@ -347,6 +352,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
Logger.i(TAG, "[onCreate]:contentId=" + getContentId());
super.onCreate(savedInstanceState);
// 全画面表示
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
......@@ -941,6 +947,13 @@ public class ContentViewActivity extends ABVContentViewActivity {
showMeetingExitDialog();
}
});
if (isCollaboration) {
pauseBtn.setVisibility(View.GONE);
exitMeetingBtn.setVisibility(View.GONE);
exitBtn.setVisibility(View.GONE);
promoteBtn.setVisibility(View.GONE);
}
}
private boolean addPageViewFinish;
......@@ -1390,6 +1403,15 @@ public class ContentViewActivity extends ABVContentViewActivity {
mBtnRemoteStart.setVisibility(View.GONE);
}
}
if (isCollaboration) {
mHistoryBtn.setVisibility(View.GONE);
indexBtn.setVisibility(View.GONE);
search.setVisibility(View.GONE);
marking.setVisibility(View.GONE);
bookmark.setVisibility(View.GONE);
subMenuBtn.setVisibility(View.GONE);
}
}
private void setMarkingViewVisibility(boolean visible){
......@@ -1823,6 +1845,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
exitMeetingBtn.setVisibility(View.VISIBLE);
}
}
mToolBar.setVisibility(visability);
}
......@@ -5363,7 +5386,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
zoomRelativeLayout.removeView(view);
}
}
List<OperationTaskDto> tasks = mTaskHotspotJSON.getPageTasks(i);
List<OperationTaskDto> tasks = mTaskHotspotJSON.getPageTasks(key);
operationTaskLayout.addAllOperationTaskIcon(zoomRelativeLayout, tasks);
}
}
......
......@@ -60,12 +60,12 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
protected ImageButton promoteBtn;
protected ImageButton pauseBtn;
protected ImageButton mBtnRemoteStart;
protected Button historyListBtn;
protected ImageButton historyListBtn;
protected ImageButton btnWebClose;
protected Button closeButton;
protected Button btnLinkOriginalBack;
protected Button btnWebBack;
protected Button btnWebForward;
protected ImageButton closeButton;
protected ImageButton btnLinkOriginalBack;
protected ImageButton btnWebBack;
protected ImageButton btnWebForward;
private ProgressBar m_progress;
protected ContentDto mContentDto;
......@@ -77,18 +77,18 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
taskListButton = (ImageButton) findViewById(R.id.btn_show_task_list);
// helpButton = (ImageButton) findViewById(R.id.btn_help);
btnWebClose = (ImageButton) findViewById(R.id.btnWebClose);
closeButton = (Button) findViewById(R.id.closeBtn);
historyListBtn = (Button) findViewById(R.id.btn_history_list);
closeButton = (ImageButton) findViewById(R.id.closeBtn);
historyListBtn = (ImageButton) findViewById(R.id.btn_history_list);
subMenuBtn = (ImageButton) findViewById(R.id.btn_sub_menu);
exitMeetingBtn = (ImageButton) findViewById(R.id.btn_exitMeeting);
mBtnRemoteStart = (ImageButton) findViewById(R.id.btn_remote_start);
pauseBtn = (ImageButton) findViewById(R.id.btn_remote_pause);
promoteBtn = (ImageButton) findViewById(R.id.btn_promote);
btnWebBack = (Button) findViewById(R.id.btnWebBack);
btnWebForward = (Button) findViewById(R.id.btnWebForward);
btnWebBack = (ImageButton) findViewById(R.id.btnWebBack);
btnWebForward = (ImageButton) findViewById(R.id.btnWebForward);
m_progress = (ProgressBar) findViewById(R.id.refresh_prog);
btnLinkOriginalBack = (Button) findViewById(R.id.btn_link_original_back);
btnLinkOriginalBack = (ImageButton) findViewById(R.id.btn_link_original_back);
if (!isLinkedContent) {
final Context context = this;
......
......@@ -18,6 +18,7 @@ import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
......@@ -61,7 +62,7 @@ public class MemoManager {
memoDialog.setContentView(contentView);
final EditText memoText = (EditText) contentView.findViewById(R.id.memoText);
final Button btnDelete = (Button) contentView.findViewById(R.id.memo_delete);
final ImageButton btnDelete = (ImageButton) contentView.findViewById(R.id.memo_delete);
final Button btnSave = (Button) contentView.findViewById(R.id.memo_save);
final Button btnCancel = (Button) contentView.findViewById(R.id.memo_cancel);
final ImageView abookmark = (ImageView) contentView.findViewById(R.id.abookmark);
......
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