huangxinbao

add drop resource

正在显示 138 个修改的文件 包含 1956 行增加1100 行删除
@@ -16,7 +16,10 @@ android { @@ -16,7 +16,10 @@ android {
16 } 16 }
17 buildTypes { 17 buildTypes {
18 release { 18 release {
  19 + //是否混淆
19 minifyEnabled false 20 minifyEnabled false
  21 + zipAlignEnabled true
  22 +// shrinkResources true//去除无用的resource文件,第一次使用
20 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 } 24 }
22 } 25 }
@@ -32,7 +35,6 @@ dependencies { @@ -32,7 +35,6 @@ dependencies {
32 androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 35 androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
33 exclude group: 'com.android.support', module: 'support-annotations' 36 exclude group: 'com.android.support', module: 'support-annotations'
34 }) 37 })
35 - compile project(':xdy')  
36 compile files('libs/pldroid-player-1.5.1.jar') 38 compile files('libs/pldroid-player-1.5.1.jar')
37 compile 'com.android.support:appcompat-v7:25.3.1' 39 compile 'com.android.support:appcompat-v7:25.3.1'
38 compile 'com.jakewharton:butterknife:8.5.1' 40 compile 'com.jakewharton:butterknife:8.5.1'
@@ -43,15 +45,16 @@ dependencies { @@ -43,15 +45,16 @@ dependencies {
43 compile 'org.kymjs.kjframe:kjframe:2.6' 45 compile 'org.kymjs.kjframe:kjframe:2.6'
44 compile 'io.reactivex:rxjava:1.0.9' 46 compile 'io.reactivex:rxjava:1.0.9'
45 compile 'io.reactivex:rxandroid:0.24.0' 47 compile 'io.reactivex:rxandroid:0.24.0'
46 - compile 'com.squareup.retrofit:retrofit:1.9.0' 48 +// compile 'com.squareup.retrofit:retrofit:1.9.0'
47 compile 'com.nineoldandroids:library:2.4.0' 49 compile 'com.nineoldandroids:library:2.4.0'
48 compile 'me.yokeyword:fragmentation:0.10.3' 50 compile 'me.yokeyword:fragmentation:0.10.3'
49 compile 'com.qiniu:happy-dns:0.2.+' 51 compile 'com.qiniu:happy-dns:0.2.+'
50 - compile 'com.android.support:support-v4:25.3.1' 52 +// compile 'com.android.support:support-v4:25.3.1'
51 testCompile 'junit:junit:4.12' 53 testCompile 'junit:junit:4.12'
52 annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1' 54 annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
53 compile 'com.qiniu:happy-dns:0.2.+' 55 compile 'com.qiniu:happy-dns:0.2.+'
54 compile 'org.greenrobot:eventbus:3.0.0' 56 compile 'org.greenrobot:eventbus:3.0.0'
55 compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar' 57 compile 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
56 compile project(':iOS_Dialog_Library') 58 compile project(':iOS_Dialog_Library')
  59 + compile project(':xdy')
57 } 60 }
@@ -15,3 +15,10 @@ @@ -15,3 +15,10 @@
15 #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 15 #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 # public *; 16 # public *;
17 #} 17 #}
  18 +
  19 +-keep class com.eventhandle.**{*;}
  20 +-keep class com.ntjbase.**{*;}
  21 +-keep class com.videoengine.**{*;}
  22 +-keep class com.voiceengine.**{*;}
  23 +
  24 +-keep class com.mang.xdy.**{*;}
1 -package com.mang.xdy.demo; 1 +package com.mang.xuedianyun.android;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.support.test.InstrumentationRegistry; 4 import android.support.test.InstrumentationRegistry;
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 - package="com.mang.xdy.demo"> 3 + package="com.mang.xuedianyun.android">
4 <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> 4 <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
5 <uses-permission android:name="android.permission.READ_PHONE_STATE" /> 5 <uses-permission android:name="android.permission.READ_PHONE_STATE" />
6 <uses-permission android:name="android.permission.INTERNET" /> 6 <uses-permission android:name="android.permission.INTERNET" />
@@ -36,13 +36,13 @@ @@ -36,13 +36,13 @@
36 36
37 37
38 <application 38 <application
39 - android:name=".application.XdyApplicaiton" 39 + android:name="com.mang.xuedianyun.android.application.XdyApplicaiton"
40 android:allowBackup="true" 40 android:allowBackup="true"
41 android:icon="@mipmap/logo" 41 android:icon="@mipmap/logo"
42 android:label="@string/app_name" 42 android:label="@string/app_name"
43 android:supportsRtl="true" 43 android:supportsRtl="true"
44 android:theme="@style/AppTheme"> 44 android:theme="@style/AppTheme">
45 - <activity android:name=".MainActivity" 45 + <activity android:name="com.mang.xuedianyun.android.MainActivity"
46 android:windowSoftInputMode="adjustPan|stateHidden" 46 android:windowSoftInputMode="adjustPan|stateHidden"
47 android:screenOrientation="portrait"> 47 android:screenOrientation="portrait">
48 <intent-filter> 48 <intent-filter>
@@ -51,10 +51,9 @@ @@ -51,10 +51,9 @@
51 <category android:name="android.intent.category.LAUNCHER" /> 51 <category android:name="android.intent.category.LAUNCHER" />
52 </intent-filter> 52 </intent-filter>
53 </activity> 53 </activity>
54 - <activity android:name=".activity.VideoPlayActivity" 54 + <activity android:name="com.mang.xuedianyun.android.activity.VideoPlayActivity"
55 android:configChanges="keyboardHidden|orientation|screenSize" 55 android:configChanges="keyboardHidden|orientation|screenSize"
56 android:screenOrientation="portrait" 56 android:screenOrientation="portrait"
57 - android:windowSoftInputMode="adjustPan|stateHidden"  
58 > 57 >
59 </activity> 58 </activity>
60 </application> 59 </application>
1 -package com.mang.xdy.demo; 1 +package com.mang.xuedianyun.android;
2 2
3 -import android.content.Context;  
4 import android.content.Intent; 3 import android.content.Intent;
5 -import android.content.res.Configuration;  
6 import android.os.Bundle; 4 import android.os.Bundle;
7 import android.support.v7.app.AppCompatActivity; 5 import android.support.v7.app.AppCompatActivity;
8 import android.text.TextUtils; 6 import android.text.TextUtils;
@@ -13,9 +11,9 @@ import android.widget.RelativeLayout; @@ -13,9 +11,9 @@ import android.widget.RelativeLayout;
13 11
14 import com.google.gson.Gson; 12 import com.google.gson.Gson;
15 13
16 -import com.mang.xdy.demo.activity.VideoPlayActivity;  
17 -import com.mang.xdy.demo.bean.JoinClassBean;  
18 -import com.mang.xdy.demo.utils.ToastUtil; 14 +import com.mang.xuedianyun.android.activity.VideoPlayActivity;
  15 +import com.mang.xuedianyun.android.bean.JoinClassBean;
  16 +import com.mang.xuedianyun.android.utils.ToastUtil;
19 17
20 import java.util.ArrayList; 18 import java.util.ArrayList;
21 19
1 -package com.mang.xdy.demo.activity; 1 +package com.mang.xuedianyun.android.activity;
2 2
  3 +import android.Manifest;
3 import android.annotation.SuppressLint; 4 import android.annotation.SuppressLint;
4 import android.app.ProgressDialog; 5 import android.app.ProgressDialog;
5 import android.content.Context; 6 import android.content.Context;
6 import android.content.DialogInterface; 7 import android.content.DialogInterface;
7 import android.content.pm.ActivityInfo; 8 import android.content.pm.ActivityInfo;
  9 +import android.content.pm.PackageManager;
8 import android.content.res.Configuration; 10 import android.content.res.Configuration;
9 import android.os.Bundle; 11 import android.os.Bundle;
10 import android.os.Handler; 12 import android.os.Handler;
11 import android.os.Message; 13 import android.os.Message;
12 import android.support.design.widget.TabLayout; 14 import android.support.design.widget.TabLayout;
  15 +import android.support.v4.app.ActivityCompat;
13 import android.support.v4.app.FragmentActivity; 16 import android.support.v4.app.FragmentActivity;
14 import android.support.v4.app.FragmentManager; 17 import android.support.v4.app.FragmentManager;
15 import android.support.v4.app.FragmentTransaction; 18 import android.support.v4.app.FragmentTransaction;
  19 +import android.support.v4.content.ContextCompat;
  20 +import android.support.v4.content.PermissionChecker;
16 import android.support.v7.app.AlertDialog; 21 import android.support.v7.app.AlertDialog;
17 import android.text.TextUtils; 22 import android.text.TextUtils;
18 import android.util.DisplayMetrics; 23 import android.util.DisplayMetrics;
@@ -29,6 +34,7 @@ import android.widget.LinearLayout; @@ -29,6 +34,7 @@ import android.widget.LinearLayout;
29 import android.widget.RelativeLayout; 34 import android.widget.RelativeLayout;
30 import android.widget.SeekBar; 35 import android.widget.SeekBar;
31 import android.widget.TextView; 36 import android.widget.TextView;
  37 +import android.widget.Toast;
32 38
33 import com.flyco.tablayout.SlidingTabLayout; 39 import com.flyco.tablayout.SlidingTabLayout;
34 import com.flyco.tablayout.listener.OnTabSelectListener; 40 import com.flyco.tablayout.listener.OnTabSelectListener;
@@ -37,21 +43,21 @@ import com.mang.xdy.bean.VideoPlayBean; @@ -37,21 +43,21 @@ import com.mang.xdy.bean.VideoPlayBean;
37 import com.mang.xdy.cache.ACache; 43 import com.mang.xdy.cache.ACache;
38 import com.mang.xdy.common.Constants; 44 import com.mang.xdy.common.Constants;
39 import com.mang.xdy.core.XdySdk; 45 import com.mang.xdy.core.XdySdk;
40 -import com.mang.xdy.demo.R;  
41 -import com.mang.xdy.demo.adapter.SimpleFragmentPagerAdapter;  
42 -import com.mang.xdy.demo.bean.ErrorEntity;  
43 -import com.mang.xdy.demo.bean.InitClassSuccessEntity;  
44 -import com.mang.xdy.demo.bean.JoinClass;  
45 -import com.mang.xdy.demo.bean.ProcessVideoOrAudioByTeacherEntity;  
46 -import com.mang.xdy.demo.bean.ResponseEntity;  
47 -import com.mang.xdy.demo.bean.TimeEntity;  
48 -import com.mang.xdy.demo.bean.VideoOrAudioStopEntity;  
49 -import com.mang.xdy.demo.fragment.ChatFragment;  
50 -import com.mang.xdy.demo.fragment.DocFragment;  
51 -import com.mang.xdy.demo.utils.JsonUtil;  
52 -import com.mang.xdy.demo.utils.ToastUtil;  
53 -import com.mang.xdy.demo.widget.dialog.LoginDialog;  
54 -import com.mang.xdy.demo.widget.view.NoScrollViewPager; 46 +import com.mang.xuedianyun.android.R;
  47 +import com.mang.xuedianyun.android.adapter.SimpleFragmentPagerAdapter;
  48 +import com.mang.xuedianyun.android.bean.ErrorEntity;
  49 +import com.mang.xuedianyun.android.bean.InitClassSuccessEntity;
  50 +import com.mang.xuedianyun.android.bean.JoinClass;
  51 +import com.mang.xuedianyun.android.bean.ProcessVideoOrAudioByTeacherEntity;
  52 +import com.mang.xuedianyun.android.bean.ResponseEntity;
  53 +import com.mang.xuedianyun.android.bean.TimeEntity;
  54 +import com.mang.xuedianyun.android.bean.VideoOrAudioStopEntity;
  55 +import com.mang.xuedianyun.android.fragment.ChatFragment;
  56 +import com.mang.xuedianyun.android.fragment.DocFragment;
  57 +import com.mang.xuedianyun.android.utils.JsonUtil;
  58 +import com.mang.xuedianyun.android.utils.ToastUtil;
  59 +import com.mang.xuedianyun.android.widget.dialog.LoginDialog;
  60 +import com.mang.xuedianyun.android.widget.view.NoScrollViewPager;
55 import com.mang.xdy.listener.ObserverListener; 61 import com.mang.xdy.listener.ObserverListener;
56 import com.mang.xdy.utils.SPUtil; 62 import com.mang.xdy.utils.SPUtil;
57 import com.mang.xdy.utils.UIUtils; 63 import com.mang.xdy.utils.UIUtils;
@@ -68,13 +74,14 @@ import org.greenrobot.eventbus.ThreadMode; @@ -68,13 +74,14 @@ import org.greenrobot.eventbus.ThreadMode;
68 import org.json.JSONException; 74 import org.json.JSONException;
69 import org.json.JSONObject; 75 import org.json.JSONObject;
70 76
  77 +import java.io.IOException;
71 import java.util.ArrayList; 78 import java.util.ArrayList;
72 import java.util.Locale; 79 import java.util.Locale;
73 80
74 import butterknife.BindView; 81 import butterknife.BindView;
75 import butterknife.ButterKnife; 82 import butterknife.ButterKnife;
76 import zhangphil.iosdialog.widget.ActionSheetDialog; 83 import zhangphil.iosdialog.widget.ActionSheetDialog;
77 -import com.mang.xdy.demo.widget.dialog.AnswerSheetDialog; 84 +import com.mang.xuedianyun.android.widget.dialog.AnswerSheetDialog;
78 85
79 import static com.pili.pldroid.player.AVOptions.KEY_DELAY_OPTIMIZATION; 86 import static com.pili.pldroid.player.AVOptions.KEY_DELAY_OPTIMIZATION;
80 87
@@ -88,8 +95,7 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -88,8 +95,7 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
88 FrameLayout fra_videoPlay_start; 95 FrameLayout fra_videoPlay_start;
89 @BindView(R.id.viewpager) 96 @BindView(R.id.viewpager)
90 NoScrollViewPager viewPager; 97 NoScrollViewPager viewPager;
91 -// @BindView(R.id.fra_videoPlay_answer)  
92 -// FrameLayout fraVideoPlayAnswer; 98 +
93 private TabLayout tabLayout; 99 private TabLayout tabLayout;
94 @BindView(R.id.surfaceview_playVideo) 100 @BindView(R.id.surfaceview_playVideo)
95 SurfaceView surfaceviewPlayVideo; 101 SurfaceView surfaceviewPlayVideo;
@@ -99,6 +105,8 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -99,6 +105,8 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
99 SurfaceView surfaceView_publish; 105 SurfaceView surfaceView_publish;
100 @BindView(R.id.img_playVideo_replay) 106 @BindView(R.id.img_playVideo_replay)
101 PLVideoTextureView mVideoView; 107 PLVideoTextureView mVideoView;
  108 + @BindView(R.id.img_playVideo_pushreplay)
  109 + PLVideoTextureView mPushVideoView;
102 @BindView(R.id.img_videoPlay_back) 110 @BindView(R.id.img_videoPlay_back)
103 ImageView mImage_Back; 111 ImageView mImage_Back;
104 @BindView(R.id.tv_videoPlay_className) 112 @BindView(R.id.tv_videoPlay_className)
@@ -107,6 +115,8 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -107,6 +115,8 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
107 SlidingTabLayout mSlidingTab; 115 SlidingTabLayout mSlidingTab;
108 @BindView(R.id.img_playVideo_publishAudio) 116 @BindView(R.id.img_playVideo_publishAudio)
109 ImageView mIamgeView_PublishAudio; 117 ImageView mIamgeView_PublishAudio;
  118 + @BindView(R.id.ll_videoPlay_back)
  119 + LinearLayout mLinearLayoutBack;
110 // @BindView(R.id.asv_videoPlay_answer) 120 // @BindView(R.id.asv_videoPlay_answer)
111 // AnswerSheetView mAnswerSheetView; 121 // AnswerSheetView mAnswerSheetView;
112 private String username = ""; 122 private String username = "";
@@ -133,13 +143,14 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -133,13 +143,14 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
133 private String className; 143 private String className;
134 /*课堂类型*/ 144 /*课堂类型*/
135 private int classType = 2; 145 private int classType = 2;
  146 +
136 private String[] titles; 147 private String[] titles;
137 148
138 private long loging_upload=0; 149 private long loging_upload=0;
139 150
140 private LinearLayout llVideo_table_chat; 151 private LinearLayout llVideo_table_chat;
141 152
142 - 153 + private final int CAMERA_REQUEST_CODE = 1;
143 // private Fragment mFragment_Tablet_Chat; 154 // private Fragment mFragment_Tablet_Chat;
144 155
145 private Handler mmHandler = new Handler() { 156 private Handler mmHandler = new Handler() {
@@ -169,7 +180,6 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -169,7 +180,6 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
169 String userJson = responseEntity.getParam(); 180 String userJson = responseEntity.getParam();
170 SPUtil.putString(VideoPlayActivity.this, Constants.CLASS_JOIN_SUCCESS, userJson); 181 SPUtil.putString(VideoPlayActivity.this, Constants.CLASS_JOIN_SUCCESS, userJson);
171 JSONObject jsonObject = null; 182 JSONObject jsonObject = null;
172 -  
173 try { 183 try {
174 jsonObject = new JSONObject(userJson); 184 jsonObject = new JSONObject(userJson);
175 seek = jsonObject.optLong("recordPlaybackMaxTime"); 185 seek = jsonObject.optLong("recordPlaybackMaxTime");
@@ -274,6 +284,7 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -274,6 +284,7 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
274 if (!replay) { 284 if (!replay) {
275 mVideoView.setVisibility(View.GONE); 285 mVideoView.setVisibility(View.GONE);
276 mMediaContainer.setVisibility(View.GONE); 286 mMediaContainer.setVisibility(View.GONE);
  287 +// mPushVideoView.setVisibility(View.GONE);
277 // mFramenLayout_stopPublish.setVisibility(View.VISIBLE); 288 // mFramenLayout_stopPublish.setVisibility(View.VISIBLE);
278 } else { 289 } else {
279 surfaceviewPlayVideo.setVisibility(View.GONE); 290 surfaceviewPlayVideo.setVisibility(View.GONE);
@@ -303,35 +314,16 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -303,35 +314,16 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
303 }else { 314 }else {
304 showSelectPublishMode(); 315 showSelectPublishMode();
305 } 316 }
306 -// AnswerSheetDialog answerSheetDialog= new AnswerSheetDialog(VideoPlayActivity.this);  
307 -// answerSheetDialog.builder().show();  
308 -// new AnswerSheetDialog(VideoPlayActivity.this).builder().show();  
309 -// new AnswText(VideoPlayActivity.this).builder().show();  
310 -// new AnswerSheetDialog(VideoPlayActivity.this).builder().show();  
311 -// mFramenLayout_stopPublish.setVisibility(View.VISIBLE);  
312 -// fra_videoPlay_start.setVisibility(View.GONE);  
313 -// surfaceView_publish.setVisibility(View.VISIBLE);  
314 -// fra_videoPlay_start.setEnabled(false);  
315 -// mFramenLayout_stopPublish.setEnabled(true);  
316 -// sh = surfaceView_publish.getHolder();  
317 -// sh.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);  
318 -// surfaceView_publish.setZOrderMediaOverlay(true);  
319 -// xdySdk.api("publishVideo", "", surfaceView_publish, VideoPlayActivity.this);  
320 -// isPlayVideoMode=true;  
321 317
322 } 318 }
323 }); 319 });
324 - mImage_Back.setOnClickListener(new View.OnClickListener() { 320 + mLinearLayoutBack.setOnClickListener(new View.OnClickListener() {
325 @Override 321 @Override
326 public void onClick(View v) { 322 public void onClick(View v) {
327 exit_dialog(); 323 exit_dialog();
328 } 324 }
329 }); 325 });
330 //TODO 326 //TODO
331 -  
332 -// getWindow().setFormat(PixelFormat.TRANSLUCENT);  
333 -// mAnswerSheetView.selectAnswerSheetType(AnswerSheetView.ANSWER_TYPE_SINGLE_OR_MORE);  
334 -// mAnswerSheetView.startCountTimerAndResizeLayout(22);  
335 } 327 }
336 328
337 // public void setTablayout() { 329 // public void setTablayout() {
@@ -355,17 +347,6 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -355,17 +347,6 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
355 @Override 347 @Override
356 public void onClick(int which) { 348 public void onClick(int which) {
357 //填写事件 349 //填写事件
358 -// coverStudent(true);  
359 -// mFramenLayout_stopPublish.setVisibility(View.VISIBLE);  
360 -// fra_videoPlay_start.setVisibility(View.GONE);  
361 -// surfaceView_publish.setVisibility(View.VISIBLE);  
362 -// fra_videoPlay_start.setEnabled(false);  
363 -// mFramenLayout_stopPublish.setEnabled(true);  
364 -// sh = surfaceView_publish.getHolder();  
365 -// sh.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);  
366 -// surfaceView_publish.setZOrderMediaOverlay(true);  
367 -// xdySdk.api("publishVideo", "", surfaceView_publish, VideoPlayActivity.this);  
368 -// isPublsishVideoMode = true;  
369 publishVideo(); 350 publishVideo();
370 } 351 }
371 }) 352 })
@@ -374,15 +355,6 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -374,15 +355,6 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
374 @Override 355 @Override
375 public void onClick(int which) { 356 public void onClick(int which) {
376 //填写事件 357 //填写事件
377 -// coverStudent(true);  
378 -// mFramenLayout_stopPublish.setVisibility(View.VISIBLE);  
379 -// fra_videoPlay_start.setVisibility(View.GONE);  
380 -// surfaceView_publish.setVisibility(View.GONE);  
381 -// mIamgeView_PublishAudio.setVisibility(View.VISIBLE);  
382 -// fra_videoPlay_start.setEnabled(false);  
383 -// mFramenLayout_stopPublish.setEnabled(true);  
384 -// xdySdk.api(Constants.PUBLISH_AUDIO, "", null, VideoPlayActivity.this);  
385 -// isPublsishVideoMode = false;  
386 publishAudio(); 358 publishAudio();
387 } 359 }
388 }) 360 })
@@ -402,22 +374,22 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -402,22 +374,22 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
402 374
403 } 375 }
404 }) 376 })
405 - .addSheetItem("对错选择", ActionSheetDialog.SheetItemColor.Blue  
406 - , new ActionSheetDialog.OnSheetItemClickListener() {  
407 - @Override  
408 - public void onClick(int which) {  
409 - //填写事件  
410 -// mAnswerSheetView.selectAnswerSheetType(AnswerSheetView.ANSWER_TYPE_RIGHT_OR_WRONG);  
411 -// mAnswerSheetView.startCountTimerAndResizeLayout(15);  
412 -// setAnswerSheetLayout_Nornal(53);  
413 -  
414 - AnswerSheetDialog answerSheetDialog= new AnswerSheetDialog(VideoPlayActivity.this);  
415 - answerSheetDialog.builder().show();  
416 - answerSheetDialog.selectAnswerSheetType(2);  
417 - answerSheetDialog.startCountTimerAndResizeLayout(30,60);  
418 -  
419 - }  
420 - }) 377 +// .addSheetItem("对错选择", ActionSheetDialog.SheetItemColor.Blue
  378 +// , new ActionSheetDialog.OnSheetItemClickListener() {
  379 +// @Override
  380 +// public void onClick(int which) {
  381 +// //填写事件
  382 +//// mAnswerSheetView.selectAnswerSheetType(AnswerSheetView.ANSWER_TYPE_RIGHT_OR_WRONG);
  383 +//// mAnswerSheetView.startCountTimerAndResizeLayout(15);
  384 +//// setAnswerSheetLayout_Nornal(53);
  385 +//
  386 +// AnswerSheetDialog answerSheetDialog= new AnswerSheetDialog(VideoPlayActivity.this);
  387 +// answerSheetDialog.builder().show();
  388 +// answerSheetDialog.selectAnswerSheetType(2);
  389 +// answerSheetDialog.startCountTimerAndResizeLayout(30,60);
  390 +//
  391 +// }
  392 +// })
