version:1.4.0
fix: update:闹钟提醒循环播放,优化sos和提醒页面
This commit is contained in:
@@ -15,8 +15,8 @@ android {
|
||||
applicationId "com.xxpatx.os"
|
||||
minSdkVersion 24
|
||||
targetSdkVersion 29
|
||||
versionCode 1039
|
||||
versionName "1.3.8"
|
||||
versionCode 1040
|
||||
versionName "1.4.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
android:excludeFromRecents="true"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/FloatingWindow" />
|
||||
android:theme="@style/AppBlackTheme" />
|
||||
<activity android:name=".activity.APPListActivity" />
|
||||
<activity
|
||||
android:name=".activity.alarm.list.AlarmListActivity"
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.tencent.mmkv.MMKV;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.adapter.SosNnmberAdapter;
|
||||
import com.xxpatx.os.adapter.EmergencyContactAdapter;
|
||||
import com.xxpatx.os.base.mvvm.BaseMvvmActivity;
|
||||
import com.xxpatx.os.bean.BaseResponse;
|
||||
import com.xxpatx.os.bean.Contact;
|
||||
@@ -32,16 +32,18 @@ import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
public class EmergencyActivity extends BaseMvvmActivity<EmergencyViewModel, ActivityEmergencyBinding> {
|
||||
private String TAG = "EmergencyActivity";
|
||||
private static final String TAG = "EmergencyActivity";
|
||||
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
|
||||
private SosNnmberAdapter mSosNnmberAdapter;
|
||||
// private SosNnmberAdapter mSosNnmberAdapter;
|
||||
private EmergencyContactAdapter mEmergencyContactAdapter;
|
||||
|
||||
private Disposable subscribe;
|
||||
private boolean needDial = false;
|
||||
private boolean isCalling = false;
|
||||
private List<Contact> phoneList;
|
||||
|
||||
private Disposable mDisposable;
|
||||
private boolean mNeedDial = false;
|
||||
private boolean mCalling = false;
|
||||
private List<Contact> mContactList;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -62,22 +64,23 @@ public class EmergencyActivity extends BaseMvvmActivity<EmergencyViewModel, Acti
|
||||
// Intent bootIntent = new Intent(BootReceiver.SOS);
|
||||
// bootIntent.setComponent(new ComponentName("com.xxpatx.sn", "com.xxpatx.sn.receiver.BootReceiver"));
|
||||
// sendBroadcast(bootIntent);
|
||||
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
|
||||
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
|
||||
mViewDataBinding.rvContact.setLayoutManager(linearLayoutManager);
|
||||
mSosNnmberAdapter = new SosNnmberAdapter();
|
||||
mViewDataBinding.rvContact.setAdapter(mSosNnmberAdapter);
|
||||
mEmergencyContactAdapter = new EmergencyContactAdapter();
|
||||
mViewDataBinding.rvContact.setAdapter(mEmergencyContactAdapter);
|
||||
|
||||
AmapManager.getInstance().startLocation();
|
||||
|
||||
final Long time = 3L;
|
||||
subscribe = Observable.interval(1, TimeUnit.SECONDS)
|
||||
mDisposable = Observable.interval(1, TimeUnit.SECONDS)
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycleSubject(), ActivityEvent.DESTROY))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(aLong -> {
|
||||
Log.e("TAG", "倒计时:" + aLong);
|
||||
if (aLong < time && !subscribe.isDisposed()) {
|
||||
if (aLong < time && !mDisposable.isDisposed()) {
|
||||
mViewDataBinding.tvCountdown.setText("倒计时(" + (time - aLong - 1) + ")秒");
|
||||
Log.e(TAG, "accept: " + (time - aLong - 1));
|
||||
} else {
|
||||
@@ -109,22 +112,22 @@ public class EmergencyActivity extends BaseMvvmActivity<EmergencyViewModel, Acti
|
||||
}
|
||||
});
|
||||
|
||||
needDial = true;
|
||||
mNeedDial = true;
|
||||
|
||||
if (phoneList == null || phoneList.isEmpty()) {
|
||||
if (mContactList == null || mContactList.isEmpty()) {
|
||||
Toaster.showLong("没有设置紧急联系人");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_CALL);
|
||||
Uri data = Uri.parse("tel:" + phoneList.get(0).getMobile());
|
||||
Uri data = Uri.parse("tel:" + mContactList.get(0).getMobile());
|
||||
intent.setData(data);
|
||||
startActivity(intent);
|
||||
phoneList.remove(0);
|
||||
mSosNnmberAdapter.notifyDataSetChanged();
|
||||
isCalling = true;
|
||||
subscribe.dispose();
|
||||
mContactList.remove(0);
|
||||
mEmergencyContactAdapter.notifyDataSetChanged();
|
||||
mCalling = true;
|
||||
mDisposable.dispose();
|
||||
}
|
||||
});
|
||||
mViewDataBinding.ivFinish.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -155,8 +158,8 @@ public class EmergencyActivity extends BaseMvvmActivity<EmergencyViewModel, Acti
|
||||
mViewModel.mContactListData.observe(this, new androidx.lifecycle.Observer<List<Contact>>() {
|
||||
@Override
|
||||
public void onChanged(List<Contact> contacts) {
|
||||
phoneList = contacts;
|
||||
mSosNnmberAdapter.setPhoneNumberList(phoneList);
|
||||
mContactList = contacts;
|
||||
mEmergencyContactAdapter.setContactList(mContactList);
|
||||
}
|
||||
});
|
||||
mViewModel.getCacheContact();
|
||||
@@ -167,10 +170,10 @@ public class EmergencyActivity extends BaseMvvmActivity<EmergencyViewModel, Acti
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
Log.e(TAG, "onStart: ");
|
||||
Log.e(TAG, "onStart: phoneList = " + phoneList);
|
||||
Log.e(TAG, "onStart: needDial = " + needDial);
|
||||
if (needDial) {
|
||||
if (phoneList != null && !phoneList.isEmpty()) {
|
||||
Log.e(TAG, "onStart: phoneList = " + mContactList);
|
||||
Log.e(TAG, "onStart: needDial = " + mNeedDial);
|
||||
if (mNeedDial) {
|
||||
if (mContactList != null && !mContactList.isEmpty()) {
|
||||
Observable.timer(3, TimeUnit.SECONDS)
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycleSubject(), ActivityEvent.DESTROY))
|
||||
.subscribeOn(Schedulers.io())
|
||||
@@ -185,10 +188,10 @@ public class EmergencyActivity extends BaseMvvmActivity<EmergencyViewModel, Acti
|
||||
public void onNext(@NonNull Long aLong) {
|
||||
Log.e(TAG, "timer onNext: " + aLong);
|
||||
Intent intent = new Intent(Intent.ACTION_CALL);
|
||||
String phone = phoneList.get(0).getMobile();
|
||||
isCalling = true;
|
||||
phoneList.remove(0);
|
||||
mSosNnmberAdapter.notifyDataSetChanged();
|
||||
String phone = mContactList.get(0).getMobile();
|
||||
mCalling = true;
|
||||
mContactList.remove(0);
|
||||
mEmergencyContactAdapter.notifyDataSetChanged();
|
||||
Uri data = Uri.parse("tel:" + phone);
|
||||
intent.setData(data);
|
||||
startActivity(intent);
|
||||
@@ -220,9 +223,9 @@ public class EmergencyActivity extends BaseMvvmActivity<EmergencyViewModel, Acti
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
Log.e(TAG, "onDestroy: ");
|
||||
if (subscribe != null && !subscribe.isDisposed()) {
|
||||
subscribe.dispose();
|
||||
subscribe = null;
|
||||
if (mDisposable != null && !mDisposable.isDisposed()) {
|
||||
mDisposable.dispose();
|
||||
mDisposable = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,22 +283,22 @@ public class EmergencyActivity extends BaseMvvmActivity<EmergencyViewModel, Acti
|
||||
|
||||
public class BtnClick{
|
||||
public void call(View view){
|
||||
needDial = true;
|
||||
mNeedDial = true;
|
||||
|
||||
if (phoneList == null || phoneList.isEmpty()) {
|
||||
if (mContactList == null || mContactList.isEmpty()) {
|
||||
Toaster.showLong("没有设置紧急联系人");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_CALL);
|
||||
Uri data = Uri.parse("tel:" + phoneList.get(0).getMobile());
|
||||
Uri data = Uri.parse("tel:" + mContactList.get(0).getMobile());
|
||||
intent.setData(data);
|
||||
startActivity(intent);
|
||||
phoneList.remove(0);
|
||||
mSosNnmberAdapter.notifyDataSetChanged();
|
||||
isCalling = true;
|
||||
subscribe.dispose();
|
||||
mContactList.remove(0);
|
||||
mEmergencyContactAdapter.notifyDataSetChanged();
|
||||
mCalling = true;
|
||||
mDisposable.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ public class NoticeActivity extends BaseDataBindingActivity {
|
||||
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, maxVolume, AudioManager.FLAG_PLAY_SOUND);
|
||||
|
||||
mMediaPlayer = MediaPlayer.create(this, R.raw.ni);
|
||||
mMediaPlayer.setLooping(true);
|
||||
// 开始播放
|
||||
mMediaPlayer.start();
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.xxpatx.os.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.shehuan.niv.NiceImageView;
|
||||
import com.xxpatx.os.R;
|
||||
import com.xxpatx.os.bean.Contact;
|
||||
import com.xxpatx.os.utils.GlideLoadUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EmergencyContactAdapter extends RecyclerView.Adapter<EmergencyContactAdapter.EmergencyContactHolder> {
|
||||
|
||||
private Context mContext;
|
||||
private List<Contact> mContactList;
|
||||
|
||||
public void setContactList(List<Contact> contactList) {
|
||||
mContactList = contactList;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public EmergencyContactHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
mContext = parent.getContext();
|
||||
return new EmergencyContactHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_emergency_contact, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull EmergencyContactHolder holder, int position) {
|
||||
Contact contact = mContactList.get(position);
|
||||
GlideLoadUtils.getInstance().glideLoad(mContext, contact.getAvatar(), holder.iv_avatar, R.drawable.default_avatar);
|
||||
holder.tv_name.setText(contact.getName());
|
||||
holder.tv_phone.setText(contact.getMobile());
|
||||
holder.root.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(Intent.ACTION_CALL);
|
||||
Uri data = Uri.parse("tel:" + contact.getMobile());
|
||||
intent.setData(data);
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mContactList == null ? 0 : mContactList.size();
|
||||
}
|
||||
|
||||
public class EmergencyContactHolder extends RecyclerView.ViewHolder {
|
||||
ConstraintLayout root;
|
||||
NiceImageView iv_avatar;
|
||||
TextView tv_name, tv_phone;
|
||||
|
||||
public EmergencyContactHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
root = itemView.findViewById(R.id.root);
|
||||
iv_avatar = itemView.findViewById(R.id.iv_avatar);
|
||||
tv_name = itemView.findViewById(R.id.tv_name);
|
||||
tv_phone = itemView.findViewById(R.id.tv_phone);
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
app/src/main/res/drawable-hdpi/icon_notice_alarm.png
Normal file
BIN
app/src/main/res/drawable-hdpi/icon_notice_alarm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
14
app/src/main/res/drawable/bt_alarm_bg.xml
Normal file
14
app/src/main/res/drawable/bt_alarm_bg.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#0362ff" />
|
||||
<!-- 圆角的幅度 -->
|
||||
|
||||
<corners android:radius="8dp" />
|
||||
|
||||
<!-- <padding-->
|
||||
<!-- android:bottom="0dp"-->
|
||||
<!-- android:left="8dp"-->
|
||||
<!-- android:right="8dp"-->
|
||||
<!-- android:top="0dp" />-->
|
||||
</shape>
|
||||
14
app/src/main/res/drawable/bt_sos_bg.xml
Normal file
14
app/src/main/res/drawable/bt_sos_bg.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="@color/sos_text_color" />
|
||||
<!-- 圆角的幅度 -->
|
||||
|
||||
<corners android:radius="8dp" />
|
||||
|
||||
<!-- <padding-->
|
||||
<!-- android:bottom="0dp"-->
|
||||
<!-- android:left="8dp"-->
|
||||
<!-- android:right="8dp"-->
|
||||
<!-- android:top="0dp" />-->
|
||||
</shape>
|
||||
14
app/src/main/res/drawable/tv_sos_bg.xml
Normal file
14
app/src/main/res/drawable/tv_sos_bg.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="#303133" />
|
||||
<!-- 圆角的幅度 -->
|
||||
|
||||
<corners android:radius="8dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="8dp"
|
||||
android:left="0dp"
|
||||
android:right="0dp"
|
||||
android:top="8dp" />
|
||||
</shape>
|
||||
@@ -15,17 +15,48 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView18"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/home_icon_sos"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout12"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/bt_sos_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:maxLines="1"
|
||||
android:text="SOS"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="50sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:maxLines="1"
|
||||
android:text="紧急服务"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="26sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView12"
|
||||
@@ -42,7 +73,7 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView18" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_countdown"
|
||||
@@ -73,11 +104,11 @@
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_contact"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="160dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/constraintLayout7"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView4"
|
||||
tools:layout_editor_absoluteX="32dp"
|
||||
tools:listitem="@layout/item_sosnumber" />
|
||||
tools:listitem="@layout/item_emergency_contact" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_finish"
|
||||
|
||||
@@ -12,17 +12,64 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintLayout9"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
android:layout_margin="8dp"
|
||||
android:background="@drawable/bt_alarm_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:layout_editor_absoluteX="8dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView13"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:adjustViewBounds="true"
|
||||
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_notice_alarm"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="16dp"
|
||||
android:gravity="center"
|
||||
android:text="闹钟提醒"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/imageView13"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="爱心提醒"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/constraintLayout9" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_voice"
|
||||
@@ -74,11 +121,15 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_nodata" />
|
||||
android:src="@drawable/icon_nodata"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<Button
|
||||
@@ -94,5 +145,6 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
77
app/src/main/res/layout/item_emergency_contact.xml
Normal file
77
app/src/main/res/layout/item_emergency_contact.xml
Normal file
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/tv_sos_bg"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:id="@+id/iv_avatar"
|
||||
app:is_circle="true"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@drawable/default_avatar" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_avatar"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
tools:text="姓名" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_phone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
tools:text="12345678987" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -30,7 +30,7 @@
|
||||
<color name="main_default_text_gray">#808080</color>
|
||||
<color name="NormalCircleColor">#99FFFFFF</color>
|
||||
<color name="SelectedCircleColor">#ffffff</color>
|
||||
<color name="sos_text_color">#ff5257</color>
|
||||
<color name="sos_text_color">#E84446</color>
|
||||
|
||||
<color name="voice_color">#00D56B</color>
|
||||
<color name="weathet_bg_color">#ffffff</color>
|
||||
|
||||
@@ -26,6 +26,14 @@
|
||||
<item name="android:windowBackground">@color/gray</item>
|
||||
</style>
|
||||
|
||||
<style name="AppBlackTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/black</item>
|
||||
<item name="colorPrimaryDark">@color/black</item>
|
||||
<item name="colorAccent">@color/black</item>
|
||||
<item name="android:windowBackground">@color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="activity_styles" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<!--设置dialog的背景-->
|
||||
|
||||
Reference in New Issue
Block a user