version:
update: bugfixes:修复缩略图
This commit is contained in:
@@ -5,7 +5,7 @@ static def appName() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static def releaseTime() {
|
static def releaseTime() {
|
||||||
return new Date().format("yyyyMMdd-HHmmss", TimeZone.getDefault())
|
return new Date().format("yyyyMMdd_HHmmss", TimeZone.getDefault())
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
@@ -89,7 +89,7 @@ android {
|
|||||||
buildTypes {
|
buildTypes {
|
||||||
debug {
|
debug {
|
||||||
buildConfigField "String", "platform", '"UMTK11"'
|
buildConfigField "String", "platform", '"UMTK11"'
|
||||||
versionNameSuffix "-debug"
|
versionNameSuffix "_debug"
|
||||||
//Zipalign优化
|
//Zipalign优化
|
||||||
zipAlignEnabled true
|
zipAlignEnabled true
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
@@ -97,7 +97,7 @@ android {
|
|||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
variant.outputs.each { output ->
|
variant.outputs.each { output ->
|
||||||
if (outputFile != null) {
|
if (outputFile != null) {
|
||||||
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
def fileName = "${appName()}_${variant.versionCode}_V${variant.versionName}_${releaseTime()}_${buildType.name}.apk"
|
||||||
output.outputFileName = fileName
|
output.outputFileName = fileName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,7 +119,7 @@ android {
|
|||||||
variant.outputs.each { output ->
|
variant.outputs.each { output ->
|
||||||
def outputFile = ""
|
def outputFile = ""
|
||||||
if (outputFile != null) {
|
if (outputFile != null) {
|
||||||
def fileName = "${appName()}-${variant.versionCode}-V${variant.versionName}-${releaseTime()}-${buildType.name}.apk"
|
def fileName = "${appName()}_${variant.versionCode}_V${variant.versionName}_${releaseTime()}_${buildType.name}.apk"
|
||||||
output.outputFileName = new File(outputFile, fileName)
|
output.outputFileName = new File(outputFile, fileName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package com.uiui.videoplayer.adapter;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.media.MediaMetadataRetriever;
|
import android.media.MediaMetadataRetriever;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
@@ -15,13 +14,10 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.bumptech.glide.request.target.SimpleTarget;
|
|
||||||
import com.bumptech.glide.request.transition.Transition;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
import com.shehuan.niv.NiceImageView;
|
import com.shehuan.niv.NiceImageView;
|
||||||
@@ -37,15 +33,6 @@ import com.uiui.videoplayer.utils.VideoUtils;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
|
||||||
import io.reactivex.rxjava3.core.Observable;
|
|
||||||
import io.reactivex.rxjava3.core.ObservableEmitter;
|
|
||||||
import io.reactivex.rxjava3.core.ObservableOnSubscribe;
|
|
||||||
import io.reactivex.rxjava3.core.Observer;
|
|
||||||
import io.reactivex.rxjava3.disposables.Disposable;
|
|
||||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
|
||||||
import wseemann.media.FFmpegMediaMetadataRetriever;
|
|
||||||
|
|
||||||
public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.VideoHolder> {
|
public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.VideoHolder> {
|
||||||
private static final String TAG = VideoAdapter.class.getSimpleName();
|
private static final String TAG = VideoAdapter.class.getSimpleName();
|
||||||
private Activity mContext;
|
private Activity mContext;
|
||||||
@@ -101,11 +88,11 @@ public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.VideoHolder>
|
|||||||
if (TextUtils.isEmpty(localPath)) {
|
if (TextUtils.isEmpty(localPath)) {
|
||||||
holder.iv_status.setVisibility(View.VISIBLE);
|
holder.iv_status.setVisibility(View.VISIBLE);
|
||||||
if (!TextUtils.isEmpty(url)) {
|
if (!TextUtils.isEmpty(url)) {
|
||||||
Glide.with(mContext).load(url).error(R.mipmap.ic_launcher).into(holder.video_image);
|
Glide.with(mContext).load(url + "?x-oss-process=video/snapshot,t_0,f_jpg").error(R.mipmap.ic_launcher).into(holder.video_image);
|
||||||
String fileName = localVideoInfo.getFile_name();
|
String fileName = localVideoInfo.getFile_name();
|
||||||
if (TextUtils.isEmpty(fileName)){
|
if (TextUtils.isEmpty(fileName)) {
|
||||||
holder.title.setText(VideoUtils.getFileNameWithoutExtension(url));
|
holder.title.setText(VideoUtils.getFileNameWithoutExtension(url));
|
||||||
}else {
|
} else {
|
||||||
holder.title.setText(fileName);
|
holder.title.setText(fileName);
|
||||||
}
|
}
|
||||||
holder.duration.setText(Utils.TimeFormat(localVideoInfo.getDuration() * 1000));
|
holder.duration.setText(Utils.TimeFormat(localVideoInfo.getDuration() * 1000));
|
||||||
@@ -115,56 +102,59 @@ public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.VideoHolder>
|
|||||||
File file = new File(localPath);
|
File file = new File(localPath);
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
holder.iv_status.setVisibility(View.GONE);
|
holder.iv_status.setVisibility(View.GONE);
|
||||||
Observable.create(new ObservableOnSubscribe<VideoResult>() {
|
Glide.with(mContext).load(url + "?x-oss-process=video/snapshot,t_0,f_jpg").error(R.mipmap.ic_launcher).into(holder.video_image);
|
||||||
@Override
|
holder.duration.setText(Utils.TimeFormat(localVideoInfo.getDuration() * 1000));
|
||||||
public void subscribe(ObservableEmitter<VideoResult> emitter) throws Exception {
|
// Observable.create(new ObservableOnSubscribe<VideoResult>() {
|
||||||
FFmpegMediaMetadataRetriever mmr = new FFmpegMediaMetadataRetriever();
|
// @Override
|
||||||
mmr.setDataSource(localPath);
|
// public void subscribe(ObservableEmitter<VideoResult> emitter) throws Exception {
|
||||||
String duration = mmr.extractMetadata(FFmpegMediaMetadataRetriever.METADATA_KEY_DURATION);
|
// FFmpegMediaMetadataRetriever mmr = new FFmpegMediaMetadataRetriever();
|
||||||
Bitmap bitmap = mmr.getFrameAtTime();//获得视频第一帧的Bitmap对象.
|
// mmr.setDataSource(localPath);
|
||||||
Long time = Long.valueOf(duration);
|
// String duration = mmr.extractMetadata(FFmpegMediaMetadataRetriever.METADATA_KEY_DURATION);
|
||||||
|
// Bitmap bitmap = mmr.getFrameAtTime();//获得视频第一帧的Bitmap对象.
|
||||||
mmr.release();
|
// Long time = Long.valueOf(duration);
|
||||||
VideoResult result = new VideoResult();
|
//
|
||||||
result.frame = bitmap;
|
// mmr.release();
|
||||||
result.time = time;
|
// VideoResult result = new VideoResult();
|
||||||
emitter.onNext(result);
|
// result.frame = bitmap;
|
||||||
}
|
// result.time = time;
|
||||||
}).subscribeOn(Schedulers.newThread())
|
// emitter.onNext(result);
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
// }
|
||||||
.subscribe(new Observer<VideoResult>() {
|
// }).subscribeOn(Schedulers.newThread())
|
||||||
@Override
|
// .observeOn(AndroidSchedulers.mainThread())
|
||||||
public void onSubscribe(Disposable d) {
|
// .subscribe(new Observer<VideoResult>() {
|
||||||
Log.e("VideoResult", "onSubscribe: ");
|
// @Override
|
||||||
}
|
// public void onSubscribe(Disposable d) {
|
||||||
|
// Log.e("VideoResult", "onSubscribe: ");
|
||||||
@Override
|
// }
|
||||||
public void onNext(VideoResult result) {
|
//
|
||||||
Log.e("VideoResult", "onNext: " + result);
|
// @Override
|
||||||
try {
|
// public void onNext(VideoResult result) {
|
||||||
Glide.with(holder.video_image).load(result.frame).skipMemoryCache(false).into(new SimpleTarget<Drawable>() {
|
// Log.e("VideoResult", "onNext: " + result);
|
||||||
@Override
|
// try {
|
||||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
// Glide.with(holder.video_image).load(result.frame).skipMemoryCache(false).into(new SimpleTarget<Drawable>() {
|
||||||
holder.video_image.setImageDrawable(resource);
|
// @Override
|
||||||
}
|
// public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||||
});
|
// holder.video_image.setImageDrawable(resource);
|
||||||
holder.duration.setText(Utils.TimeFormat(result.time));
|
// }
|
||||||
} catch (Exception e) {
|
// });
|
||||||
|
// holder.duration.setText(Utils.TimeFormat(result.time));
|
||||||
}
|
// } catch (Exception e) {
|
||||||
}
|
//
|
||||||
|
// }
|
||||||
@Override
|
// }
|
||||||
public void onError(Throwable e) {
|
//
|
||||||
Log.e("VideoResult", "onError: " + e.getMessage());
|
// @Override
|
||||||
}
|
// public void onError(Throwable e) {
|
||||||
|
// Log.e("VideoResult", "onError: " + e.getMessage());
|
||||||
@Override
|
// }
|
||||||
public void onComplete() {
|
//
|
||||||
Log.e("VideoResult", "onComplete: ");
|
// @Override
|
||||||
}
|
// public void onComplete() {
|
||||||
});
|
// Log.e("VideoResult", "onComplete: ");
|
||||||
|
// }
|
||||||
|
// });
|
||||||
} else {
|
} else {
|
||||||
|
holder.iv_status.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -180,7 +170,7 @@ public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.VideoHolder>
|
|||||||
mContext.startActivity(intent);
|
mContext.startActivity(intent);
|
||||||
} else {
|
} else {
|
||||||
JGYUtils.getInstance().ariaDownload(url, GsonUtils.getJsonObject(GsonUtils.toJSONString(localVideoInfo)));
|
JGYUtils.getInstance().ariaDownload(url, GsonUtils.getJsonObject(GsonUtils.toJSONString(localVideoInfo)));
|
||||||
ToastUtil.show(String.format( mContext.getString(R.string.download_now), VideoUtils.getFileNameWithoutExtension(url)));
|
ToastUtil.show(String.format(mContext.getString(R.string.download_now), VideoUtils.getFileNameWithoutExtension(url)));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Intent intent = new Intent(mContext, ActivityTikTok.class);
|
Intent intent = new Intent(mContext, ActivityTikTok.class);
|
||||||
@@ -203,7 +193,7 @@ public class VideoAdapter extends RecyclerView.Adapter<VideoAdapter.VideoHolder>
|
|||||||
mContext.startActivity(intent);
|
mContext.startActivity(intent);
|
||||||
} else {
|
} else {
|
||||||
JGYUtils.getInstance().ariaDownload(url, GsonUtils.getJsonObject(GsonUtils.toJSONString(localVideoInfo)));
|
JGYUtils.getInstance().ariaDownload(url, GsonUtils.getJsonObject(GsonUtils.toJSONString(localVideoInfo)));
|
||||||
ToastUtil.show(String.format( mContext.getString(R.string.download_now), VideoUtils.getFileNameWithoutExtension(url)));
|
ToastUtil.show(String.format(mContext.getString(R.string.download_now), VideoUtils.getFileNameWithoutExtension(url)));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Intent intent = new Intent(mContext, ActivityTikTok.class);
|
Intent intent = new Intent(mContext, ActivityTikTok.class);
|
||||||
|
|||||||
BIN
app/src/main/res/drawable-hdpi/icon_back.png
Normal file
BIN
app/src/main/res/drawable-hdpi/icon_back.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 891 B |
@@ -41,7 +41,7 @@
|
|||||||
android:layout_height="@dimen/dp_24"
|
android:layout_height="@dimen/dp_24"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/back"
|
android:src="@drawable/icon_back"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="家庭空间"
|
android:text="家庭空间"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_20"
|
android:textSize="@dimen/sp_20"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -87,12 +87,12 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:tl_indicator_color="@color/black"
|
app:tl_indicator_color="@color/white"
|
||||||
app:tl_indicator_style="NORMAL"
|
app:tl_indicator_style="NORMAL"
|
||||||
app:tl_indicator_width_equal_title="true"
|
app:tl_indicator_width_equal_title="true"
|
||||||
app:tl_tab_space_equal="true"
|
app:tl_tab_space_equal="true"
|
||||||
app:tl_textBold="SELECT"
|
app:tl_textBold="SELECT"
|
||||||
app:tl_textSelectColor="@color/black"
|
app:tl_textSelectColor="@color/white"
|
||||||
app:tl_textSelectSize="@dimen/sp_18"
|
app:tl_textSelectSize="@dimen/sp_18"
|
||||||
app:tl_textSize="@dimen/sp_17"
|
app:tl_textSize="@dimen/sp_17"
|
||||||
app:tl_textUnSelectColor="@color/gray"
|
app:tl_textUnSelectColor="@color/gray"
|
||||||
@@ -104,7 +104,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="@dimen/dp_8"
|
android:layout_marginEnd="@dimen/dp_8"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_12"
|
android:textSize="@dimen/sp_12"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/main_sliding_tab_layout"
|
app:layout_constraintBottom_toBottomOf="@+id/main_sliding_tab_layout"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|||||||
@@ -42,9 +42,12 @@
|
|||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="00:00"
|
android:text="00:00"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_7"
|
android:textSize="@dimen/sp_12"
|
||||||
|
android:textStyle="bold"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/video_image"
|
app:layout_constraintBottom_toBottomOf="@+id/video_image"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/video_image" />
|
app:layout_constraintEnd_toEndOf="@+id/video_image"
|
||||||
|
app:layout_constraintHorizontal_bias="0.872"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<color name="colorPrimary">#6200EE</color>
|
<color name="colorPrimary">#6200EE</color>
|
||||||
<color name="colorPrimaryDark">#3700B3</color>
|
<color name="colorPrimaryDark">#3700B3</color>
|
||||||
<color name="colorAccent">#4880ff</color>
|
<color name="colorAccent">#4880ff</color>
|
||||||
<color name="colorBackground">#f3f3f3</color>
|
<color name="colorBackground">#000000</color>
|
||||||
|
|
||||||
<color name="white">#FFFFFF</color>
|
<color name="white">#FFFFFF</color>
|
||||||
<color name="black">#000000</color>
|
<color name="black">#000000</color>
|
||||||
|
|||||||
@@ -60,11 +60,11 @@ public class RemoteManager {
|
|||||||
public void onServiceDisconnected(ComponentName name) {
|
public void onServiceDisconnected(ComponentName name) {
|
||||||
Log.e(TAG, "onServiceDisconnected: " + name);
|
Log.e(TAG, "onServiceDisconnected: " + name);
|
||||||
mIGetInfoInterface = null;
|
mIGetInfoInterface = null;
|
||||||
bindinfoService();
|
bindInfoService();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (mIGetInfoInterface == null) {
|
if (mIGetInfoInterface == null) {
|
||||||
bindinfoService();
|
bindInfoService();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ public class RemoteManager {
|
|||||||
|
|
||||||
public void checkAvailable() {
|
public void checkAvailable() {
|
||||||
if (mIGetInfoInterface == null) {
|
if (mIGetInfoInterface == null) {
|
||||||
bindinfoService();
|
bindInfoService();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ public class RemoteManager {
|
|||||||
mListeners.remove(listener);
|
mListeners.remove(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindinfoService() {
|
private void bindInfoService() {
|
||||||
//这是连接aidl服务的代码
|
//这是连接aidl服务的代码
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setAction(AOLEYUNINFO_ACTION);
|
intent.setAction(AOLEYUNINFO_ACTION);
|
||||||
@@ -123,7 +123,7 @@ public class RemoteManager {
|
|||||||
String sn = mMMKV.decodeString(serialKey, "");
|
String sn = mMMKV.decodeString(serialKey, "");
|
||||||
Log.e(TAG, "sn: " + sn);
|
Log.e(TAG, "sn: " + sn);
|
||||||
if (mIGetInfoInterface == null) {
|
if (mIGetInfoInterface == null) {
|
||||||
bindinfoService();
|
bindInfoService();
|
||||||
return sn;
|
return sn;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user