正在显示
100 个修改的文件
包含
1277 行增加
和
292 行删除
| @@ -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 | <?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. |
| @@ -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 |
| @@ -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.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.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.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; | ||
| 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; |
| @@ -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.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; |
MyApplication/XdyDemo/src/main/java/com/mang/xuedianyun/android/widget/dialog/AnswText.java
0 → 100644
| 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; |
| @@ -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.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.7 KB
1.7 KB
2.3 KB
2.0 KB
1.6 KB
2.7 KB
| 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 | +<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 | + <!--<!–内边距–>--> | ||
| 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> |
-
请 注册 或 登录 后发表评论