version:2.7

fix:
update:优化爱心提醒,修改高度一致
This commit is contained in:
2022-08-31 14:52:14 +08:00
parent 7388d2bbf4
commit 61fb4663a6
18 changed files with 468 additions and 99 deletions

View File

@@ -16,8 +16,8 @@ android {
applicationId "com.uiui.aios" applicationId "com.uiui.aios"
minSdkVersion 24 minSdkVersion 24
targetSdkVersion 29 targetSdkVersion 29
versionCode 17 versionCode 18
versionName "2.6" versionName "2.7"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@@ -73,6 +73,7 @@ public class NoticeActivity extends AppCompatActivity {
if (alarmClockData == null) { if (alarmClockData == null) {
finish(); finish();
} }
Log.e(TAG, "onCreate: " + alarmClockData);
showData(alarmClockData); showData(alarmClockData);
} }

View File

@@ -1,7 +1,10 @@
package com.uiui.aios.adapter; package com.uiui.aios.adapter;
import android.content.Context;
import android.graphics.Bitmap;
import android.media.AudioAttributes; import android.media.AudioAttributes;
import android.media.MediaPlayer; import android.media.MediaPlayer;
import android.os.Build;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@@ -13,23 +16,25 @@ import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.uiui.aios.R; import com.uiui.aios.R;
import com.uiui.aios.bean.AlarmClockData; import com.uiui.aios.bean.AlarmClockData;
import com.uiui.aios.utils.AudioUtils; import com.uiui.aios.utils.FFmpegUtils;
import com.uiui.aios.view.MyJzvdStdNoTitleNoClarity;
import java.io.IOException; import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.regex.Pattern;
import io.reactivex.rxjava3.core.Observer; import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.disposables.Disposable; import io.reactivex.rxjava3.disposables.Disposable;
public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> { public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> {
private FragmentActivity mContext;
private List<AlarmClockData> mAlarmClockData; private List<AlarmClockData> mAlarmClockData;
public void setAlarmClockData(List<AlarmClockData> alarmClockData) { public void setAlarmClockData(List<AlarmClockData> alarmClockData) {
@@ -40,6 +45,7 @@ public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> {
@NonNull @NonNull
@Override @Override
public holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { public holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
mContext = (FragmentActivity) parent.getContext();
return new AlarmAdapter.holder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_alarm_clock, parent, false)); return new AlarmAdapter.holder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_alarm_clock, parent, false));
} }
@@ -48,15 +54,16 @@ public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> {
AlarmClockData alarmClockData = mAlarmClockData.get(position); AlarmClockData alarmClockData = mAlarmClockData.get(position);
switch (alarmClockData.getType()) { switch (alarmClockData.getType()) {
case 1: case 1:
try { // try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date date = sdf.parse(alarmClockData.getTime()); // Date date = sdf.parse(alarmClockData.getTime());
SimpleDateFormat hours = new SimpleDateFormat("HH:mm"); // SimpleDateFormat hours = new SimpleDateFormat("HH:mm");
String time = hours.format(date); // String time = hours.format(date);
holder.tv_time.setText(time); // holder.tv_time.setText(time);
} catch (ParseException e) { // } catch (ParseException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
holder.tv_time.setText(alarmClockData.getTime());
holder.tv_remind_type.setText("单次"); holder.tv_remind_type.setText("单次");
break; break;
case 2: case 2:
@@ -101,7 +108,7 @@ public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> {
} }
//让MediaPlayer对象准备用这个方法防止加载时耗时导致anr //让MediaPlayer对象准备用这个方法防止加载时耗时导致anr
mMediaPlayer.prepareAsync(); mMediaPlayer.prepareAsync();
AudioUtils.getDurationInMilliseconds(voice, new Observer<Integer>() { FFmpegUtils.getDurationInMilliseconds(voice, new Observer<Integer>() {
@Override @Override
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) { public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
@@ -129,7 +136,60 @@ public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> {
} }
}); });
} }
String url = alarmClockData.getFile();
if (TextUtils.isEmpty(url)) {
holder.cl_vp.setVisibility(View.GONE);
} else {
holder.cl_vp.setVisibility(View.VISIBLE);
if (isImgUrl(url)) {
holder.imageView.setVisibility(View.VISIBLE);
holder.jz_video.setVisibility(View.GONE);
if (!mContext.isDestroyed()) {
Glide.with(mContext).load(url).into(holder.imageView);
}
} else {
holder.imageView.setVisibility(View.GONE);
holder.jz_video.setVisibility(View.VISIBLE);
holder.jz_video.setUp(url, "");
holder.jz_video.startButton.setImageDrawable(mContext.getDrawable(R.drawable.play));
FFmpegUtils.loadVideoScreenshot(url, new Observer<Bitmap>() {
@Override
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
}
@Override
public void onNext(@io.reactivex.rxjava3.annotations.NonNull Bitmap bitmap) {
if (!mContext.isDestroyed()) {
Glide.with(mContext).load(bitmap).into(holder.jz_video.posterImageView);
}
holder.jz_video.startButton.setImageDrawable(mContext.getDrawable(R.drawable.play));
}
@Override
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
}
@Override
public void onComplete() {
}
});
}
}
}
private Pattern mCompile = Pattern.compile(".*?(gif|jpeg|png|jpg|bmp|webp)");
private boolean isImgUrl(String url) {
if (TextUtils.isEmpty(url) || url.trim().length() == 0) {
return false;
}
return mCompile.matcher(url).matches();
} }
@Override @Override
@@ -138,13 +198,11 @@ public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> {
} }
class holder extends RecyclerView.ViewHolder { class holder extends RecyclerView.ViewHolder {
TextView tv_time; TextView tv_time, tv_remind_type, tv_title, tv_voice;
TextView tv_remind_type; ConstraintLayout cl_voice, cl_vp;
TextView tv_title; MyJzvdStdNoTitleNoClarity jz_video;
TextView tv_voice; ImageView imageView;
ConstraintLayout cl_voice;
Switch switch1; Switch switch1;
ImageView iv_delete;
public holder(@NonNull View itemView) { public holder(@NonNull View itemView) {
super(itemView); super(itemView);
@@ -154,7 +212,9 @@ public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.holder> {
tv_voice = itemView.findViewById(R.id.tv_voice); tv_voice = itemView.findViewById(R.id.tv_voice);
cl_voice = itemView.findViewById(R.id.cl_voice); cl_voice = itemView.findViewById(R.id.cl_voice);
switch1 = itemView.findViewById(R.id.switch1); switch1 = itemView.findViewById(R.id.switch1);
iv_delete = itemView.findViewById(R.id.iv_delete); cl_vp = itemView.findViewById(R.id.cl_vp);
jz_video = itemView.findViewById(R.id.jz_video);
imageView = itemView.findViewById(R.id.imageView);
} }
} }
} }