421 // .addSheetItem("填空题", ActionSheetDialog.SheetItemColor.Blue 393 // .addSheetItem("填空题", ActionSheetDialog.SheetItemColor.Blue
422 // , new ActionSheetDialog.OnSheetItemClickListener() { 394 // , new ActionSheetDialog.OnSheetItemClickListener() {
423 // @Override 395 // @Override
@@ -529,12 +501,12 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -529,12 +501,12 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
529 // progressDialogDismiss(); 501 // progressDialogDismiss();
530 502
531 if (replay) { 503 if (replay) {
532 - playRecord(response); 504 + playRecord(response,false);
533 505
534 } else { 506 } else {
535 - if (!checkPermission()) {  
536 - return;  
537 - } 507 +// if (!checkPermission()) {
  508 +// return;
  509 +// }
538 510
539 DisplayMetrics dm = new DisplayMetrics(); 511 DisplayMetrics dm = new DisplayMetrics();
540 getWindowManager().getDefaultDisplay().getMetrics(dm); 512 getWindowManager().getDefaultDisplay().getMetrics(dm);
@@ -584,13 +556,11 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -584,13 +556,11 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
584 public void playAudio(String response) { 556 public void playAudio(String response) {
585 557
586 if (replay) { 558 if (replay) {
587 - playRecord(response);  
588 - img_playVideo_novideo.setImageResource(R.mipmap.audio_mode);  
589 - img_playVideo_novideo.setVisibility(View.VISIBLE); 559 + playRecord(response,true);
  560 +// img_playVideo_novideo.setImageResource(R.mipmap.audio_mode);
  561 +// img_playVideo_novideo.setVisibility(View.VISIBLE);
590 } else { 562 } else {
591 - if (!checkPermission()) {  
592 - return;  
593 - } 563 +
594 xdySdk.api("playAudio", response, null, VideoPlayActivity.this); 564 xdySdk.api("playAudio", response, null, VideoPlayActivity.this);
595 img_playVideo_novideo.setImageResource(R.mipmap.audio_mode); 565 img_playVideo_novideo.setImageResource(R.mipmap.audio_mode);
596 img_playVideo_novideo.setVisibility(View.VISIBLE); 566 img_playVideo_novideo.setVisibility(View.VISIBLE);
@@ -768,6 +738,9 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -768,6 +738,9 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
768 if (mVideoView != null) { 738 if (mVideoView != null) {
769 mVideoView.stopPlayback(); 739 mVideoView.stopPlayback();
770 } 740 }
  741 + if(mPushVideoView!=null){
  742 + mPushVideoView.stopPlayback();
  743 + }
771 UIUtils.closeDialog(mLoginDialog); 744 UIUtils.closeDialog(mLoginDialog);
772 if (!replay) { 745 if (!replay) {
773 xdySdk.removeAll(); 746 xdySdk.removeAll();
@@ -821,7 +794,7 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -821,7 +794,7 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
821 VideoOrAudioStopEntity entity = JsonUtil.parseJsonToBean(response, VideoOrAudioStopEntity.class); 794 VideoOrAudioStopEntity entity = JsonUtil.parseJsonToBean(response, VideoOrAudioStopEntity.class);
822 if (entity != null) { 795 if (entity != null) {
823 if (xdySdk.onPlayStop(entity.getMediaId() + "")) { 796 if (xdySdk.onPlayStop(entity.getMediaId() + "")) {
824 - img_playVideo_novideo.setImageResource(R.mipmap.novideo); 797 + img_playVideo_novideo.setImageResource(R.mipmap.no_video);
825 img_playVideo_novideo.setVisibility(View.VISIBLE); 798 img_playVideo_novideo.setVisibility(View.VISIBLE);
826 } 799 }
827 } 800 }
@@ -888,9 +861,45 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -888,9 +861,45 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
888 // } catch (Exception e) { 861 // } catch (Exception e) {
889 // e.printStackTrace(); 862 // e.printStackTrace();
890 // } 863 // }
  864 +
  865 +
  866 +// try {
  867 +// if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)
  868 +// != PackageManager.PERMISSION_GRANTED) {
  869 +// // 第一次请求权限时,用户如果拒绝,下一次请求shouldShowRequestPermissionRationale()返回true
  870 +// // 向用户解释为什么需要这个权限
  871 +// if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA)) {
  872 +//
  873 +// } else {
  874 +// //申请相机权限
  875 +// ActivityCompat.requestPermissions(this,
  876 +// new String[]{Manifest.permission.CAMERA}, CAMERA_REQUEST_CODE);
  877 +// }
  878 +// }
  879 +// }catch ( Exception e){
  880 +//
  881 +// }
891 return true; 882 return true;
892 } 883 }
893 884
  885 + private void requestPermission() {
  886 + if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)
  887 + != PackageManager.PERMISSION_GRANTED) {
  888 + // 第一次请求权限时,用户如果拒绝,下一次请求shouldShowRequestPermissionRationale()返回true
  889 + // 向用户解释为什么需要这个权限
  890 + if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.CAMERA)) {
  891 +
  892 + } else {
  893 + //申请相机权限
  894 + ActivityCompat.requestPermissions(this,
  895 + new String[]{Manifest.permission.CAMERA}, CAMERA_REQUEST_CODE);
  896 + }
  897 + } else {
  898 +// tvPermissionStatus.setTextColor(Color.GREEN);
  899 +// tvPermissionStatus.setText("相机权限已申请");
  900 + }
  901 + }
  902 +
894 @Override 903 @Override
895 public void observerUpData(String type, String parameter) { 904 public void observerUpData(String type, String parameter) {
896 XdyLogUtil.e(TAG + "observer:", Thread.currentThread().getId() + "type:" + type); 905 XdyLogUtil.e(TAG + "observer:", Thread.currentThread().getId() + "type:" + type);
@@ -901,9 +910,7 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -901,9 +910,7 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
901 } 910 }
902 911
903 912
904 - /***************************************  
905 - * 回放  
906 - ***************************************************/ 913 + /**************************************** 回放***************************************************/
907 private static final int FADE_OUT = 1; 914 private static final int FADE_OUT = 1;
908 private static final int SHOW_PROGRESS = 2; 915 private static final int SHOW_PROGRESS = 2;
909 private boolean mShowing; 916 private boolean mShowing;
@@ -948,12 +955,18 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -948,12 +955,18 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
948 } 955 }
949 } 956 }
950 }; 957 };
951 -  
952 public void initReplay() { 958 public void initReplay() {
953 mVideoView.setOnInfoListener(this); 959 mVideoView.setOnInfoListener(this);
954 mVideoView.setOnErrorListener(this); 960 mVideoView.setOnErrorListener(this);
955 mVideoView.setOnSeekCompleteListener(mOnSeekCompleteListener); 961 mVideoView.setOnSeekCompleteListener(mOnSeekCompleteListener);
956 mVideoView.setDisplayAspectRatio(PLVideoView.ASPECT_RATIO_PAVED_PARENT); 962 mVideoView.setDisplayAspectRatio(PLVideoView.ASPECT_RATIO_PAVED_PARENT);
  963 +
  964 +
  965 + mPushVideoView.setOnInfoListener(this);
  966 + mPushVideoView.setOnErrorListener(this);
  967 + mPushVideoView.setOnSeekCompleteListener(mOnSeekCompleteListener);
  968 + mPushVideoView.setDisplayAspectRatio(PLVideoView.ASPECT_RATIO_PAVED_PARENT);
  969 +
957 AVOptions options = new AVOptions(); 970 AVOptions options = new AVOptions();
958 mSeekBar.setOnSeekBarChangeListener(mSeekListener); 971 mSeekBar.setOnSeekBarChangeListener(mSeekListener);
959 972
@@ -985,11 +998,11 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -985,11 +998,11 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
985 } 998 }
986 // 默认的缓存大小,单位是 ms 999 // 默认的缓存大小,单位是 ms
987 // 默认值是:2000 1000 // 默认值是:2000
988 - options.setInteger(AVOptions.KEY_CACHE_BUFFER_DURATION, 300); 1001 + options.setInteger(AVOptions.KEY_CACHE_BUFFER_DURATION, 1100);
989 1002
990 // 最大的缓存大小,单位是 ms 1003 // 最大的缓存大小,单位是 ms
991 // 默认值是:4000 1004 // 默认值是:4000
992 - options.setInteger(AVOptions.KEY_MAX_CACHE_BUFFER_DURATION, 300); 1005 + options.setInteger(AVOptions.KEY_MAX_CACHE_BUFFER_DURATION, 1200);
993 // 是否自动启动播放,如果设置为 1,则在调用 `prepareAsync` 或者 `setVideoPath` 之后自动启动播放,无需调用 `start()` 1006 // 是否自动启动播放,如果设置为 1,则在调用 `prepareAsync` 或者 `setVideoPath` 之后自动启动播放,无需调用 `start()`
994 // 默认值是:1 1007 // 默认值是:1
995 options.setInteger(AVOptions.KEY_START_ON_PREPARED, 0); 1008 options.setInteger(AVOptions.KEY_START_ON_PREPARED, 0);
@@ -999,10 +1012,10 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -999,10 +1012,10 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
999 options.setInteger(AVOptions.KEY_PROBESIZE, 128 * 1024); 1012 options.setInteger(AVOptions.KEY_PROBESIZE, 128 * 1024);
1000 options.setInteger(AVOptions.KEY_BUFFER_TIME, 300); 1013 options.setInteger(AVOptions.KEY_BUFFER_TIME, 300);
1001 1014
1002 -// 请在开始播放之前配置  
1003 - mVideoView.setAVOptions(options);  
1004 -  
1005 1015
  1016 + // 请在开始播放之前配置
  1017 + mVideoView.setAVOptions(options);
  1018 + mPushVideoView.setAVOptions(options);
1006 mPauseContainer.setOnClickListener(new View.OnClickListener() { 1019 mPauseContainer.setOnClickListener(new View.OnClickListener() {
1007 @Override 1020 @Override
1008 public void onClick(View v) { 1021 public void onClick(View v) {
@@ -1216,7 +1229,10 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -1216,7 +1229,10 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
1216 xdySdk.api("startRecordPlayback", ""); 1229 xdySdk.api("startRecordPlayback", "");
1217 } 1230 }
1218 }, 200); 1231 }, 200);
  1232 + mPushVideoView.start();
1219 mVideoView.start(); 1233 mVideoView.start();
  1234 +
  1235 +
1220 } 1236 }
1221 1237
1222 private void handleTime(String pa) { 1238 private void handleTime(String pa) {
@@ -1245,6 +1261,14 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -1245,6 +1261,14 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
1245 mVideoView.start(); 1261 mVideoView.start();
1246 XdyLogUtil.i(TAG, "视频开始"); 1262 XdyLogUtil.i(TAG, "视频开始");
1247 } 1263 }
  1264 +
  1265 + if (isPause && mPushVideoView != null && mPushVideoView.isPlaying()) {
  1266 + mPushVideoView.pause();
  1267 + XdyLogUtil.i(TAG, "视频停止");
  1268 + } else if (mPushVideoView != null) {
  1269 + mPushVideoView.start();
  1270 + XdyLogUtil.i(TAG, "视频开始");
  1271 + }
1248 } 1272 }
1249 1273
1250 /** 1274 /**
@@ -1252,7 +1276,7 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -1252,7 +1276,7 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
1252 * 1276 *
1253 * @param response 1277 * @param response
1254 */ 1278 */
1255 - public void playRecord(String response) { 1279 + public void playRecord(String response,boolean isAudio) {
1256 String json_video = aCache.getAsString(response); 1280 String json_video = aCache.getAsString(response);
1257 if (TextUtils.isEmpty(json_video)) { 1281 if (TextUtils.isEmpty(json_video)) {
1258 ///给出相应的提示表示没有 这个id 1282 ///给出相应的提示表示没有 这个id
@@ -1262,8 +1286,13 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -1262,8 +1286,13 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
1262 VideoPlayBean videoPlayBean = JsonUtil.parseJsonToBean(json_video, VideoPlayBean.class); 1286 VideoPlayBean videoPlayBean = JsonUtil.parseJsonToBean(json_video, VideoPlayBean.class);
1263 if (videoPlayBean != null) { 1287 if (videoPlayBean != null) {
1264 //回放不会出现Constants.PLAY_SUCCESS: 1288 //回放不会出现Constants.PLAY_SUCCESS:
  1289 + if(Constants.HOST.equals(videoPlayBean.getUserRole())) {
1265 if (img_playVideo_novideo != null) 1290 if (img_playVideo_novideo != null)
1266 img_playVideo_novideo.setVisibility(View.GONE); 1291 img_playVideo_novideo.setVisibility(View.GONE);
  1292 + if(isAudio){
  1293 + img_playVideo_novideo.setImageResource(R.mipmap.audio_mode);
  1294 + img_playVideo_novideo.setVisibility(View.VISIBLE);
  1295 + }
1267 if (mVideoView.isPlaying()) { 1296 if (mVideoView.isPlaying()) {
1268 mVideoView.stopPlayback(); 1297 mVideoView.stopPlayback();
1269 } 1298 }
@@ -1273,9 +1302,30 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -1273,9 +1302,30 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
1273 mVideoView.seekTo(videoPlayBean.getSeek() * 1000); 1302 mVideoView.seekTo(videoPlayBean.getSeek() * 1000);
1274 } 1303 }
1275 mVideoView.start(); 1304 mVideoView.start();
  1305 + }else{
  1306 + //推流 回放
  1307 +// if (img_playVideo_novideo != null) {
  1308 +// img_playVideo_novideo.setVisibility(View.GONE);
  1309 +// }
  1310 + if (mPushVideoView != null) {
  1311 + mPushVideoView.setVisibility(View.VISIBLE);
1276 } 1312 }
  1313 + if(isAudio){
  1314 + mIamgeView_PublishAudio.setVisibility(View.VISIBLE);
  1315 + }
  1316 + if (mPushVideoView.isPlaying()) {
  1317 + mPushVideoView.stopPlayback();
1277 } 1318 }
  1319 + mPushVideoView.setVideoPath("http://123.56.73.119:6001/live/h5dev_1992614331_980_983042_1494927366/total.m3u8");
  1320 + if (replay && videoPlayBean.getSeek() > 0) {
1278 1321
  1322 + mPushVideoView.seekTo(videoPlayBean.getSeek() * 1000);
  1323 + }
  1324 + mPushVideoView.start();
  1325 + }
  1326 + }
  1327 + }
  1328 + /*回放暂停*/
1279 public void stopVideo() { 1329 public void stopVideo() {
1280 mHandler.post(new Runnable() { 1330 mHandler.post(new Runnable() {
1281 @Override 1331 @Override
@@ -1284,18 +1334,33 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -1284,18 +1334,33 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
1284 img_playVideo_novideo.setVisibility(View.VISIBLE); 1334 img_playVideo_novideo.setVisibility(View.VISIBLE);
1285 } 1335 }
1286 }); 1336 });
  1337 + //隐藏直播回放
  1338 + mPushVideoView.setVisibility(View.GONE);
1287 1339
1288 -  
1289 - if (isPlayVideoMode && mVideoView != null && mVideoView.isPlaying()) 1340 + if (isPlayVideoMode && mVideoView != null && mVideoView.isPlaying()) {
1290 mVideoView.stopPlayback(); 1341 mVideoView.stopPlayback();
1291 } 1342 }
1292 1343
  1344 + if (isPlayVideoMode && mPushVideoView != null && mPushVideoView.isPlaying()) {
  1345 + mPushVideoView.stopPlayback();
  1346 + }
  1347 + }
  1348 +
