迁移项目

This commit is contained in:
2025-12-10 23:03:26 +08:00
parent 28fe161276
commit 51890e9432
67 changed files with 2461 additions and 985 deletions

View File

@@ -1,16 +1,22 @@
apply plugin: 'com.android.application'
plugins {
alias(libs.plugins.android.application)
}
android {
compileSdkVersion 26
buildToolsVersion '28.0.3'
namespace "org.easydarwin.easyplayer"
compileSdk {
version = release(36)
}
defaultConfig {
applicationId "org.easydarwin.easyplayer"
minSdkVersion 19
targetSdkVersion 26
applicationId "org.easydarwin.easyplayer.pro"
minSdk 28
targetSdk 36
versionCode 14210703
versionName "1.4.21.0703"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
if (project.hasProperty('PLAYER_KEY')) {
buildConfigField 'String', 'PLAYER_KEY', PLAYER_KEY
} else {
@@ -19,44 +25,27 @@ android {
}
ndk {
//设置支持的SO库架构
// abiFilters 'armeabi', 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
abiFilters 'x86', 'armeabi-v7a'
abiFilters 'armeabi-v7a'/*, 'arm64-v8a'*/
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
}
dataBinding {
enabled = true
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
flavorDimensions "prod"
productFlavors {
pro {
applicationId "org.easydarwin.easyplayer.pro"
dimension "prod"
}
/*fastPro {
applicationId "org.easydarwin.easyplayer.pro"
dimension "prod"
}*/
/*njjl {
applicationId "org.easydarwin.easyplayer.pro"
dimension "prod"
}*/
}
//签名配置
signingConfigs {
buildFeatures {
buildConfig true
viewBinding true
dataBinding true
}
android.applicationVariants.all { variant ->
@@ -66,32 +55,19 @@ android {
}
}
repositories {
flatDir {
dirs 'libs'
}
mavenCentral()
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation files('libs/gson-2.1.jar')
implementation "com.android.support:appcompat-v7:${support_version}"
implementation "com.android.support:support-v4:${support_version}"
implementation "com.android.support:preference-v7:${support_version}"
implementation "com.android.support:design:${support_version}"
implementation "com.android.support:cardview-v7:${support_version}"
// implementation 'com.writingminds:FFmpegAndroid:0.3.2'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.github.chrisbanes:PhotoView:1.3.0'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.budiyev.android:code-scanner:1.9.4'
testImplementation 'junit:junit:4.12'
implementation libs.androidx.core.ktx
implementation libs.androidx.appcompat
implementation libs.androidx.constraintlayout
implementation libs.androidx.recyclerview
implementation libs.androidx.swiperefreshlayout
implementation libs.material.components
implementation libs.glide
implementation libs.code.scanner
implementation project(':ijkplayer-java')
implementation project(':photoview')
testImplementation libs.junit
androidTestImplementation libs.androidx.junit
androidTestImplementation libs.androidx.espresso.core
}

Binary file not shown.

View File

@@ -1,30 +1,21 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in D:\software\adt-bundle-windows-x86_64-20140702\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# 忽略警告
-ignorewarning
-keepclassmembers class org.easydarwin.video.EasyRTSPClient {
public *;
}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
-keepclassmembers class org.easydarwin.video.RTSPClient {
private void onRTSPSourceCallBack(int, int, int, byte[], byte[]);
}
-keepclassmembers class org.easydarwin.video.RTSPClient$FrameInfo{
*;
}
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@@ -1,13 +0,0 @@
package org.esaydarwin.rtsp.player;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}

View File

@@ -33,10 +33,14 @@ import android.opengl.GLES20;
import android.opengl.Matrix;
import android.os.Build;
import android.os.Environment;
import android.test.AndroidTestCase;
import android.util.Log;
import android.view.Surface;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
@@ -66,8 +70,8 @@ import java.nio.FloatBuffer;
* (This was derived from bits and pieces of CTS tests, and is packaged as such, but is not
* currently part of CTS.)
*/
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
public class CameraToMpegTest extends AndroidTestCase {
@RunWith(AndroidJUnit4.class)
public class CameraToMpegTest {
private static final String TAG = "CameraToMpegTest";
private static final boolean VERBOSE = false; // lots of logging
@@ -104,45 +108,41 @@ public class CameraToMpegTest extends AndroidTestCase {
// allocate one of these up front so we don't need to do it every time
private MediaCodec.BufferInfo mBufferInfo;
/** test entry point */
public void testEncodeCameraToMp4() throws Throwable {
CameraToMpegWrapper.runTest(this);
/**
* Attempts to find a preview size that matches the provided width and height (which
* specify the dimensions of the encoded video). If it fails to find a match it just
* uses the default preview size.
* <p>
* TODO: should do a best-fit match.
*/
private static void choosePreviewSize(Camera.Parameters parms, int width, int height) {
// We should make sure that the requested MPEG size is less than the preferred
// size, and has the same aspect ratio.
Camera.Size ppsfv = parms.getPreferredPreviewSizeForVideo();
if (VERBOSE && ppsfv != null) {
Log.d(TAG, "Camera preferred preview size for video is " +
ppsfv.width + "x" + ppsfv.height);
}
for (Camera.Size size : parms.getSupportedPreviewSizes()) {
if (size.width == width && size.height == height) {
parms.setPreviewSize(width, height);
return;
}
}
Log.w(TAG, "Unable to set preview size to " + width + "x" + height);
if (ppsfv != null) {
parms.setPreviewSize(ppsfv.width, ppsfv.height);
}
}
/**
* Wraps encodeCameraToMpeg(). This is necessary because SurfaceTexture will try to use
* the looper in the current thread if one exists, and the CTS tests create one on the
* test thread.
*
* The wrapper propagates exceptions thrown by the worker thread back to the caller.
* test entry point
*/
private static class CameraToMpegWrapper implements Runnable {
private Throwable mThrowable;
private CameraToMpegTest mTest;
private CameraToMpegWrapper(CameraToMpegTest test) {
mTest = test;
}
@Override
public void run() {
try {
mTest.encodeCameraToMpeg();
} catch (Throwable th) {
mThrowable = th;
}
}
/** Entry point. */
public static void runTest(CameraToMpegTest obj) throws Throwable {
CameraToMpegWrapper wrapper = new CameraToMpegWrapper(obj);
Thread th = new Thread(wrapper, "codec test");
th.start();
th.join();
if (wrapper.mThrowable != null) {
throw wrapper.mThrowable;
}
}
@Test
public void testEncodeCameraToMp4() throws Throwable {
CameraToMpegWrapper.runTest(this);
}
/**
@@ -261,35 +261,6 @@ public class CameraToMpegTest extends AndroidTestCase {
Log.d(TAG, "Camera preview size is " + size.width + "x" + size.height);
}
/**
* Attempts to find a preview size that matches the provided width and height (which
* specify the dimensions of the encoded video). If it fails to find a match it just
* uses the default preview size.
* <p>
* TODO: should do a best-fit match.
*/
private static void choosePreviewSize(Camera.Parameters parms, int width, int height) {
// We should make sure that the requested MPEG size is less than the preferred
// size, and has the same aspect ratio.
Camera.Size ppsfv = parms.getPreferredPreviewSizeForVideo();
if (VERBOSE && ppsfv != null) {
Log.d(TAG, "Camera preferred preview size for video is " +
ppsfv.width + "x" + ppsfv.height);
}
for (Camera.Size size : parms.getSupportedPreviewSizes()) {
if (size.width == width && size.height == height) {
parms.setPreviewSize(width, height);
return;
}
}
Log.w(TAG, "Unable to set preview size to " + width + "x" + height);
if (ppsfv != null) {
parms.setPreviewSize(ppsfv.width, ppsfv.height);
}
}
/**
* Stops camera preview, and releases the camera to the system.
*/
@@ -497,6 +468,43 @@ public class CameraToMpegTest extends AndroidTestCase {
}
}
/**
* Wraps encodeCameraToMpeg(). This is necessary because SurfaceTexture will try to use
* the looper in the current thread if one exists, and the CTS tests create one on the
* test thread.
* <p>
* The wrapper propagates exceptions thrown by the worker thread back to the caller.
*/
private static class CameraToMpegWrapper implements Runnable {
private Throwable mThrowable;
private CameraToMpegTest mTest;
private CameraToMpegWrapper(CameraToMpegTest test) {
mTest = test;
}
/**
* Entry point.
*/
public static void runTest(CameraToMpegTest obj) throws Throwable {
CameraToMpegWrapper wrapper = new CameraToMpegWrapper(obj);
Thread th = new Thread(wrapper, "codec test");
th.start();
th.join();
if (wrapper.mThrowable != null) {
throw wrapper.mThrowable;
}
}
@Override
public void run() {
try {
mTest.encodeCameraToMpeg();
} catch (Throwable th) {
mThrowable = th;
}
}
}
/**
* Holds state associated with a Surface used for MediaCodec encoder input.
@@ -754,16 +762,6 @@ public class CameraToMpegTest extends AndroidTestCase {
private static final int TRIANGLE_VERTICES_DATA_STRIDE_BYTES = 5 * FLOAT_SIZE_BYTES;
private static final int TRIANGLE_VERTICES_DATA_POS_OFFSET = 0;
private static final int TRIANGLE_VERTICES_DATA_UV_OFFSET = 3;
private final float[] mTriangleVerticesData = {
// X, Y, Z, U, V
-1.0f, -1.0f, 0, 0.f, 0.f,
1.0f, -1.0f, 0, 1.f, 0.f,
-1.0f, 1.0f, 0, 0.f, 1.f,
1.0f, 1.0f, 0, 1.f, 1.f,
};
private FloatBuffer mTriangleVertices;
private static final String VERTEX_SHADER =
"uniform mat4 uMVPMatrix;\n" +
"uniform mat4 uSTMatrix;\n" +
@@ -774,7 +772,6 @@ public class CameraToMpegTest extends AndroidTestCase {
" gl_Position = uMVPMatrix * aPosition;\n" +
" vTextureCoord = (uSTMatrix * aTextureCoord).xy;\n" +
"}\n";
private static final String FRAGMENT_SHADER =
"#extension GL_OES_EGL_image_external : require\n" +
"precision mediump float;\n" + // highp here doesn't seem to matter
@@ -783,7 +780,14 @@ public class CameraToMpegTest extends AndroidTestCase {
"void main() {\n" +
" gl_FragColor = texture2D(sTexture, vTextureCoord);\n" +
"}\n";
private final float[] mTriangleVerticesData = {
// X, Y, Z, U, V
-1.0f, -1.0f, 0, 0.f, 0.f,
1.0f, -1.0f, 0, 1.f, 0.f,
-1.0f, 1.0f, 0, 0.f, 1.f,
1.0f, 1.0f, 0, 1.f, 1.f,
};
private FloatBuffer mTriangleVertices;
private float[] mMVPMatrix = new float[16];
private float[] mSTMatrix = new float[16];
@@ -796,13 +800,19 @@ public class CameraToMpegTest extends AndroidTestCase {
public STextureRender() {
mTriangleVertices = ByteBuffer.allocateDirect(
mTriangleVerticesData.length * FLOAT_SIZE_BYTES)
mTriangleVerticesData.length * FLOAT_SIZE_BYTES)
.order(ByteOrder.nativeOrder()).asFloatBuffer();
mTriangleVertices.put(mTriangleVerticesData).position(0);
Matrix.setIdentityM(mSTMatrix, 0);
}
public static void checkLocation(int location, String label) {
if (location < 0) {
throw new RuntimeException("Unable to locate '" + label + "' in program");
}
}
public int getTextureId() {
return mTextureID;
}
@@ -952,11 +962,5 @@ public class CameraToMpegTest extends AndroidTestCase {
throw new RuntimeException(op + ": glError " + error);
}
}
public static void checkLocation(int location, String label) {
if (location < 0) {
throw new RuntimeException("Unable to locate '" + label + "' in program");
}
}
}
}

View File

@@ -1,18 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.easydarwin.easyplayer">
xmlns:tools="http://schemas.android.com/tools">
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="32"
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
<application
android:name=".TheApp"
@@ -20,6 +27,7 @@
android:icon="@mipmap/ic_launcher_foreground"
android:label="@string/app_name"
android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme">
<meta-data
@@ -31,6 +39,7 @@
<activity
android:name=".PlayListActivity"
android:exported="true"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -50,15 +59,18 @@
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/FullscreenTheme" />
<activity
android:name=".AboutActivity" />
<activity android:name=".AboutActivity" />
<activity
android:name=".SettingsActivity"
android:label="@string/title_activity_settings" />
<activity android:name=".MediaFilesActivity" android:label="文件夹"/>
<activity android:name=".ScanQRActivity" android:label="扫码"/>
<activity
android:name=".MediaFilesActivity"
android:label="文件夹" />
<activity
android:name=".ScanQRActivity"
android:label="扫码" />
</application>

View File

@@ -1,17 +1,18 @@
package org.easydarwin.easyplayer;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import org.easydarwin.easyplayer.databinding.ActivityAboutBinding;
import org.easydarwin.easyplayer.views.ProVideoView;
@@ -43,7 +44,7 @@ public class AboutActivity extends AppCompatActivity implements View.OnClickList
binding.version.setText("EasyPlayer Pro播放器");
binding.version.append("(");
long activeDays = ProVideoView.getActiveDays(this,BuildConfig.PLAYER_KEY);
long activeDays = ProVideoView.getActiveDays(this, BuildConfig.PLAYER_KEY);
SpannableString ss;
if (activeDays >= 9999) {
@@ -76,20 +77,17 @@ public class AboutActivity extends AppCompatActivity implements View.OnClickList
@Override
public void onClick(View v) {
Intent intent= new Intent();
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
Uri content_url = Uri.parse("http://www.easydarwin.org");
switch (v.getId()) {
case R.id.darwin_content_tv:
content_url = Uri.parse("http://www.easydarwin.org");
break;
case R.id.dss_content_tv:
content_url = Uri.parse("http://www.easydss.com");
break;
case R.id.nvr_content_tv:
content_url = Uri.parse("http://www.easynvr.com");
break;
int id = v.getId();
if (id == R.id.darwin_content_tv) {
content_url = Uri.parse("http://www.easydarwin.org");
} else if (id == R.id.dss_content_tv) {
content_url = Uri.parse("http://www.easydss.com");
} else if (id == R.id.nvr_content_tv) {
content_url = Uri.parse("http://www.easynvr.com");
}
intent.setData(content_url);

View File

@@ -1,13 +1,8 @@
package org.easydarwin.easyplayer;
import android.databinding.DataBindingUtil;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
@@ -15,12 +10,19 @@ import android.text.style.RelativeSizeSpan;
import android.view.MenuItem;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentPagerAdapter;
import org.easydarwin.easyplayer.databinding.ActivityMediaFilesBinding;
import org.easydarwin.easyplayer.fragments.LocalFileFragment;
/**
* 录像和截图
* */
*
*/
public class MediaFilesActivity extends AppCompatActivity {
private ActivityMediaFilesBinding mDataBinding;

View File

@@ -1,22 +1,17 @@
package org.easydarwin.easyplayer;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.databinding.DataBindingUtil;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
@@ -27,8 +22,15 @@ import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.bumptech.glide.Glide;
import com.bumptech.glide.signature.StringSignature;
import org.easydarwin.easyplayer.data.VideoSource;
import org.easydarwin.easyplayer.databinding.ActivityPlayListBinding;
@@ -40,21 +42,18 @@ import org.easydarwin.easyplayer.views.ProVideoView;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
/**
* 视频广场
* */
*
*/
@SuppressLint("Range")
public class PlayListActivity extends AppCompatActivity implements View.OnClickListener, View.OnLongClickListener {
private static final int REQUEST_PLAY = 1000;
public static final int REQUEST_CAMERA_PERMISSION = 1001;
private static final int REQUEST_SCAN_TEXT_URL = 1003; // 扫描二维码
public static final String EXTRA_BOOLEAN_SELECT_ITEM_TO_PLAY = "extra-boolean-select-item-to-play";
private static final int REQUEST_PLAY = 1000;
private static final int REQUEST_SCAN_TEXT_URL = 1003; // 扫描二维码
private int mPos;
private ActivityPlayListBinding mBinding;
private RecyclerView mRecyclerView;
@@ -83,9 +82,7 @@ public class PlayListActivity extends AppCompatActivity implements View.OnClickL
mCursor = TheApp.sDB.query(VideoSource.TABLE_NAME, null, null, null, null, null, null);
if (!mCursor.moveToFirst()) {
List<String> urls = new ArrayList<>();
urls.add("rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov");
urls.add("rtmp://live.hkstv.hk.lxdns.com/live/hks2");
urls.add("http://www.easydarwin.org/public/video/3/video.m3u8");
urls.add("rtsp://77.110.228.219/axis-media/media.amp");
urls.add("http://m4.pptvyun.com/pvod/e11a0/ijblO6coKRX6a8NEQgg8LDZcqPY/eyJkbCI6MTUxNjYyNTM3NSwiZXMiOjYwNDgwMCwiaWQiOiIwYTJkbnEtWG82S2VvcTZMNEsyZG9hZmhvNkNjbTY2WXB3IiwidiI6IjEuMCJ9/0a2dnq-Xo6Keoq6L4K2doafho6Ccm66Ypw.mp4");
for (String url : urls) {
@@ -127,7 +124,6 @@ public class PlayListActivity extends AppCompatActivity implements View.OnClickL
Glide.with(PlayListActivity.this)
.load(file)
.signature(new StringSignature(UUID.randomUUID().toString()))
.placeholder(R.drawable.placeholder)
.centerCrop()
.into(plvh.mImageView);
@@ -192,9 +188,10 @@ public class PlayListActivity extends AppCompatActivity implements View.OnClickL
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode) {
case REQUEST_CAMERA_PERMISSION: {
if (grantResults.length > 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
if (grantResults.length > 1 && grantResults[0] == PERMISSION_GRANTED && grantResults[1] == PERMISSION_GRANTED) {
toScanQRActivity();
}
@@ -310,9 +307,9 @@ public class PlayListActivity extends AppCompatActivity implements View.OnClickL
}
if (url.toLowerCase().indexOf("rtsp://") != 0 && url.toLowerCase().indexOf("rtmp://") != 0 &&
url.toLowerCase().indexOf("http://") != 0 && url.toLowerCase().indexOf("https://") != 0 &&
url.toLowerCase().indexOf("http://") != 0 && url.toLowerCase().indexOf("https://") != 0 &&
url.toLowerCase().indexOf("hls://") != 0) {
Toast.makeText(PlayListActivity.this,"不是合法的地址,请重新添加.",Toast.LENGTH_SHORT).show();
Toast.makeText(PlayListActivity.this, "不是合法的地址,请重新添加.", Toast.LENGTH_SHORT).show();
return;
}
@@ -361,7 +358,7 @@ public class PlayListActivity extends AppCompatActivity implements View.OnClickL
private void notifyAboutColorChange() {
//// !!!! important to set KEY !!!!
ProVideoView.setKey(BuildConfig.PLAYER_KEY);
long activeDays = ProVideoView.getActiveDays(this,BuildConfig.PLAYER_KEY);
long activeDays = ProVideoView.getActiveDays(this, BuildConfig.PLAYER_KEY);
ImageView iv = findViewById(R.id.toolbar_about);
@@ -379,9 +376,25 @@ public class PlayListActivity extends AppCompatActivity implements View.OnClickL
startActivity(i);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_SCAN_TEXT_URL) {
if (resultCode == RESULT_OK) {
String url = data.getStringExtra("text");
edit.setText(url);
}
} else {
// mRecyclerView.getAdapter().notifyItemChanged(mPos);
mRecyclerView.getAdapter().notifyDataSetChanged();
}
}
/**
* 视频源的item
* */
*
*/
class PlayListViewHolder extends RecyclerView.ViewHolder {
private final TextView mTextView;
private final TextView mAudienceNumber;
@@ -399,19 +412,4 @@ public class PlayListActivity extends AppCompatActivity implements View.OnClickL
itemView.setTag(this);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_SCAN_TEXT_URL) {
if (resultCode == RESULT_OK) {
String url = data.getStringExtra("text");
edit.setText(url);
}
} else {
// mRecyclerView.getAdapter().notifyItemChanged(mPos);
mRecyclerView.getAdapter().notifyDataSetChanged();
}
}
}

View File

@@ -16,24 +16,19 @@ package org.easydarwin.easyplayer;
* limitations under the License.
*/
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
import android.Manifest;
import android.content.ContentResolver;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.databinding.DataBindingUtil;
import android.graphics.Color;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewConfigurationCompat;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.util.Log;
import android.view.GestureDetector;
@@ -45,6 +40,13 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.view.ViewCompat;
import androidx.core.view.ViewConfigurationCompat;
import androidx.databinding.DataBindingUtil;
import com.bumptech.glide.Glide;
import org.easydarwin.easyplayer.databinding.ActivityMainProBinding;
@@ -60,13 +62,9 @@ import java.util.Date;
import tv.danmaku.ijk.media.player.IMediaPlayer;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
public class ProVideoActivity extends AppCompatActivity {
private static final String TAG = "ProVideoActivity";
public static final int REQUEST_WRITE_STORAGE = 111;
private static final String TAG = "ProVideoActivity";
private String mVideoPath;
private Uri mVideoUri;
@@ -315,8 +313,8 @@ public class ProVideoActivity extends AppCompatActivity {
TextView view = (TextView) findViewById(R.id.loading_speed);
view.setText(String.format("%3.01fKB/s", received * 1.0f / 1024));
if (findViewById(android.R.id.progress).getVisibility() == View.VISIBLE){
mVideoView.postDelayed(this,1000);
if (findViewById(android.R.id.progress).getVisibility() == View.VISIBLE) {
mVideoView.postDelayed(this, 1000);
}
}
};
@@ -368,7 +366,7 @@ public class ProVideoActivity extends AppCompatActivity {
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (REQUEST_WRITE_STORAGE == requestCode){
if (REQUEST_WRITE_STORAGE == requestCode) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
doTakePicture();
}
@@ -426,11 +424,11 @@ public class ProVideoActivity extends AppCompatActivity {
}
/*
* 截图
* */
* 截图
* */
public void onTakePicture(View view) {
if (mVideoView.isInPlaybackState()) {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_WRITE_STORAGE);
} else {
doTakePicture();
@@ -446,7 +444,7 @@ public class ProVideoActivity extends AppCompatActivity {
final String picture = mVideoView.takePicture(file.getPath());
if (!TextUtils.isEmpty(picture)) {
Toast.makeText(ProVideoActivity.this,"图片已保存", Toast.LENGTH_SHORT).show();
Toast.makeText(ProVideoActivity.this, "图片已保存", Toast.LENGTH_SHORT).show();
if (mScanner == null) {
MediaScannerConnection connection = new MediaScannerConnection(ProVideoActivity.this, new MediaScannerConnection.MediaScannerConnectionClient() {

View File

@@ -2,11 +2,12 @@ package org.easydarwin.easyplayer;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.budiyev.android.codescanner.CodeScanner;
import com.budiyev.android.codescanner.CodeScannerView;
import com.budiyev.android.codescanner.DecodeCallback;

View File

@@ -1,13 +1,14 @@
package org.easydarwin.easyplayer;
import android.databinding.DataBindingUtil;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.CompoundButton;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import org.easydarwin.easyplayer.databinding.ActivitySettingBinding;
import org.easydarwin.easyplayer.util.SPUtil;

View File

@@ -4,12 +4,13 @@ import android.annotation.SuppressLint;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.MotionEvent;
import android.view.View;
import android.widget.TextView;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
/**
* 启动页
*/
@@ -53,7 +54,6 @@ public class SplashActivity extends AppCompatActivity {
}
}
};
private boolean mVisible;
private final Runnable mHideRunnable = new Runnable() {
@Override
public void run() {
@@ -74,6 +74,7 @@ public class SplashActivity extends AppCompatActivity {
return false;
}
};
private boolean mVisible;
@Override
protected void onCreate(Bundle savedInstanceState) {

View File

@@ -2,14 +2,8 @@ package org.easydarwin.easyplayer.fragments;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.util.SparseArray;
import android.view.LayoutInflater;
@@ -20,9 +14,15 @@ import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import org.easydarwin.easyplayer.PlayListActivity;
import org.easydarwin.easyplayer.ProVideoActivity;
import org.easydarwin.easyplayer.R;
import org.easydarwin.easyplayer.databinding.FragmentMediaFileBinding;
@@ -34,16 +34,13 @@ import java.io.FilenameFilter;
public class LocalFileFragment extends Fragment implements CompoundButton.OnCheckedChangeListener, View.OnClickListener {
public static final String KEY_IS_RECORD = "key_last_selection";
private boolean mShowMp4File;
private FragmentMediaFileBinding mBinding;
SparseArray<Boolean> mImageChecked;
private String mSuffix;
File mRoot = null;
File[] mSubFiles;
int mImgHeight;
private boolean mShowMp4File;
private FragmentMediaFileBinding mBinding;
private String mSuffix;
@Override
public void onCreate(Bundle savedInstanceState) {

View File

@@ -1,13 +1,16 @@
package org.easydarwin.easyplayer.views;
import static tv.danmaku.ijk.media.player.IjkMediaPlayer.native_active_days;
import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.support.v4.app.ActivityCompat;
import android.text.TextUtils;
import android.util.AttributeSet;
import androidx.core.app.ActivityCompat;
import org.easydarwin.easyplayer.ProVideoActivity;
import org.easydarwin.easyplayer.util.FileUtil;
@@ -18,11 +21,9 @@ import java.util.Date;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;
import tv.danmaku.ijk.media.widget.media.IjkVideoView;
import static tv.danmaku.ijk.media.player.IjkMediaPlayer.native_active_days;
/**
* 播放器
*
* <p>
* Created by apple on 2017/2/11.
*/
public class ProVideoView extends IjkVideoView implements VideoControllerView.FullScreenAbleMediaPlayerControl {
@@ -53,19 +54,21 @@ public class ProVideoView extends IjkVideoView implements VideoControllerView.Fu
return native_active_days(context, key);
}
/** ================ super override ================ */
/**
* ================ super override ================
*/
public void startRecord(String path, int seconds) {
if (mMediaPlayer == null) {
return;
}
super.startRecord(path,seconds);
super.startRecord(path, seconds);
mRecordPath = path;
}
public void stopRecord() {
if (mMediaPlayer == null){
if (mMediaPlayer == null) {
return;
}
@@ -73,7 +76,9 @@ public class ProVideoView extends IjkVideoView implements VideoControllerView.Fu
mRecordPath = null;
}
/** ================ FullScreenAbleMediaPlayerControl ================ */
/**
* ================ FullScreenAbleMediaPlayerControl ================
*/
@Override
public boolean isFullScreen() {
@@ -131,7 +136,7 @@ public class ProVideoView extends IjkVideoView implements VideoControllerView.Fu
@Override
public void reStart() {
super.reStart();
if (mRecordPath != null){
if (mRecordPath != null) {
toggleRecord();
toggleRecord();
}
@@ -142,8 +147,8 @@ public class ProVideoView extends IjkVideoView implements VideoControllerView.Fu
if (getContext() instanceof ProVideoActivity) {
ProVideoActivity pro = (ProVideoActivity) getContext();
if (ActivityCompat.checkSelfPermission(pro, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){
ActivityCompat.requestPermissions(pro, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, ProVideoActivity.REQUEST_WRITE_STORAGE +1);
if (ActivityCompat.checkSelfPermission(pro, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(pro, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, ProVideoActivity.REQUEST_WRITE_STORAGE + 1);
return;
}
}
@@ -184,8 +189,8 @@ public class ProVideoView extends IjkVideoView implements VideoControllerView.Fu
@Override
public void setSpeed(float speed) {
if (mMediaPlayer == null ) {
return ;
if (mMediaPlayer == null) {
return;
}
if (mMediaPlayer instanceof IjkMediaPlayer) {
@@ -196,7 +201,7 @@ public class ProVideoView extends IjkVideoView implements VideoControllerView.Fu
@Override
public void takePicture() {
if (getContext() instanceof ProVideoActivity){
if (getContext() instanceof ProVideoActivity) {
ProVideoActivity pro = (ProVideoActivity) getContext();
pro.onTakePicture(null);
}

View File

@@ -3,12 +3,11 @@ package org.easydarwin.easyplayer.views;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* Created by John on 2014/11/11.
*/
public class SquareImageView extends ImageView {
public class SquareImageView extends androidx.appcompat.widget.AppCompatImageView {
public SquareImageView(Context context) {
super(context);

View File

@@ -1,17 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/colorWhite">
android:background="@color/colorWhite"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="66dp"
@@ -24,33 +22,33 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="版本信息"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="18sp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="12dp"/>
android:layout_centerHorizontal="true"
android:layout_marginBottom="12dp"
android:gravity="center"
android:text="版本信息"
android:textColor="#ffffff"
android:textSize="18sp" />
<ImageButton
android:id="@+id/toolbar_back"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/new_nav_back"
style="@style/Base.Widget.AppCompat.ActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="0dp"/>
android:layout_marginBottom="0dp"
android:src="@drawable/new_nav_back" />
</RelativeLayout>
</android.support.v7.widget.Toolbar>
</androidx.appcompat.widget.Toolbar>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
@@ -69,17 +67,17 @@
android:id="@+id/desc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/about_info"
android:textSize="15sp"
android:lineSpacingExtra="5dp"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/version"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp" />
android:layout_marginRight="16dp"
android:lineSpacingExtra="5dp"
android:text="@string/about_info"
android:textSize="15sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/version" />
<TextView
android:id="@+id/darwin_tv"
@@ -102,8 +100,8 @@
android:layout_marginTop="5dp"
android:layout_marginRight="16dp"
android:text="http://www.easydarwin.org"
android:textSize="14sp"
android:textColor="@color/colorTheme2"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/darwin_tv" />
@@ -129,8 +127,8 @@
android:layout_marginTop="5dp"
android:layout_marginRight="16dp"
android:text="http://www.easydss.com"
android:textSize="14sp"
android:textColor="@color/colorTheme2"
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/dss_tv" />
@@ -173,18 +171,18 @@
app:layout_constraintTop_toBottomOf="@+id/nvr_content_tv" />
<TextView
android:text="Copyright @ Open.TSINGSEE.com"
android:layout_height="40dp"
android:layout_width="0dp"
android:gravity="center"
android:id="@+id/textView3"
android:background="@color/colorTheme2"
android:textColor="#FFFFFF"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginTop="30dp"
app:layout_constraintTop_toBottomOf="@+id/imageView"
android:background="@color/colorTheme2"
android:gravity="center"
android:text="Copyright @ Open.TSINGSEE.com"
android:textColor="#FFFFFF"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
</android.support.constraint.ConstraintLayout>
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</LinearLayout>

View File

@@ -9,24 +9,24 @@
tools:context="org.easydarwin.easyplayer.PlayActivity">
<FrameLayout
android:id="@+id/render_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/render_container"
android:layout_gravity="center"
android:background="#000000">
<org.easydarwin.easyplayer.views.ProVideoView
android:id="@+id/video_view2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:visibility="gone"
android:layout_height="match_parent" />
android:visibility="gone" />
<org.easydarwin.easyplayer.views.ProVideoView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:keepScreenOn="true"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:keepScreenOn="true" />
<ImageView
android:id="@+id/surface_cover"
@@ -40,8 +40,8 @@
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_gravity="center"
android:gravity="center"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical">
<ProgressBar
@@ -51,12 +51,12 @@
android:indeterminateDrawable="@drawable/anim" />
<TextView
android:layout_width="wrap_content"
android:text="加载中"
android:id="@+id/loading_speed"
android:textColor="@color/colorTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_height="wrap_content" />
android:text="加载中"
android:textColor="@color/colorTheme" />
</LinearLayout>
@@ -77,16 +77,16 @@
android:id="@+id/player_container"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="#fff"
android:layout_gravity="center"
android:background="#fff"
android:gravity="center"
android:visibility="gone"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/new_lost"/>
android:src="@drawable/new_lost" />
</LinearLayout>

View File

@@ -6,10 +6,10 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/colorWhite">
android:background="@color/colorWhite"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="66dp"
@@ -22,42 +22,42 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="文件夹"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="18sp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="12dp"/>
android:layout_centerHorizontal="true"
android:layout_marginBottom="12dp"
android:gravity="center"
android:text="文件夹"
android:textColor="#ffffff"
android:textSize="18sp" />
<ImageButton
android:id="@+id/toolbar_back"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/new_nav_back"
style="@style/Base.Widget.AppCompat.ActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="0dp"/>
android:layout_marginBottom="0dp"
android:src="@drawable/new_nav_back" />
</RelativeLayout>
</android.support.v7.widget.Toolbar>
</androidx.appcompat.widget.Toolbar>
<android.support.v4.view.ViewPager
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.PagerTitleStrip
<androidx.viewpager.widget.PagerTitleStrip
android:id="@+id/pager_title_strip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#f2f2f2"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:background="#f2f2f2"
android:textAlignment="center"
android:textSize="16sp" />
</android.support.v4.view.ViewPager>
</androidx.viewpager.widget.ViewPager>
</LinearLayout>
</layout>

View File

@@ -1,17 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<layout>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#ffffff"
android:orientation="vertical"
tools:context="org.easydarwin.easyplayer.activity.PlayListActivity">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="66dp"
@@ -24,27 +22,27 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="EasyPlayer Pro"
android:gravity="center"
android:textColor="#ffffff"
android:textSize="18sp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="12dp"/>
android:layout_centerHorizontal="true"
android:layout_marginBottom="12dp"
android:gravity="center"
android:text="EasyPlayer Pro"
android:textColor="#ffffff"
android:textSize="18sp" />
<ImageButton
android:id="@+id/toolbar_about"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/new_version1"
style="@style/Base.Widget.AppCompat.ActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="0dp"/>
android:layout_marginBottom="0dp"
android:src="@drawable/new_version1" />
</RelativeLayout>
</android.support.v7.widget.Toolbar>
</androidx.appcompat.widget.Toolbar>
<LinearLayout
android:id="@+id/bottom_ll"
@@ -56,64 +54,64 @@
<TextView
android:id="@+id/toolbar_add"
android:layout_height="match_parent"
style="@style/Base.Widget.AppCompat.ActionButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:layout_weight="1"
android:text="地址"
android:textColor="@drawable/new_color_text"
android:textSize="13sp"
android:drawableTop="@drawable/new_address_btn"
android:paddingTop="8dp"
style="@style/Base.Widget.AppCompat.ActionButton"
android:layout_gravity="end" />
android:text="地址"
android:textColor="@drawable/new_color_text"
android:textSize="13sp" />
<TextView
android:id="@+id/toolbar_file"
android:layout_height="match_parent"
style="@style/Base.Widget.AppCompat.ActionButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:layout_weight="1"
android:drawableTop="@drawable/new_file_btn"
android:onClick="fileList"
android:paddingTop="8dp"
android:text="文件夹"
android:textColor="@drawable/new_color_text"
android:textSize="13sp"
android:drawableTop="@drawable/new_file_btn"
android:paddingTop="8dp"
android:onClick="fileList"
style="@style/Base.Widget.AppCompat.ActionButton"
android:layout_gravity="end" />
android:textSize="13sp" />
<TextView
android:id="@+id/toolbar_setting"
android:layout_height="match_parent"
style="@style/Base.Widget.AppCompat.ActionButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:layout_weight="1"
android:text="设置"
android:textColor="@drawable/new_color_text"
android:textSize="13sp"
android:drawableTop="@drawable/new_setting_btn"
android:paddingTop="8dp"
style="@style/Base.Widget.AppCompat.ActionButton"
android:layout_gravity="end" />
android:text="设置"
android:textColor="@drawable/new_color_text"
android:textSize="13sp" />
</LinearLayout>
<android.support.v4.widget.SwipeRefreshLayout
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/pull_to_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar"
android:layout_above="@id/bottom_ll">
android:layout_above="@id/bottom_ll"
android:layout_below="@id/toolbar">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
</android.support.v4.widget.SwipeRefreshLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</RelativeLayout>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -13,19 +12,19 @@
app:autoFocusButtonVisible="false"
app:flashButtonColor="@android:color/white"
app:flashButtonVisible="true"
app:frameAspectRatioHeight="1"
app:frameAspectRatioWidth="1"
app:frameColor="@android:color/white"
app:frameCornersSize="50dp"
app:frameAspectRatioWidth="1"
app:frameAspectRatioHeight="1"
app:frameSize="0.75"
app:frameThickness="2dp"
app:maskColor="#66000000"/>
app:maskColor="#66000000" />
<ImageView
android:layout_width="56dp"
android:src="@drawable/new_nav_back"
android:padding="18dp"
android:layout_height="56dp"
android:onClick="onClose"
android:layout_height="56dp" />
android:padding="18dp"
android:src="@drawable/new_nav_back" />
</FrameLayout>

View File

@@ -9,7 +9,7 @@
android:background="@color/colorWhite"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="66dp"
@@ -42,7 +42,7 @@
</RelativeLayout>
</android.support.v7.widget.Toolbar>
</androidx.appcompat.widget.Toolbar>
<RelativeLayout
android:layout_width="match_parent"

View File

@@ -14,13 +14,13 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:gravity="center"
android:text="EasyPlayer Pro"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:text="EasyPlayer Pro" />
android:textSize="20sp" />
<TextView
android:id="@+id/txt_copyright"
@@ -30,21 +30,19 @@
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:gravity="center"
android:text="Copyright @ Open.TSINGSEE.com"
android:textColor="#666"
android:textSize="12sp"
android:text="Copyright @ Open.TSINGSEE.com" />
android:textSize="12sp" />
<TextView
android:id="@+id/txt_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/txt_copyright"
android:layout_marginBottom="10dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:text="EasyPlayer 1.0.0"
android:textColor="#666"
android:textSize="12sp"
android:text="EasyPlayer 1.0.0" />
android:textSize="12sp" />
</RelativeLayout>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View File

@@ -10,8 +10,8 @@
android:layout_width="match_parent"
android:layout_height="128dp"
android:layout_margin="1dp"
android:background="#666"
android:adjustViewBounds="true"
android:background="#666"
android:scaleType="centerCrop" />
<ImageView
@@ -19,7 +19,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/new_player"/>
android:src="@drawable/new_player" />
<CheckBox
android:id="@+id/image_checkbox"

View File

@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/media_controller_ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/media_controller_ll"
android:background="#6000"
android:orientation="vertical">
@@ -17,26 +16,26 @@
android:id="@+id/tv_speed"
style="@style/Widget.AppCompat.ActionButton"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:visibility="gone"
android:textColor="@color/white" />
android:layout_weight="1"
android:textColor="@color/white"
android:visibility="gone" />
<TextView
android:id="@+id/tv_fps"
style="@style/Widget.AppCompat.ActionButton"
android:layout_width="0dp"
android:layout_weight="1"
android:visibility="gone"
android:layout_height="wrap_content"
android:textColor="@color/white" />
android:layout_weight="1"
android:textColor="@color/white"
android:visibility="gone" />
<TextView
android:id="@+id/tv_kbps"
style="@style/Widget.AppCompat.ActionButton"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/white"
android:visibility="gone" />
</LinearLayout>
@@ -49,38 +48,38 @@
<ImageButton
android:id="@+id/slow"
android:layout_weight="1"
style="@android:style/MediaButton.Next"
android:src="@drawable/new_slow_btn"
android:contentDescription="@string/description" />
android:layout_weight="1"
android:contentDescription="@string/description"
android:src="@drawable/new_slow_btn" />
<ImageButton
android:id="@+id/rewind"
android:layout_weight="1"
style="@android:style/MediaButton.Rew"
android:src="@drawable/new_moveback_btn"
android:contentDescription="@string/description" />
android:layout_weight="1"
android:contentDescription="@string/description"
android:src="@drawable/new_moveback_btn" />
<ImageButton
android:id="@+id/pause"
android:layout_weight="1"
style="@android:style/MediaButton.Play"
android:src="@drawable/new_stop_white"
android:contentDescription="@string/description" />
android:layout_weight="1"
android:contentDescription="@string/description"
android:src="@drawable/new_stop_white" />
<ImageButton
android:id="@+id/fast_forward"
android:layout_weight="1"
style="@android:style/MediaButton.Ffwd"
android:src="@drawable/new_forward_btn"
android:contentDescription="@string/description" />
android:layout_weight="1"
android:contentDescription="@string/description"
android:src="@drawable/new_forward_btn" />
<ImageButton
android:id="@+id/fast"
android:layout_weight="1"
style="@android:style/MediaButton.Ffwd"
android:src="@drawable/new_fast_btn"
android:contentDescription="@string/description" />
android:layout_weight="1"
android:contentDescription="@string/description"
android:src="@drawable/new_fast_btn" />
</LinearLayout>
@@ -95,52 +94,52 @@
android:id="@+id/action_take_picture"
style="@style/Widget.AppCompat.ActionButton"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/new_snapshot_btn" />
<ImageButton
android:id="@+id/action_record"
style="@style/Widget.AppCompat.ActionButton"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/new_videotape_btn" />
<TextView
android:id="@+id/tv_record_time"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:gravity="center"
android:visibility="gone"
android:textColor="#ff0000"
android:drawablePadding="5dp"
android:layout_weight="1"
android:drawableLeft="@drawable/red_dot"
android:text="00:00" />
android:drawablePadding="5dp"
android:gravity="center"
android:text="00:00"
android:textColor="#ff0000"
android:visibility="gone" />
<ImageButton
android:id="@+id/action_change_mode"
style="@style/Widget.AppCompat.ActionButton"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/new_stretch_btn" />
<ImageButton
android:id="@+id/fullscreen"
style="@style/Widget.AppCompat.ActionButton"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/new_full" />
</LinearLayout>
<LinearLayout
android:id="@+id/seek_bar_container"
android:layout_width="match_parent"
android:layout_height="30dp"
android:id="@+id/seek_bar_container"
android:gravity="center_vertical"
android:orientation="horizontal">
@@ -150,20 +149,20 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingLeft="4dip"
android:paddingRight="4dip"
android:paddingTop="4dip"
android:textSize="14sp"
android:paddingRight="4dip"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
<SeekBar
android:id="@+id/media_controller_progress"
style="@style/CustomSeekbarStyle"
android:progress="10"
android:secondaryProgress="60"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1" />
android:layout_weight="1"
android:progress="10"
android:secondaryProgress="60" />
<TextView
android:id="@+id/total_time"
@@ -171,9 +170,9 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingLeft="4dip"
android:textColor="@color/white"
android:paddingRight="4dip"
android:paddingTop="4dip"
android:paddingRight="4dip"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />

View File

@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorWhite">
@@ -11,12 +9,12 @@
android:id="@+id/new_media_scan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/new_scan_btn"
android:background="@null"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginRight="8dp"
app:layout_constraintTop_toTopOf="@id/new_media_source_url"
app:layout_constraintBottom_toBottomOf="@id/new_media_source_url" />
android:background="@null"
android:src="@drawable/new_scan_btn"
app:layout_constraintBottom_toBottomOf="@id/new_media_source_url"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/new_media_source_url" />
<EditText
@@ -32,4 +30,4 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -1,13 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layout>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="240dp"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin">
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin">
<FrameLayout
android:layout_width="match_parent"
@@ -32,10 +31,10 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxHeight="40dp"
android:minHeight="40dp"
android:ellipsize="end"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:text="9"
@@ -55,5 +54,5 @@
</LinearLayout>
</FrameLayout>
</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>
</layout>