Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
huangxinbao
/
Android_Sdk
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
huangxinbao
2017-05-14 21:54:52 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
78fae0a78fefded6a9ea22b7a7500379183c0068
78fae0a7
1 parent
de4f460d
add for Tablet layout
隐藏空白字符变更
内嵌
并排对比
正在显示
11 个修改的文件
包含
208 行增加
和
162 行删除
MyApplication/.idea/gradle.xml
MyApplication/.idea/misc.xml
MyApplication/.idea/modules.xml
MyApplication/XdyDemo/src/main/AndroidManifest.xml
MyApplication/XdyDemo/src/main/java/com/mang/xdy/demo/MainActivity.java
MyApplication/XdyDemo/src/main/java/com/mang/xdy/demo/activity/VideoPlayActivity.java
MyApplication/XdyDemo/src/main/res/layout/activity_video_play.xml
MyApplication/XdyDemo/src/main/res/values/strings.xml
MyApplication/iOS_Dialog_Library/build/intermediates/incremental/mergeReleaseResources/compile-file-map.properties
MyApplication/iOS_Dialog_Library/build/intermediates/incremental/packageReleaseResources/compile-file-map.properties
MyApplication/iOS_Dialog_Library/build/outputs/aar/iOS_Dialog_Library-release.aar
MyApplication/.idea/gradle.xml
查看文件 @
78fae0a
...
...
@@ -6,20 +6,6 @@
<option
name=
"distributionType"
value=
"LOCAL"
/>
<option
name=
"externalProjectPath"
value=
"$PROJECT_DIR$"
/>
<option
name=
"gradleHome"
value=
"C:\Program Files\Android\Android Studio\gradle\gradle-2.14.1"
/>
<option
name=
"modules"
>
<set>
<option
value=
"$PROJECT_DIR$"
/>
<option
value=
"$PROJECT_DIR$/XdyDemo"
/>
<option
value=
"$PROJECT_DIR$/app"
/>
<option
value=
"$PROJECT_DIR$/easeUI_CN"
/>
<option
value=
"$PROJECT_DIR$/iOS_Dialog_Library"
/>
<option
value=
"$PROJECT_DIR$/myapplication2"
/>
<option
value=
"$PROJECT_DIR$/mylibrary"
/>
<option
value=
"$PROJECT_DIR$/sdklibraryssss"
/>
<option
value=
"$PROJECT_DIR$/smartPlayer"
/>
<option
value=
"$PROJECT_DIR$/xdy"
/>
</set>
</option>
<option
name=
"resolveModulePerSourceSet"
value=
"false"
/>
</GradleProjectSettings>
</option>
...
...
MyApplication/.idea/misc.xml
查看文件 @
78fae0a
...
...
@@ -10,7 +10,7 @@
<ConfirmationsSetting
value=
"0"
id=
"Add"
/>
<ConfirmationsSetting
value=
"0"
id=
"Remove"
/>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_
7"
default=
"true"
assert-keyword=
"true"
jdk-15=
"true"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK
"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_
3"
default=
"true"
assert-keyword=
"false"
jdk-15=
"false
"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
...
...
MyApplication/.idea/modules.xml
查看文件 @
78fae0a
...
...
@@ -3,15 +3,6 @@
<component
name=
"ProjectModuleManager"
>
<modules>
<module
fileurl=
"file://$PROJECT_DIR$/MyApplication.iml"
filepath=
"$PROJECT_DIR$/MyApplication.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/XdyDemo/XdyDemo.iml"
filepath=
"$PROJECT_DIR$/XdyDemo/XdyDemo.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/app/app.iml"
filepath=
"$PROJECT_DIR$/app/app.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/easeUI_CN/easeUI_CN.iml"
filepath=
"$PROJECT_DIR$/easeUI_CN/easeUI_CN.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/iOS_Dialog_Library/iOS_Dialog_Library.iml"
filepath=
"$PROJECT_DIR$/iOS_Dialog_Library/iOS_Dialog_Library.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/myapplication2/myapplication2.iml"
filepath=
"$PROJECT_DIR$/myapplication2/myapplication2.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/mylibrary/mylibrary.iml"
filepath=
"$PROJECT_DIR$/mylibrary/mylibrary.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/sdklibraryssss/sdklibraryssss.iml"
filepath=
"$PROJECT_DIR$/sdklibraryssss/sdklibraryssss.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/smartPlayer/smartPlayer.iml"
filepath=
"$PROJECT_DIR$/smartPlayer/smartPlayer.iml"
/>
<module
fileurl=
"file://$PROJECT_DIR$/xdy/xdy.iml"
filepath=
"$PROJECT_DIR$/xdy/xdy.iml"
/>
</modules>
</component>
</project>
\ No newline at end of file
...
...
MyApplication/XdyDemo/src/main/AndroidManifest.xml
查看文件 @
78fae0a
...
...
@@ -42,7 +42,9 @@
android:label=
"@string/app_name"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".MainActivity"
>
<activity
android:name=
".MainActivity"
android:screenOrientation=
"portrait"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
@@ -50,13 +52,9 @@
</intent-filter>
</activity>
<activity
android:name=
".activity.VideoPlayActivity"
android:screenOrientation=
"
portrait
"
android:screenOrientation=
"
landscape
"
>
</activity>
<activity
android:name=
".activity.VideoPublisherActivity"
android:screenOrientation=
"portrait"
></activity>
<activity
android:name=
".activity.AudioPublisherActivity"
android:screenOrientation=
"portrait"
/>
</application>
</manifest>
\ No newline at end of file
...
...
MyApplication/XdyDemo/src/main/java/com/mang/xdy/demo/MainActivity.java
查看文件 @
78fae0a
package
com
.
mang
.
xdy
.
demo
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.res.Configuration
;
import
android.os.Bundle
;
import
android.support.v7.app.AppCompatActivity
;
import
android.text.TextUtils
;
...
...
@@ -88,19 +90,19 @@ public class MainActivity extends AppCompatActivity {
serviceIp
=
edtHomeServiceIp
.
getText
().
toString
();
userId
=
edtHomeUserId
.
getText
().
toString
();
if
(
TextUtils
.
isEmpty
(
classId
)){
ToastUtil
.
showToast
(
"课堂Id不能为空"
,
this
);
ToastUtil
.
showToast
(
getResources
().
getString
(
R
.
string
.
main_login_error_classId
)
,
this
);
return
false
;
}
if
(
TextUtils
.
isEmpty
(
serviceIp
)){
ToastUtil
.
showToast
(
"服务器地址不能为空"
,
this
);
ToastUtil
.
showToast
(
getResources
().
getString
(
R
.
string
.
main_login_error_portal
)
,
this
);
return
false
;
}
if
(
TextUtils
.
isEmpty
(
userRole
)){
ToastUtil
.
showToast
(
"角色不能为空"
,
this
);
ToastUtil
.
showToast
(
getResources
().
getString
(
R
.
string
.
main_login_error_role
)
,
this
);
return
false
;
}
if
(
TextUtils
.
isEmpty
(
userId
)){
ToastUtil
.
showToast
(
"用户id不能为空"
,
this
);
ToastUtil
.
showToast
(
getResources
().
getString
(
R
.
string
.
main_login_error_userId
)
,
this
);
return
false
;
}
return
true
;
...
...
@@ -121,4 +123,7 @@ public class MainActivity extends AppCompatActivity {
}
}
}
...
...
MyApplication/XdyDemo/src/main/java/com/mang/xdy/demo/activity/VideoPlayActivity.java
查看文件 @
78fae0a
...
...
@@ -2,16 +2,23 @@ package com.mang.xdy.demo.activity;
import
android.annotation.SuppressLint
;
import
android.app.ProgressDialog
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.pm.ActivityInfo
;
import
android.content.res.Configuration
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.support.design.widget.TabLayout
;
import
android.support.v4.app.FragmentActivity
;
import
android.support.v4.app.FragmentManager
;
import
android.support.v4.app.FragmentTransaction
;
import
android.support.v7.app.AlertDialog
;
import
android.support.v7.app.AppCompatActivity
;
import
android.text.TextUtils
;
import
android.util.DisplayMetrics
;
import
android.util.Log
;
import
android.view.KeyEvent
;
import
android.view.SurfaceHolder
;
import
android.view.SurfaceView
;
import
android.view.View
;
...
...
@@ -19,6 +26,7 @@ import android.view.WindowManager;
import
android.widget.FrameLayout
;
import
android.widget.ImageButton
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.SeekBar
;
import
android.widget.TextView
;
...
...
@@ -38,6 +46,8 @@ import com.mang.xdy.demo.bean.JoinClass;
import
com.mang.xdy.demo.bean.ResponseEntity
;
import
com.mang.xdy.demo.bean.TimeEntity
;
import
com.mang.xdy.demo.bean.VideoOrAudioStopEntity
;
import
com.mang.xdy.demo.fragment.ChatFragment
;
import
com.mang.xdy.demo.fragment.DocFragment
;
import
com.mang.xdy.demo.utils.JsonUtil
;
import
com.mang.xdy.demo.utils.ToastUtil
;
import
com.mang.xdy.demo.widget.answersheet.AnswerSheetView
;
...
...
@@ -71,7 +81,7 @@ import static com.pili.pldroid.player.AVOptions.KEY_DELAY_OPTIMIZATION;
;
public
class
VideoPlayActivity
extends
AppCompa
tActivity
implements
ObserverListener
,
PLMediaPlayer
.
OnErrorListener
,
PLMediaPlayer
.
OnInfoListener
,
NoScrollViewPager
.
OnRplayTouchListener
{
public
class
VideoPlayActivity
extends
Fragmen
tActivity
implements
ObserverListener
,
PLMediaPlayer
.
OnErrorListener
,
PLMediaPlayer
.
OnInfoListener
,
NoScrollViewPager
.
OnRplayTouchListener
{
private
final
static
String
TAG
=
"VideoPlayActivity"
;
@BindView
(
R
.
id
.
img_playVideo_novideo
)
ImageView
img_playVideo_novideo
;
...
...
@@ -98,8 +108,8 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
SlidingTabLayout
mSlidingTab
;
@BindView
(
R
.
id
.
img_playVideo_publishAudio
)
ImageView
mIamgeView_PublishAudio
;
@BindView
(
R
.
id
.
asv_videoPlay_answer
)
AnswerSheetView
mAnswerSheetView
;
// @BindView(R.id.asv_videoPlay_answer)
// AnswerSheetView mAnswerSheetView;
private
String
username
=
""
;
private
String
userpwd
=
""
;
private
SimpleFragmentPagerAdapter
pagerAdapter
;
...
...
@@ -125,6 +135,14 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
/*课堂类型*/
private
int
classType
=
2
;
private
String
[]
titles
;
private
long
loging_upload
=
0
;
private
LinearLayout
llVideo_table_chat
;
// private Fragment mFragment_Tablet_Chat;
private
Handler
mmHandler
=
new
Handler
()
{
@Override
public
void
handleMessage
(
Message
msg
)
{
...
...
@@ -132,7 +150,7 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
ResponseEntity
responseEntity
=
(
ResponseEntity
)
msg
.
obj
;
switch
(
responseEntity
.
getType
())
{
case
Constants
.
CLASS_EXIT
:
ToastUtil
.
showToast
(
"退出课堂"
,
VideoPlayActivity
.
this
);
ToastUtil
.
showToast
(
getResources
().
getString
(
R
.
string
.
home_msg_exit_class
)
,
VideoPlayActivity
.
this
);
progressDialogDismiss
();
exit
();
break
;
...
...
@@ -142,13 +160,13 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
case
Constants
.
CLASS_INIT_SUCCESS
:
String
login
=
responseEntity
.
getParam
();
parseJoinClass
(
login
,
true
);
ToastUtil
.
showToastshort
(
"初始化课堂成功"
,
VideoPlayActivity
.
this
);
//
ToastUtil.showToastshort("初始化课堂成功", VideoPlayActivity.this);
break
;
case
Constants
.
CLASS_JOIN_SUCCESS
:
//加入课堂成功
progressDialogDismiss
();
UIUtils
.
closeDialog
(
mLoginDialog
);
ToastUtil
.
showToastshort
(
"加入课堂成功"
,
VideoPlayActivity
.
this
);
ToastUtil
.
showToastshort
(
getResources
().
getString
(
R
.
string
.
home_msg_join_class_success
)
,
VideoPlayActivity
.
this
);
String
userJson
=
responseEntity
.
getParam
();
SPUtil
.
putString
(
VideoPlayActivity
.
this
,
Constants
.
CLASS_JOIN_SUCCESS
,
userJson
);
JSONObject
jsonObject
=
null
;
...
...
@@ -217,13 +235,15 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
super
.
onCreate
(
savedInstanceState
);
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_KEEP_SCREEN_ON
);
//屏幕常亮
setContentView
(
R
.
layout
.
activity_video_play
);
EventBus
.
getDefault
().
register
(
this
);
ButterKnife
.
bind
(
this
);
aCache
=
ACache
.
get
(
this
);
xdySdk
=
XdySdk
.
getXdyInstance
();
xdySdk
.
add
(
this
);
init
();
initTablet
();
loging_upload
=
System
.
currentTimeMillis
();
progressDialogShow
();
setTablayout
();
...
...
@@ -358,7 +378,7 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
isPublsishVideoMode
=
false
;
}
})
.
addSheetItem
(
"
开始答题
"
,
ActionSheetDialog
.
SheetItemColor
.
Blue
.
addSheetItem
(
"
单选或者多选
"
,
ActionSheetDialog
.
SheetItemColor
.
Blue
,
new
ActionSheetDialog
.
OnSheetItemClickListener
()
{
@Override
public
void
onClick
(
int
which
)
{
...
...
@@ -390,47 +410,58 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
}
})
.
addSheetItem
(
"填空题"
,
ActionSheetDialog
.
SheetItemColor
.
Blue
,
new
ActionSheetDialog
.
OnSheetItemClickListener
()
{
@Override
public
void
onClick
(
int
which
)
{
//填写事件
// mAnswerSheetView.selectAnswerSheetType(AnswerSheetView.ANSWER_TYPE_FILLING);
// mAnswerSheetView.startCountTimerAndResizeLayout(15);
// setAnswerSheetLayout_Nornal(53);
AnswerSheetDialog
answerSheetDialog
=
new
AnswerSheetDialog
(
VideoPlayActivity
.
this
);
answerSheetDialog
.
builder
().
show
();
answerSheetDialog
.
selectAnswerSheetType
(
3
);
answerSheetDialog
.
startCountTimerAndResizeLayout
(
15
,
40
);
}
}).
show
();
// .addSheetItem("填空题", ActionSheetDialog.SheetItemColor.Blue
// , new ActionSheetDialog.OnSheetItemClickListener() {
// @Override
// public void onClick(int which) {
// //填写事件
//// mAnswerSheetView.selectAnswerSheetType(AnswerSheetView.ANSWER_TYPE_FILLING);
//// mAnswerSheetView.startCountTimerAndResizeLayout(15);
//// setAnswerSheetLayout_Nornal(53);
// AnswerSheetDialog answerSheetDialog= new AnswerSheetDialog(VideoPlayActivity.this);
// answerSheetDialog.builder().show();
// answerSheetDialog.selectAnswerSheetType(3);
// answerSheetDialog.startCountTimerAndResizeLayout(15,40);
//
//
//
// }
// })
.
show
();
}
public
void
setTablayout
()
{
titles
=
new
String
[]{
getResources
().
getString
(
R
.
string
.
home_content_doc
),
getResources
().
getString
(
R
.
string
.
home_content_chat
)};
pagerAdapter
=
new
SimpleFragmentPagerAdapter
(
getSupportFragmentManager
(),
this
,
replay
);
viewPager
.
setAdapter
(
pagerAdapter
);
viewPager
.
setOnRplayTouchListener
(
this
);
// viewPager.setPagingEnabled(false);
if
(
isTablet
(
this
))
{
mSlidingTab
.
setVisibility
(
View
.
GONE
);
viewPager
.
setVisibility
(
View
.
GONE
);
FragmentManager
fm
=
getSupportFragmentManager
();
FragmentTransaction
transaction
=
fm
.
beginTransaction
();
transaction
.
add
(
R
.
id
.
ll_videoPlay_tablet_doc
,
DocFragment
.
newInstance
(
replay
),
"tag"
);
transaction
.
commit
();
}
else
{
titles
=
new
String
[]{
getResources
().
getString
(
R
.
string
.
home_content_doc
),
getResources
().
getString
(
R
.
string
.
home_content_chat
)};
pagerAdapter
=
new
SimpleFragmentPagerAdapter
(
getSupportFragmentManager
(),
this
,
replay
);
viewPager
.
setAdapter
(
pagerAdapter
);
viewPager
.
setOnRplayTouchListener
(
this
);
viewPager
.
setPagingEnabled
(
false
);
// viewPager.setOffscreenPageLimit(0);
mSlidingTab
.
setViewPager
(
viewPager
,
titles
);
mSlidingTab
.
setOnTabSelectListener
(
new
OnTabSelectListener
()
{
@Override
public
void
onTabSelect
(
int
position
)
{
if
(
1
==
position
&&
replay
)
{
//为了避免回访时切换界面出现桌面 暂时先这样写了
showMediaContainer
(
TIME_OUT
);
mSlidingTab
.
setViewPager
(
viewPager
,
titles
);
mSlidingTab
.
setOnTabSelectListener
(
new
OnTabSelectListener
()
{
@Override
public
void
onTabSelect
(
int
position
)
{
if
(
1
==
position
&&
replay
)
{
//为了避免回访时切换界面出现桌面 暂时先这样写了
showMediaContainer
(
TIME_OUT
);
}
}
}
@Override
public
void
onTabReselect
(
int
position
)
{
@Override
public
void
onTabReselect
(
int
position
)
{
}
});
}
});
}
}
//判断解析是否有密码
...
...
@@ -501,37 +532,39 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
getWindowManager
().
getDefaultDisplay
().
getMetrics
(
dm
);
int
widthPixels
=
dm
.
widthPixels
;
int
heightPixels
=
dm
.
heightPixels
;
if
(
surfaceviewPlayVideo
!=
null
)
{
// int margin = (mSurfaceViewWidth - w) / 2;
SurfaceHolder
surfaceHolder
=
surfaceviewPlayVideo
.
getHolder
();
RelativeLayout
.
LayoutParams
lp
=
new
RelativeLayout
.
LayoutParams
(
RelativeLayout
.
LayoutParams
.
MATCH_PARENT
,
RelativeLayout
.
LayoutParams
.
MATCH_PARENT
);
int
setWidth
=
640
;
int
setHeight
=
480
;
int
leftW
=
0
;
int
leftH
=
0
;
int
width
=
surfaceviewPlayVideo
.
getWidth
();
int
height
=
surfaceviewPlayVideo
.
getHeight
();
if
(
width
>
height
)
{
setWidth
=
width
;
setHeight
=
height
*
(
4
/
3
);
leftH
=
0
;
leftW
=
(
widthPixels
-
setHeight
)
/
2
;
}
else
{
}
lp
.
setMargins
(
leftW
,
0
,
leftW
,
0
);
// surfaceHolder.setFixedSize(640,480);
XdyLogUtil
.
e
(
"surface 高度计算:"
,
surfaceviewPlayVideo
.
getWidth
()
+
"高:"
+
surfaceviewPlayVideo
.
getHeight
());
surfaceviewPlayVideo
.
setLayoutParams
(
lp
);
XdyLogUtil
.
e
(
"surface 设置后的高度的高度计算:"
,
surfaceviewPlayVideo
.
getWidth
()
+
"高:"
+
surfaceviewPlayVideo
.
getHeight
());
}
//TODO surfaceview 高度设置
// if (surfaceviewPlayVideo != null) {
//// int margin = (mSurfaceViewWidth - w) / 2;
// SurfaceHolder surfaceHolder = surfaceviewPlayVideo.getHolder();
// RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
// RelativeLayout.LayoutParams.MATCH_PARENT,
// RelativeLayout.LayoutParams.MATCH_PARENT);
// int setWidth = 640;
// int setHeight = 480;
// int leftW = 0;
// int leftH = 0;
// int width = surfaceviewPlayVideo.getWidth();
// int height = surfaceviewPlayVideo.getHeight();
// if (width > height) {
// setWidth = width;
// setHeight = height * (4 / 3);
// leftH = 0;
// leftW = (widthPixels - setHeight) / 2;
// } else {
//
// }
// lp.setMargins(leftW, 0, leftW, 0);
//// surfaceHolder.setFixedSize(640,480);
// XdyLogUtil.e("surface 高度计算:", surfaceviewPlayVideo.getWidth() + "高:" + surfaceviewPlayVideo.getHeight());
// surfaceviewPlayVideo.setLayoutParams(lp);
// XdyLogUtil.e("surface 设置后的高度的高度计算:", surfaceviewPlayVideo.getWidth() + "高:" + surfaceviewPlayVideo.getHeight());
//
// }
xdySdk
.
api
(
"playVideo"
,
response
+
""
,
surfaceviewPlayVideo
,
VideoPlayActivity
.
this
);
// img_playVideo_novideo.setVisibility(View.GONE);
img_playVideo_novideo
.
setImageResource
(
R
.
mipmap
.
no_video
);
ToastUtil
.
showToastshort
(
"视频播放初始化"
,
VideoPlayActivity
.
this
);
ToastUtil
.
showToastshort
(
getResources
().
getString
(
R
.
string
.
home_msg_play_video_init
)
,
VideoPlayActivity
.
this
);
}
}
...
...
@@ -553,7 +586,7 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
xdySdk
.
api
(
"playAudio"
,
response
,
null
,
VideoPlayActivity
.
this
);
img_playVideo_novideo
.
setImageResource
(
R
.
mipmap
.
audio_mode
);
img_playVideo_novideo
.
setVisibility
(
View
.
VISIBLE
);
ToastUtil
.
showToastshort
(
"音频播放初始化"
,
VideoPlayActivity
.
this
);
ToastUtil
.
showToastshort
(
getResources
().
getString
(
R
.
string
.
home_msg_play_audio_init
)
,
VideoPlayActivity
.
this
);
}
}
...
...
@@ -561,19 +594,22 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
public
void
onBackPressed
()
{
UIUtils
.
closeDialog
(
mLoginDialog
);
exit_dialog
();
// if(System.currentTimeMillis()-loging_upload>8*1000) {
// progressDialogDismiss();
// }
}
public
void
exit_dialog
()
{
final
AlertDialog
alertDialog
=
new
AlertDialog
.
Builder
(
this
)
.
setTitle
(
"退出"
)
.
setMessage
(
"是否离开课堂"
)
.
setNegativeButton
(
"在看看"
,
new
DialogInterface
.
OnClickListener
()
{
.
setTitle
(
getResources
().
getString
(
R
.
string
.
home_msg_leave_character
))
.
setMessage
(
getResources
().
getString
(
R
.
string
.
home_msg_leave_class_whether
))
.
setNegativeButton
(
getResources
().
getString
(
R
.
string
.
home_msg_leave_no
),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialogInterface
,
int
i
)
{
dialogInterface
.
dismiss
();
}
})
.
setPositiveButton
(
"确认"
,
new
DialogInterface
.
OnClickListener
()
{
.
setPositiveButton
(
getResources
().
getString
(
R
.
string
.
home_msg_leave_yes
)
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialogInterface
,
int
i
)
{
...
...
@@ -698,6 +734,7 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
xdySdk
.
api
(
"stopPublishVideo"
,
""
);
xdySdk
.
api
(
"leaveClass"
,
""
);
xdySdk
.
remove
(
this
);
mLoginDialog
=
null
;
xdySdk
.
onPublisherStop
();
if
(
mVideoView
!=
null
)
{
mVideoView
.
stopPlayback
();
...
...
@@ -719,8 +756,21 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
public
void
progressDialogShow
()
{
if
(
mProgressDialog
==
null
)
{
mProgressDialog
=
ProgressDialog
.
show
(
VideoPlayActivity
.
this
,
""
,
"加载中"
);
mProgressDialog
=
ProgressDialog
.
show
(
VideoPlayActivity
.
this
,
""
,
getResources
().
getString
(
R
.
string
.
home_msg_loading
));
// mProgressDialog.setOnCancelListener(new);
mProgressDialog
.
setOnKeyListener
(
new
DialogInterface
.
OnKeyListener
()
{
@Override
public
boolean
onKey
(
DialogInterface
dialog
,
int
keyCode
,
KeyEvent
event
)
{
if
(
keyCode
==
KeyEvent
.
KEYCODE_BACK
)
{
exit
();
}
return
false
;
}
});
}
else
{
mProgressDialog
.
show
();
}
}
...
...
@@ -758,9 +808,9 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
return
;
progressDialogDismiss
();
mErrorDialog
=
new
AlertDialog
.
Builder
(
this
)
.
setTitle
(
"退出"
)
.
setMessage
(
"您设备的网络属于断开状态,请重新进入"
)
.
setPositiveButton
(
"确认"
,
new
DialogInterface
.
OnClickListener
()
{
.
setTitle
(
getResources
().
getString
(
R
.
string
.
home_msg_leave_character
))
.
setMessage
(
getResources
().
getString
(
R
.
string
.
home_msg_error_net_disconnection
))
.
setPositiveButton
(
getResources
().
getString
(
R
.
string
.
home_msg_verify
),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialogInterface
,
int
i
)
{
dialogInterface
.
dismiss
();
...
...
@@ -770,7 +820,11 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
})
.
create
();
mErrorDialog
.
setCanceledOnTouchOutside
(
false
);
mErrorDialog
.
show
();
try
{
mErrorDialog
.
show
();
}
catch
(
Exception
e
){
}
}
...
...
@@ -1250,34 +1304,38 @@ public class VideoPlayActivity extends AppCompatActivity implements ObserverList
}
/********************************
答题卡
*********************************************************/
/********************************
平板
*********************************************************/
// public void setAnswerLayout(){
// mAnswerSheetView.setOnAnswerLayoutChangeListener(new AnswerSheetView.OnAnswerLayoutChangeListener()
// {
// @Override
// public void setAnswerSheetFramLayout(int num) {
// RelativeLayout.LayoutParams layoutParams=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,XdyStringUtils.dp2px(VideoPlayActivity.this,num));
//// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
//// layoutParams.setLayoutDirection(RelativeLayout.ALIGN_PARENT_BOTTOM);
//// }
// fraVideoPlayAnswer.setLayoutParams(layoutParams);
// }
//
// @Override
// public void setAnswerSheetNormal(int num) {
// setAnswerSheetLayout_Nornal(num);
// }
// });
// }
public
void
initTablet
(){
if
(!
isTablet
(
this
)){
return
;
}
DisplayMetrics
metric
=
new
DisplayMetrics
();
this
.
getWindowManager
().
getDefaultDisplay
().
getMetrics
(
metric
);
int
winWidth
=
metric
.
widthPixels
;
// 屏幕宽度(像素)
int
winHeight
=
metric
.
heightPixels
;
// 屏幕高度(像素)
llVideo_table_chat
=
(
LinearLayout
)
findViewById
(
R
.
id
.
ll_videoPlay_tablet_chat
);
LinearLayout
.
LayoutParams
layoutParams
=
new
LinearLayout
.
LayoutParams
(
winWidth
/
4
,
winWidth
/
3
);
XdyLogUtil
.
e
(
"学点云Tablet:"
,
""
+
winWidth
/
3
+
"::"
+
winWidth
/
4
+
":"
+
winWidth
);
llVideo_table_chat
.
setLayoutParams
(
layoutParams
);
//如果是横排,则改为竖排
if
(
getRequestedOrientation
()
==
ActivityInfo
.
SCREEN_ORIENTATION_PORTRAIT
)
{
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_LANDSCAPE
);
}
FragmentManager
fm
=
getSupportFragmentManager
();
FragmentTransaction
transaction
=
fm
.
beginTransaction
();
transaction
.
add
(
R
.
id
.
ll_videoPlay_tablet_chat
,
ChatFragment
.
newInstance
(
replay
),
"tag"
);
transaction
.
commit
();
}
/**
* 判断当前设备是手机还是平板,代码来自 Google I/O App for Android
* @param context
* @return 平板返回 True,手机返回 False
*/
public
static
boolean
isTablet
(
Context
context
)
{
return
(
context
.
getResources
().
getConfiguration
().
screenLayout
&
Configuration
.
SCREENLAYOUT_SIZE_MASK
)
>=
Configuration
.
SCREENLAYOUT_SIZE_LARGE
;
}
// public void setAnswerSheetLayout_Nornal(int num){
// fraVideoPlayAnswer.setVisibility(View.VISIBLE);
// RelativeLayout.LayoutParams layoutParams=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,XdyStringUtils.dp2px(VideoPlayActivity.this,num));
//// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
//// layoutParams.setLayoutDirection(RelativeLayout.ALIGN_PARENT_BOTTOM);
//// }
// fraVideoPlayAnswer.setLayoutParams(layoutParams);
// }
}
...
...
MyApplication/XdyDemo/src/main/res/layout/activity_video_play.xml
查看文件 @
78fae0a
...
...
@@ -64,17 +64,26 @@
android:id=
"@+id/img_videoPlay_back"
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/ui_titlebar_height"
android:paddingRight=
"
2
0dp"
android:paddingRight=
"
1
0dp"
android:paddingLeft=
"15dp"
android:src=
"@mipmap/back"
/>
<TextView
android:layout_toRightOf=
"@+id/img_videoPlay_back"
android:layout_width=
"wrap_content"
style=
"@style/ui_wrapTvBaseStyle"
android:layout_height=
"@dimen/ui_titlebar_height"
android:text=
"@string/home_title_back"
android:gravity=
"center"
android:textColor=
"@color/white"
/>
<TextView
android:id=
"@+id/tv_videoPlay_className"
style=
"@style/ui_wrapTvBaseStyle"
android:layout_height=
"@dimen/ui_titlebar_height"
android:layout_centerHorizontal=
"true"
android:gravity=
"center"
android:textColor=
"@color/white"
tools:text=
"
hahaha
"
tools:text=
""
android:textSize=
"@dimen/ui_DIMEN_34.0PX"
/>
</RelativeLayout>
<SurfaceView
...
...
@@ -178,22 +187,5 @@
android:layout_height=
"wrap_content"
/>
</FrameLayout>
<FrameLayout
android:id=
"@+id/fra_videoPlay_answer"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_alignParentBottom=
"true"
android:layout_marginBottom=
"10dp"
>
<com.mang.xdy.demo.widget.answersheet.AnswerSheetView
android:id=
"@+id/asv_videoPlay_answer"
android:layout_width=
"match_parent"
android:layout_height=
"90dp"
android:layout_gravity=
"bottom"
>
</com.mang.xdy.demo.widget.answersheet.AnswerSheetView>
</FrameLayout>
</RelativeLayout>
...
...
MyApplication/XdyDemo/src/main/res/values/strings.xml
查看文件 @
78fae0a
...
...
@@ -18,5 +18,21 @@
<string
name=
"home_dialog_pushAudio"
>
推送音频
</string>
<string
name=
"home_dialog_pushVideo"
>
推送视频
</string>
<string
name=
"home_dialog_selectList"
>
选择列表
</string>
<string
name=
"home_msg_leave_character"
>
退出
</string>
<string
name=
"home_msg_leave_class_whether"
>
是否离开课堂
</string>
<string
name=
"home_msg_exit_class"
>
退出课堂
</string>
<string
name=
"home_msg_leave_no"
>
否
</string>
<string
name=
"home_msg_leave_yes"
>
是
</string>
<string
name=
"home_msg_loading"
>
加载中
</string>
<string
name=
"home_msg_join_class_success"
>
加入课堂成功
</string>
<string
name=
"home_msg_error_net_disconnection"
>
您设备的网络属于断开状态,请重新进入
</string>
<string
name=
"home_msg_verify"
>
确认
</string>
<string
name=
"home_title_back"
>
返回
</string>
<string
name=
"home_msg_play_audio_init"
>
音频播放初始化
</string>
<string
name=
"home_msg_play_video_init"
>
视频播放初始化
</string>
<!--登录-->
<string
name=
"main_login_error_classId"
>
课堂Id不能为空
</string>
<string
name=
"main_login_error_portal"
>
服务器地址不能为空
</string>
<string
name=
"main_login_error_role"
>
角色不能为空
</string>
<string
name=
"main_login_error_userId"
>
用户id不能为空
</string>
</resources>
...
...
MyApplication/iOS_Dialog_Library/build/intermediates/incremental/mergeReleaseResources/compile-file-map.properties
查看文件 @
78fae0a
#
Wed May 10 11:45:01
CST 2017
#
Fri May 12 10:52:43
CST 2017
D\:\\Android_Sdk\\MyApplication\\iOS_Dialog_Library\\src\\main\\res\\drawable-hdpi\\
actionsheet_bottom_pressed.9.png
=
D
\:\\
Android_Sdk
\\
MyApplication
\\
iOS_Dialog_Library
\\
build
\\
intermediates
\\
res
\\
merged
\\
release
\\
drawable-hdpi-v4
\\
actionsheet_bottom_pressed.9.png
D\:\\Android_Sdk\\MyApplication\\iOS_Dialog_Library\\src\\main\\res\\drawable-hdpi\\
actionsheet_single_normal.9.png
=
D
\:\\
Android_Sdk
\\
MyApplication
\\
iOS_Dialog_Library
\\
build
\\
intermediates
\\
res
\\
merged
\\
release
\\
drawable-hdpi-v4
\\
actionsheet_single_normal.9.png
D\:\\Android_Sdk\\MyApplication\\iOS_Dialog_Library\\src\\main\\res\\anim\\
actionsheet_dialog_out.xml
=
D
\:\\
Android_Sdk
\\
MyApplication
\\
iOS_Dialog_Library
\\
build
\\
intermediates
\\
res
\\
merged
\\
release
\\
anim
\\
actionsheet_dialog_out.xml
...
...
MyApplication/iOS_Dialog_Library/build/intermediates/incremental/packageReleaseResources/compile-file-map.properties
查看文件 @
78fae0a
#
Wed May 10 11:43:51
CST 2017
#
Fri May 12 10:51:43
CST 2017
D\:\\Android_Sdk\\MyApplication\\iOS_Dialog_Library\\src\\main\\res\\drawable-hdpi\\
actionsheet_bottom_pressed.9.png
=
D
\:\\
Android_Sdk
\\
MyApplication
\\
iOS_Dialog_Library
\\
build
\\
intermediates
\\
bundles
\\
release
\\
res
\\
drawable-hdpi-v4
\\
actionsheet_bottom_pressed.9.png
D\:\\Android_Sdk\\MyApplication\\iOS_Dialog_Library\\src\\main\\res\\drawable-hdpi\\
actionsheet_single_normal.9.png
=
D
\:\\
Android_Sdk
\\
MyApplication
\\
iOS_Dialog_Library
\\
build
\\
intermediates
\\
bundles
\\
release
\\
res
\\
drawable-hdpi-v4
\\
actionsheet_single_normal.9.png
D\:\\Android_Sdk\\MyApplication\\iOS_Dialog_Library\\src\\main\\res\\anim\\
actionsheet_dialog_out.xml
=
D
\:\\
Android_Sdk
\\
MyApplication
\\
iOS_Dialog_Library
\\
build
\\
intermediates
\\
bundles
\\
release
\\
res
\\
anim
\\
actionsheet_dialog_out.xml
...
...
MyApplication/iOS_Dialog_Library/build/outputs/aar/iOS_Dialog_Library-release.aar
查看文件 @
78fae0a
不能预览此文件类型
请
注册
或
登录
后发表评论