1293 public void stopAudio() { 1349 public void stopAudio() {
1294 img_playVideo_novideo.setImageResource(R.mipmap.no_video); 1350 img_playVideo_novideo.setImageResource(R.mipmap.no_video);
1295 img_playVideo_novideo.setVisibility(View.VISIBLE); 1351 img_playVideo_novideo.setVisibility(View.VISIBLE);
1296 1352
1297 - if (isPlayVideoMode && mVideoView != null && mVideoView.isPlaying()) 1353 + //隐藏直播回放
  1354 + mPushVideoView.setVisibility(View.GONE);
  1355 + mIamgeView_PublishAudio.setVisibility(View.GONE);
  1356 +
  1357 + if (isPlayVideoMode && mVideoView != null && mVideoView.isPlaying()) {
1298 mVideoView.stopPlayback(); 1358 mVideoView.stopPlayback();
  1359 + }
  1360 +
  1361 + if (isPlayVideoMode && mPushVideoView != null && mPushVideoView.isPlaying()) {
  1362 + mPushVideoView.stopPlayback();
  1363 + }
1299 1364
1300 } 1365 }
1301 1366
@@ -1434,9 +1499,12 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -1434,9 +1499,12 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
1434 /******************************************************公共**********************************/ 1499 /******************************************************公共**********************************/
1435 1500
1436 1501
1437 - /*播放视频*/ 1502 + /*推送视频*/
1438 public void publishVideo(){ 1503 public void publishVideo(){
1439 //填写事件 1504 //填写事件
  1505 + if (!checkPermission()) {
  1506 + return;
  1507 + }
1440 coverStudent(true); 1508 coverStudent(true);
1441 tabletShowAudio(true); 1509 tabletShowAudio(true);
1442 mFramenLayout_stopPublish.setVisibility(View.VISIBLE); 1510 mFramenLayout_stopPublish.setVisibility(View.VISIBLE);
@@ -1450,8 +1518,11 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe @@ -1450,8 +1518,11 @@ public class VideoPlayActivity extends FragmentActivity implements ObserverListe
1450 xdySdk.api("publishVideo", "", surfaceView_publish, VideoPlayActivity.this); 1518 xdySdk.api("publishVideo", "", surfaceView_publish, VideoPlayActivity.this);
1451 isPublsishVideoMode = true; 1519 isPublsishVideoMode = true;
1452 } 1520 }
1453 - /*播放音频*/ 1521 + /*推送音频*/
1454 public void publishAudio(){ 1522 public void publishAudio(){
  1523 + if (!checkPermission()) {
  1524 + return;
  1525 + }
1455 coverStudent(true); 1526 coverStudent(true);
1456 tabletShowAudio(true); 1527 tabletShowAudio(true);
1457 mFramenLayout_stopPublish.setVisibility(View.VISIBLE); 1528 mFramenLayout_stopPublish.setVisibility(View.VISIBLE);
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package com.mang.xdy.demo.adapter; 16 +package com.mang.xuedianyun.android.adapter;
17 17
18 import android.content.Context; 18 import android.content.Context;
19 import android.text.TextUtils; 19 import android.text.TextUtils;
@@ -28,12 +28,12 @@ import android.widget.TextView; @@ -28,12 +28,12 @@ import android.widget.TextView;
28 28
29 import com.mang.xdy.common.Constants; 29 import com.mang.xdy.common.Constants;
30 import com.mang.xdy.utils.SPUtil; 30 import com.mang.xdy.utils.SPUtil;
31 -import com.mang.xdy.demo.R;  
32 -import com.mang.xdy.demo.bean.JoinClassSuccessEntity;  
33 -import com.mang.xdy.demo.bean.Message;  
34 -import com.mang.xdy.demo.fragment.ChatFragment;  
35 -import com.mang.xdy.demo.utils.JsonUtil;  
36 -import com.mang.xdy.demo.widget.chat.UrlUtils; 31 +import com.mang.xuedianyun.android.R;
  32 +import com.mang.xuedianyun.android.bean.JoinClassSuccessEntity;
  33 +import com.mang.xuedianyun.android.bean.Message;
  34 +import com.mang.xuedianyun.android.fragment.ChatFragment;
  35 +import com.mang.xuedianyun.android.utils.JsonUtil;
  36 +import com.mang.xuedianyun.android.widget.chat.UrlUtils;
37 37
38 import org.kymjs.kjframe.KJBitmap; 38 import org.kymjs.kjframe.KJBitmap;
39 39
@@ -13,14 +13,14 @@ @@ -13,14 +13,14 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package com.mang.xdy.demo.adapter; 16 +package com.mang.xuedianyun.android.adapter;
17 17
18 import android.widget.AbsListView; 18 import android.widget.AbsListView;
19 import android.widget.ImageView; 19 import android.widget.ImageView;
20 20
21 21
22 -import com.mang.xdy.demo.R;  
23 -import com.mang.xdy.demo.bean.Faceicon; 22 +import com.mang.xuedianyun.android.R;
  23 +import com.mang.xuedianyun.android.bean.Faceicon;
24 24
25 import org.kymjs.kjframe.KJBitmap; 25 import org.kymjs.kjframe.KJBitmap;
26 import org.kymjs.kjframe.widget.AdapterHolder; 26 import org.kymjs.kjframe.widget.AdapterHolder;
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package com.mang.xdy.demo.adapter; 16 +package com.mang.xuedianyun.android.adapter;
17 17
18 import android.graphics.Bitmap; 18 import android.graphics.Bitmap;
19 import android.os.Bundle; 19 import android.os.Bundle;
@@ -23,13 +23,13 @@ import android.support.v4.app.FragmentStatePagerAdapter; @@ -23,13 +23,13 @@ import android.support.v4.app.FragmentStatePagerAdapter;
23 import android.widget.ImageView; 23 import android.widget.ImageView;
24 24
25 25
26 -import com.mang.xdy.demo.R;  
27 -import com.mang.xdy.demo.widget.chat.ChatFunctionFragment;  
28 -import com.mang.xdy.demo.widget.chat.FacePageFragment;  
29 -import com.mang.xdy.demo.widget.chat.KJChatKeyboard;  
30 -import com.mang.xdy.demo.widget.chat.OnOperationListener;  
31 -import com.mang.xdy.demo.widget.chat.PagerSlidingTabStrip;  
32 -import com.mang.xdy.demo.widget.emoji.EmojiPageFragment; 26 +import com.mang.xuedianyun.android.R;
  27 +import com.mang.xuedianyun.android.widget.chat.ChatFunctionFragment;
  28 +import com.mang.xuedianyun.android.widget.chat.FacePageFragment;
  29 +import com.mang.xuedianyun.android.widget.chat.KJChatKeyboard;
  30 +import com.mang.xuedianyun.android.widget.chat.OnOperationListener;
  31 +import com.mang.xuedianyun.android.widget.chat.PagerSlidingTabStrip;
  32 +import com.mang.xuedianyun.android.widget.emoji.EmojiPageFragment;
33 33
34 import org.kymjs.kjframe.bitmap.BitmapCreate; 34 import org.kymjs.kjframe.bitmap.BitmapCreate;
35 35
1 -package com.mang.xdy.demo.adapter; 1 +package com.mang.xuedianyun.android.adapter;
2 2
3 /** 3 /**
4 * Created by huang on 2017/4/9. 4 * Created by huang on 2017/4/9.
@@ -9,9 +9,8 @@ import android.support.v4.app.Fragment; @@ -9,9 +9,8 @@ import android.support.v4.app.Fragment;
9 import android.support.v4.app.FragmentManager; 9 import android.support.v4.app.FragmentManager;
10 import android.support.v4.app.FragmentPagerAdapter; 10 import android.support.v4.app.FragmentPagerAdapter;
11 11
12 -import com.mang.xdy.demo.fragment.ChatFragment;  
13 -import com.mang.xdy.demo.fragment.DocFragment;  
14 -import com.mang.xdy.demo.fragment.PageFragment; 12 +import com.mang.xuedianyun.android.fragment.ChatFragment;
  13 +import com.mang.xuedianyun.android.fragment.DocFragment;
15 14
16 import java.util.ArrayList; 15 import java.util.ArrayList;
17 import java.util.List; 16 import java.util.List;
1 -package com.mang.xdy.demo.application; 1 +package com.mang.xuedianyun.android.application;
2 2
3 import android.app.Activity; 3 import android.app.Activity;
4 import android.app.Application; 4 import android.app.Application;
5 import android.content.Context; 5 import android.content.Context;
6 6
7 import com.mang.xdy.core.XdySdk; 7 import com.mang.xdy.core.XdySdk;
8 -import com.mang.xdy.demo.utils.ResUtil; 8 +import com.mang.xuedianyun.android.utils.ResUtil;
9 9
10 /** 10 /**
11 * Created by abao on 2017/3/30. 11 * Created by abao on 2017/3/30.
1 -package com.mang.xdy.demo.base; 1 +package com.mang.xuedianyun.android.base;
2 2
3 import java.lang.ref.WeakReference; 3 import java.lang.ref.WeakReference;
4 4
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 import java.util.List; 3 import java.util.List;
4 -import java.util.List;  
5 4
6 /** 5 /**
7 * Created by Admin on 2017/3/27. 6 * Created by Admin on 2017/3/27.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by huang on 2017/4/9. 4 * Created by huang on 2017/4/9.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by huang on 2017/4/9. 4 * Created by huang on 2017/4/9.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by Admin on 2017/3/25. 4 * Created by Admin on 2017/3/25.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 import java.util.List; 3 import java.util.List;
4 4
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 public class ErrorEntity { 3 public class ErrorEntity {
4 4
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by abao on 2017/4/28. 4 * Created by abao on 2017/4/28.
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package com.mang.xdy.demo.bean; 16 +package com.mang.xuedianyun.android.bean;
17 17
18 import java.io.Serializable; 18 import java.io.Serializable;
19 19
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by abao on 2017/4/11. 4 * Created by abao on 2017/4/11.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by abao on 2017/4/10. 4 * Created by abao on 2017/4/10.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by abao on 2017/4/10. 加入课堂 4 * Created by abao on 2017/4/10. 加入课堂
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by huang on 2017/4/9. 4 * Created by huang on 2017/4/9.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by abao on 2017/4/10. 4 * Created by abao on 2017/4/10.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by abao on 2017/4/7. 4 * Created by abao on 2017/4/7.
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package com.mang.xdy.demo.bean; 16 +package com.mang.xuedianyun.android.bean;
17 17
18 /** 18 /**
19 * 聊天消息javabean 19 * 聊天消息javabean
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by Admin on 2017/3/27. 4 * Created by Admin on 2017/3/27.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by Admin on 2017/3/26. 4 * Created by Admin on 2017/3/26.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by abao on 2017/4/10. 4 * Created by abao on 2017/4/10.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by abao on 2017/4/11. 4 * Created by abao on 2017/4/11.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by abao on 2017/4/11. 4 * Created by abao on 2017/4/11.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 public class ResponseEntity { 3 public class ResponseEntity {
4 private String type; 4 private String type;
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by abao on 2017/4/18. 4 * Created by abao on 2017/4/18.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by abao on 2017/4/28. 4 * Created by abao on 2017/4/28.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 /** 3 /**
4 * Created by abao on 2017/4/19. 4 * Created by abao on 2017/4/19.
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 // FIXME generate failure method set and get MediaId 3 // FIXME generate failure method set and get MediaId
4 // FIXME generate failure field _$Replay151 4 // FIXME generate failure field _$Replay151
1 -package com.mang.xdy.demo.bean; 1 +package com.mang.xuedianyun.android.bean;
2 2
3 import android.graphics.Bitmap; 3 import android.graphics.Bitmap;
4 4
1 -package com.mang.xdy.demo.dialog; 1 +package com.mang.xuedianyun.android.dialog;
2 2
3 import android.view.View; 3 import android.view.View;
4 import android.view.animation.Interpolator; 4 import android.view.animation.Interpolator;
1 -package com.mang.xdy.demo.dialog; 1 +package com.mang.xuedianyun.android.dialog;
2 2
3 import android.app.Dialog; 3 import android.app.Dialog;
4 import android.content.Context; 4 import android.content.Context;
@@ -15,7 +15,7 @@ import android.view.Window; @@ -15,7 +15,7 @@ import android.view.Window;
15 import android.view.WindowManager.LayoutParams; 15 import android.view.WindowManager.LayoutParams;
16 import android.widget.LinearLayout; 16 import android.widget.LinearLayout;
17 17
18 -import com.mang.xdy.demo.utils.DisplayUtil; 18 +import com.mang.xuedianyun.android.utils.DisplayUtil;
19 import com.nineoldandroids.animation.Animator; 19 import com.nineoldandroids.animation.Animator;
20 20
21 import java.lang.ref.WeakReference; 21 import java.lang.ref.WeakReference;
1 -package com.mang.xdy.demo.dialog; 1 +package com.mang.xuedianyun.android.dialog;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.view.Gravity; 4 import android.view.Gravity;
1 -package com.mang.xdy.demo.dialog; 1 +package com.mang.xuedianyun.android.dialog;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.view.MotionEvent; 4 import android.view.MotionEvent;
1 -package com.mang.xdy.demo.dialog; 1 +package com.mang.xuedianyun.android.dialog;
2 2
3 import android.graphics.drawable.ColorDrawable; 3 import android.graphics.drawable.ColorDrawable;
4 import android.graphics.drawable.Drawable; 4 import android.graphics.drawable.Drawable;
1 -package com.mang.xdy.demo.dialog; 1 +package com.mang.xuedianyun.android.dialog;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.graphics.Color; 4 import android.graphics.Color;
@@ -9,7 +9,7 @@ import android.view.View; @@ -9,7 +9,7 @@ import android.view.View;
9 import android.widget.LinearLayout; 9 import android.widget.LinearLayout;
10 import android.widget.TextView; 10 import android.widget.TextView;
11 11
12 -import com.mang.xdy.demo.R; 12 +import com.mang.xuedianyun.android.R;
13 13
14 14
15 public class NormalDialog extends BaseDialog { 15 public class NormalDialog extends BaseDialog {
1 -package com.mang.xdy.demo.dialog; 1 +package com.mang.xuedianyun.android.dialog;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.graphics.Color; 4 import android.graphics.Color;
@@ -9,7 +9,7 @@ import android.view.View; @@ -9,7 +9,7 @@ import android.view.View;
9 import android.widget.LinearLayout; 9 import android.widget.LinearLayout;
10 import android.widget.TextView; 10 import android.widget.TextView;
11 11
12 -import com.mang.xdy.demo.R; 12 +import com.mang.xuedianyun.android.R;
13 13
14 14
15 /** 15 /**
1 -package com.mang.xdy.demo.dialog; 1 +package com.mang.xuedianyun.android.dialog;
2 2
3 public interface OnBtnClick { 3 public interface OnBtnClick {
4 void onBtnClick(); 4 void onBtnClick();
1 -package com.mang.xdy.demo.dialog; 1 +package com.mang.xuedianyun.android.dialog;
2 2
3 public interface OnBtnLeftClick { 3 public interface OnBtnLeftClick {
4 void onBtnLeftClick(); 4 void onBtnLeftClick();
1 -package com.mang.xdy.demo.dialog; 1 +package com.mang.xuedianyun.android.dialog;
2 2
3 public interface OnBtnRightClick { 3 public interface OnBtnRightClick {
4 void onBtnRightClick(); 4 void onBtnRightClick();
1 -package com.mang.xdy.demo.fragment; 1 +package com.mang.xuedianyun.android.fragment;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.os.Bundle; 4 import android.os.Bundle;
@@ -18,17 +18,17 @@ import com.google.gson.Gson; @@ -18,17 +18,17 @@ import com.google.gson.Gson;
18 import com.mang.xdy.common.Constants; 18 import com.mang.xdy.common.Constants;
19 import com.mang.xdy.utils.SPUtil; 19 import com.mang.xdy.utils.SPUtil;
20 import com.mang.xdy.core.XdySdk; 20 import com.mang.xdy.core.XdySdk;
21 -import com.mang.xdy.demo.R;  
22 -import com.mang.xdy.demo.adapter.ChatAdapter;  
23 -import com.mang.xdy.demo.bean.ChatMsgEntity;  
24 -import com.mang.xdy.demo.bean.Faceicon;  
25 -import com.mang.xdy.demo.bean.JoinClassSuccessEntity;  
26 -import com.mang.xdy.demo.bean.Message;  
27 -import com.mang.xdy.demo.bean.SendChatMsgEntity;  
28 -import com.mang.xdy.demo.utils.JsonUtil;  
29 -import com.mang.xdy.demo.widget.chat.KJChatKeyboard;  
30 -import com.mang.xdy.demo.widget.chat.OnOperationListener;  
31 -import com.mang.xdy.demo.widget.emoji.DisplayRules; 21 +import com.mang.xuedianyun.android.R;
  22 +import com.mang.xuedianyun.android.adapter.ChatAdapter;
  23 +import com.mang.xuedianyun.android.bean.ChatMsgEntity;
  24 +import com.mang.xuedianyun.android.bean.Faceicon;
  25 +import com.mang.xuedianyun.android.bean.JoinClassSuccessEntity;
  26 +import com.mang.xuedianyun.android.bean.Message;
  27 +import com.mang.xuedianyun.android.bean.SendChatMsgEntity;
  28 +import com.mang.xuedianyun.android.utils.JsonUtil;
  29 +import com.mang.xuedianyun.android.widget.chat.KJChatKeyboard;
  30 +import com.mang.xuedianyun.android.widget.chat.OnOperationListener;
  31 +import com.mang.xuedianyun.android.widget.emoji.DisplayRules;
32 import com.mang.xdy.listener.ObserverListener; 32 import com.mang.xdy.listener.ObserverListener;
33 import com.mang.xdy.utils.XdyLogUtil; 33 import com.mang.xdy.utils.XdyLogUtil;
34 34
1 -package com.mang.xdy.demo.fragment; 1 +package com.mang.xuedianyun.android.fragment;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.graphics.Bitmap; 4 import android.graphics.Bitmap;
@@ -11,21 +11,20 @@ import android.support.v4.app.Fragment; @@ -11,21 +11,20 @@ import android.support.v4.app.Fragment;
11 import android.text.TextUtils; 11 import android.text.TextUtils;
12 import android.util.DisplayMetrics; 12 import android.util.DisplayMetrics;
13 import android.view.LayoutInflater; 13 import android.view.LayoutInflater;
14 -import android.view.SurfaceView;  
15 import android.view.View; 14 import android.view.View;
16 import android.view.ViewGroup; 15 import android.view.ViewGroup;
17 16
18 import com.bumptech.glide.Glide; 17 import com.bumptech.glide.Glide;
19 import com.mang.xdy.common.Constants; 18 import com.mang.xdy.common.Constants;
20 import com.mang.xdy.core.XdySdk; 19 import com.mang.xdy.core.XdySdk;
21 -import com.mang.xdy.demo.R;  
22 -import com.mang.xdy.demo.base.BaseRunnable;  
23 -import com.mang.xdy.demo.bean.DocEntity;  
24 -import com.mang.xdy.demo.bean.WhiteboardUpdateEntity;  
25 -import com.mang.xdy.demo.bean.WrapDocBitMapEntity;  
26 -import com.mang.xdy.demo.utils.JsonUtil;  
27 -import com.mang.xdy.demo.utils.ToastUtil;  
28 -import com.mang.xdy.demo.widget.CanvasView; 20 +import com.mang.xuedianyun.android.R;
  21 +import com.mang.xuedianyun.android.base.BaseRunnable;
  22 +import com.mang.xuedianyun.android.bean.DocEntity;
  23 +import com.mang.xuedianyun.android.bean.WhiteboardUpdateEntity;
  24 +import com.mang.xuedianyun.android.bean.WrapDocBitMapEntity;
  25 +import com.mang.xuedianyun.android.utils.JsonUtil;
  26 +import com.mang.xuedianyun.android.utils.ToastUtil;
  27 +import com.mang.xuedianyun.android.widget.CanvasView;
29 import com.mang.xdy.listener.ObserverListener; 28 import com.mang.xdy.listener.ObserverListener;
30 import com.mang.xdy.utils.XdyLogUtil; 29 import com.mang.xdy.utils.XdyLogUtil;
31 30
@@ -85,7 +84,7 @@ public class DocFragment extends Fragment implements ObserverListener{ @@ -85,7 +84,7 @@ public class DocFragment extends Fragment implements ObserverListener{
85 @Override 84 @Override
86 public void handleMessage(Message msg) { 85 public void handleMessage(Message msg) {
87 super.handleMessage(msg); 86 super.handleMessage(msg);
88 - ToastUtil.showToastshort("图片加载失败",mContext); 87 + ToastUtil.showToastshort(getResources().getString(R.string.imge_load_error),mContext);
89 } 88 }
90 }; 89 };
91 90
@@ -99,17 +98,15 @@ public class DocFragment extends Fragment implements ObserverListener{ @@ -99,17 +98,15 @@ public class DocFragment extends Fragment implements ObserverListener{
99 98
100 99
101 public void init(){ 100 public void init(){
102 -  
103 Bundle arguments = getArguments(); 101 Bundle arguments = getArguments();
104 if(arguments!=null) 102 if(arguments!=null)
105 replay = arguments.getBoolean("replay"); 103 replay = arguments.getBoolean("replay");
106 DisplayMetrics metric = new DisplayMetrics(); 104 DisplayMetrics metric = new DisplayMetrics();
107 getWindowWith(metric); 105 getWindowWith(metric);
108 docUrlTransformBitmap(null); 106 docUrlTransformBitmap(null);
109 -// mCanvasView.setZOrderMediaOverlay(false);  
110 -// mCanvasView.setZOrderOnTop(false);  
111 -//// mCanvasView.getHolder().setFormat(SurfaceView.TRANSPARENT);  
112 -// mCanvasView.getHolder().setFormat(SurfaceView.TRANSPARENT); 107 + if(replay) {
  108 + mCanvasView.setZOrderMediaOverlay(true);
  109 + }
113 } 110 }
114 111
115 private void getWindowWith(DisplayMetrics metric) { 112 private void getWindowWith(DisplayMetrics metric) {
@@ -237,7 +234,7 @@ public class DocFragment extends Fragment implements ObserverListener{ @@ -237,7 +234,7 @@ public class DocFragment extends Fragment implements ObserverListener{
237 public void call(WrapDocBitMapEntity resource) { 234 public void call(WrapDocBitMapEntity resource) {
238 235
239 if (resource.getBitmap() == null) { 236 if (resource.getBitmap() == null) {
240 - ToastUtil.showToastshort("图片获取失败",mContext); 237 + ToastUtil.showToastshort(getResources().getString(R.string.imge_load_error),mContext);
241 Bitmap bitmap = getEmptyBitmap(); 238 Bitmap bitmap = getEmptyBitmap();
242 mCanvasView.setBitmap(bitmap, false); 239 mCanvasView.setBitmap(bitmap, false);
243 } else { 240 } else {
1 -package com.mang.xdy.demo.fragment; 1 +package com.mang.xuedianyun.android.fragment;
2 2
3 3
4 import android.os.Bundle; 4 import android.os.Bundle;
@@ -9,7 +9,7 @@ import android.view.View; @@ -9,7 +9,7 @@ import android.view.View;
9 import android.view.ViewGroup; 9 import android.view.ViewGroup;
10 import android.widget.TextView; 10 import android.widget.TextView;
11 11
12 -import com.mang.xdy.demo.R; 12 +import com.mang.xuedianyun.android.R;
13 13
14 14
15 /** 15 /**
1 -package com.mang.xdy.demo.fragment; 1 +package com.mang.xuedianyun.android.fragment;
2 2
3 3
4 import android.os.Bundle; 4 import android.os.Bundle;
@@ -7,12 +7,13 @@ import android.view.LayoutInflater; @@ -7,12 +7,13 @@ import android.view.LayoutInflater;
7 import android.view.View; 7 import android.view.View;
8 import android.view.ViewGroup; 8 import android.view.ViewGroup;
9 9
10 -import com.mang.xdy.demo.R; 10 +import com.mang.xuedianyun.android.R;
11 11
12 /** 12 /**
13 * A simple {@link Fragment} subclass. 13 * A simple {@link Fragment} subclass.
14 * Use the {@link PublishFragment#newInstance} factory method to 14 * Use the {@link PublishFragment#newInstance} factory method to
15 * create an instance of this fragment. 15 * create an instance of this fragment.
  16 + * @deprecated
16 */ 17 */
17 public class PublishFragment extends Fragment { 18 public class PublishFragment extends Fragment {
18 // TODO: Rename parameter arguments, choose names that match 19 // TODO: Rename parameter arguments, choose names that match
1 -package com.mang.xdy.demo.utils;  
2 -  
3 -import android.annotation.SuppressLint;  
4 -import android.app.Activity;  
5 -import android.content.Context;  
6 -import android.content.res.Resources;  
7 -import android.graphics.Rect;  
8 -import android.util.DisplayMetrics;  
9 -import android.view.View;  
10 -import android.view.Window;  
11 -import android.view.WindowManager;  
12 -  
13 -import java.lang.reflect.Field;  
14 -import java.lang.reflect.InvocationTargetException;  
15 -import java.lang.reflect.Method; 1 +package com.mang.xuedianyun.android.utils;
16 2
17 import android.annotation.SuppressLint; 3 import android.annotation.SuppressLint;
18 import android.app.Activity; 4 import android.app.Activity;
1 -package com.mang.xdy.demo.utils; 1 +package com.mang.xuedianyun.android.utils;
2 2
3 import android.text.TextUtils; 3 import android.text.TextUtils;
4 import android.util.Log; 4 import android.util.Log;
1 -package com.mang.xdy.demo.utils;  
2 -  
3 -import android.content.Context;  
4 -import android.content.res.Resources;  
5 -import android.support.annotation.StringRes;  
6 -  
7 -import java.io.BufferedReader;  
8 -import java.io.IOException;  
9 -import java.io.InputStream;  
10 -import java.io.InputStreamReader; 1 +package com.mang.xuedianyun.android.utils;
11 2
12 import android.content.Context; 3 import android.content.Context;
13 import android.content.res.Resources; 4 import android.content.res.Resources;
1 -package com.mang.xdy.demo.utils; 1 +package com.mang.xuedianyun.android.utils;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.widget.Toast; 4 import android.widget.Toast;
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 * See the License for the specific language governing permissions and 11 * See the License for the specific language governing permissions and
12 * limitations under the License. 12 * limitations under the License.
13 */ 13 */
14 -package com.mang.xdy.demo.utils.cache; 14 +package com.mang.xuedianyun.android.utils.cache;
15 15
16 import android.content.Context; 16 import android.content.Context;
17 import android.graphics.Bitmap; 17 import android.graphics.Bitmap;
1 -package com.mang.xdy.demo.utils.cache; 1 +package com.mang.xuedianyun.android.utils.cache;
2 2
3 import android.graphics.Bitmap; 3 import android.graphics.Bitmap;
4 import android.graphics.drawable.Drawable; 4 import android.graphics.drawable.Drawable;
1 -package com.mang.xdy.demo.widget; 1 +package com.mang.xuedianyun.android.widget;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.graphics.Bitmap; 4 import android.graphics.Bitmap;
@@ -17,13 +17,12 @@ import android.view.SurfaceHolder; @@ -17,13 +17,12 @@ import android.view.SurfaceHolder;
17 import android.view.SurfaceView; 17 import android.view.SurfaceView;
18 import android.view.View; 18 import android.view.View;
19 19
20 -import com.mang.xdy.demo.R;  
21 -import com.mang.xdy.demo.bean.AnnotaionEntity;  
22 -import com.mang.xdy.demo.bean.PointGroupEntity;  
23 -import com.mang.xdy.demo.bean.PointXY;  
24 -import com.mang.xdy.demo.utils.DisplayUtil;  
25 -import com.mang.xdy.demo.utils.ResUtil;  
26 -import com.mang.xdy.utils.XdyLogUtil; 20 +import com.mang.xuedianyun.android.R;
  21 +import com.mang.xuedianyun.android.bean.AnnotaionEntity;
  22 +import com.mang.xuedianyun.android.bean.PointGroupEntity;
  23 +import com.mang.xuedianyun.android.bean.PointXY;
  24 +import com.mang.xuedianyun.android.utils.DisplayUtil;
  25 +import com.mang.xuedianyun.android.utils.ResUtil;
27 26
28 import java.util.ArrayList; 27 import java.util.ArrayList;
29 import java.util.Iterator; 28 import java.util.Iterator;
  1 +package com.mang.xuedianyun.android.widget.answersheet;
  2 +
  3 +import android.content.Context;
  4 +import android.os.CountDownTimer;
  5 +import android.util.AttributeSet;
  6 +import android.view.Display;
  7 +import android.view.LayoutInflater;
  8 +import android.view.View;
  9 +import android.widget.CheckBox;
  10 +import android.widget.LinearLayout;
  11 +import android.widget.RadioButton;
  12 +import android.widget.RelativeLayout;
  13 +import android.widget.TextView;
  14 +
  15 +import com.mang.xuedianyun.android.R;
  16 +import com.mang.xuedianyun.android.utils.ToastUtil;
  17 +
  18 +import butterknife.BindView;
  19 +import butterknife.ButterKnife;
  20 +import butterknife.OnClick;
  21 +
  22 +/**
  23 + * Created by abao on 2017/5/5.
  24 + * @deprecated
  25 + */
  26 +
  27 +public class AnswerSheetView extends RelativeLayout {
  28 + /*单选多选类型*/
  29 + public final static int ANSWER_TYPE_SINGLE_OR_MORE = 1;
  30 + /*对错类型*/
  31 + public final static int ANSWER_TYPE_RIGHT_OR_WRONG = 2;
  32 + /*填空*/
  33 + public final static int ANSWER_TYPE_FILLING = 3;
  34 + /*单前的type*/
  35 + private static int ANSWER_CURRENT_TYPE = 1;
  36 + /*倒计时时间 s*/
  37 + public static int ANSWER_TIMEOUT = 30;
  38 + @BindView(R.id.tv_exam_countdown)
  39 + TextView tvExamCountdown;
  40 + @BindView(R.id.rel_home_tv_exam_countdown)
  41 + RelativeLayout relHomeTvExamCountdown;
  42 + @BindView(R.id.cb_exam_A)
  43 + CheckBox cbExamA;
  44 + @BindView(R.id.cb_exam_B)
  45 + CheckBox cbExamB;
  46 + @BindView(R.id.cb_exam_C)
  47 + CheckBox cbExamC;
  48 + @BindView(R.id.cb_exam_D)
  49 + CheckBox cbExamD;
  50 + @BindView(R.id.ll_exam_SingleOrMore)
  51 + LinearLayout llExamSingleOrMore;
  52 + @BindView(R.id.rb_exam_R)
  53 + RadioButton rbExamR;
  54 + @BindView(R.id.rb_exam_W)
  55 + RadioButton rbExamW;
  56 + @BindView(R.id.ll_exam_selectRightOrWrong)
  57 + LinearLayout llExamSelectRightOrWrong;
  58 + @BindView(R.id.ll_exam_filling)
  59 + LinearLayout llExamFilling;
  60 + @BindView(R.id.tv_exam_up)
  61 + TextView tvExamUp;
  62 + @BindView(R.id.tv_exam_cancle)
  63 + TextView tvExamCancle;
  64 + @BindView(R.id.ll_exam_submit)
  65 + LinearLayout llExamSubmit;
  66 + @BindView(R.id.rel_exam_layout)
  67 + RelativeLayout relExamLayout;
  68 + @BindView(R.id.ll_exam_answer)
  69 + LinearLayout llExamAnswer;
  70 +
  71 + private AnswerCount mAnswerCount;
  72 +
  73 + private StringBuffer sb = new StringBuffer();
  74 + private Context mContext;
  75 + private String character_close="关闭";
  76 + private String character_cancle="放弃";
  77 + Display display;
  78 +
  79 + private OnAnswerLayoutChangeListener onAnswerLayoutChangeListener;
  80 + public interface OnAnswerLayoutChangeListener{
  81 + /**
  82 + * 改变显示布局的大小
  83 + * @param
  84 + */
  85 + void setAnswerSheetFramLayout(int num);
  86 +
  87 + void setAnswerSheetNormal(int num);
  88 + }
  89 + public void setOnAnswerLayoutChangeListener(OnAnswerLayoutChangeListener onAnswerLayoutChangeListener){
  90 + this.onAnswerLayoutChangeListener=onAnswerLayoutChangeListener;
  91 + }
  92 +
  93 +
  94 +
  95 + public AnswerSheetView(Context context) {
  96 + this(context, null);
  97 + }
  98 +
  99 + public AnswerSheetView(Context context, AttributeSet attrs) {
  100 + this(context, attrs, 0);
  101 + }
  102 +
  103 + public AnswerSheetView(Context context, AttributeSet attrs, int defStyleAttr) {
  104 + super(context, attrs, defStyleAttr);
  105 + mContext = context;
  106 + View view = initView(context);
  107 +
  108 + this.addView(view);
  109 + }
  110 +
  111 + public View initView(Context context) {
  112 + View view = LayoutInflater.from(context).inflate(R.layout.item_answer, null);
  113 + ButterKnife.bind(this, view);
  114 + return view;
  115 + }
  116 +
  117 + /*选择答题类型*/
  118 + public void selectAnswerSheetType(int type) {
  119 + tvExamCountdown.setText("_s");
  120 + llExamAnswer.setVisibility(View.GONE);
  121 + tvExamUp.setVisibility(View.VISIBLE);
  122 + tvExamCancle.setText(character_cancle);
  123 + switch (type) {
  124 + case ANSWER_TYPE_SINGLE_OR_MORE:
  125 + ANSWER_CURRENT_TYPE = ANSWER_TYPE_SINGLE_OR_MORE;
  126 + llExamSingleOrMore.setVisibility(View.VISIBLE);
  127 + llExamSelectRightOrWrong.setVisibility(View.GONE);
  128 + llExamFilling.setVisibility(View.GONE);
  129 + break;
  130 + case ANSWER_TYPE_RIGHT_OR_WRONG:
  131 + ANSWER_CURRENT_TYPE = ANSWER_TYPE_RIGHT_OR_WRONG;
  132 + llExamSingleOrMore.setVisibility(View.GONE);
  133 + llExamSelectRightOrWrong.setVisibility(View.VISIBLE);
  134 + llExamFilling.setVisibility(View.GONE);
  135 + break;
  136 + case ANSWER_TYPE_FILLING:
  137 + ANSWER_CURRENT_TYPE = ANSWER_TYPE_FILLING;
  138 + llExamSingleOrMore.setVisibility(View.GONE);
  139 + llExamSelectRightOrWrong.setVisibility(View.GONE);
  140 + llExamFilling.setVisibility(View.VISIBLE);
  141 + break;
  142 +
  143 + }
  144 + }
  145 +
  146 + @OnClick({R.id.tv_exam_up, R.id.tv_exam_cancle})
  147 + public void onViewClicked(View view) {
  148 + switch (view.getId()) {
  149 + case R.id.tv_exam_up:
  150 + //提交需要获取结果,清除数据,时间清理
  151 +// relExamLayout.setVisibility(GONE);
  152 + handleAnswer(ANSWER_CURRENT_TYPE);
  153 + ToastUtil.showToastshort("选择答案:" + sb.toString() + sb.length(), mContext);
  154 + recoverStatus();
  155 + setSubmitAnswer();
  156 + break;
  157 + case R.id.tv_exam_cancle:
  158 + recoverStatus();
  159 +// if(character_cancle.equals(tvExamCancle)) {
  160 +// setAnsNormalLayout(53);
  161 +// }else{
  162 +//
  163 +// }
  164 + if(relExamLayout.isShown()){
  165 + relExamLayout.setVisibility(GONE);
  166 + }
  167 + break;
  168 + }
  169 + }
  170 +
  171 + /*开始倒计时*/
  172 + public void startCountTimer(int time) {
  173 + ANSWER_TIMEOUT = time;
  174 + cancleCountTimer();
  175 + mAnswerCount = new AnswerCount(ANSWER_TIMEOUT * 1000, 1000);
  176 + mAnswerCount.start();
  177 + //提交需要获取结果,清除数据,时间清理
  178 + relExamLayout.setVisibility(VISIBLE);
  179 + }
  180 +
  181 + /*销毁倒计时*/
  182 + public void cancleCountTimer() {
  183 + if (mAnswerCount != null) {
  184 + mAnswerCount.cancel();
  185 + }
  186 + }
  187 +
  188 + /**
  189 + * 处理结果,拼装答案
  190 + *
  191 + * @param type
  192 + */
  193 + public void handleAnswer(int type) {
  194 + switch (type) {
  195 + case ANSWER_TYPE_SINGLE_OR_MORE:
  196 + handleSingleOrMore();
  197 + break;
  198 + case ANSWER_TYPE_RIGHT_OR_WRONG:
  199 + handleRightOrWrong();
  200 + break;
  201 + case ANSWER_TYPE_FILLING:
  202 +
  203 + break;
  204 + }
  205 +
  206 + }
  207 +
  208 + /*单选,多选答案拼接*/
  209 + public void handleSingleOrMore() {
  210 + sb.setLength(0);
  211 + if (cbExamA.isChecked()) {
  212 + sb.append("A");
  213 + }
  214 + if (cbExamB.isChecked()) {
  215 + sb.append("B");
  216 + }
  217 + if (cbExamC.isChecked()) {
  218 + sb.append("C");
  219 + }
  220 + if (cbExamD.isChecked()) {
  221 + sb.append("D");
  222 + }
  223 +
  224 + }
  225 +
  226 + /*处理对错*/
  227 + public void handleRightOrWrong() {
  228 + sb.setLength(0);
  229 + if (rbExamR.isChecked()) {
  230 + sb.append("对");
  231 + } else {
  232 + sb.append("错");
  233 + }
  234 +
  235 + }
  236 +
  237 + /*恢复状态*/
  238 + public void recoverStatus() {
  239 + switch (ANSWER_CURRENT_TYPE) {
  240 + case ANSWER_TYPE_SINGLE_OR_MORE:
  241 + cbExamA.setChecked(false);
  242 + cbExamB.setChecked(false);
  243 + cbExamC.setChecked(false);
  244 + cbExamD.setChecked(false);
  245 + break;
  246 + case ANSWER_TYPE_RIGHT_OR_WRONG:
  247 + rbExamR.setChecked(true);
  248 + rbExamW.setChecked(false);
  249 + break;
  250 + case ANSWER_TYPE_FILLING:
  251 + break;
  252 + }
  253 + }
  254 + /*隐藏所有题目*/
  255 + private void hideAllTitle(){
  256 + llExamSingleOrMore.setVisibility(View.GONE);
  257 + llExamSelectRightOrWrong.setVisibility(View.GONE);
  258 + llExamFilling.setVisibility(View.GONE);
  259 + }
  260 + /*设置显示答案布局大小*/
  261 + public void setAnswerLayout(int num){
  262 + if(onAnswerLayoutChangeListener!=null) {
  263 + onAnswerLayoutChangeListener.setAnswerSheetFramLayout(num);
  264 + }
  265 + }
  266 +
  267 + /*设置显示答案布局大小*/
  268 + public void setAnsNormalLayout(int num){
  269 + if(onAnswerLayoutChangeListener!=null) {
  270 + onAnswerLayoutChangeListener.setAnswerSheetNormal(num);
  271 + }
  272 + }
  273 + /*提交答案 设置*/
  274 + private void setSubmitAnswer(){
  275 + hideAllTitle();
  276 + llExamAnswer.setVisibility(View.VISIBLE);
  277 + cancleCountTimer();
  278 + tvExamUp.setVisibility(View.GONE);
  279 + tvExamCancle.setText(character_close);
  280 + setAnswerLayout(100);
  281 +
  282 + }
  283 + @OnClick(R.id.ll_exam_answer)
  284 + public void onViewClicked() {
  285 + }
  286 +
  287 + /*倒计时处理*/
  288 + class AnswerCount extends CountDownTimer {
  289 +
  290 + /**
  291 + * @param millisInFuture The number of millis in the future from the call
  292 + * to {@link #start()} until the countdown is done and {@link #onFinish()}
  293 + * is called.
  294 + * @param countDownInterval The interval along the way to receive
  295 + * {@link #onTick(long)} callbacks.
  296 + */
  297 + public AnswerCount(long millisInFuture, long countDownInterval) {
  298 + super(millisInFuture, countDownInterval);
  299 + }
  300 +
  301 + @Override
  302 + public void onTick(long millisUntilFinished) {
  303 + if (millisUntilFinished < 10) {
  304 + tvExamCountdown.setText(" " + millisUntilFinished / 1000 + "s");
  305 + } else {
  306 + tvExamCountdown.setText(millisUntilFinished / 1000 + "s");
  307 + }
  308 +
  309 + }
  310 +
  311 + @Override
  312 + public void onFinish() {
  313 + //这个结束应该做自动提交答案的工作
  314 + tvExamCountdown.setText("0s");
  315 + }
  316 + }
  317 +}
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package com.mang.xdy.demo.widget.chat; 16 +package com.mang.xuedianyun.android.widget.chat;
17 17
18 import android.os.Bundle; 18 import android.os.Bundle;
19 import android.view.LayoutInflater; 19 import android.view.LayoutInflater;
@@ -22,7 +22,7 @@ import android.view.ViewGroup; @@ -22,7 +22,7 @@ import android.view.ViewGroup;
22 import android.widget.LinearLayout; 22 import android.widget.LinearLayout;
23 23
24 24
25 -import com.mang.xdy.demo.R; 25 +import com.mang.xuedianyun.android.R;
26 26
27 import org.kymjs.kjframe.ui.SupportFragment; 27 import org.kymjs.kjframe.ui.SupportFragment;
28 28
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package com.mang.xdy.demo.widget.chat; 16 +package com.mang.xuedianyun.android.widget.chat;
17 17
18 import android.app.Activity; 18 import android.app.Activity;
19 import android.graphics.Color; 19 import android.graphics.Color;
@@ -36,9 +36,9 @@ import android.widget.RadioButton; @@ -36,9 +36,9 @@ import android.widget.RadioButton;
36 import android.widget.RadioGroup; 36 import android.widget.RadioGroup;
37 37
38 38
39 -import com.mang.xdy.demo.R;  
40 -import com.mang.xdy.demo.adapter.FaceAdapter;  
41 -import com.mang.xdy.demo.bean.Faceicon; 39 +import com.mang.xuedianyun.android.R;
  40 +import com.mang.xuedianyun.android.adapter.FaceAdapter;
  41 +import com.mang.xuedianyun.android.bean.Faceicon;
42 42
43 import org.kymjs.kjframe.ui.SupportFragment; 43 import org.kymjs.kjframe.ui.SupportFragment;
44 import org.kymjs.kjframe.utils.StringUtils; 44 import org.kymjs.kjframe.utils.StringUtils;
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package com.mang.xdy.demo.widget.chat; 16 +package com.mang.xuedianyun.android.widget.chat;
17 17
18 import android.app.Activity; 18 import android.app.Activity;
19 import android.content.Context; 19 import android.content.Context;
@@ -29,8 +29,8 @@ import android.widget.LinearLayout; @@ -29,8 +29,8 @@ import android.widget.LinearLayout;
29 import android.widget.RelativeLayout; 29 import android.widget.RelativeLayout;
30 30
31 31
32 -import com.mang.xdy.demo.R;  
33 -import com.mang.xdy.demo.adapter.FaceCategroyAdapter; 32 +import com.mang.xuedianyun.android.R;
  33 +import com.mang.xuedianyun.android.adapter.FaceCategroyAdapter;
34 34
35 import java.util.List; 35 import java.util.List;
36 36
@@ -13,10 +13,10 @@ @@ -13,10 +13,10 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package com.mang.xdy.demo.widget.chat; 16 +package com.mang.xuedianyun.android.widget.chat;
17 17
18 18
19 -import com.mang.xdy.demo.bean.Faceicon; 19 +import com.mang.xuedianyun.android.bean.Faceicon;
20 20
21 /** 21 /**
22 * 表情栏顶部按钮的监听器 22 * 表情栏顶部按钮的监听器
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package com.mang.xdy.demo.widget.chat; 16 +package com.mang.xuedianyun.android.widget.chat;
17 17
18 import android.annotation.SuppressLint; 18 import android.annotation.SuppressLint;
19 import android.content.Context; 19 import android.content.Context;
@@ -39,7 +39,7 @@ import android.widget.LinearLayout; @@ -39,7 +39,7 @@ import android.widget.LinearLayout;
39 import android.widget.TextView; 39 import android.widget.TextView;
40 40
41 41
42 -import com.mang.xdy.demo.R; 42 +import com.mang.xuedianyun.android.R;
43 43
44 import java.util.Locale; 44 import java.util.Locale;
45 45
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package com.mang.xdy.demo.widget.chat; 16 +package com.mang.xuedianyun.android.widget.chat;
17 17
18 import android.graphics.Rect; 18 import android.graphics.Rect;
19 import android.view.View; 19 import android.view.View;
1 -package com.mang.xdy.demo.widget.chat; 1 +package com.mang.xuedianyun.android.widget.chat;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.content.Intent; 4 import android.content.Intent;
  1 +package com.mang.xuedianyun.android.widget.dialog;
  2 +
  3 +import android.app.Dialog;
  4 +import android.content.Context;
  5 +import android.view.Display;
  6 +import android.view.Gravity;
  7 +import android.view.LayoutInflater;
  8 +import android.view.View;
  9 +import android.view.Window;
  10 +import android.view.WindowManager;
  11 +import android.widget.LinearLayout;
  12 +import android.widget.ScrollView;
  13 +import android.widget.TextView;
  14 +
  15 +import com.mang.xuedianyun.android.R;
  16 +
  17 +import butterknife.ButterKnife;
  18 +
  19 +
  20 +/**
  21 + * Created by abao on 2017/5/9.
  22 + * @deprecated
  23 + */
  24 +
  25 +public class AnswText {
  26 +
  27 +
  28 +
  29 +
  30 +
  31 +
  32 + /*单选多选类型*/
  33 + public final static int ANSWER_TYPE_SINGLE_OR_MORE = 1;
  34 + /*对错类型*/
  35 + public final static int ANSWER_TYPE_RIGHT_OR_WRONG = 2;
  36 + /*填空*/
  37 + public final static int ANSWER_TYPE_FILLING = 3;
  38 + /*单前的type*/
  39 + private static int ANSWER_CURRENT_TYPE = 1;
  40 + /*倒计时时间 s*/
  41 + public static int ANSWER_TIMEOUT = 30;
  42 +
  43 +
  44 +
  45 + private StringBuffer sb = new StringBuffer();
  46 + private Context mContext;
  47 + private String character_close="关闭";
  48 + private String character_cancle="放弃";
  49 +
  50 + private OnAnswerLayoutChangeListener onAnswerLayoutChangeListener;
  51 + public interface OnAnswerLayoutChangeListener{
  52 + /**
  53 + * 改变显示布局的大小
  54 + * @param
  55 + */
  56 + void setAnswerSheetFramLayout(int num);
  57 +
  58 + void setAnswerSheetNormal(int num);
  59 + }
  60 + public void setOnAnswerLayoutChangeListener(OnAnswerLayoutChangeListener onAnswerLayoutChangeListener){
  61 + this.onAnswerLayoutChangeListener=onAnswerLayoutChangeListener;
  62 + }
  63 +
  64 + private Context context;
  65 + private Dialog dialog;
  66 + private TextView txt_title;
  67 + private TextView txt_cancel;
  68 + private LinearLayout lLayout_content;
  69 + private ScrollView sLayout_content;
  70 + private boolean showTitle = false;
  71 +// private List<ActionSheetDialog.SheetItem> sheetItemList;
  72 + private Display display;
  73 +
  74 + public AnswText(Context context) {
  75 + this.context = context;
  76 + this.mContext=context;
  77 + WindowManager windowManager = (WindowManager) context
  78 + .getSystemService(Context.WINDOW_SERVICE);
  79 + display = windowManager.getDefaultDisplay();
  80 + }
  81 +
  82 + public AnswText builder() {
  83 + View view = LayoutInflater.from(context).inflate(
  84 + R.layout.view_text, null);
  85 + ButterKnife.bind(this,view);
  86 + view.setMinimumWidth(display.getWidth());
  87 +
  88 + dialog = new Dialog(context, R.style.ActionSheetDialogStyle);
  89 + dialog.setContentView(view);
  90 + Window dialogWindow = dialog.getWindow();
  91 + dialogWindow.setGravity(Gravity.LEFT | Gravity.BOTTOM);
  92 +// dialogWindow.setGravity( Gravity.BOTTOM);
  93 + WindowManager.LayoutParams lp = dialogWindow.getAttributes();
  94 + lp.x = 0;
  95 + lp.y = 0;
  96 + dialogWindow.setAttributes(lp);
  97 + return this;
  98 + }
  99 + public void show() {
  100 + dialog.show();
  101 + }
  102 +
  103 +
  104 +
  105 +}
  106 +
1 -package com.mang.xdy.demo.widget.dialog; 1 +package com.mang.xuedianyun.android.widget.dialog;
2 2
3 import android.app.Dialog; 3 import android.app.Dialog;
4 import android.content.Context; 4 import android.content.Context;
@@ -12,15 +12,14 @@ import android.view.ViewGroup; @@ -12,15 +12,14 @@ import android.view.ViewGroup;
12 import android.view.Window; 12 import android.view.Window;
13 import android.view.WindowManager; 13 import android.view.WindowManager;
14 import android.widget.CheckBox; 14 import android.widget.CheckBox;
15 -import android.widget.ImageView;  
16 import android.widget.LinearLayout; 15 import android.widget.LinearLayout;
17 import android.widget.RadioButton; 16 import android.widget.RadioButton;
18 import android.widget.RelativeLayout; 17 import android.widget.RelativeLayout;
19 import android.widget.ScrollView; 18 import android.widget.ScrollView;
20 import android.widget.TextView; 19 import android.widget.TextView;
21 20
22 -import com.mang.xdy.demo.R;  
23 -import com.mang.xdy.demo.utils.ToastUtil; 21 +import com.mang.xuedianyun.android.R;
  22 +import com.mang.xuedianyun.android.utils.ToastUtil;
24 import com.mang.xdy.utils.XdyLogUtil; 23 import com.mang.xdy.utils.XdyLogUtil;
25 import com.mang.xdy.utils.XdyStringUtils; 24 import com.mang.xdy.utils.XdyStringUtils;
26 25
1 -package com.mang.xdy.demo.widget.dialog; 1 +package com.mang.xuedianyun.android.widget.dialog;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.view.Gravity; 4 import android.view.Gravity;
@@ -7,8 +7,8 @@ import android.widget.Button; @@ -7,8 +7,8 @@ import android.widget.Button;
7 import android.widget.EditText; 7 import android.widget.EditText;
8 8
9 9
10 -import com.mang.xdy.demo.R;  
11 -import com.mang.xdy.demo.dialog.BaseDialog; 10 +import com.mang.xuedianyun.android.R;
  11 +import com.mang.xuedianyun.android.dialog.BaseDialog;
12 import com.mang.xdy.utils.UIUtils; 12 import com.mang.xdy.utils.UIUtils;
13 13
14 import org.greenrobot.eventbus.EventBus; 14 import org.greenrobot.eventbus.EventBus;
1 -package com.mang.xdy.demo.widget.emoji; 1 +package com.mang.xuedianyun.android.widget.emoji;
2 2
3 import android.view.KeyEvent; 3 import android.view.KeyEvent;
4 import android.widget.EditText; 4 import android.widget.EditText;
@@ -13,13 +13,13 @@ @@ -13,13 +13,13 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package com.mang.xdy.demo.widget.emoji; 16 +package com.mang.xuedianyun.android.widget.emoji;
17 17
18 import android.widget.AbsListView; 18 import android.widget.AbsListView;
19 import android.widget.TextView; 19 import android.widget.TextView;
20 20
21 21
22 -import com.mang.xdy.demo.R; 22 +import com.mang.xuedianyun.android.R;
23 23
24 import org.kymjs.kjframe.widget.AdapterHolder; 24 import org.kymjs.kjframe.widget.AdapterHolder;
25 import org.kymjs.kjframe.widget.KJAdapter; 25 import org.kymjs.kjframe.widget.KJAdapter;
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package com.mang.xdy.demo.widget.emoji; 16 +package com.mang.xuedianyun.android.widget.emoji;
17 17
18 import android.app.Activity; 18 import android.app.Activity;
19 import android.os.Bundle; 19 import android.os.Bundle;
@@ -31,8 +31,8 @@ import android.widget.RadioButton; @@ -31,8 +31,8 @@ import android.widget.RadioButton;
31 import android.widget.RadioGroup; 31 import android.widget.RadioGroup;
32 32
33 33
34 -import com.mang.xdy.demo.R;  
35 -import com.mang.xdy.demo.widget.chat.OnOperationListener; 34 +import com.mang.xuedianyun.android.R;
  35 +import com.mang.xuedianyun.android.widget.chat.OnOperationListener;
36 36
37 import org.kymjs.kjframe.ui.SupportFragment; 37 import org.kymjs.kjframe.ui.SupportFragment;
38 38
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16 -package com.mang.xdy.demo.widget.emoji; 16 +package com.mang.xuedianyun.android.widget.emoji;
17 17
18 /** 18 /**
19 * emoji表情的javabean 19 * emoji表情的javabean
1 -package com.mang.xdy.demo.widget.emoji; 1 +package com.mang.xuedianyun.android.widget.emoji;
2 2
3 3
4 -import com.mang.xdy.demo.R; 4 +import com.mang.xuedianyun.android.R;
5 5
6 import java.util.ArrayList; 6 import java.util.ArrayList;
7 import java.util.HashMap; 7 import java.util.HashMap;
1 -package com.mang.xdy.demo.widget.emoji; 1 +package com.mang.xuedianyun.android.widget.emoji;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.content.res.TypedArray; 4 import android.content.res.TypedArray;
1 -package com.mang.xdy.demo.widget.emoji; 1 +package com.mang.xuedianyun.android.widget.emoji;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.content.res.TypedArray; 4 import android.content.res.TypedArray;
1 -package com.mang.xdy.demo.widget.view; 1 +package com.mang.xuedianyun.android.widget.view;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.os.Build; 4 import android.os.Build;
@@ -7,7 +7,7 @@ import android.view.View; @@ -7,7 +7,7 @@ import android.view.View;
7 import android.view.ViewGroup; 7 import android.view.ViewGroup;
8 import android.widget.RelativeLayout; 8 import android.widget.RelativeLayout;
9 9
10 -import com.mang.xdy.demo.utils.DisplayUtil; 10 +import com.mang.xuedianyun.android.utils.DisplayUtil;
11 11
12 12
13 public class AutoAdaptHeaderViewGroup extends RelativeLayout { 13 public class AutoAdaptHeaderViewGroup extends RelativeLayout {
1 -package com.mang.xdy.demo.widget.view; 1 +package com.mang.xuedianyun.android.widget.view;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.support.v4.view.ViewPager; 4 import android.support.v4.view.ViewPager;
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <item android:drawable="@color/home_btn_green_press" android:state_pressed="true"></item>
  4 + <item android:drawable="@color/home_btn_green_press" android:state_checked="true"></item>
  5 + <item android:drawable="@color/home_btn_green"></item>
  6 +</selector>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <item android:drawable="@drawable/answer_select" android:state_checked="true" />
  4 + <item android:drawable="@drawable/answer_unselect" />
  5 +</selector>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<selector xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <item android:drawable="@drawable/spreadback" android:state_checked="true" />
  4 + <item android:drawable="@drawable/foldback" />
  5 +</selector>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<shape
  3 + xmlns:android="http://schemas.android.com/apk/res/android"
  4 + android:shape="oval"
  5 + android:useLevel="false" >
  6 + <solid android:color="@color/colorSkyBlue" />
  7 + <!--<padding-->
  8 + <!--android:left="2dp"-->
  9 + <!--android:top="1dp"-->
  10 + <!--android:right="2dp"-->
  11 + <!--android:bottom="1dp" />-->
  12 + <!--<solid-->
  13 + <!--android:color="@color/actionsheet_red" />-->
  14 + <!--<stroke-->
  15 + <!--android:width="1dp"-->
  16 + <!--android:color="@android:color/white" />-->
  17 + <size android:width="18dp"
  18 + android:height="18dp" />
  19 +</shape>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<shape
  3 + xmlns:android="http://schemas.android.com/apk/res/android"
  4 + android:shape="oval"
  5 + android:useLevel="false" >
  6 + <solid android:color="@color/actionsheet_red" />
  7 + <!--<padding-->
  8 + <!--android:left="2dp"-->
  9 + <!--android:top="1dp"-->
  10 + <!--android:right="2dp"-->
  11 + <!--android:bottom="1dp" />-->
  12 + <!--<solid-->
  13 + <!--android:color="@color/actionsheet_red" />-->
  14 + <!--<stroke-->
  15 + <!--android:width="1dp"-->
  16 + <!--android:color="@android:color/white" />-->
  17 + <size android:width="18dp"
  18 + android:height="18dp" />
  19 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:shape="rectangle">
  4 +
  5 + <!-- 圆角 -->
  6 + <corners android:radius="16dp" />
  7 +
  8 + <!-- 填充颜色 -->
  9 + <solid android:color="@color/colorSkyBlue" />
  10 +
  11 +
  12 + <!--&lt;!&ndash;内边距&ndash;&gt;-->
  13 + <padding
  14 + android:bottom="5dp"
  15 + android:left="5dp"
  16 + android:right="5dp"
  17 + android:top="5dp" />
  18 +</shape>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<shape xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:shape="rectangle">
  4 +
  5 + <!-- 圆角 -->
  6 + <corners android:radius="16dp" />
  7 +
  8 + <!-- 填充颜色 -->
  9 + <solid android:color="@color/colorGrey" />
  10 +
  11 +
  12 + <!--内边距-->
  13 + <padding
  14 + android:bottom="5dp"
  15 + android:left="5dp"
  16 + android:right="5dp"
  17 + android:top="5dp" />
  18 +</shape>
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 android:layout_width="match_parent" 5 android:layout_width="match_parent"
6 android:layout_height="match_parent" 6 android:layout_height="match_parent"
7 android:orientation="vertical" 7 android:orientation="vertical"
8 - tools:context="com.mang.xdy.demo.MainActivity"> 8 + tools:context="com.mang.xuedianyun.android.MainActivity">
9 <RelativeLayout 9 <RelativeLayout
10 android:id="@+id/rl_home_close" 10 android:id="@+id/rl_home_close"
11 android:layout_width="@dimen/ui_DIMEN_98.0PX" 11 android:layout_width="@dimen/ui_DIMEN_98.0PX"
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:tools="http://schemas.android.com/tools"
  4 + xmlns:custom="http://schemas.android.com/apk/res-auto"
  5 + android:id="@+id/activity_video_play"
  6 + android:layout_width="match_parent"
  7 + android:layout_height="match_parent"
  8 + android:orientation="vertical"
  9 + android:background="#e3e4e6"
  10 + tools:context="com.mang.xuedianyun.android.activity.VideoPlayActivity">
  11 + <RelativeLayout
  12 + android:id="@+id/avg_videoPlay_back"
  13 + android:layout_width="match_parent"
  14 + android:layout_height="wrap_content"
  15 + android:layout_alignParentLeft="true"
  16 + android:layout_alignParentStart="true"
  17 + android:layout_alignParentTop="true"
  18 + android:paddingLeft="@dimen/ui_DIMEN_20.0PX"
  19 + android:paddingRight="@dimen/ui_DIMEN_20.0PX">
  20 +
  21 + <ImageView
  22 + android:id="@+id/img_videoPlay_back"
  23 + android:layout_width="wrap_content"
  24 + android:layout_height="@dimen/ui_titlebar_height"
  25 + android:paddingRight="10dp"
  26 + android:paddingLeft="15dp"
  27 + android:src="@mipmap/back"/>
  28 + <TextView
  29 + android:layout_toRightOf="@+id/img_videoPlay_back"
  30 + android:layout_width="wrap_content"
  31 + style="@style/ui_wrapTvBaseStyle"
  32 + android:layout_height="@dimen/ui_titlebar_height"
  33 + android:text="@string/home_title_back"
  34 + android:gravity="center"
  35 + android:textColor="@color/white"
  36 + android:visibility="gone"
  37 + />
  38 + <TextView
  39 + android:id="@+id/tv_videoPlay_className"
  40 + style="@style/ui_wrapTvBaseStyle"
  41 + android:layout_height="@dimen/ui_titlebar_height"
  42 + android:gravity="center"
  43 + android:layout_centerHorizontal="true"
  44 + android:textColor="@color/white"
  45 + android:layout_toRightOf="@+id/img_videoPlay_back"
  46 + tools:text="dfdfdfdfdfdf"
  47 + android:textSize="@dimen/ui_DIMEN_34.0PX"/>
  48 + </RelativeLayout>
  49 + <!--白板+right-->
  50 + <RelativeLayout
  51 + android:layout_width="match_parent"
  52 + android:layout_height="match_parent"
  53 + android:orientation="horizontal"
  54 + android:layout_below="@+id/avg_videoPlay_back"
  55 + android:layout_above="@+id/fl_media"
  56 + >
  57 +
  58 + <LinearLayout
  59 + android:id="@+id/ll_videoPlay_right"
  60 + android:layout_width="wrap_content"
  61 + android:layout_height="match_parent"
  62 + android:layout_weight="1"
  63 + android:orientation="vertical"
  64 + android:layout_alignParentRight="true"
  65 + >
  66 + <RelativeLayout
  67 + android:id="@+id/rel_videoPlay_play"
  68 + android:layout_width="255dp"
  69 + android:layout_alignParentRight="true"
  70 + android:layout_weight="1"
  71 + android:layout_height="wrap_content">
  72 + <com.pili.pldroid.player.widget.PLVideoTextureView
  73 + android:id="@+id/img_playVideo_replay"
  74 + android:layout_width="match_parent"
  75 + android:layout_height="match_parent"
  76 + android:layout_gravity="center"/>
  77 + <SurfaceView
  78 + android:id="@+id/surfaceview_playVideo"
  79 + android:layout_width="match_parent"
  80 + android:layout_height="match_parent"
  81 + />
  82 + <ImageView
  83 + android:id="@+id/img_playVideo_novideo"
  84 + android:layout_width="match_parent"
  85 + android:layout_height="match_parent"
  86 + android:background="@mipmap/novideo"
  87 + />
  88 + <FrameLayout
  89 + android:layout_width="match_parent"
  90 + android:layout_height="wrap_content">
  91 +
  92 + </FrameLayout>
  93 + <LinearLayout
  94 + android:layout_width="wrap_content"
  95 + android:layout_height="wrap_content"
  96 + android:orientation="vertical"
  97 + android:layout_alignParentRight="true"
  98 + android:id="@+id/linearLayout">
  99 +
  100 + </LinearLayout>
  101 +
  102 +
  103 +
  104 + </RelativeLayout>
  105 +
  106 + <!--推流-->
  107 + <RelativeLayout
  108 + android:id="@+id/rel_videoPlay_publish"
  109 + android:layout_width="255dp"
  110 + android:layout_height="wrap_content"
  111 + android:layout_weight="1"
  112 + android:layout_below="@+id/rel_videoPlay_play"
  113 + android:layout_alignParentRight="true"
  114 + android:layout_alignLeft="@+id/rel_videoPlay_play"
  115 + android:layout_marginTop="8dp"
  116 + >
  117 +
  118 + <SurfaceView
  119 + android:id="@+id/sur_plaVideo_publish"
  120 + android:layout_width="match_parent"
  121 + android:layout_height="match_parent"
  122 + android:visibility="gone"
  123 + tools:visibility="visible"
  124 + android:layout_alignParentRight="true"
  125 + android:layout_alignParentBottom="true"
  126 + />
  127 + <FrameLayout
  128 + android:id="@+id/fra_videoPlay_student_cover"
  129 + android:layout_width="match_parent"
  130 + android:layout_height="match_parent"
  131 + android:layout_centerInParent="true"
  132 + >
  133 + <ImageView
  134 + android:layout_width="wrap_content"
  135 + android:layout_height="wrap_content"
  136 + android:background="@mipmap/student"
  137 + tools:visibility="visible"
  138 + android:layout_gravity="center"
  139 + android:scaleType="fitCenter"
  140 + />
  141 + </FrameLayout>
  142 +
  143 + <ImageView
  144 + android:id="@+id/img_playVideo_publishAudio"
  145 + android:layout_width="match_parent"
  146 + android:layout_height="match_parent"
  147 + android:background="@mipmap/audio_mode"
  148 + android:visibility="gone"
  149 + tools:visibility="visible"
  150 + android:scaleType="fitCenter"
  151 + android:layout_alignParentRight="true"
  152 + android:layout_alignParentBottom="true"
  153 + />
  154 + <FrameLayout
  155 + android:id="@+id/fra_videoPlay_start"
  156 + android:layout_width="50dp"
  157 + android:layout_height="50dp"
  158 +
  159 + tools:visibility="visible"
  160 + android:layout_alignParentLeft="true"
  161 + android:layout_alignParentBottom="true"
  162 + >
  163 + <ImageView
  164 + android:id="@+id/img_videoPlay_start"
  165 + android:layout_width="20dp"
  166 + android:layout_height="12dp"
  167 + android:layout_marginTop="20dp"
  168 + android:layout_marginLeft="5dp"
  169 + android:background="@mipmap/camera_normal2x"
  170 + />
  171 + </FrameLayout>
  172 + <!--音频-->
  173 + <FrameLayout
  174 + android:id="@+id/fra_videoPlay_start_audio"
  175 + android:layout_width="50dp"
  176 + android:layout_height="50dp"
  177 + android:layout_toRightOf="@+id/fra_videoPlay_start"
  178 + tools:visibility="visible"
  179 + android:layout_alignParentBottom="true"
  180 + >
  181 + <ImageView
  182 + android:id="@+id/img_videoPlay_start_audio"
  183 + android:layout_width="12dp"
  184 + android:layout_height="20dp"
  185 + android:layout_marginTop="15dp"
  186 + android:background="@mipmap/mic_normal2x"
  187 + />
  188 + </FrameLayout>
  189 +
  190 + <FrameLayout
  191 + android:id="@+id/fra_videoPlay_stopPublish"
  192 + android:layout_width="70dp"
  193 + android:layout_height="50dp"
  194 + android:visibility="gone"
  195 + tools:visibility="visible"
  196 + android:layout_alignParentLeft="true"
  197 + android:layout_alignParentBottom="true"
  198 + android:layout_alignBottom="@+id/sur_plaVideo_publish"
  199 + >
  200 + <ImageView
  201 + android:id="@+id/img_videoPlay_stopPublish"
  202 + android:layout_width="wrap_content"
  203 + android:layout_height="wrap_content"
  204 + android:layout_marginTop="20dp"
  205 + android:layout_marginLeft="15dp"
  206 + android:enabled="false"
  207 + android:background="@mipmap/hangup_normal2x"
  208 + />
  209 + </FrameLayout>
  210 + </RelativeLayout>
  211 +
  212 + <LinearLayout
  213 + android:id="@+id/ll_videoPlay_tablet_chat"
  214 + android:layout_width="255dp"
  215 + android:layout_height="match_parent"
  216 + android:orientation="vertical"
  217 + android:layout_marginTop="8dp"
  218 + />
  219 + </LinearLayout>
  220 + <!--Tablet文档-->
  221 + <LinearLayout
  222 + android:id="@+id/ll_videoPlay_tablet_doc"
  223 + android:layout_width="match_parent"
  224 + android:layout_height="match_parent"
  225 + android:layout_weight="3"
  226 + android:orientation="vertical"
  227 + android:layout_marginRight="5dp"
  228 + android:layout_marginLeft="5dp"
  229 + android:layout_toLeftOf="@+id/ll_videoPlay_right"
  230 + />
  231 +
  232 + </RelativeLayout>
  233 + <com.flyco.tablayout.SlidingTabLayout
  234 + android:id="@+id/stl_videoPlay_tab"
  235 + android:layout_width="match_parent"
  236 + android:layout_height="@dimen/ui_titlebar_height"
  237 + android:layout_alignParentLeft="true"
  238 + android:layout_alignParentStart="true"
  239 + android:background="#fafafa"
  240 + custom:tl_indicator_color="@color/home_tab_selected"
  241 + custom:tl_indicator_corner_radius="1.5dp"
  242 + custom:tl_indicator_height="@dimen/ui_DIMEN_5.0PX"
  243 + custom:tl_tab_space_equal="true"
  244 + custom:tl_textSelectColor="@color/home_tab_selected"
  245 + custom:tl_textUnselectColor="@color/home_tab_unselected"
  246 + custom:tl_textsize="@dimen/ui_DIMEN_28.0PX"/>
  247 + <com.mang.xuedianyun.android.widget.view.NoScrollViewPager
  248 + android:id="@+id/viewpager"
  249 + android:layout_below="@+id/stl_videoPlay_tab"
  250 + android:layout_width="wrap_content"
  251 + android:layout_height="wrap_content"
  252 + android:layout_alignRight="@+id/stl_videoPlay_tab"
  253 +
  254 +
  255 + android:background="@android:color/white" >
  256 +
  257 + </com.mang.xuedianyun.android.widget.view.NoScrollViewPager>
  258 +
  259 +
  260 + <FrameLayout
  261 + android:id="@+id/fl_media"
  262 + android:layout_width="match_parent"
  263 + android:layout_height="wrap_content"
  264 + android:layout_alignParentBottom="true"
  265 + >
  266 + <include
  267 + layout="@layout/home_media_controller"
  268 + android:layout_width="match_parent"
  269 + android:layout_height="wrap_content"/>
  270 + </FrameLayout>
  271 +
  272 +
  273 +</RelativeLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:tools="http://schemas.android.com/tools"
  4 + android:id="@+id/activity_video_play"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + android:orientation="vertical"
  8 + tools:context="com.mang.xuedianyun.android.activity.VideoPlayActivity">
  9 + <RelativeLayout
  10 + android:layout_width="wrap_content"
  11 + android:layout_height="wrap_content"
  12 + android:visibility="gone"
  13 + >
  14 + <SurfaceView
  15 + android:id="@+id/surfaceview_playVideo"
  16 + android:layout_width="match_parent"
  17 + android:layout_height="200dp"
  18 + android:visibility="gone"/>
  19 + <ImageView
  20 + android:id="@+id/img_playVideo_novideo"
  21 + android:layout_width="match_parent"
  22 + android:layout_height="200dp"
  23 + android:background="@mipmap/novideo"
  24 + />
  25 + </RelativeLayout>
  26 + <SurfaceView
  27 + android:id="@+id/surfaceview_pubisherVideo"
  28 + android:layout_width="match_parent"
  29 + android:layout_height="300dp" />
  30 + <android.support.design.widget.TabLayout
  31 + android:id="@+id/sliding_tabs"
  32 + android:layout_width="match_parent"
  33 + android:layout_height="wrap_content"
  34 + />
  35 +
  36 + <android.support.v4.view.ViewPager
  37 + android:id="@+id/viewpager"
  38 + android:layout_width="match_parent"
  39 + android:layout_height="0px"
  40 + android:layout_weight="1"
  41 + android:background="@android:color/white" />
  42 + <TextView
  43 + android:id="@+id/tv_videoPlay_url"
  44 + android:layout_width="wrap_content"
  45 + android:layout_height="wrap_content"
  46 + />
  47 + <LinearLayout
  48 + android:layout_width="match_parent"
  49 + android:layout_height="wrap_content"
  50 + android:orientation="horizontal">
  51 + <Button
  52 + android:id="@+id/btn_videoPlay_chat"
  53 + android:layout_width="wrap_content"
  54 + android:layout_height="wrap_content"
  55 + android:text="发送hello"
  56 + android:visibility="gone"
  57 + />
  58 + <Button
  59 + android:id="@+id/btn_videoPlay_pubsherVideo"
  60 + android:layout_width="wrap_content"
  61 + android:layout_height="wrap_content"
  62 + android:text="获取推流地址推送视频"
  63 + android:enabled="false"
  64 + />
  65 + <Button
  66 + android:id="@+id/btn_videoPlay_publisherAudio"
  67 + android:layout_width="wrap_content"
  68 + android:layout_height="wrap_content"
  69 + android:text="获取推流地址推送音频"
  70 + android:enabled="false"
  71 + />
  72 + <Button
  73 + android:id="@+id/btn_videoPlay_stop"
  74 + android:layout_width="wrap_content"
  75 + android:layout_height="wrap_content"
  76 + android:text="停止推流"
  77 + />
  78 + </LinearLayout>
  79 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout
  3 + android:layout_width="@dimen/ui_DIMEN_500.0PX"
  4 + android:layout_height="wrap_content"
  5 + android:layout_centerInParent="true"
  6 + android:background="@drawable/radius_solid_white_stroke_999"
  7 + android:gravity="center_horizontal"
  8 + android:orientation="vertical"
  9 + android:paddingBottom="@dimen/ui_DIMEN_20.0PX"
  10 + xmlns:android="http://schemas.android.com/apk/res/android">
  11 +<EditText
  12 + android:id="@+id/dialog_edt_username"
  13 + style="@style/home_login_edit_style"
  14 + android:hint="用户名"/>
  15 + <EditText
  16 + android:id="@+id/dialog_edt_userpwd"
  17 + style="@style/home_login_edit_style"
  18 + android:hint="密码"/>
  19 + <Button
  20 + android:id="@+id/dialog_btn_enter"
  21 + android:layout_width="100dp"
  22 + android:layout_height="wrap_content"
  23 + style="@style/home_site_btn_style"
  24 + android:text="登录"
  25 + />
  26 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:id="@+id/ll_chat_fragment_parent"
  4 + android:layout_width="match_parent"
  5 + android:layout_height="match_parent"
  6 + android:background="#ebebeb"
  7 + android:orientation="vertical">
  8 +
  9 + <com.mang.xuedianyun.android.widget.chat.KJChatKeyboard
  10 + android:id="@+id/chat_msg_input_box"
  11 + android:layout_width="match_parent"
  12 + android:layout_height="wrap_content"
  13 + android:layout_alignParentBottom="true" />
  14 +
  15 + <ListView
  16 + android:id="@+id/chat_listview"
  17 + android:layout_width="match_parent"
  18 + android:layout_height="match_parent"
  19 + android:layout_above="@+id/chat_msg_input_box"
  20 + android:cacheColorHint="#00000000"
  21 + android:divider="@null"
  22 + android:dividerHeight="8.33dp"
  23 + android:scrollbarStyle="outsideOverlay"
  24 + android:transcriptMode="normal" />
  25 +
  26 + <View
  27 + android:id="@+id/view_line"
  28 + android:layout_width="match_parent"
  29 + android:layout_height="1dp"
  30 + android:layout_below="@id/chat_listview"
  31 + android:background="#7fd8d8d8" />
  32 +
  33 +
  34 + <!-- -->
  35 +
  36 +</RelativeLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:orientation="vertical" android:layout_width="match_parent"
  4 + android:layout_height="match_parent">
  5 + <com.mang.xuedianyun.android.widget.CanvasView
  6 + android:id="@+id/canvas_doc_show"
  7 + android:layout_width="wrap_content"
  8 + android:layout_height="wrap_content" />
  9 +</RelativeLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<TextView xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:gravity="center" />
  1 +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2 + xmlns:tools="http://schemas.android.com/tools"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + tools:context="com.mang.xuedianyun.android.fragment.PublishFragment">
  6 +
  7 + <!-- TODO: Update blank fragment layout -->
  8 + <SurfaceView
  9 + android:id="@+id/sur_publish"
  10 + android:layout_width="match_parent"
  11 + android:layout_height="200dp"
  12 + android:text="@string/hello_blank_fragment" />
  13 + <Button
  14 + android:id="@+id/btn_publish_gets"
  15 + android:layout_width="wrap_content"
  16 + android:layout_height="wrap_content"
  17 + android:text="获取推流地址,开始推流"
  18 + />
  19 + <Button
  20 + android:id="@+id/btn_publish_stop"
  21 + android:layout_width="wrap_content"
  22 + android:layout_height="wrap_content"
  23 + android:text="停止推流"
  24 + />
  25 +</FrameLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="160dp"
  5 + android:orientation="vertical">
  6 +
  7 + <android.support.v4.view.ViewPager
  8 + android:id="@+id/frag_pager_face"
  9 + android:layout_width="match_parent"
  10 + android:layout_height="150dp">
  11 + </android.support.v4.view.ViewPager>
  12 +
  13 + <RadioGroup
  14 + android:id="@+id/frag_point"
  15 + android:layout_width="match_parent"
  16 + android:layout_height="10dp"
  17 + android:layout_marginBottom="6dip"
  18 + android:background="#00000000"
  19 + android:gravity="center"
  20 + android:orientation="horizontal">
  21 + </RadioGroup>
  22 +
  23 +</LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<com.mang.xuedianyun.android.widget.emoji.EmoticonsTextView
  3 + android:id="@+id/itemEmoji"
  4 + xmlns:android="http://schemas.android.com/apk/res/android"
  5 + android:layout_width="33dp"
  6 + android:layout_height="33dp"
  7 + android:layout_margin="2dp"
  8 + android:adjustViewBounds="true"
  9 + android:background="@android:color/transparent"
  10 + android:gravity="center"
  11 + android:textColor="@android:color/black"
  12 + android:textSize="25sp"/>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="55dp"
  4 + android:layout_height="55dp"
  5 + android:gravity="center"
  6 + android:padding="5dip">
  7 +
  8 + <ImageView
  9 + android:id="@+id/itemImage"
  10 + android:layout_width="45dp"
  11 + android:layout_height="45dp"
  12 + android:layout_centerInParent="true"
  13 + android:adjustViewBounds="true"
  14 + android:contentDescription="@null"
  15 + android:scaleType="centerCrop"/>
  16 +
  17 +</RelativeLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:my="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="wrap_content"
  7 + android:orientation="vertical"
  8 + android:paddingLeft="@dimen/ui_DIMEN_24.0PX"
  9 + android:paddingRight="@dimen/ui_DIMEN_24.0PX">
  10 +
  11 +
  12 + <TextView
  13 + android:id="@+id/chat_item_date"
  14 + android:layout_width="@dimen/ui_DIMEN_80.0PX"
  15 + android:layout_height="@dimen/ui_DIMEN_35.0PX"
  16 + android:layout_gravity="center_horizontal"
  17 + android:background="@drawable/home_chat_item_date_bg"
  18 + android:gravity="center"
  19 + android:textColor="#ffffff"
  20 + android:textSize="@dimen/ui_DIMEN_22.0PX"
  21 + android:visibility="gone" />
  22 +
  23 + <RelativeLayout
  24 + android:layout_width="match_parent"
  25 + android:layout_height="wrap_content"
  26 + android:layout_marginLeft="5dp"
  27 + android:layout_marginTop="5dp">
  28 +
  29 + <ImageView
  30 +
  31 + android:id="@+id/chat_item_avatar"
  32 + style="@style/home_chat_item_avatar"
  33 + android:layout_alignParentLeft="true" />
  34 +
  35 + <LinearLayout
  36 + android:id="@+id/ll_item_name_parent"
  37 + android:layout_width="wrap_content"
  38 + android:layout_height="wrap_content"
  39 + android:layout_marginLeft="@dimen/ui_DIMEN_20.0PX"
  40 + android:layout_toRightOf="@id/chat_item_avatar"
  41 + android:orientation="horizontal">
  42 +
  43 + <TextView
  44 + android:id="@+id/chat_item_taacher_bg"
  45 + android:layout_width="wrap_content"
  46 + android:layout_height="wrap_content"
  47 + android:layout_marginRight="@dimen/ui_DIMEN_8.0PX"
  48 + android:background="@drawable/home_chat_teacher_bg"
  49 + android:gravity="center"
  50 + android:paddingLeft="@dimen/ui_DIMEN_10.0PX"
  51 + android:paddingRight="@dimen/ui_DIMEN_10.0PX"
  52 + android:text="老师"
  53 + android:textColor="#ffffff"
  54 + android:textSize="@dimen/ui_DIMEN_20.0PX"
  55 + android:visibility="gone" />
  56 +
  57 + <TextView
  58 + android:id="@+id/chat_item_name"
  59 + android:layout_width="wrap_content"
  60 + android:layout_height="wrap_content"
  61 + android:text=""
  62 + android:textColor="#808080"
  63 + android:textSize="@dimen/ui_DIMEN_22.0PX" />
  64 + </LinearLayout>
  65 +
  66 +
  67 + <RelativeLayout
  68 + android:id="@+id/chat_item_layout_content"
  69 + style="@style/home_chat_item_content"
  70 + android:layout_below="@id/ll_item_name_parent"
  71 + android:layout_centerVertical="true"
  72 + android:layout_marginTop="@dimen/ui_DIMEN_8.0PX"
  73 + android:layout_toRightOf="@id/chat_item_avatar">
  74 +
  75 + <com.mang.xuedianyun.android.widget.emoji.EmoticonsTextView
  76 + android:id="@+id/chat_item_content_text"
  77 + style="@style/home_chat_item_text_content"
  78 + android:layout_centerInParent="true"
  79 + android:background="@drawable/chat_pop_receive"
  80 + android:gravity="start|center_vertical"
  81 + android:paddingLeft="@dimen/ui_DIMEN_20.0PX"
  82 + android:paddingRight="@dimen/ui_DIMEN_10.0PX"
  83 + my:emojiconSize="@dimen/ui_DIMEN_40.0PX"
  84 + tools:text="" />
  85 +
  86 + <ImageView
  87 + android:id="@+id/chat_item_content_image"
  88 + style="@style/home_chat_item_image_content"
  89 + android:visibility="gone" />
  90 + </RelativeLayout>
  91 +
  92 + <ImageView
  93 + android:id="@+id/chat_item_fail"
  94 + android:layout_width="25dp"
  95 + android:layout_height="25dp"
  96 + android:layout_centerVertical="true"
  97 + android:layout_toRightOf="@+id/chat_item_layout_content"
  98 + android:background="@mipmap/msg_state_fail_resend"
  99 + android:focusable="false"
  100 + android:visibility="gone" />
  101 +
  102 + <ProgressBar
  103 + android:id="@+id/chat_item_progress"
  104 + style="@android:style/Widget.ProgressBar.Small.Inverse"
  105 + android:layout_width="wrap_content"
  106 + android:layout_height="wrap_content"
  107 + android:layout_centerVertical="true"
  108 + android:layout_toRightOf="@+id/chat_item_layout_content"
  109 + android:visibility="gone" />
  110 + </RelativeLayout>
  111 +
  112 +</LinearLayout>
@@ -67,7 +67,7 @@ @@ -67,7 +67,7 @@
67 android:layout_toLeftOf="@id/chat_item_avatar" 67 android:layout_toLeftOf="@id/chat_item_avatar"
68 android:gravity="end"> 68 android:gravity="end">
69 69
70 - <com.mang.xdy.demo.widget.emoji.EmoticonsTextView 70 + <com.mang.xuedianyun.android.widget.emoji.EmoticonsTextView
71 android:id="@+id/chat_item_content_text" 71 android:id="@+id/chat_item_content_text"
72 style="@style/home_chat_item_text_content" 72 style="@style/home_chat_item_text_content"
73 android:layout_centerVertical="true" 73 android:layout_centerVertical="true"
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 android:visibility="gone" 33 android:visibility="gone"
34 android:button="@null"/> 34 android:button="@null"/>
35 35
36 - <com.mang.xdy.demo.widget.emoji.EmoticonsEditText 36 + <com.mang.xuedianyun.android.widget.emoji.EmoticonsEditText
37 android:id="@+id/toolbox_et_message" 37 android:id="@+id/toolbox_et_message"
38 android:layout_width="match_parent" 38 android:layout_width="match_parent"
39 android:layout_height="wrap_content" 39 android:layout_height="wrap_content"
@@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
78 android:layout_width="match_parent" 78 android:layout_width="match_parent"
79 android:layout_height="160dp"></android.support.v4.view.ViewPager> 79 android:layout_height="160dp"></android.support.v4.view.ViewPager>
80 80
81 - <com.mang.xdy.demo.widget.chat.PagerSlidingTabStrip 81 + <com.mang.xuedianyun.android.widget.chat.PagerSlidingTabStrip
82 android:id="@+id/toolbox_tabs" 82 android:id="@+id/toolbox_tabs"
83 android:layout_width="match_parent" 83 android:layout_width="match_parent"
84 android:layout_height="40dp" 84 android:layout_height="40dp"
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 android:layout_width="match_parent" 5 android:layout_width="match_parent"
6 android:layout_height="match_parent" 6 android:layout_height="match_parent"
7 android:orientation="vertical" 7 android:orientation="vertical"
8 - tools:context="com.mang.xdy.demo.MainActivity"> 8 + tools:context="com.mang.xuedianyun.android.MainActivity">
9 <RelativeLayout 9 <RelativeLayout
10 android:id="@+id/rl_home_close" 10 android:id="@+id/rl_home_close"
11 android:layout_width="@dimen/ui_DIMEN_98.0PX" 11 android:layout_width="@dimen/ui_DIMEN_98.0PX"
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
44 style="@style/home_input_edit_style" 44 style="@style/home_input_edit_style"
45 android:hint="classId" 45 android:hint="classId"
46 android:inputType="number" 46 android:inputType="number"
47 - android:text="118417229"/> 47 + android:text="1992614331"/>
48 48
49 <View 49 <View
50 style="@style/ui_divider_line_horizontal" 50 style="@style/ui_divider_line_horizontal"
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 android:layout_width="match_parent" 6 android:layout_width="match_parent"
7 android:layout_height="match_parent" 7 android:layout_height="match_parent"
8 android:orientation="vertical" 8 android:orientation="vertical"
9 - tools:context="com.mang.xdy.demo.activity.VideoPlayActivity"> 9 + tools:context="com.mang.xuedianyun.android.activity.VideoPlayActivity">
10 <RelativeLayout 10 <RelativeLayout
11 android:id="@+id/rel_videoPlay_play" 11 android:id="@+id/rel_videoPlay_play"
12 android:layout_width="match_parent" 12 android:layout_width="match_parent"
@@ -21,13 +21,12 @@ @@ -21,13 +21,12 @@
21 android:layout_width="match_parent" 21 android:layout_width="match_parent"
22 android:layout_height="match_parent" 22 android:layout_height="match_parent"
23 /> 23 />
24 - android:layout_width="match_parent"  
25 - android:layout_height="match_parent">  
26 <ImageView 24 <ImageView
27 android:id="@+id/img_playVideo_novideo" 25 android:id="@+id/img_playVideo_novideo"
28 android:layout_width="match_parent" 26 android:layout_width="match_parent"
29 android:layout_height="match_parent" 27 android:layout_height="match_parent"
30 - android:background="@mipmap/novideo" 28 + android:scaleType="fitXY"
  29 + android:background="@mipmap/no_video"
31 /> 30 />
32 <FrameLayout 31 <FrameLayout
33 android:layout_width="match_parent" 32 android:layout_width="match_parent"
@@ -59,6 +58,12 @@ @@ -59,6 +58,12 @@
59 android:layout_alignParentTop="true" 58 android:layout_alignParentTop="true"
60 android:paddingLeft="@dimen/ui_DIMEN_20.0PX" 59 android:paddingLeft="@dimen/ui_DIMEN_20.0PX"
61 android:paddingRight="@dimen/ui_DIMEN_20.0PX"> 60 android:paddingRight="@dimen/ui_DIMEN_20.0PX">
  61 + <LinearLayout
  62 + android:id="@+id/ll_videoPlay_back"
  63 + android:layout_width="wrap_content"
  64 + android:layout_height="wrap_content"
  65 + android:orientation="horizontal"
  66 + >
62 67
63 <ImageView 68 <ImageView
64 android:id="@+id/img_videoPlay_back" 69 android:id="@+id/img_videoPlay_back"
@@ -76,6 +81,7 @@ @@ -76,6 +81,7 @@
76 android:gravity="center" 81 android:gravity="center"
77 android:textColor="@color/white" 82 android:textColor="@color/white"
78 /> 83 />
  84 + </LinearLayout>
79 <TextView 85 <TextView
80 android:id="@+id/tv_videoPlay_className" 86 android:id="@+id/tv_videoPlay_className"
81 style="@style/ui_wrapTvBaseStyle" 87 style="@style/ui_wrapTvBaseStyle"
@@ -95,6 +101,13 @@ @@ -95,6 +101,13 @@
95 android:layout_alignParentRight="true" 101 android:layout_alignParentRight="true"
96 android:layout_alignParentBottom="true" 102 android:layout_alignParentBottom="true"
97 /> 103 />
  104 + <com.pili.pldroid.player.widget.PLVideoTextureView
  105 + android:id="@+id/img_playVideo_pushreplay"
  106 + android:layout_width="120dp"
  107 + android:layout_height="150dp"
  108 + android:layout_alignParentBottom="true"
  109 + android:layout_alignParentRight="true"
  110 + />
98 <ImageView 111 <ImageView
99 android:id="@+id/img_playVideo_publishAudio" 112 android:id="@+id/img_playVideo_publishAudio"
100 android:layout_width="150dp" 113 android:layout_width="150dp"
@@ -164,7 +177,7 @@ @@ -164,7 +177,7 @@
164 custom:tl_textUnselectColor="@color/home_tab_unselected" 177 custom:tl_textUnselectColor="@color/home_tab_unselected"
165 178
166 custom:tl_textsize="@dimen/ui_DIMEN_28.0PX"/> 179 custom:tl_textsize="@dimen/ui_DIMEN_28.0PX"/>
167 - <com.mang.xdy.demo.widget.view.NoScrollViewPager 180 + <com.mang.xuedianyun.android.widget.view.NoScrollViewPager
168 android:id="@+id/viewpager" 181 android:id="@+id/viewpager"
169 android:layout_below="@+id/stl_videoPlay_tab" 182 android:layout_below="@+id/stl_videoPlay_tab"
170 android:layout_width="match_parent" 183 android:layout_width="match_parent"
@@ -172,7 +185,7 @@ @@ -172,7 +185,7 @@
172 android:layout_weight="1" 185 android:layout_weight="1"
173 android:background="@android:color/white" > 186 android:background="@android:color/white" >
174 187
175 - </com.mang.xdy.demo.widget.view.NoScrollViewPager> 188 + </com.mang.xuedianyun.android.widget.view.NoScrollViewPager>
176 189
177 190
178 <FrameLayout 191 <FrameLayout
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 android:layout_width="match_parent" 5 android:layout_width="match_parent"
6 android:layout_height="match_parent" 6 android:layout_height="match_parent"
7 android:orientation="vertical" 7 android:orientation="vertical"
8 - tools:context="com.mang.xdy.demo.activity.VideoPlayActivity"> 8 + tools:context="com.mang.xuedianyun.android.activity.VideoPlayActivity">
9 <RelativeLayout 9 <RelativeLayout
10 android:layout_width="wrap_content" 10 android:layout_width="wrap_content"
11 android:layout_height="wrap_content" 11 android:layout_height="wrap_content"
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 android:background="#ebebeb" 6 android:background="#ebebeb"
7 android:orientation="vertical"> 7 android:orientation="vertical">
8 8
9 - <com.mang.xdy.demo.widget.chat.KJChatKeyboard 9 + <com.mang.xuedianyun.android.widget.chat.KJChatKeyboard
10 android:id="@+id/chat_msg_input_box" 10 android:id="@+id/chat_msg_input_box"
11 android:layout_width="match_parent" 11 android:layout_width="match_parent"
12 android:layout_height="wrap_content" 12 android:layout_height="wrap_content"
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:orientation="vertical" android:layout_width="match_parent" 3 android:orientation="vertical" android:layout_width="match_parent"
4 android:layout_height="match_parent"> 4 android:layout_height="match_parent">
5 - <com.mang.xdy.demo.widget.CanvasView 5 + <com.mang.xuedianyun.android.widget.CanvasView
6 android:id="@+id/canvas_doc_show" 6 android:id="@+id/canvas_doc_show"
7 android:layout_width="wrap_content" 7 android:layout_width="wrap_content"
8 android:layout_height="wrap_content" /> 8 android:layout_height="wrap_content" />
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 xmlns:tools="http://schemas.android.com/tools" 2 xmlns:tools="http://schemas.android.com/tools"
3 android:layout_width="match_parent" 3 android:layout_width="match_parent"
4 android:layout_height="match_parent" 4 android:layout_height="match_parent"
5 - tools:context="com.mang.xdy.demo.fragment.PublishFragment"> 5 + tools:context="com.mang.xuedianyun.android.fragment.PublishFragment">
6 6
7 <!-- TODO: Update blank fragment layout --> 7 <!-- TODO: Update blank fragment layout -->
8 <SurfaceView 8 <SurfaceView
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 -<com.mang.xdy.demo.widget.emoji.EmoticonsTextView 2 +<com.mang.xuedianyun.android.widget.emoji.EmoticonsTextView
3 android:id="@+id/itemEmoji" 3 android:id="@+id/itemEmoji"
4 xmlns:android="http://schemas.android.com/apk/res/android" 4 xmlns:android="http://schemas.android.com/apk/res/android"
5 android:layout_width="33dp" 5 android:layout_width="33dp"
@@ -72,7 +72,7 @@ @@ -72,7 +72,7 @@
72 android:layout_marginTop="@dimen/ui_DIMEN_8.0PX" 72 android:layout_marginTop="@dimen/ui_DIMEN_8.0PX"
73 android:layout_toRightOf="@id/chat_item_avatar"> 73 android:layout_toRightOf="@id/chat_item_avatar">
74 74
75 - <com.mang.xdy.demo.widget.emoji.EmoticonsTextView 75 + <com.mang.xuedianyun.android.widget.emoji.EmoticonsTextView
76 android:id="@+id/chat_item_content_text" 76 android:id="@+id/chat_item_content_text"
77 style="@style/home_chat_item_text_content" 77 style="@style/home_chat_item_text_content"
78 android:layout_centerInParent="true" 78 android:layout_centerInParent="true"
@@ -67,7 +67,7 @@ @@ -67,7 +67,7 @@
67 android:layout_toLeftOf="@id/chat_item_avatar" 67 android:layout_toLeftOf="@id/chat_item_avatar"
68 android:gravity="end"> 68 android:gravity="end">
69 69
70 - <com.mang.xdy.demo.widget.emoji.EmoticonsTextView 70 + <com.mang.xuedianyun.android.widget.emoji.EmoticonsTextView
71 android:id="@+id/chat_item_content_text" 71 android:id="@+id/chat_item_content_text"
72 style="@style/home_chat_item_text_content" 72 style="@style/home_chat_item_text_content"
73 android:layout_centerVertical="true" 73 android:layout_centerVertical="true"
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 android:visibility="gone" 33 android:visibility="gone"
34 android:button="@null"/> 34 android:button="@null"/>
35 35
36 - <com.mang.xdy.demo.widget.emoji.EmoticonsEditText 36 + <com.mang.xuedianyun.android.widget.emoji.EmoticonsEditText
37 android:id="@+id/toolbox_et_message" 37 android:id="@+id/toolbox_et_message"
38 android:layout_width="match_parent" 38 android:layout_width="match_parent"
39 android:layout_height="wrap_content" 39 android:layout_height="wrap_content"
@@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
78 android:layout_width="match_parent" 78 android:layout_width="match_parent"
79 android:layout_height="160dp"></android.support.v4.view.ViewPager> 79 android:layout_height="160dp"></android.support.v4.view.ViewPager>
80 80
81 - <com.mang.xdy.demo.widget.chat.PagerSlidingTabStrip 81 + <com.mang.xuedianyun.android.widget.chat.PagerSlidingTabStrip
82 android:id="@+id/toolbox_tabs" 82 android:id="@+id/toolbox_tabs"
83 android:layout_width="match_parent" 83 android:layout_width="match_parent"
84 android:layout_height="40dp" 84 android:layout_height="40dp"
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:tool="http://schemas.android.com/tools"
  4 +
  5 + android:layout_width="match_parent"
  6 + tool:visibility="visible"
  7 + android:layout_height="match_parent"
  8 + android:orientation="vertical"
  9 + >
  10 + <LinearLayout
  11 + android:id="@+id/ll_exam_spreadOrfold"
  12 + android:layout_width="60dp"
  13 + android:layout_height="60dp"
  14 + android:layout_marginBottom="-20dp"
  15 + android:layout_gravity="right"
  16 + android:visibility="gone"
  17 + android:orientation="vertical">
  18 +
  19 + </LinearLayout>
  20 + <CheckBox
  21 + android:id="@+id/cb_exam_spreadOrfold"
  22 + android:layout_width="45dp"
  23 + android:layout_height="45dp"
  24 + android:layout_marginBottom="-17dp"
  25 + android:layout_gravity="right"
  26 + android:button="@null"
  27 + android:drawableRight="@drawable/selector_exam_fold"/>
  28 + <!--<CheckBox-->
  29 + <!--android:id="@+id/cb_exam_A"-->
  30 + <!--style="@style/exam_cb_style_SingleOrMore"-->
  31 + <!--android:drawableLeft="@drawable/selector_exam"-->
  32 + <!--android:text="A" />-->
  33 + <!--倒计时-->
  34 + <RelativeLayout
  35 + android:layout_width="match_parent"
  36 + android:background="#e3e3e3"
  37 + android:id="@+id/rel_exam_layout"
  38 + android:layout_height="90dp">
  39 + <RelativeLayout
  40 + android:id="@+id/rel_home_tv_exam_countdown"
  41 + android:layout_width="wrap_content"
  42 + android:layout_height="match_parent"
  43 + android:orientation="vertical">
  44 + <TextView
  45 + android:id="@+id/tv_exam_countdown"
  46 + android:layout_width="23dp"
  47 + android:layout_height="15dp"
  48 + android:layout_marginRight="5dp"
  49 + android:layout_alignParentLeft="true"
  50 + android:text="__s"
  51 + android:textSize="12dp"
  52 + android:textColor="@color/actionsheet_red"
  53 + android:background="@color/white"
  54 + />
  55 + </RelativeLayout>
  56 + <RelativeLayout
  57 + android:layout_marginLeft="5dp"
  58 + android:layout_toRightOf="@+id/rel_home_tv_exam_countdown"
  59 + android:layout_width="match_parent"
  60 + android:layout_height="match_parent"
  61 + >
  62 + <!--单选多选-->
  63 + <LinearLayout
  64 + android:id="@+id/ll_exam_SingleOrMore"
  65 + android:layout_width="match_parent"
  66 + android:layout_height="match_parent"
  67 + android:layout_toLeftOf="@+id/ll_exam_submit"
  68 + android:gravity="center"
  69 + android:visibility="gone"
  70 + android:orientation="horizontal"
  71 + >
  72 + <CheckBox
  73 + android:id="@+id/cb_exam_A"
  74 + style="@style/exam_cb_style_SingleOrMore"
  75 + android:drawableLeft="@drawable/selector_exam"
  76 + android:text="A" />
  77 +
  78 + <CheckBox
  79 + android:id="@+id/cb_exam_B"
  80 + style="@style/exam_cb_style_SingleOrMore"
  81 + android:drawableLeft="@drawable/selector_exam"
  82 + android:text="B" />
  83 +
  84 + <CheckBox
  85 + android:id="@+id/cb_exam_C"
  86 + style="@style/exam_cb_style_SingleOrMore"
  87 + android:drawableLeft="@drawable/selector_exam"
  88 + android:text="C" />
  89 +
  90 + <CheckBox
  91 + android:id="@+id/cb_exam_D"
  92 + style="@style/exam_cb_style_SingleOrMore"
  93 + android:drawableLeft="@drawable/selector_exam"
  94 + android:text="D" />
  95 + </LinearLayout>
  96 + <!--对错-->
  97 + <LinearLayout
  98 + android:id="@+id/ll_exam_selectRightOrWrong"
  99 + android:layout_width="match_parent"
  100 + android:layout_height="match_parent"
  101 + android:layout_toLeftOf="@+id/ll_exam_submit"
  102 + android:gravity="center"
  103 + android:visibility="gone"
  104 + tool:visibility="visible"
  105 + android:orientation="horizontal"
  106 + >
  107 + <RadioGroup
  108 + android:layout_width="match_parent"
  109 + android:layout_height="match_parent"
  110 + android:orientation="horizontal"
  111 + >
  112 + <RadioButton
  113 + android:id="@+id/rb_exam_R"
  114 + style="@style/exam_cb_style_RightOrWrong"
  115 + android:drawableLeft="@drawable/selector_exam"
  116 + android:checked="true"
  117 + android:text="对" />
  118 +
  119 + <RadioButton
  120 + android:id="@+id/rb_exam_W"
  121 + style="@style/exam_cb_style_RightOrWrong"
  122 + android:drawableLeft="@drawable/selector_exam"
  123 + android:text="错" />
  124 + </RadioGroup>
  125 + </LinearLayout>
  126 +
  127 + <LinearLayout
  128 + android:id="@+id/ll_exam_filling"
  129 + android:layout_width="match_parent"
  130 + android:layout_height="match_parent"
  131 + android:layout_toLeftOf="@+id/ll_exam_submit"
  132 + android:gravity="center"
  133 + android:visibility="gone"
  134 + android:orientation="horizontal"
  135 + >
  136 + <TextView
  137 + android:layout_width="wrap_content"
  138 + android:layout_height="wrap_content"
  139 + android:layout_weight="1"
  140 + android:hint="一"
  141 + />
  142 + <TextView
  143 + android:layout_width="wrap_content"
  144 + android:layout_height="wrap_content"
  145 + android:layout_weight="1"
  146 + android:hint="二"
  147 + />
  148 +
  149 + <EditText
  150 + android:layout_width="20dp"
  151 + android:layout_height="wrap_content"
  152 + android:layout_weight="1"
  153 + android:maxLength="20"
  154 + android:singleLine="true"
  155 + android:hint="输入答案"
  156 + />
  157 + </LinearLayout>
  158 +
  159 +
  160 + <!--答案-->
  161 + <LinearLayout
  162 + android:id="@+id/ll_exam_answer"
  163 + android:layout_width="match_parent"
  164 + android:layout_height="match_parent"
  165 + android:layout_toLeftOf="@+id/ll_exam_submit"
  166 + android:gravity="center|left"
  167 + android:visibility="gone"
  168 + tool:visibility="visible"
  169 + android:orientation="vertical"
  170 + >
  171 + <LinearLayout
  172 + android:layout_width="wrap_content"
  173 + android:layout_height="wrap_content"
  174 + android:orientation="horizontal">
  175 + <TextView
  176 + android:layout_width="wrap_content"
  177 + android:layout_height="wrap_content"
  178 + android:text="我的答案:"
  179 + />
  180 +
  181 + <LinearLayout
  182 + android:id="@+id/ll_exam_Myanswer"
  183 + android:layout_width="wrap_content"
  184 + android:layout_height="wrap_content"
  185 + android:gravity="center"
  186 + android:orientation="horizontal">
  187 + </LinearLayout>
  188 + </LinearLayout>
  189 + <LinearLayout
  190 + android:layout_width="match_parent"
  191 + android:layout_height="wrap_content"
  192 + android:layout_marginTop="5dp"
  193 + android:orientation="horizontal">
  194 + <TextView
  195 + android:layout_width="wrap_content"
  196 + android:layout_height="wrap_content"
  197 + android:text="正确答案:"
  198 + />
  199 + <TextView
  200 + android:layout_width="wrap_content"
  201 + android:layout_height="wrap_content"
  202 + android:layout_centerInParent="true"
  203 + android:layout_margin="4dp"
  204 + android:background="@mipmap/lv_bj"
  205 + android:gravity="center"
  206 + android:textColor="@android:color/white"
  207 + android:text="C"
  208 + android:visibility="gone"
  209 + />
  210 + <LinearLayout
  211 + android:id="@+id/ll_exam_Correctanswer"
  212 + android:layout_width="wrap_content"
  213 + android:layout_height="wrap_content"
  214 + android:gravity="center"
  215 + android:orientation="horizontal">
  216 + </LinearLayout>
  217 +
  218 + <TextView
  219 + android:layout_width="wrap_content"
  220 + android:layout_height="wrap_content"
  221 + android:layout_marginLeft="10dp"
  222 + android:text="正确率:"
  223 + />
  224 + <TextView
  225 + android:layout_width="wrap_content"
  226 + android:layout_height="wrap_content"
  227 + android:text="20%"
  228 + />
  229 + </LinearLayout>
  230 +
  231 + </LinearLayout>
  232 + <!--提交-->
  233 + <LinearLayout
  234 + android:id="@+id/ll_exam_submit"
  235 + android:layout_width="100dp"
  236 + android:layout_height="match_parent"
  237 + android:orientation="horizontal"
  238 + android:gravity="center"
  239 + android:layout_marginLeft="10dp"
  240 + android:layout_alignParentRight="true"
  241 + >
  242 + <TextView
  243 + android:id="@+id/tv_exam_up"
  244 + android:layout_width="wrap_content"
  245 + android:layout_height="wrap_content"
  246 +
  247 + android:text="提交"
  248 + android:layout_gravity="center_vertical"
  249 + android:textColor="@android:color/white"
  250 + android:background="@drawable/shape_bg_full_circle_blue"
  251 + android:layout_marginRight="10dp"
  252 + android:textSize="12sp"
  253 + />
  254 + <TextView
  255 + android:id="@+id/tv_exam_cancle"
  256 + android:layout_width="wrap_content"
  257 + android:layout_height="wrap_content"
  258 + android:text="放弃"
  259 + android:layout_gravity="center_vertical"
  260 + android:textColor="@android:color/white"
  261 + android:background="@drawable/shape_bg_full_circle_grey"
  262 + android:layout_marginRight="8dp"
  263 + android:textSize="12sp"
  264 + />
  265 + </LinearLayout>
  266 + </RelativeLayout>
  267 + </RelativeLayout>
  268 + </LinearLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:orientation="vertical" android:layout_width="match_parent"
  4 + android:background="#e3e3e3"
  5 + android:layout_height="match_parent">
  6 + <TextView
  7 + android:layout_width="match_parent"
  8 + android:text="wo jiusldjflkdjf"
  9 + android:layout_height="wrap_content" />
  10 +</LinearLayout>
@@ -30,6 +30,8 @@ @@ -30,6 +30,8 @@
30 <string name="home_title_back">Back</string> 30 <string name="home_title_back">Back</string>
31 <string name="home_msg_play_audio_init">Audio playback initialization</string> 31 <string name="home_msg_play_audio_init">Audio playback initialization</string>
32 <string name="home_msg_play_video_init">Video playback initialization</string> 32 <string name="home_msg_play_video_init">Video playback initialization</string>
  33 +
  34 + <string name="imge_load_error">Pictures for failure</string>
33 <!--登录--> 35 <!--登录-->
34 <string name="main_login_error_classId">Please enter class number</string> 36 <string name="main_login_error_classId">Please enter class number</string>
35 <string name="main_login_error_portal">Please enter portal</string> 37 <string name="main_login_error_portal">Please enter portal</string>
@@ -30,6 +30,8 @@ @@ -30,6 +30,8 @@
30 <string name="home_title_back">返回</string> 30 <string name="home_title_back">返回</string>
31 <string name="home_msg_play_audio_init">音频播放初始化</string> 31 <string name="home_msg_play_audio_init">音频播放初始化</string>
32 <string name="home_msg_play_video_init">视频播放初始化</string> 32 <string name="home_msg_play_video_init">视频播放初始化</string>
  33 +
  34 + <string name="imge_load_error">图片获取失败</string>
33 <!--登录--> 35 <!--登录-->
34 <string name="main_login_error_classId">课堂Id不能为空</string> 36 <string name="main_login_error_classId">课堂Id不能为空</string>
35 <string name="main_login_error_portal">服务器地址不能为空</string> 37 <string name="main_login_error_portal">服务器地址不能为空</string>
  1 +<resources>
  2 + <string name="dialog_cancle">cancel</string>
  3 +</resources>
1 -package com.mang.xdy; 1 +package com.mang.xuedianyun;
2 2
3 import android.content.Context; 3 import android.content.Context;
4 import android.support.test.InstrumentationRegistry; 4 import android.support.test.InstrumentationRegistry;
1 -/*  
2 - * SmartPlayer.java  
3 - * SmartPlayer  
4 - *  
5 - * Github: https://github.com/daniulive/SmarterStreaming  
6 - * WebSite: http://www.daniulive.com  
7 - *  
8 - * Created by DaniuLive on 2015/09/26.  
9 - * Copyright © 2014~2017 DaniuLive. All rights reserved.  
10 - */  
11 -  
12 -package com.daniulive.smartplayer;  
13 -  
14 -import java.nio.ByteBuffer;  
15 -  
16 -import android.app.Activity;  
17 -import android.app.AlertDialog;  
18 -import android.content.Context;  
19 -import android.content.DialogInterface;  
20 -import android.content.res.Configuration;  
21 -import android.os.Bundle;  
22 -import android.util.Log;  
23 -import android.view.SurfaceView;  
24 -  
25 -import android.view.View;  
26 -import android.view.ViewGroup.LayoutParams;  
27 -import android.widget.Button;  
28 -import android.widget.EditText;  
29 -import android.widget.FrameLayout;  
30 -import android.widget.LinearLayout;  
31 -import android.widget.RelativeLayout;  
32 -import android.widget.TextView;  
33 -  
34 -import com.eventhandle.SmartEventCallback;  
35 -import com.videoengine.*;  
36 -  
37 -public class SmartPlayer extends Activity {  
38 -  
39 - private SurfaceView sSurfaceView = null;  
40 -  
41 - private long playerHandle = 0;  
42 -  
43 - private static final int PORTRAIT = 1; //竖屏  
44 - private static final int LANDSCAPE = 2; //横屏  
45 - private static final String TAG = "SmartPlayer";  
46 -  
47 - private SmartPlayerJni libPlayer = null;  
48 -  
49 - private int currentOrigentation = PORTRAIT;  
50 -  
51 - private boolean isPlaybackViewStarted = false;  
52 -  
53 - private String playbackUrl = null;  
54 -  
55 - private boolean isMute = false;  
56 -  
57 - private boolean isHardwareDecoder = false;  
58 -  
59 - Button btnPopInputText;  
60 - Button btnPopInputUrl;  
61 - Button btnMute;  
62 - Button btnStartStopPlayback;  
63 - Button btnHardwareDecoder;  
64 - TextView txtCopyright;  
65 - TextView txtQQQun;  
66 -  
67 - LinearLayout lLayout = null;  
68 - FrameLayout fFrameLayout = null;  
69 -  
70 - private Context myContext;  
71 - String url="rtmp://player.daniulive.com:1935/hls/stream";  
72 - static {  
73 - System.loadLibrary("SmartPlayer");  
74 - }  
75 -  
76 - @Override protected void onCreate(Bundle icicle) {  
77 - super.onCreate(icicle);  
78 - url=getIntent().getStringExtra("url");  
79 - Log.i(TAG, "Run into OnCreate++");  
80 - Log.e("URl",url+"");  
81 - libPlayer = new SmartPlayerJni();  
82 -  
83 - myContext = this.getApplicationContext();  
84 -  
85 - boolean bViewCreated = CreateView();  
86 -  
87 - if(bViewCreated){  
88 - inflateLayout(LinearLayout.VERTICAL);  
89 - }  
90 - }  
91 -  
92 - /* For smartplayer demo app, the url is based on: baseURL + inputID  
93 - * For example:  
94 - * baseURL: rtmp://player.daniulive.com:1935/hls/stream  
95 - * inputID: 123456  
96 - * playbackUrl: rtmp://player.daniulive.com:1935/hls/stream123456  
97 - * */  
98 - private void GenerateURL(String id){  
99 - if(id == null)  
100 - return;  
101 -  
102 - if(id.equals("hks"))  
103 - {  
104 - playbackUrl = "rtmp://live.hkstv.hk.lxdns.com/live/hks";  
105 - return;  
106 - }  
107 -  
108 - btnStartStopPlayback.setEnabled(true);  
109 -// String baseURL = "rtmp://player.daniulive.com:1935/hls/stream";  
110 - String baseURL = url;  
111 -  
112 - playbackUrl = baseURL + id;  
113 - }  
114 -  
115 - private void SaveInputUrl(String url)  
116 - {  
117 - playbackUrl = "";  
118 -  
119 - if ( url == null )  
120 - return;  
121 -  
122 - // rtmp:/  
123 - if ( url.length() < 8 )  
124 - {  
125 - Log.e(TAG, "Input full url error:" + url);  
126 - return;  
127 - }  
128 -  
129 - if ( !url.startsWith("rtmp://") && !url.startsWith("rtsp://"))  
130 - {  
131 - Log.e(TAG, "Input full url error:" + url);  
132 - return;  
133 - }  
134 -  
135 - btnStartStopPlayback.setEnabled(true);  
136 - playbackUrl = url;  
137 -  
138 - Log.i(TAG, "Input full url:" + url);  
139 - }  
140 -  
141 - /* Popup InputID dialog */  
142 - private void PopDialog(){  
143 - final EditText inputID = new EditText(this);  
144 - inputID.setFocusable(true);  
145 -  
146 - AlertDialog.Builder builder = new AlertDialog.Builder(this);  
147 - builder.setTitle("如 rtmp://player.daniulive.com:1935/hls/stream123456,请输入123456").setView(inputID).setNegativeButton(  
148 - "取消", null);  
149 - builder.setPositiveButton("确认", new DialogInterface.OnClickListener() {  
150 -  
151 - public void onClick(DialogInterface dialog, int which) {  
152 -// String strID = inputID.getText().toString() ;  
153 - String strID = url;  
154 - GenerateURL(strID);  
155 - }  
156 - });  
157 - builder.show();  
158 - }  
159 -  
160 -  
161 - private void PopFullUrlDialog(){  
162 - final EditText inputUrlTxt = new EditText(this);  
163 - inputUrlTxt.setFocusable(true);  
164 - inputUrlTxt.setText(url+"");  
165 -  
166 - AlertDialog.Builder builderUrl = new AlertDialog.Builder(this);  
167 - builderUrl.setTitle(""+url).setView(inputUrlTxt).setNegativeButton(  
168 - "取消", null);  
169 - builderUrl.setPositiveButton("确认", new DialogInterface.OnClickListener() {  
170 -  
171 - public void onClick(DialogInterface dialog, int which) {  
172 - //TODO 这个位置是修改的  
173 - String fullUrl =url;  
174 -// String fullUrl = inputUrlTxt.getText().toString();  
175 - SaveInputUrl(fullUrl);  
176 - }  
177 - });  
178 - builderUrl.show();  
179 - }  
180 -  
181 - /* Generate basic layout */  
182 - private void inflateLayout(int orientation) {  
183 - if (null == lLayout)  
184 - lLayout = new LinearLayout(this);  
185 -  
186 - addContentView(lLayout, new LayoutParams(LayoutParams.WRAP_CONTENT,  
187 - LayoutParams.WRAP_CONTENT));  
188 -  
189 - lLayout.setOrientation(orientation);  
190 -  
191 - fFrameLayout = new FrameLayout(this);  
192 -  
193 - LayoutParams lp = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT, 1.0f);  
194 - fFrameLayout.setLayoutParams(lp);  
195 - Log.i(TAG, "++inflateLayout..");  
196 -  
197 - sSurfaceView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));  
198 -  
199 - fFrameLayout.addView(sSurfaceView, 0);  
200 -  
201 - RelativeLayout outLinearLayout = new RelativeLayout(this);  
202 - outLinearLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT));  
203 -  
204 - LinearLayout lLinearLayout = new LinearLayout(this);  
205 - lLinearLayout.setOrientation(LinearLayout.VERTICAL);  
206 - lLinearLayout.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));  
207 -  
208 -  
209 - LinearLayout copyRightLinearLayout = new LinearLayout(this);  
210 - copyRightLinearLayout.setOrientation(LinearLayout.VERTICAL);  
211 - RelativeLayout.LayoutParams rl = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);  
212 - rl.topMargin = getWindowManager().getDefaultDisplay().getHeight()-270;  
213 - copyRightLinearLayout.setLayoutParams(rl);  
214 -  
215 - txtCopyright=new TextView(this);  
216 - txtCopyright.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));  
217 - txtCopyright.setText("Copyright 2014~2016 www.daniulive.com v1.0.16.0326");  
218 - copyRightLinearLayout.addView(txtCopyright, 0);  
219 -  
220 - txtQQQun=new TextView(this);  
221 - txtQQQun.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));  
222 - txtQQQun.setText("学点云");  
223 - copyRightLinearLayout.addView(txtQQQun, 1);  
224 -  
225 - /* PopInput button */  
226 - btnPopInputText = new Button(this);  
227 - btnPopInputText.setText("输入urlID");  
228 - btnPopInputText.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));  
229 - lLinearLayout.addView(btnPopInputText, 0);  
230 -  
231 - btnPopInputUrl = new Button(this);  
232 - btnPopInputUrl.setText("输入完整url");  
233 - btnPopInputUrl.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));  
234 - lLinearLayout.addView(btnPopInputUrl, 1);  
235 -  
236 - /*mute button */  
237 - isMute = false;  
238 - btnMute = new Button(this);  
239 - btnMute.setText("静音 ");  
240 - btnMute.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));  
241 - lLinearLayout.addView(btnMute, 2);  
242 -  
243 - /*hardware decoder button */  
244 - isHardwareDecoder = false;  
245 - btnHardwareDecoder = new Button(this);  
246 - btnHardwareDecoder.setText("当前软解码");  
247 - btnHardwareDecoder.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));  
248 - lLinearLayout.addView(btnHardwareDecoder, 3);  
249 -  
250 - /* Start playback stream button */  
251 - btnStartStopPlayback = new Button(this);  
252 - btnStartStopPlayback.setText("开始播放 ");  
253 - btnStartStopPlayback.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));  
254 - lLinearLayout.addView(btnStartStopPlayback, 4);  
255 -  
256 -  
257 - outLinearLayout.addView(lLinearLayout, 0);  
258 - outLinearLayout.addView(copyRightLinearLayout, 1);  
259 - fFrameLayout.addView(outLinearLayout, 1);  
260 -  
261 - lLayout.addView(fFrameLayout, 0);  
262 -  
263 - if(isPlaybackViewStarted)  
264 - {  
265 - btnPopInputText.setEnabled(false);  
266 - btnPopInputUrl.setEnabled(false);  
267 - btnHardwareDecoder.setEnabled(false);  
268 - btnStartStopPlayback.setText("停止播放 ");  
269 - }  
270 - else  
271 - {  
272 - btnPopInputText.setEnabled(true);  
273 - btnPopInputUrl.setEnabled(true);  
274 - btnHardwareDecoder.setEnabled(true);  
275 - btnStartStopPlayback.setText("开始播放 ");  
276 - }  
277 -  
278 - /* PopInput button listener */  
279 - btnPopInputText.setOnClickListener(new Button.OnClickListener() {  
280 -  
281 - // @Override  
282 - public void onClick(View v) {  
283 - Log.i(TAG, "Run into input playback ID++");  
284 -  
285 - PopDialog();  
286 -  
287 - Log.i(TAG, "Run out from input playback ID--");  
288 - }  
289 - });  
290 -  
291 -  
292 - btnPopInputUrl.setOnClickListener(new Button.OnClickListener() {  
293 - public void onClick(View v) {  
294 - PopFullUrlDialog();  
295 - }  
296 - });  
297 -  
298 - btnMute.setOnClickListener(new Button.OnClickListener()  
299 - {  
300 - public void onClick(View v) {  
301 - isMute = !isMute;  
302 -  
303 - if ( isMute )  
304 - {  
305 - btnMute.setText("取消静音");  
306 - }  
307 - else  
308 - {  
309 - btnMute.setText("静音");  
310 - }  
311 -  
312 - if ( playerHandle != 0 )  
313 - {  
314 - libPlayer.SmartPlayerSetMute(playerHandle, isMute?1:0);  
315 - }  
316 - }  
317 - });  
318 -  
319 - btnHardwareDecoder.setOnClickListener(new Button.OnClickListener()  
320 - {  
321 - public void onClick(View v) {  
322 - isHardwareDecoder = !isHardwareDecoder;  
323 -  
324 - if ( isHardwareDecoder )  
325 - {  
326 - btnHardwareDecoder.setText("当前硬解码");  
327 - }  
328 - else  
329 - {  
330 - btnHardwareDecoder.setText("当前软解码");  
331 - }  
332 -  
333 - }  
334 - });  
335 -  
336 - btnStartStopPlayback.setOnClickListener(new Button.OnClickListener() {  
337 -  
338 - // @Override  
339 - public void onClick(View v) {  
340 -  
341 - if(isPlaybackViewStarted)  
342 - {  
343 - Log.i(TAG, "Stop playback stream++");  
344 - btnStartStopPlayback.setText("开始播放 ");  
345 - btnPopInputText.setEnabled(true);  
346 - btnPopInputUrl.setEnabled(true);  
347 - btnHardwareDecoder.setEnabled(true);  
348 - libPlayer.SmartPlayerClose(playerHandle);  
349 - playerHandle = 0;  
350 - isPlaybackViewStarted = false;  
351 - Log.i(TAG, "Stop playback stream--");  
352 - }  
353 - else  
354 - {  
355 - Log.i(TAG, "Start playback stream++");  
356 -  
357 - playerHandle = libPlayer.SmartPlayerInit(myContext);  
358 -  
359 - if(playerHandle == 0)  
360 - {  
361 - Log.e(TAG, "surfaceHandle with nil..");  
362 - return;  
363 - }  
364 -  
365 - libPlayer.SetSmartPlayerEventCallback(playerHandle, new EventHande());  
366 -  
367 - libPlayer.SmartPlayerSetSurface(playerHandle, sSurfaceView); //if set the second param with null, it means it will playback audio only..  
368 -  
369 - // libPlayer.SmartPlayerSetSurface(playerHandle, null);  
370 -  
371 - // External Render test  
372 - //libPlayer.SmartPlayerSetExternalRender(playerHandle, new RGBAExternalRender());  
373 - //libPlayer.SmartPlayerSetExternalRender(playerHandle, new I420ExternalRender());  
374 -  
375 - libPlayer.SmartPlayerSetAudioOutputType(playerHandle, 0);  
376 -  
377 - libPlayer.SmartPlayerSetBuffer(playerHandle, 200);  
378 -  
379 - if ( isMute )  
380 - {  
381 - libPlayer.SmartPlayerSetMute(playerHandle, isMute?1:0);  
382 - }  
383 -  
384 - if( isHardwareDecoder )  
385 - {  
386 - Log.i(TAG, "check isHardwareDecoder: " + isHardwareDecoder);  
387 -  
388 - int hwChecking = libPlayer.SetSmartPlayerVideoHWDecoder(playerHandle, isHardwareDecoder?1:0);  
389 -  
390 - Log.i(TAG, "[daniulive] hwChecking: " + hwChecking);  
391 - }  
392 -  
393 - //It only used when playback RTSP stream..  
394 - // libPlayer.SmartPlayerSetRTSPTcpMode(playerHandle, 1);  
395 -  
396 - //playbackUrl = "rtmp://live.hkstv.hk.lxdns.com/live/hks";  
397 -  
398 - //playbackUrl = "rtsp://rtsp-v3-spbtv.msk.spbtv.com/spbtv_v3_1/214_110.sdp";  
399 -  
400 - //playbackUrl = "rtmp://10.2.68.91:1935/hls/stream8";  
401 -  
402 - if(playbackUrl == null){  
403 - Log.e(TAG, "playback URL with NULL...");  
404 - return;  
405 - }  
406 -  
407 - int iPlaybackRet = libPlayer.SmartPlayerStartPlayback(playerHandle, playbackUrl);  
408 -  
409 - if(iPlaybackRet != 0)  
410 - {  
411 - Log.e(TAG, "StartPlayback strem failed..");  
412 - return;  
413 - }  
414 -  
415 - btnStartStopPlayback.setText("停止播放 ");  
416 - btnPopInputText.setEnabled(false);  
417 - btnPopInputUrl.setEnabled(false);  
418 - btnHardwareDecoder.setEnabled(false);  
419 - isPlaybackViewStarted = true;  
420 - Log.i(TAG, "Start playback stream--");  
421 - }  
422 - }  
423 - });  
424 - }  
425 -  
426 -  
427 - public static final String bytesToHexString(byte[] buffer)  
428 - {  
429 - StringBuffer sb = new StringBuffer(buffer.length);  
430 - String temp;  
431 -  
432 - for (int i = 0; i < buffer.length; ++i)  
433 - {  
434 - temp = Integer.toHexString(0xff&buffer[i]);  
435 - if (temp.length() < 2)  
436 - sb.append(0);  
437 -  
438 - sb.append(temp);  
439 - }  
440 -  
441 - return sb.toString();  
442 - }  
443 -  
444 - class RGBAExternalRender implements NTExternalRender  
445 - {  
446 - //public static final int NT_FRAME_FORMAT_RGBA = 1;  
447 - //public static final int NT_FRAME_FORMAT_ABGR = 2;  
448 - //public static final int NT_FRAME_FORMAT_I420 = 3;  
449 -  
450 - private int width_ = 0;  
451 - private int height_ = 0;  
452 - private int row_bytes_ = 0;  
453 - private ByteBuffer rgba_buffer_ = null;  
454 -  
455 - @Override  
456 - public int getNTFrameFormat()  
457 - {  
458 - Log.i(TAG, "RGBAExternalRender::getNTFrameFormat return "+ NT_FRAME_FORMAT_RGBA);  
459 - return NT_FRAME_FORMAT_RGBA;  
460 - }  
461 -  
462 - @Override  
463 - public void onNTFrameSizeChanged(int width, int height)  
464 - {  
465 - width_ = width;  
466 - height_ = height;  
467 -  
468 - row_bytes_ = width_ * 4;  
469 -  
470 - Log.i(TAG, "RGBAExternalRender::onNTFrameSizeChanged width_:" + width_ + " height_:" + height_);  
471 -  
472 - rgba_buffer_ = ByteBuffer.allocateDirect(row_bytes_*height_);  
473 - }  
474 -  
475 - @Override  
476 - public ByteBuffer getNTPlaneByteBuffer(int index)  
477 - {  
478 - if ( index == 0 )  
479 - {  
480 - return rgba_buffer_;  
481 - }  
482 - else  
483 - {  
484 - Log.e(TAG, "RGBAExternalRender::getNTPlaneByteBuffer index error:" + index);  
485 - return null;  
486 - }  
487 - }  
488 -  
489 - @Override  
490 - public int getNTPlanePerRowBytes(int index)  
491 - {  
492 - if ( index == 0 )  
493 - {  
494 - return row_bytes_;  
495 - }  
496 - else  
497 - {  
498 - Log.e(TAG, "RGBAExternalRender::getNTPlanePerRowBytes index error:" + index);  
499 - return 0;  
500 - }  
501 - }  
502 -  
503 - public void onNTRenderFrame()  
504 - {  
505 - if( rgba_buffer_ == null )  
506 - return;  
507 -  
508 - rgba_buffer_.rewind();  
509 -  
510 - // copy buffer  
511 -  
512 - // test  
513 - // byte[] test_buffer = new byte[16];  
514 - // rgba_buffer_.get(test_buffer);  
515 -  
516 - //Log.i(TAG, "RGBAExternalRender:onNTRenderFrame rgba:" + bytesToHexString(test_buffer));  
517 - }  
518 - }  
519 -  
520 - class I420ExternalRender implements NTExternalRender  
521 - {  
522 - //public static final int NT_FRAME_FORMAT_RGBA = 1;  
523 - //public static final int NT_FRAME_FORMAT_ABGR = 2;  
524 - //public static final int NT_FRAME_FORMAT_I420 = 3;  
525 -  
526 - private int width_ = 0;  
527 - private int height_ = 0;  
528 -  
529 - private int y_row_bytes_ = 0;  
530 - private int u_row_bytes_ = 0;  
531 - private int v_row_bytes_ = 0;  
532 -  
533 - private ByteBuffer y_buffer_ = null;  
534 - private ByteBuffer u_buffer_ = null;  
535 - private ByteBuffer v_buffer_ = null;  
536 -  
537 - @Override  
538 - public int getNTFrameFormat()  
539 - {  
540 - Log.i(TAG, "I420ExternalRender::getNTFrameFormat return "+ NT_FRAME_FORMAT_I420);  
541 - return NT_FRAME_FORMAT_I420;  
542 - }  
543 -  
544 - @Override  
545 - public void onNTFrameSizeChanged(int width, int height)  
546 - {  
547 - width_ = width;  
548 - height_ = height;  
549 -  
550 - y_row_bytes_ = (width_ + 15) & (~15);  
551 - u_row_bytes_ = ((width_+1)/2 + 15) & (~15);  
552 - v_row_bytes_ = ((width_+1)/2 + 15) & (~15);  
553 -  
554 - y_buffer_ = ByteBuffer.allocateDirect(y_row_bytes_*height_);  
555 - u_buffer_ = ByteBuffer.allocateDirect(u_row_bytes_*(height_+1)/2);  
556 - v_buffer_ = ByteBuffer.allocateDirect(v_row_bytes_*(height_+1)/2);  
557 -  
558 - Log.i(TAG, "I420ExternalRender::onNTFrameSizeChanged width_="  
559 - + width_ + " height_=" + height_  
560 - + " y_row_bytes_=" + y_row_bytes_  
561 - + " u_row_bytes_=" + u_row_bytes_  
562 - + " v_row_bytes_=" + v_row_bytes_);  
563 - }  
564 -  
565 - @Override  
566 - public ByteBuffer getNTPlaneByteBuffer(int index)  
567 - {  
568 - if ( index == 0 )  
569 - {  
570 - return y_buffer_;  
571 - }  
572 - else if ( index == 1 )  
573 - {  
574 - return u_buffer_;  
575 - }  
576 - else if ( index == 2 )  
577 - {  
578 - return v_buffer_;  
579 - }  
580 - else  
581 - {  
582 - Log.e(TAG, "I420ExternalRender::getNTPlaneByteBuffer index error:" + index);  
583 - return null;  
584 - }  
585 - }  
586 -  
587 - @Override  
588 - public int getNTPlanePerRowBytes(int index)  
589 - {  
590 - if ( index == 0 )  
591 - {  
592 - return y_row_bytes_;  
593 - }  
594 - else if ( index == 1)  
595 - {  
596 - return u_row_bytes_;  
597 - }  
598 - else if (index == 2 )  
599 - {  
600 - return v_row_bytes_;  
601 - }  
602 - else  
603 - {  
604 - Log.e(TAG, "I420ExternalRender::getNTPlanePerRowBytes index error:" + index);  
605 - return 0;  
606 - }  
607 - }  
608 -  
609 - public void onNTRenderFrame()  
610 - {  
611 - if ( y_buffer_ == null )  
612 - return;  
613 -  
614 - if ( u_buffer_ == null )  
615 - return;  
616 -  
617 - if ( v_buffer_ == null )  
618 - return;  
619 -  
620 -  
621 - y_buffer_.rewind();  
622 -  
623 - u_buffer_.rewind();  
624 -  
625 - v_buffer_.rewind();  
626 -  
627 - // copy buffer  
628 -  
629 - // test  
630 - // byte[] test_buffer = new byte[16];  
631 - // y_buffer_.get(test_buffer);  
632 -  
633 - // Log.i(TAG, "I420ExternalRender::onNTRenderFrame y data:" + bytesToHexString(test_buffer));  
634 -  
635 - // u_buffer_.get(test_buffer);  
636 - // Log.i(TAG, "I420ExternalRender::onNTRenderFrame u data:" + bytesToHexString(test_buffer));  
637 -  
638 - // v_buffer_.get(test_buffer);  
639 - // Log.i(TAG, "I420ExternalRender::onNTRenderFrame v data:" + bytesToHexString(test_buffer));  
640 - }  
641 - }  
642 -  
643 -  
644 - class EventHande implements SmartEventCallback  
645 - {  
646 - @Override  
647 - public void onCallback(int code, long param1, long param2, String param3, String param4, Object param5){  
648 - switch (code) {  
649 - case EVENTID.EVENT_DANIULIVE_ERC_PLAYER_STARTED:  
650 - Log.i(TAG, "开始。。");  
651 - break;  
652 - case EVENTID.EVENT_DANIULIVE_ERC_PLAYER_CONNECTING:  
653 - Log.i(TAG, "连接中。。");  
654 - break;  
655 - case EVENTID.EVENT_DANIULIVE_ERC_PLAYER_CONNECTION_FAILED:  
656 - Log.i(TAG, "连接失败。。");  
657 - break;  
658 - case EVENTID.EVENT_DANIULIVE_ERC_PLAYER_CONNECTED:  
659 - Log.i(TAG, "连接成功。。");  
660 - break;  
661 - case EVENTID.EVENT_DANIULIVE_ERC_PLAYER_DISCONNECTED:  
662 - Log.i(TAG, "连接断开。。");  
663 - break;  
664 - case EVENTID.EVENT_DANIULIVE_ERC_PLAYER_STOP:  
665 - Log.i(TAG, "关闭。。");  
666 - break;  
667 - case EVENTID.EVENT_DANIULIVE_ERC_PLAYER_RESOLUTION_INFO:  
668 - Log.i(TAG, "分辨率信息: width: " + param1 + ", height: " + param2);  
669 - break;  
670 - case EVENTID.EVENT_DANIULIVE_ERC_PLAYER_NO_MEDIADATA_RECEIVED:  
671 - Log.i(TAG, "收不到媒体数据,可能是url错误。。");  
672 - }  
673 - }  
674 - }  
675 -  
676 - /* Create rendering */  
677 - private boolean CreateView() {  
678 -  
679 - if(sSurfaceView == null)  
680 - {  
681 - /*  
682 - * useOpenGLES2:  
683 - * If with true: Check if system supports openGLES, if supported, it will choose openGLES.  
684 - * If with false: it will set with default surfaceView;  
685 - */  
686 - sSurfaceView = NTRenderer.CreateRenderer(this, true);  
687 - }  
688 -  
689 - if(sSurfaceView == null)  
690 - {  
691 - Log.i(TAG, "Create render failed..");  
692 - return false;  
693 - }  
694 -  
695 - return true;  
696 - }  
697 -  
698 - @Override  
699 - public void onConfigurationChanged(Configuration newConfig) {  
700 - super.onConfigurationChanged(newConfig);  
701 -  
702 - Log.i(TAG, "Run into onConfigurationChanged++");  
703 -  
704 - if (null != fFrameLayout)  
705 - {  
706 - fFrameLayout.removeAllViews();  
707 - fFrameLayout = null;  
708 - }  
709 -  
710 - if (null != lLayout)  
711 - {  
712 - lLayout.removeAllViews();  
713 - lLayout = null;  
714 - }  
715 -  
716 - if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE)  
717 - {  
718 - Log.i(TAG, "onConfigurationChanged, with LANDSCAPE。。");  
719 -  
720 - inflateLayout(LinearLayout.HORIZONTAL);  
721 -  
722 - currentOrigentation = LANDSCAPE;  
723 - }  
724 - else  
725 - {  
726 - Log.i(TAG, "onConfigurationChanged, with PORTRAIT。。");  
727 -  
728 - inflateLayout(LinearLayout.VERTICAL);  
729 -  
730 - currentOrigentation = PORTRAIT;  
731 - }  
732 -  
733 - if(!isPlaybackViewStarted)  
734 - return;  
735 -  
736 - libPlayer.SmartPlayerSetOrientation(playerHandle, currentOrigentation);  
737 -  
738 - Log.i(TAG, "Run out of onConfigurationChanged--");  
739 - }  
740 -  
741 - @Override  
742 - protected void onDestroy()  
743 - {  
744 - Log.i(TAG, "Run into activity destory++");  
745 -  
746 - if(playerHandle!=0)  
747 - {  
748 - libPlayer.SmartPlayerClose(playerHandle);  
749 - playerHandle = 0;  
750 - }  
751 - super.onDestroy();  
752 - finish();  
753 -// System.exit(0);  
754 - }  
755 -}  
@@ -23,6 +23,15 @@ public class VideoPlayBean { @@ -23,6 +23,15 @@ public class VideoPlayBean {
23 private String rtmpUrl; 23 private String rtmpUrl;
24 private String replay; 24 private String replay;
25 private int seek; 25 private int seek;
  26 + private String userRole;
  27 +
  28 + public String getUserRole() {
  29 + return userRole;
  30 + }
  31 +
  32 + public void setUserRole(String userRole) {
  33 + this.userRole = userRole;
  34 + }
26 35
27 public int getMediaId() { 36 public int getMediaId() {
28 return mediaId; 37 return mediaId;
@@ -79,4 +88,18 @@ public class VideoPlayBean { @@ -79,4 +88,18 @@ public class VideoPlayBean {
79 public void setSeek(int seek) { 88 public void setSeek(int seek) {
80 this.seek = seek; 89 this.seek = seek;
81 } 90 }
  91 +
  92 + @Override
  93 + public String toString() {
  94 + return "VideoPlayBean{" +
  95 + "mediaId=" + mediaId +
  96 + ", fromNodeId=" + fromNodeId +
  97 + ", userName='" + userName + '\'' +
  98 + ", m3u8Url='" + m3u8Url + '\'' +
  99 + ", rtmpUrl='" + rtmpUrl + '\'' +
  100 + ", replay='" + replay + '\'' +
  101 + ", seek=" + seek +
  102 + ", userRole='" + userRole + '\'' +
  103 + '}';
  104 + }
82 } 105 }
@@ -182,6 +182,11 @@ public interface Constants { @@ -182,6 +182,11 @@ public interface Constants {
182 * 开始录制回放 182 * 开始录制回放
183 */ 183 */
184 String START_RECORD_PLAY_BACK="startRecordPlayback"; 184 String START_RECORD_PLAY_BACK="startRecordPlayback";
  185 + /**
  186 + * 主持人角色
  187 + */
  188 + String HOST="host";
  189 +
185 String UN_PUBLISH_VIDEO="unPublishVideo"; 190 String UN_PUBLISH_VIDEO="unPublishVideo";
186 /*Context为空的时候给出的提示*/ 191 /*Context为空的时候给出的提示*/
187 String ERROR_CONTENT_NULL="Xdy,init context is null"; 192 String ERROR_CONTENT_NULL="Xdy,init context is null";
@@ -7,20 +7,14 @@ package com.mang.xdy.core; @@ -7,20 +7,14 @@ package com.mang.xdy.core;
7 import android.content.Context; 7 import android.content.Context;
8 import android.graphics.Bitmap; 8 import android.graphics.Bitmap;
9 import android.os.Build; 9 import android.os.Build;
10 -import android.text.NoCopySpan;  
11 -import android.text.TextUtils;  
12 import android.webkit.JavascriptInterface; 10 import android.webkit.JavascriptInterface;
13 import android.webkit.ValueCallback; 11 import android.webkit.ValueCallback;
14 import android.webkit.WebChromeClient; 12 import android.webkit.WebChromeClient;
15 -import android.webkit.WebResourceError;  
16 -import android.webkit.WebResourceRequest;  
17 import android.webkit.WebSettings; 13 import android.webkit.WebSettings;
18 import android.webkit.WebView; 14 import android.webkit.WebView;
19 import android.webkit.WebViewClient; 15 import android.webkit.WebViewClient;
20 16
21 -import com.mang.xdy.common.Constants;  
22 import com.mang.xdy.utils.XdyLogUtil; 17 import com.mang.xdy.utils.XdyLogUtil;
23 -import com.mang.xdy.utils.XdyStringUtils;  
24 18
25 /** 19 /**
26 * 数据的异常检测都放在最外层(便于给用户提示),这层默认数据都是完整 20 * 数据的异常检测都放在最外层(便于给用户提示),这层默认数据都是完整
@@ -125,10 +119,10 @@ public class XdyJsCore { @@ -125,10 +119,10 @@ public class XdyJsCore {
125 @JavascriptInterface 119 @JavascriptInterface
126 public void _js2native(String id,String parmp){ 120 public void _js2native(String id,String parmp){
127 /* _native2js("接口名称","参数为JOSN字符串")*/ 121 /* _native2js("接口名称","参数为JOSN字符串")*/
128 - // XdyLogUtil.e("s3sjs2native","id:"+id+" parmp:"+parmp);  
129 - if(mOnXdyAsyncMessageListener !=null){  
130 - mOnXdyAsyncMessageListener.getSdyAsyncMessageListener(id,parmp);  
131 - } 122 + XdyLogUtil.e("s3sjs2native","id:"+id+" parmp:"+parmp);
  123 +// if(mOnXdyAsyncMessageListener !=null){
  124 +// mOnXdyAsyncMessageListener.getSdyAsyncMessageListener(id,parmp);
  125 +// }
132 XdySdk.getXdyInstance().notifyObserver(id, parmp); 126 XdySdk.getXdyInstance().notifyObserver(id, parmp);
133 } 127 }
134 } 128 }
@@ -10,22 +10,22 @@ import android.view.SurfaceView; @@ -10,22 +10,22 @@ import android.view.SurfaceView;
10 10
11 import com.eventhandle.SmartEventCallback; 11 import com.eventhandle.SmartEventCallback;
12 import com.google.gson.Gson; 12 import com.google.gson.Gson;
13 -import com.mang.xdy.bean.AudioPlayBean;  
14 -import com.mang.xdy.bean.ErrorCodeEntity;  
15 import com.mang.xdy.bean.GetPublishPathReceiveBean; 13 import com.mang.xdy.bean.GetPublishPathReceiveBean;
16 import com.mang.xdy.bean.PublisherSuccessEntity; 14 import com.mang.xdy.bean.PublisherSuccessEntity;
17 -import com.mang.xdy.bean.PublisherVideoReturnBean;  
18 import com.mang.xdy.bean.VideoPlayBean; 15 import com.mang.xdy.bean.VideoPlayBean;
19 -import com.mang.xdy.cache.ACache;  
20 import com.mang.xdy.common.Constants; 16 import com.mang.xdy.common.Constants;
21 import com.mang.xdy.listener.ObserverListener; 17 import com.mang.xdy.listener.ObserverListener;
22 import com.mang.xdy.listener.SubjectListener; 18 import com.mang.xdy.listener.SubjectListener;
23 -import com.mang.xdy.message.MsgManage;  
24 import com.mang.xdy.play.XdyPlayer; 19 import com.mang.xdy.play.XdyPlayer;
25 -import com.mang.xdy.play.XdyPublisher;  
26 import com.mang.xdy.utils.JsonUtil; 20 import com.mang.xdy.utils.JsonUtil;
27 -import com.mang.xdy.utils.NetWorkUtils;  
28 import com.mang.xdy.utils.PlayerUtils; 21 import com.mang.xdy.utils.PlayerUtils;
  22 +import com.mang.xdy.bean.AudioPlayBean;
  23 +import com.mang.xdy.bean.ErrorCodeEntity;
  24 +import com.mang.xdy.bean.PublisherVideoReturnBean;
  25 +import com.mang.xdy.cache.ACache;
  26 +import com.mang.xdy.message.MsgManage;
  27 +import com.mang.xdy.play.XdyPublisher;
  28 +import com.mang.xdy.utils.NetWorkUtils;
29 import com.mang.xdy.utils.XdyLogUtil; 29 import com.mang.xdy.utils.XdyLogUtil;
30 import com.mang.xdy.utils.XdyStringUtils; 30 import com.mang.xdy.utils.XdyStringUtils;
31 31
@@ -35,16 +35,12 @@ import org.json.JSONObject; @@ -35,16 +35,12 @@ import org.json.JSONObject;
35 import java.util.ArrayList; 35 import java.util.ArrayList;
36 import java.util.List; 36 import java.util.List;
37 37
38 -import static com.mang.xdy.utils.PlayerUtils.getPublishPathAudio;  
39 -import static com.mang.xdy.utils.PlayerUtils.getPublishPathVideo;  
40 -  
41 /** 38 /**
42 - * 对外调用的接口  
43 - * Created by abao on 2017/3/31. 39 + * 对外调用的接
44 * 受原先的文档设计的规则,所有方法的都是静态的方法,影响性能 40 * 受原先的文档设计的规则,所有方法的都是静态的方法,影响性能
45 * 考虑跟换文档,提升性能 41 * 考虑跟换文档,提升性能
46 */ 42 */
47 -public class XdySdk implements SubjectListener{ 43 +public class XdySdk implements SubjectListener {
48 /** 44 /**
49 * 用户初始化,还是调用各种方法,都需要统一的对外给出监听事件 45 * 用户初始化,还是调用各种方法,都需要统一的对外给出监听事件
50 */ 46 */
@@ -78,6 +74,9 @@ public class XdySdk implements SubjectListener{ @@ -78,6 +74,9 @@ public class XdySdk implements SubjectListener{
78 private String publish_url=""; 74 private String publish_url="";
79 /*保存nodeid ,自己的唯一标识*/ 75 /*保存nodeid ,自己的唯一标识*/
80 private int mNodeId =0; 76 private int mNodeId =0;
  77 + /*z正在播放视频 onStop 重置状态,是否是Host 在播放视频,这个优先级最高,1v1 产物*/
  78 + private boolean isCurrentVideoHost=false;
  79 + private boolean isCurrentAudioHost=false;
81 80
82 @Override 81 @Override
83 public void add(ObserverListener observerListener) { 82 public void add(ObserverListener observerListener) {
@@ -106,7 +105,7 @@ public class XdySdk implements SubjectListener{ @@ -106,7 +105,7 @@ public class XdySdk implements SubjectListener{
106 @Override 105 @Override
107 public void handleMessage(Message msg) { 106 public void handleMessage(Message msg) {
108 super.handleMessage(msg); 107 super.handleMessage(msg);
109 - if(msg.what==Constants.LEAVE_CLASS_CODE){ 108 + if(msg.what== Constants.LEAVE_CLASS_CODE){
110 if(!NetWorkUtils.isNetworkConnected(mContext)) { 109 if(!NetWorkUtils.isNetworkConnected(mContext)) {
111 if (mXdySdk != null) { 110 if (mXdySdk != null) {
112 mXdySdk.onPublisherStop(); 111 mXdySdk.onPublisherStop();
@@ -147,8 +146,12 @@ public class XdySdk implements SubjectListener{ @@ -147,8 +146,12 @@ public class XdySdk implements SubjectListener{
147 break; 146 break;
148 case "stopAudio": 147 case "stopAudio":
149 //停止播放audio() 148 //停止播放audio()
  149 + isCurrentAudioHost=false;
  150 + onPlayDestroy();
  151 + break;
150 case"stopVideo": 152 case"stopVideo":
151 //停止播放video( 停止播放:根据api) 153 //停止播放video( 停止播放:根据api)
  154 + isCurrentVideoHost=false;
152 onPlayDestroy(); 155 onPlayDestroy();
153 break; 156 break;
154 } 157 }
@@ -187,13 +190,22 @@ public class XdySdk implements SubjectListener{ @@ -187,13 +190,22 @@ public class XdySdk implements SubjectListener{
187 XdyLogUtil.e(TAG,"Play Audio Can not find this mediaId"); 190 XdyLogUtil.e(TAG,"Play Audio Can not find this mediaId");
188 return; 191 return;
189 } 192 }
190 - currentPlayId=mediaId;  
191 - AudioPlayBean audioPlayBean=JsonUtil.parseJsonToBean(json_audio,AudioPlayBean.class); 193 +
  194 + AudioPlayBean audioPlayBean= JsonUtil.parseJsonToBean(json_audio,AudioPlayBean.class);
192 if(audioPlayBean!=null) { 195 if(audioPlayBean!=null) {
193 String play_url_audio=""; 196 String play_url_audio="";
194 if(isRecordPlayBack){ 197 if(isRecordPlayBack){
195 //如果是回放给出。m3u8的id用户 用户需要自己获取play_url_audio=audioPlayBean.getReplay(); 198 //如果是回放给出。m3u8的id用户 用户需要自己获取play_url_audio=audioPlayBean.getReplay();
196 }else{ 199 }else{
  200 + //如果是host权限的在播放,下次在播放必须是host
  201 + if(isCurrentAudioHost){
  202 + if(!Constants.HOST.equals(audioPlayBean.getUserRole())){
  203 + return;
  204 + }
  205 + }
  206 + if(Constants.HOST.equals(audioPlayBean.getUserRole())){
  207 + isCurrentAudioHost=true;
  208 + }
197 play_url_audio=audioPlayBean.getRtmpUrl() ; 209 play_url_audio=audioPlayBean.getRtmpUrl() ;
198 if(mXdyPlayer ==null) { 210 if(mXdyPlayer ==null) {
199 mXdyPlayer = XdyPlayer.getXdyPlayerCore(play_url_audio, activity); 211 mXdyPlayer = XdyPlayer.getXdyPlayerCore(play_url_audio, activity);
@@ -201,6 +213,7 @@ public class XdySdk implements SubjectListener{ @@ -201,6 +213,7 @@ public class XdySdk implements SubjectListener{
201 mXdyPlayer.onStopPlay(); 213 mXdyPlayer.onStopPlay();
202 } 214 }
203 mXdyPlayer.playAudio(play_url_audio, new EventHande_Play()); 215 mXdyPlayer.playAudio(play_url_audio, new EventHande_Play());
  216 + currentPlayId=mediaId;
204 } 217 }
205 218
206 }else{ 219 }else{
@@ -216,13 +229,22 @@ public class XdySdk implements SubjectListener{ @@ -216,13 +229,22 @@ public class XdySdk implements SubjectListener{
216 XdyLogUtil.e(TAG,"Play Video Can not find this mediaId"); 229 XdyLogUtil.e(TAG,"Play Video Can not find this mediaId");
217 return; 230 return;
218 } 231 }
219 - currentPlayId=mediaId; 232 +
220 VideoPlayBean videoPlayBean=JsonUtil.parseJsonToBean(json_video,VideoPlayBean.class); 233 VideoPlayBean videoPlayBean=JsonUtil.parseJsonToBean(json_video,VideoPlayBean.class);
221 if(videoPlayBean!=null){ 234 if(videoPlayBean!=null){
222 String play_url_video=""; 235 String play_url_video="";
223 if(isRecordPlayBack){ 236 if(isRecordPlayBack){
224 // play_url_video=videoPlayBean.getReplay(); 237 // play_url_video=videoPlayBean.getReplay();
225 }else{ 238 }else{
  239 + //如果是host权限的在播放,下次在播放必须是host
  240 + if(isCurrentVideoHost){
  241 + if(!Constants.HOST.equals(videoPlayBean.getUserRole())){
  242 + return;
  243 + }
  244 + }
  245 + if(Constants.HOST.equals(videoPlayBean.getUserRole())){
  246 + isCurrentVideoHost=true;
  247 + }
226 play_url_video=videoPlayBean.getRtmpUrl(); 248 play_url_video=videoPlayBean.getRtmpUrl();
227 if(mXdyPlayer ==null) { 249 if(mXdyPlayer ==null) {
228 mXdyPlayer = XdyPlayer.getXdyPlayerCore(play_url_video, activity); 250 mXdyPlayer = XdyPlayer.getXdyPlayerCore(play_url_video, activity);
@@ -231,6 +253,7 @@ public class XdySdk implements SubjectListener{ @@ -231,6 +253,7 @@ public class XdySdk implements SubjectListener{
231 mXdyPlayer.onStopPlay(); 253 mXdyPlayer.onStopPlay();
232 } 254 }
233 mXdyPlayer.playVideo(play_url_video, surfaceView,new EventHande_Play()); 255 mXdyPlayer.playVideo(play_url_video, surfaceView,new EventHande_Play());
  256 + currentPlayId=mediaId;
234 } 257 }
235 258
236 }else{ 259 }else{
@@ -245,13 +268,13 @@ public class XdySdk implements SubjectListener{ @@ -245,13 +268,13 @@ public class XdySdk implements SubjectListener{
245 * 2,判断地址时候有用,有用的话打开播放器,开启推流的过程 268 * 2,判断地址时候有用,有用的话打开播放器,开启推流的过程
246 * 3,推流成功告知后台,和用户 269 * 3,推流成功告知后台,和用户
247 */ 270 */
248 - getPublishPathVideo(); 271 + PlayerUtils.getPublishPathVideo();
249 mSurfaceView_Publish=surfaceView; 272 mSurfaceView_Publish=surfaceView;
250 mActivity=activity; 273 mActivity=activity;
251 break; 274 break;
252 case Constants.PUBLISH_AUDIO: 275 case Constants.PUBLISH_AUDIO:
253 //只推送音频 276 //只推送音频
254 - getPublishPathAudio(); 277 + PlayerUtils.getPublishPathAudio();
255 mActivity=activity; 278 mActivity=activity;
256 break; 279 break;
257 280
@@ -301,7 +324,6 @@ public class XdySdk implements SubjectListener{ @@ -301,7 +324,6 @@ public class XdySdk implements SubjectListener{
301 audio 324 audio
302 plublisher Video 325 plublisher Video
303 publisher Audio 326 publisher Audio
304 -  
305 */ 327 */
306 switch (type) { 328 switch (type) {
307 case Constants.CLASS_JOIN_SUCCESS: 329 case Constants.CLASS_JOIN_SUCCESS:
@@ -530,6 +552,10 @@ public class XdySdk implements SubjectListener{ @@ -530,6 +552,10 @@ public class XdySdk implements SubjectListener{
530 mXdyPlayer.onStopPlay(); 552 mXdyPlayer.onStopPlay();
531 // mXdyPlayer = null; 553 // mXdyPlayer = null;
532 554
  555 + isCurrentAudioHost=false;
  556 + isCurrentVideoHost=false;
  557 +
  558 +
533 } 559 }
534 return true; 560 return true;
535 } 561 }
@@ -545,6 +571,8 @@ public class XdySdk implements SubjectListener{ @@ -545,6 +571,8 @@ public class XdySdk implements SubjectListener{
545 if(mXdyJsCore!=null&&!isRecordPlayBack) { 571 if(mXdyJsCore!=null&&!isRecordPlayBack) {
546 mXdyJsCore.init(mContext); 572 mXdyJsCore.init(mContext);
547 } 573 }
  574 + isCurrentVideoHost=false;
  575 + isCurrentAudioHost=false;
548 onPublisherStop(); 576 onPublisherStop();
549 } 577 }
550 578
  1 +package com.mang.xdy.utils;
  2 +
  3 +import android.content.Context;
  4 +import android.content.SharedPreferences;
  5 +
  6 +import java.io.ByteArrayOutputStream;
  7 +import java.io.IOException;
  8 +import java.io.InputStream;
  9 +
  10 +
  11 +public class SPUtil {
  12 + private static SharedPreferences mSp;
  13 +
  14 + private static SharedPreferences getSharedPreferences(Context context) {
  15 + if (mSp == null) {
  16 + mSp = context.getSharedPreferences("config", Context.MODE_PRIVATE);
  17 + }
  18 + return mSp;
  19 + }
  20 +
  21 + public static void putBoolean(Context context, String key, boolean value) {
  22 + // SharedPreferences sp = mContext.getSharedPreferences("config",
  23 + // Context.MODE_PRIVATE);
  24 + getSharedPreferences(context).edit().putBoolean(key, value).commit();
  25 + }
  26 +
  27 + public static boolean getBoolean(Context context, String key, boolean defValue) {
  28 + // SharedPreferences sp = mContext.getSharedPreferences("config",
  29 + // Context.MODE_PRIVATE);
  30 + return getSharedPreferences(context).getBoolean(key, defValue);
  31 + }
  32 +
  33 + public static void putString(Context context, String key, String value) {
  34 + getSharedPreferences(context).edit().putString(key, value).commit();
  35 + }
  36 +
  37 + public static String getString(Context context, String key, String defValue) {
  38 + return getSharedPreferences(context).getString(key, defValue);
  39 + }
  40 +
  41 + public static void putInt(Context context, String key, int value) {
  42 + getSharedPreferences(context).edit().putInt(key, value).commit();
  43 + }
  44 +
  45 + public static int getInt(Context context, String key, int defValue) {
  46 + return getSharedPreferences(context).getInt(key, defValue);
  47 + }
  48 +
  49 + /**
  50 + * 移除一个字符串值
  51 + *
  52 + * @param context
  53 + * @param key
  54 + */
  55 + public static void removeString(Context context, String key) {
  56 + getSharedPreferences(context).edit().remove(key).commit();
  57 + }
  58 +
  59 + /**
  60 + * 把流里的内容解析成字符串
  61 + *
  62 + * @param is
  63 + * @return
  64 + * @throws IOException
  65 + */
  66 + public static String streamToString(InputStream is) throws IOException {
  67 + ByteArrayOutputStream baos = new ByteArrayOutputStream();
  68 + byte[] buffer = new byte[1024];
  69 + int len = -1;
  70 + while ((len = is.read(buffer)) != -1) {
  71 + baos.write(buffer, 0, len);
  72 + }
  73 + String string = baos.toString();
  74 + baos.close();
  75 + is.close();
  76 + return string;
  77 + }
  78 + public static long getLong(String key,long defValue) {
  79 + return mSp.getLong(key, defValue);
  80 + }
  81 + public static void setLong(Context context, String key, Long value) {
  82 + getSharedPreferences(context).edit().putLong(key, value).commit();
  83 + }
  84 +}