View File

@@ -15,7 +15,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.uiui.aios.R; import com.uiui.aios.R;
import com.uiui.aios.bean.AlarmClockData; import com.uiui.aios.bean.AlarmClockData;
import com.uiui.aios.utils.AudioUtils; import com.uiui.aios.utils.FFmpegUtils;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
@@ -59,7 +59,7 @@ public class NotificationAdapter extends RecyclerView.Adapter<NotificationAdapte
} }
//让MediaPlayer对象准备用这个方法防止加载时耗时导致anr //让MediaPlayer对象准备用这个方法防止加载时耗时导致anr
mMediaPlayer.prepareAsync(); mMediaPlayer.prepareAsync();
AudioUtils.getDurationInMilliseconds(voice, new Observer<Integer>() { FFmpegUtils.getDurationInMilliseconds(voice, new Observer<Integer>() {
@Override @Override
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) { public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {

View File

@@ -18,6 +18,8 @@ public class AlarmClockData implements Serializable {
String voice;//语音文件地址 String voice;//语音文件地址
String voice_md5; String voice_md5;
String file;//图片或视频文件地址 String file;//图片或视频文件地址
int remind_type;
int is_onoff;//0关闭 1开启
boolean finished = false; boolean finished = false;
@@ -85,6 +87,22 @@ public class AlarmClockData implements Serializable {
this.finished = finished; this.finished = finished;
} }
public int getRemind_type() {
return remind_type;
}
public void setRemind_type(int remind_type) {
this.remind_type = remind_type;
}
public int getIs_onoff() {
return is_onoff;
}
public void setIs_onoff(int is_onoff) {
this.is_onoff = is_onoff;
}
@NonNull @NonNull
@Override @Override
public String toString() { public String toString() {
@@ -102,6 +120,9 @@ public class AlarmClockData implements Serializable {
if (!voice.equals(((AlarmClockData) obj).voice)) return false; if (!voice.equals(((AlarmClockData) obj).voice)) return false;
if (!voice_md5.equals(((AlarmClockData) obj).voice_md5)) return false; if (!voice_md5.equals(((AlarmClockData) obj).voice_md5)) return false;
if (!file.equals(((AlarmClockData) obj).file)) return false; if (!file.equals(((AlarmClockData) obj).file)) return false;
if (remind_type != ((AlarmClockData) obj).remind_type) return false;
if (is_onoff != ((AlarmClockData) obj).is_onoff) return false;
return true; return true;
} }
} }

View File

@@ -50,6 +50,7 @@ import com.uiui.aios.adapter.SOSNnmberAdapter;
import com.uiui.aios.bean.AlarmClockData; import com.uiui.aios.bean.AlarmClockData;
import com.uiui.aios.bean.AlarmItem; import com.uiui.aios.bean.AlarmItem;
import com.uiui.aios.manager.AmapManager; import com.uiui.aios.manager.AmapManager;
import com.uiui.aios.utils.AlarmUtils;
import com.uiui.aios.utils.ApkUtils; import com.uiui.aios.utils.ApkUtils;
import com.uiui.aios.utils.AppUtil; import com.uiui.aios.utils.AppUtil;
import com.uiui.aios.utils.SchemeUtils; import com.uiui.aios.utils.SchemeUtils;
@@ -442,11 +443,8 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
private void getAlarmClock() { private void getAlarmClock() {
String jsonString = mmkv.decodeString("AlarmClock", ""); String jsonString = mmkv.decodeString("AlarmClock", "");
if (!TextUtils.isEmpty(jsonString)) { if (!TextUtils.isEmpty(jsonString)) {
Type type = new TypeToken<List<AlarmClockData>>() { List<AlarmClockData> data = new ArrayList<>();
}.getType(); data.add(AlarmUtils.getInstance().getRecentAlarmClock());
Gson gson = new Gson();
List<AlarmClockData> data = gson.fromJson(jsonString, type);
List<AlarmClockData> showData = data.subList(0, 1);
notificationAdapter.setDataList(data); notificationAdapter.setDataList(data);
rv_noti.setVisibility(View.VISIBLE); rv_noti.setVisibility(View.VISIBLE);
iv_note_nodata.setVisibility(View.GONE); iv_note_nodata.setVisibility(View.GONE);

View File

@@ -18,9 +18,14 @@ import com.uiui.aios.service.main.MainService;
import java.io.File; import java.io.File;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
@@ -107,7 +112,7 @@ public class AlarmUtils {
}.getType(); }.getType();
Gson gson = new Gson(); Gson gson = new Gson();
List<AlarmClockData> data = gson.fromJson(jsonString, type); List<AlarmClockData> data = gson.fromJson(jsonString, type);
HashMap hashMap = new HashMap(); HashMap<Integer, AlarmClockData> hashMap = new HashMap<>();
for (AlarmClockData clockData : data) { for (AlarmClockData clockData : data) {
hashMap.put(clockData.getId(), clockData); hashMap.put(clockData.getId(), clockData);
} }
@@ -115,6 +120,41 @@ public class AlarmUtils {
} }
} }
public List<AlarmClockData> getOldDataList() {
String jsonString = mmkv.decodeString("AlarmClock", "");
Log.e(TAG, "getOldPendingIntents: " + jsonString);
if (TextUtils.isEmpty(jsonString)) {
return new ArrayList<>();
} else {
Type type = new TypeToken<List<AlarmClockData>>() {
}.getType();
Gson gson = new Gson();
List<AlarmClockData> data = gson.fromJson(jsonString, type);
return data;
}
}
public AlarmClockData getRecentAlarmClock() {
List<AlarmClockData> alarmClockData = getOldDataList();
if (alarmClockData == null || alarmClockData.size() == 0) {
return null;
} else {
Collections.sort(alarmClockData, new Comparator<AlarmClockData>() {
DateFormat df = new SimpleDateFormat("HH:mm");
@Override
public int compare(AlarmClockData o1, AlarmClockData o2) {
try {
return df.parse(o1.getTime()).compareTo(df.parse(o2.getTime()));
} catch (ParseException e) {
throw new IllegalArgumentException(e);
}
}
});
return alarmClockData.get(0);
}
}
private HashSet<PendingIntent> getOldPendingIntents() { private HashSet<PendingIntent> getOldPendingIntents() {
HashSet<PendingIntent> pendingIntents = new HashSet<>(); HashSet<PendingIntent> pendingIntents = new HashSet<>();
HashMap<Integer, AlarmClockData> data = getOldData(); HashMap<Integer, AlarmClockData> data = getOldData();
@@ -246,7 +286,6 @@ public class AlarmUtils {
} }
public void ariaDownload(String url, String md5) { public void ariaDownload(String url, String md5) {
String fileName = Utils.getFileNamefromURL(url); String fileName = Utils.getFileNamefromURL(url);
File file = new File(Utils.getDownLoadPath(mContext) + fileName); File file = new File(Utils.getDownLoadPath(mContext) + fileName);

View File

@@ -1,5 +1,7 @@
package com.uiui.aios.utils; package com.uiui.aios.utils;
import android.content.Context;
import android.graphics.Bitmap;
import android.util.Log; import android.util.Log;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
@@ -11,7 +13,7 @@ import io.reactivex.rxjava3.core.Observer;
import io.reactivex.rxjava3.schedulers.Schedulers; import io.reactivex.rxjava3.schedulers.Schedulers;
import wseemann.media.FFmpegMediaMetadataRetriever; import wseemann.media.FFmpegMediaMetadataRetriever;
public class AudioUtils { public class FFmpegUtils {
/** /**
* 获取在线音频时间长度 * 获取在线音频时间长度
* *
@@ -34,4 +36,22 @@ public class AudioUtils {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(observer); .subscribe(observer);
} }
public static void loadVideoScreenshot(String url, Observer<Bitmap> observer) {
Observable.create(new ObservableOnSubscribe<Bitmap>() {
@Override
public void subscribe(@NonNull ObservableEmitter<Bitmap> emitter) throws Throwable {
FFmpegMediaMetadataRetriever mmr = new FFmpegMediaMetadataRetriever();
mmr.setDataSource(url);
mmr.extractMetadata(FFmpegMediaMetadataRetriever.METADATA_KEY_ALBUM);
mmr.extractMetadata(FFmpegMediaMetadataRetriever.METADATA_KEY_ARTIST);
Bitmap b = mmr.getFrameAtTime(2000000, FFmpegMediaMetadataRetriever.OPTION_CLOSEST); // frame at 2 seconds
byte[] artwork = mmr.getEmbeddedPicture();
mmr.release();
emitter.onNext(b);
}
}).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(observer);
}
} }

View File

@@ -39,9 +39,9 @@ public class IconUtils {
this.add("com.mediatek.fmradio");//收音机 this.add("com.mediatek.fmradio");//收音机
this.add("com.android.fmradio");//收音机 this.add("com.android.fmradio");//收音机
this.add("com.android.email");//电子邮件 this.add("com.android.email");//电子邮件
this.add("com.ss.android.ugc.aweme");//抖音 // this.add("com.ss.android.ugc.aweme");//抖音
this.add("com.ss.android.article.news");//头条 // this.add("com.ss.android.article.news");//头条
this.add("com.tencent.mm");//微信 // this.add("com.tencent.mm");//微信
}}; }};
public static List<String> appIconList = new ArrayList<String>() {{ public static List<String> appIconList = new ArrayList<String>() {{
@@ -77,9 +77,9 @@ public class IconUtils {
this.add("com_mediatek_fmradio"); this.add("com_mediatek_fmradio");
this.add("com_mediatek_fmradio");//收音机 this.add("com_mediatek_fmradio");//收音机
this.add("com_android_email"); this.add("com_android_email");
this.add("com_android_aweme2"); // this.add("com_android_aweme2");
this.add("com_android_news2"); // this.add("com_android_news2");
this.add("com_tencent_mm2"); // this.add("com_tencent_mm2");
}}; }};
public static List<String> appIconList2 = new ArrayList<String>() {{ public static List<String> appIconList2 = new ArrayList<String>() {{

View File

@@ -0,0 +1,25 @@
package com.uiui.aios.view;
import android.content.Context;
import android.util.AttributeSet;
import com.uiui.aios.R;
import cn.jzvd.JzvdStd;
public class MyJzvdStdNoTitleNoClarity extends JzvdStd {
public MyJzvdStdNoTitleNoClarity(Context context) {
super(context);
}
public MyJzvdStdNoTitleNoClarity(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public int getLayoutId() {
return R.layout.layout_jzstd_notitle;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -8,8 +8,6 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:layout_marginBottom="30dp"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
@@ -22,7 +20,10 @@
android:id="@+id/cl_weather" android:id="@+id/cl_weather"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="4dp"
android:layout_weight="3" android:layout_weight="3"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -81,7 +82,10 @@
android:id="@+id/cl_note" android:id="@+id/cl_note"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_marginStart="4dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="4dp"
android:layout_weight="3" android:layout_weight="3"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -133,7 +137,10 @@
android:id="@+id/cl_sos" android:id="@+id/cl_sos"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_marginStart="4dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
android:layout_weight="2" android:layout_weight="2"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -232,7 +239,10 @@
android:id="@+id/cl_health" android:id="@+id/cl_health"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background" android:background="@drawable/custom_background"
tools:ignore="NestedWeights"> tools:ignore="NestedWeights">
@@ -267,7 +277,10 @@
android:id="@+id/cl_tongue" android:id="@+id/cl_tongue"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -301,7 +314,10 @@
android:id="@+id/cl_face" android:id="@+id/cl_face"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -334,7 +350,10 @@
android:id="@+id/cl_hand" android:id="@+id/cl_hand"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">

View File

@@ -19,10 +19,10 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="16dp" android:layout_marginStart="8dp"
android:layout_marginTop="16dp" android:layout_marginTop="8dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="4dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="4dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -174,10 +174,10 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="8dp" android:layout_marginStart="4dp"
android:layout_marginTop="16dp" android:layout_marginTop="8dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="4dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -269,10 +269,10 @@
android:id="@+id/cl_activity" android:id="@+id/cl_activity"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="16dp" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:layout_marginTop="4dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="4dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -390,10 +390,10 @@
android:id="@+id/cl_demand" android:id="@+id/cl_demand"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="8dp" android:layout_marginStart="4dp"
android:layout_marginTop="8dp" android:layout_marginTop="4dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">

View File

@@ -8,8 +8,6 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:layout_marginBottom="30dp"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
@@ -22,7 +20,10 @@
android:id="@+id/cl_weather" android:id="@+id/cl_weather"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="4dp"
android:layout_weight="3" android:layout_weight="3"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -81,7 +82,10 @@
android:id="@+id/cl_note" android:id="@+id/cl_note"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_marginStart="4dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="4dp"
android:layout_weight="3" android:layout_weight="3"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -133,7 +137,10 @@
android:id="@+id/cl_sos" android:id="@+id/cl_sos"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_marginStart="4dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="4dp"
android:layout_weight="2" android:layout_weight="2"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -232,7 +239,10 @@
android:id="@+id/cl_health" android:id="@+id/cl_health"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background" android:background="@drawable/custom_background"
tools:ignore="NestedWeights"> tools:ignore="NestedWeights">
@@ -267,7 +277,10 @@
android:id="@+id/cl_tongue" android:id="@+id/cl_tongue"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -301,7 +314,10 @@
android:id="@+id/cl_face" android:id="@+id/cl_face"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="4dp"
android:layout_marginBottom="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -334,7 +350,10 @@
android:id="@+id/cl_hand" android:id="@+id/cl_hand"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">

View File

@@ -19,10 +19,10 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="16dp" android:layout_marginStart="8dp"
android:layout_marginTop="16dp" android:layout_marginTop="8dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="4dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="4dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -174,10 +174,10 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="8dp" android:layout_marginStart="4dp"
android:layout_marginTop="16dp" android:layout_marginTop="8dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="4dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -269,10 +269,10 @@
android:id="@+id/cl_activity" android:id="@+id/cl_activity"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="16dp" android:layout_marginStart="8dp"
android:layout_marginTop="8dp" android:layout_marginTop="4dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="4dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">
@@ -390,10 +390,10 @@
android:id="@+id/cl_demand" android:id="@+id/cl_demand"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginStart="8dp" android:layout_marginStart="4dp"
android:layout_marginTop="8dp" android:layout_marginTop="4dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/custom_background"> android:background="@drawable/custom_background">

View File

@@ -51,8 +51,8 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_vp" android:id="@+id/cl_vp"
android:layout_width="360dp" android:layout_width="400dp"
android:layout_height="360dp" android:layout_height="400dp"
app:layout_constraintBottom_toTopOf="@+id/bt_ok" app:layout_constraintBottom_toTopOf="@+id/bt_ok"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@@ -67,7 +67,6 @@
android:id="@+id/imageView" android:id="@+id/imageView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<Button <Button

View File

@@ -7,7 +7,7 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="300dp" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
@@ -45,10 +45,12 @@
android:id="@+id/tv_title" android:id="@+id/tv_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:text="标题" android:text="标题"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="24sp" android:textSize="24sp"
app:layout_constraintBottom_toTopOf="@+id/cl_voice"
app:layout_constraintStart_toStartOf="@+id/tv_remind_type" app:layout_constraintStart_toStartOf="@+id/tv_remind_type"
app:layout_constraintTop_toBottomOf="@+id/tv_remind_type" /> app:layout_constraintTop_toBottomOf="@+id/tv_remind_type" />
@@ -56,10 +58,10 @@
android:id="@+id/cl_voice" android:id="@+id/cl_voice"
android:layout_width="280dp" android:layout_width="280dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginBottom="16dp"
android:background="@drawable/voice_background" android:background="@drawable/voice_background"
app:layout_constraintStart_toStartOf="@+id/tv_title" app:layout_constraintBottom_toTopOf="@+id/cl_vp"
app:layout_constraintTop_toBottomOf="@+id/tv_title"> app:layout_constraintStart_toStartOf="@+id/tv_title">
<TextView <TextView
android:id="@+id/tv_voice" android:id="@+id/tv_voice"
@@ -85,7 +87,6 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<Switch <Switch
android:id="@+id/switch1" android:id="@+id/switch1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -104,9 +105,34 @@
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/delete" android:src="@drawable/delete"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/cl_voice" app:layout_constraintBottom_toBottomOf="@+id/cl_voice"
app:layout_constraintEnd_toEndOf="@+id/switch1" /> app:layout_constraintEnd_toEndOf="@+id/switch1" />
</androidx.constraintlayout.widget.ConstraintLayout> <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_vp"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:layout_marginBottom="32dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<com.uiui.aios.view.MyJzvdStdNoTitleNoClarity
android:id="@+id/jz_video"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
android:descendantFocusability="afterDescendants">
<FrameLayout
android:id="@+id/surface_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
<ImageView
android:id="@+id/poster"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:adjustViewBounds="true"
android:background="#000000"
android:scaleType="fitXY" />
<RelativeLayout
android:id="@+id/layout_bottom"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:background="@drawable/jz_bottom_bg"
android:gravity="center_vertical|right"
android:orientation="horizontal"
android:visibility="invisible">
<ImageView
android:id="@+id/fullscreen"
android:layout_width="52.5dp"
android:layout_height="fill_parent"
android:paddingLeft="14dp"
android:paddingRight="14dp"
android:scaleType="centerInside"
android:src="@drawable/jz_enlarge" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_top"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="@drawable/jz_title_bg"
android:paddingStart="10dp"
android:paddingLeft="10dp"
android:visibility="gone">
<ImageView
android:id="@+id/back"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="12dp"
android:padding="3dp"
android:scaleType="centerInside"
android:src="@drawable/jz_click_back_selector" />
</RelativeLayout>
<ProgressBar
android:id="@+id/loading"
android:layout_width="@dimen/jz_start_button_w_h_normal"
android:layout_height="@dimen/jz_start_button_w_h_normal"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:indeterminateDrawable="@drawable/jz_loading"
android:visibility="invisible" />
<LinearLayout
android:id="@+id/start_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_gravity="center_vertical">
<ImageView
android:id="@+id/start"
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@drawable/play" />
</LinearLayout>
<TextView
android:id="@+id/replay_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/start_layout"
android:layout_centerHorizontal="true"
android:layout_marginTop="6dp"
android:text="@string/replay"
android:textColor="#ffffff"
android:textSize="12sp"
android:visibility="invisible" />
<LinearLayout
android:id="@+id/retry_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:gravity="center_horizontal"
android:orientation="vertical"
android:visibility="invisible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/video_loading_failed"
android:textColor="@android:color/white"
android:textSize="14sp" />
<TextView
android:id="@+id/retry_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="@drawable/jz_retry"
android:paddingLeft="9dp"
android:paddingTop="4dp"
android:paddingRight="9dp"
android:paddingBottom="4dp"
android:text="@string/click_to_restart"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
</RelativeLayout>