version:6.0
fix: update:优化布局适配手机
This commit is contained in:
@@ -15,8 +15,8 @@ android {
|
|||||||
applicationId "com.uiuios.aios"
|
applicationId "com.uiuios.aios"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 49
|
versionCode 51
|
||||||
versionName "5.8"
|
versionName "6.0"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
|||||||
@@ -229,20 +229,20 @@
|
|||||||
android:name=".activity.EmergencyActivity"
|
android:name=".activity.EmergencyActivity"
|
||||||
android:launchMode="singleTask" />
|
android:launchMode="singleTask" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.NoticeActivity"
|
android:name=".activity.noti.NoticeActivity"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/FloatingWindow" />
|
android:theme="@style/FloatingWindow" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.NoticeInfoActivity"
|
android:name=".activity.noti.NoticeInfoActivity"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/activity_styles" />
|
android:theme="@style/activity_styles" />
|
||||||
<activity android:name=".activity.APPListActivity" />
|
<activity android:name=".activity.APPListActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.alarm.AlarmActivity"
|
android:name=".activity.alarm.main.AlarmActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
@@ -250,19 +250,19 @@
|
|||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.alarmclock.AlarmClockActivity"
|
android:name=".activity.alarmclock.main.AlarmClockActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppWhiteTheme" />
|
android:theme="@style/AppWhiteTheme" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.alarmclock.AlarmClockAddActivity"
|
android:name=".activity.alarmclock.add.AlarmClockAddActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.alarmclock.port.PortAlarmClockAddActivity"
|
android:name=".activity.alarmclock.add.port.PortAlarmClockAddActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.alarmclock.AlarmClockEditActivity"
|
android:name=".activity.alarmclock.edit.AlarmClockEditActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
@@ -310,7 +310,7 @@
|
|||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activity.wecontact.AddWechatContactActivity"
|
android:name=".activity.contact.AddWechatContactActivity"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.uiuios.aios.activity.alarm;
|
package com.uiuios.aios.activity.alarm.main;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -15,7 +15,7 @@ import com.hjq.toast.Toaster;
|
|||||||
import com.trello.rxlifecycle4.RxLifecycle;
|
import com.trello.rxlifecycle4.RxLifecycle;
|
||||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
import com.uiuios.aios.activity.alarmclock.AlarmClockAddActivity;
|
import com.uiuios.aios.activity.alarmclock.add.AlarmClockAddActivity;
|
||||||
import com.uiuios.aios.alarm.AlarmAdapter;
|
import com.uiuios.aios.alarm.AlarmAdapter;
|
||||||
import com.uiuios.aios.alarm.AlarmClockData;
|
import com.uiuios.aios.alarm.AlarmClockData;
|
||||||
import com.uiuios.aios.alarm.AlarmUtils;
|
import com.uiuios.aios.alarm.AlarmUtils;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.uiuios.aios.activity.alarm;
|
package com.uiuios.aios.activity.alarm.main;
|
||||||
|
|
||||||
import com.uiuios.aios.alarm.AlarmClockData;
|
import com.uiuios.aios.alarm.AlarmClockData;
|
||||||
import com.uiuios.aios.base.mvp.BasePresenter;
|
import com.uiuios.aios.base.mvp.BasePresenter;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.uiuios.aios.activity.alarm;
|
package com.uiuios.aios.activity.alarm.main;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -12,7 +12,7 @@ import com.hjq.toast.Toaster;
|
|||||||
import com.trello.rxlifecycle4.RxLifecycle;
|
import com.trello.rxlifecycle4.RxLifecycle;
|
||||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
import com.uiuios.aios.activity.alarmclock.port.PortAlarmClockAddActivity;
|
import com.uiuios.aios.activity.alarmclock.add.port.PortAlarmClockAddActivity;
|
||||||
import com.uiuios.aios.alarm.AlarmClockData;
|
import com.uiuios.aios.alarm.AlarmClockData;
|
||||||
import com.uiuios.aios.alarm.AlarmUtils;
|
import com.uiuios.aios.alarm.AlarmUtils;
|
||||||
import com.uiuios.aios.alarm.PortAlarmAdapter;
|
import com.uiuios.aios.alarm.PortAlarmAdapter;
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
package com.uiuios.aios.activity.alarmclock;
|
|
||||||
|
|
||||||
import com.uiuios.aios.alarm.AlarmClockData;
|
|
||||||
import com.uiuios.aios.base.mvp.BasePresenter;
|
|
||||||
import com.uiuios.aios.base.mvp.BaseView;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class AlarmClockContact {
|
|
||||||
public interface Presenter extends BasePresenter<ClockView> {
|
|
||||||
void getAlarmClock();
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface ClockView extends BaseView {
|
|
||||||
void showAlarmClock(List<AlarmClockData> alarmClockData);
|
|
||||||
void setAlarmClockEmpty();
|
|
||||||
void onError();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
package com.uiuios.aios.activity.alarmclock;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
|
|
||||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
|
||||||
import com.uiuios.aios.alarm.AlarmClockData;
|
|
||||||
import com.uiuios.aios.network.NetInterfaceManager;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import io.reactivex.rxjava3.subjects.BehaviorSubject;
|
|
||||||
|
|
||||||
public class AlarmClockPresenter implements AlarmClockContact.Presenter {
|
|
||||||
|
|
||||||
private AlarmClockContact.ClockView mView;
|
|
||||||
private Context mContext;
|
|
||||||
|
|
||||||
AlarmClockPresenter(Context context) {
|
|
||||||
this.mContext = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
private BehaviorSubject<ActivityEvent> lifecycle;
|
|
||||||
|
|
||||||
void setLifecycle(BehaviorSubject<ActivityEvent> lifecycle) {
|
|
||||||
this.lifecycle = lifecycle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BehaviorSubject<ActivityEvent> getLifecycle() {
|
|
||||||
return lifecycle;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void attachView(@NonNull AlarmClockContact.ClockView view) {
|
|
||||||
this.mView = view;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void detachView() {
|
|
||||||
this.mView = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void getAlarmClock() {
|
|
||||||
NetInterfaceManager.getInstance().getAlarmClock(true, getLifecycle(), new NetInterfaceManager.AlarmClockCallback() {
|
|
||||||
@Override
|
|
||||||
public void setAlarmClock(List<AlarmClockData> alarmClockList) {
|
|
||||||
mView.showAlarmClock(alarmClockList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setAlarmClockEmpty() {
|
|
||||||
mView.setAlarmClockEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError() {
|
|
||||||
mView.onError();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.uiuios.aios.activity.alarmclock;
|
package com.uiuios.aios.activity.alarmclock.add;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.uiuios.aios.activity.alarmclock.port;
|
package com.uiuios.aios.activity.alarmclock.add.port;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.uiuios.aios.activity.alarmclock.port;
|
package com.uiuios.aios.activity.alarmclock.add.port;
|
||||||
|
|
||||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||||
import com.uiuios.aios.base.mvvm.BaseViewModel;
|
import com.uiuios.aios.base.mvvm.BaseViewModel;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.uiuios.aios.activity.alarmclock;
|
package com.uiuios.aios.activity.alarmclock.edit;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
@@ -81,6 +81,7 @@ public class AlarmClockEditActivity extends AppCompatActivity implements Lifecyc
|
|||||||
private static final String TAG = AlarmClockEditActivity.class.getSimpleName();
|
private static final String TAG = AlarmClockEditActivity.class.getSimpleName();
|
||||||
private final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
|
private final BehaviorSubject<ActivityEvent> lifecycleSubject = BehaviorSubject.create();
|
||||||
|
|
||||||
|
private LoadingDialog mLoadingDialog;
|
||||||
|
|
||||||
@BindView(R.id.cl_content)
|
@BindView(R.id.cl_content)
|
||||||
ConstraintLayout cl_content;
|
ConstraintLayout cl_content;
|
||||||
@@ -409,8 +410,6 @@ public class AlarmClockEditActivity extends AppCompatActivity implements Lifecyc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadingDialog mLoadingDialog;
|
|
||||||
|
|
||||||
private void checkContent() {
|
private void checkContent() {
|
||||||
pvTime.returnData();
|
pvTime.returnData();
|
||||||
if (TextUtils.isEmpty(et_activation.getText())) {
|
if (TextUtils.isEmpty(et_activation.getText())) {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.uiuios.aios.activity.alarmclock;
|
package com.uiuios.aios.activity.alarmclock.main;
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -19,11 +19,14 @@ import com.hjq.toast.Toaster;
|
|||||||
import com.trello.rxlifecycle4.RxLifecycle;
|
import com.trello.rxlifecycle4.RxLifecycle;
|
||||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
|
import com.uiuios.aios.activity.alarmclock.add.AlarmClockAddActivity;
|
||||||
import com.uiuios.aios.alarm.AlarmAdapter;
|
import com.uiuios.aios.alarm.AlarmAdapter;
|
||||||
import com.uiuios.aios.alarm.AlarmClockData;
|
import com.uiuios.aios.alarm.AlarmClockData;
|
||||||
import com.uiuios.aios.alarm.AlarmUtils;
|
import com.uiuios.aios.alarm.AlarmUtils;
|
||||||
import com.uiuios.aios.base.mvp.BaseMvpActivity;
|
import com.uiuios.aios.base.mvp.BaseMvpActivity;
|
||||||
|
import com.uiuios.aios.base.mvvm.BaseMvvmActivity;
|
||||||
import com.uiuios.aios.bean.BaseResponse;
|
import com.uiuios.aios.bean.BaseResponse;
|
||||||
|
import com.uiuios.aios.databinding.ActivityAlarmBinding;
|
||||||
import com.uiuios.aios.dialog.DeleteDialog;
|
import com.uiuios.aios.dialog.DeleteDialog;
|
||||||
import com.uiuios.aios.network.NetInterfaceManager;
|
import com.uiuios.aios.network.NetInterfaceManager;
|
||||||
import com.uiuios.aios.push.PushManager;
|
import com.uiuios.aios.push.PushManager;
|
||||||
@@ -38,21 +41,9 @@ import cn.jzvd.Jzvd;
|
|||||||
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 AlarmClockActivity extends BaseMvpActivity implements AlarmClockContact.ClockView {
|
public class AlarmClockActivity extends BaseMvvmActivity<AlarmClockViewModel, ActivityAlarmBinding> {
|
||||||
private static final String TAG = AlarmClockActivity.class.getSimpleName();
|
private static final String TAG = AlarmClockActivity.class.getSimpleName();
|
||||||
|
|
||||||
@BindView(R.id.recyclerView)
|
|
||||||
RecyclerView recyclerView;
|
|
||||||
@BindView(R.id.iv_back)
|
|
||||||
ImageView iv_back;
|
|
||||||
@BindView(R.id.swipeRefreshLayout)
|
|
||||||
SwipeRefreshLayout swipeRefreshLayout;
|
|
||||||
@BindView(R.id.fab)
|
|
||||||
FloatingActionButton fab;
|
|
||||||
@BindView(R.id.cl_nodata)
|
|
||||||
ConstraintLayout cl_nodata;
|
|
||||||
|
|
||||||
private AlarmClockPresenter mPresenter;
|
|
||||||
private AlarmAdapter mAlarmAdapter;
|
private AlarmAdapter mAlarmAdapter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -60,16 +51,20 @@ public class AlarmClockActivity extends BaseMvpActivity implements AlarmClockCon
|
|||||||
return R.layout.activity_alarm;
|
return R.layout.activity_alarm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initDataBinding() {
|
||||||
|
mViewModel.setCtx(this);
|
||||||
|
mViewModel.setVDBinding(mViewDataBinding);
|
||||||
|
mViewModel.setLifecycle(getLifecycleSubject());
|
||||||
|
mViewDataBinding.setClick(new BtnClick());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initView() {
|
public void initView() {
|
||||||
UltimateBarX.statusBarOnly(this)
|
UltimateBarX.statusBarOnly(this)
|
||||||
.colorRes(R.color.default_blue)
|
.colorRes(R.color.default_blue)
|
||||||
.fitWindow(true)
|
.fitWindow(true)
|
||||||
.apply();
|
.apply();
|
||||||
ButterKnife.bind(this);
|
|
||||||
mPresenter = new AlarmClockPresenter(this);
|
|
||||||
mPresenter.attachView(this);
|
|
||||||
mPresenter.setLifecycle(getLifecycleSubject());
|
|
||||||
|
|
||||||
mAlarmAdapter = new AlarmAdapter();
|
mAlarmAdapter = new AlarmAdapter();
|
||||||
mAlarmAdapter.setOnLongClickListener(new AlarmAdapter.OnLongClickListener() {
|
mAlarmAdapter.setOnLongClickListener(new AlarmAdapter.OnLongClickListener() {
|
||||||
@@ -78,26 +73,26 @@ public class AlarmClockActivity extends BaseMvpActivity implements AlarmClockCon
|
|||||||
showDialog(alarmClockData);
|
showDialog(alarmClockData);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(AlarmClockActivity.this));
|
mViewDataBinding.rvData.setLayoutManager(new LinearLayoutManager(AlarmClockActivity.this));
|
||||||
recyclerView.setAdapter(mAlarmAdapter);
|
mViewDataBinding.rvData.setAdapter(mAlarmAdapter);
|
||||||
iv_back.setOnClickListener(new View.OnClickListener() {
|
mViewDataBinding.ivBack.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
// mViewDataBinding.swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||||
@Override
|
// @Override
|
||||||
public void onRefresh() {
|
// public void onRefresh() {
|
||||||
mPresenter.getAlarmClock();
|
// mViewModel.getAlarmClock();
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
fab.setOnClickListener(new View.OnClickListener() {
|
// mViewDataBinding.fab.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
// @Override
|
||||||
public void onClick(View view) {
|
// public void onClick(View view) {
|
||||||
startActivity(new Intent(AlarmClockActivity.this, AlarmClockAddActivity.class));
|
// startActivity(new Intent(AlarmClockActivity.this, AlarmClockAddActivity.class));
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showDialog(AlarmClockData alarmClockData) {
|
private void showDialog(AlarmClockData alarmClockData) {
|
||||||
@@ -156,7 +151,7 @@ public class AlarmClockActivity extends BaseMvpActivity implements AlarmClockCon
|
|||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
Log.e("deleteAlarm", "onComplete: ");
|
Log.e("deleteAlarm", "onComplete: ");
|
||||||
mPresenter.getAlarmClock();
|
mViewModel.getAlarmClock();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -167,26 +162,26 @@ public class AlarmClockActivity extends BaseMvpActivity implements AlarmClockCon
|
|||||||
registerAlarmClockReceiver();
|
registerAlarmClockReceiver();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void showAlarmClock(List<AlarmClockData> alarmClockData) {
|
// public void showAlarmClock(List<AlarmClockData> alarmClockData) {
|
||||||
mAlarmAdapter.setAlarmClockData(alarmClockData);
|
// mAlarmAdapter.setAlarmClockData(alarmClockData);
|
||||||
swipeRefreshLayout.setRefreshing(false);
|
//// mViewDataBinding.swipeRefreshLayout.setRefreshing(false);
|
||||||
cl_nodata.setVisibility(View.GONE);
|
// mViewDataBinding.clNodata.setVisibility(View.GONE);
|
||||||
recyclerView.setVisibility(View.VISIBLE);
|
// mViewDataBinding.rvData.setVisibility(View.VISIBLE);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void setAlarmClockEmpty() {
|
// public void setAlarmClockEmpty() {
|
||||||
mAlarmAdapter.setAlarmClockData(null);
|
// mAlarmAdapter.setAlarmClockData(null);
|
||||||
swipeRefreshLayout.setRefreshing(false);
|
//// mViewDataBinding.swipeRefreshLayout.setRefreshing(false);
|
||||||
cl_nodata.setVisibility(View.VISIBLE);
|
// mViewDataBinding.clNodata.setVisibility(View.VISIBLE);
|
||||||
recyclerView.setVisibility(View.GONE);
|
// mViewDataBinding.rvData.setVisibility(View.GONE);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onError() {
|
// public void onError() {
|
||||||
swipeRefreshLayout.setRefreshing(false);
|
//// mViewDataBinding.swipeRefreshLayout.setRefreshing(false);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
@@ -200,7 +195,7 @@ public class AlarmClockActivity extends BaseMvpActivity implements AlarmClockCon
|
|||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
mPresenter.getAlarmClock();
|
mViewModel.getAlarmClock();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerAlarmClockReceiver() {
|
private void registerAlarmClockReceiver() {
|
||||||
@@ -222,8 +217,13 @@ public class AlarmClockActivity extends BaseMvpActivity implements AlarmClockCon
|
|||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
Log.e(TAG, "onReceive: " + action);
|
Log.e(TAG, "onReceive: " + action);
|
||||||
if (PushManager.SET_ALARMCLOCK.equals(action)) {
|
if (PushManager.SET_ALARMCLOCK.equals(action)) {
|
||||||
mPresenter.getAlarmClock();
|
mViewModel.getAlarmClock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class BtnClick {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.uiuios.aios.activity.alarmclock.main;
|
||||||
|
|
||||||
|
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||||
|
import com.uiuios.aios.alarm.AlarmClockData;
|
||||||
|
import com.uiuios.aios.base.mvvm.BaseViewModel;
|
||||||
|
import com.uiuios.aios.databinding.ActivityAlarmBinding;
|
||||||
|
import com.uiuios.aios.network.NetInterfaceManager;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class AlarmClockViewModel extends BaseViewModel<ActivityAlarmBinding, ActivityEvent> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ActivityAlarmBinding getVDBinding() {
|
||||||
|
return binding;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void getAlarmClock() {
|
||||||
|
NetInterfaceManager.getInstance().getAlarmClock(true, getLifecycle(), new NetInterfaceManager.AlarmClockCallback() {
|
||||||
|
@Override
|
||||||
|
public void setAlarmClock(List<AlarmClockData> alarmClockList) {
|
||||||
|
// mView.showAlarmClock(alarmClockList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setAlarmClockEmpty() {
|
||||||
|
// mView.setAlarmClockEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError() {
|
||||||
|
// mView.onError();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,18 +2,20 @@ package com.uiuios.aios.activity.callwechat;
|
|||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import com.hjq.toast.Toaster;
|
||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
import com.uiuios.aios.base.mvvm.BaseMvvmActivity;
|
import com.uiuios.aios.base.mvvm.BaseMvvmActivity;
|
||||||
import com.uiuios.aios.bean.WechatInfo;
|
import com.uiuios.aios.bean.Contact;
|
||||||
import com.uiuios.aios.databinding.ActivityWechatCallBinding;
|
import com.uiuios.aios.databinding.ActivityWechatCallBinding;
|
||||||
import com.uiuios.aios.service.WeAccessibilityService;
|
import com.uiuios.aios.service.WeAccessibilityService;
|
||||||
|
|
||||||
public class CallWechatActivity extends BaseMvvmActivity<CallWechatViewModel, ActivityWechatCallBinding> {
|
public class CallWechatActivity extends BaseMvvmActivity<CallWechatViewModel, ActivityWechatCallBinding> {
|
||||||
|
|
||||||
private WechatInfo mWechatInfo;
|
private Contact mContact;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setfitWindow() {
|
public boolean setfitWindow() {
|
||||||
@@ -42,10 +44,10 @@ public class CallWechatActivity extends BaseMvvmActivity<CallWechatViewModel, Ac
|
|||||||
protected void initData() {
|
protected void initData() {
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
if (intent != null) {
|
if (intent != null) {
|
||||||
WechatInfo wechatInfo = (WechatInfo) intent.getSerializableExtra("WechatInfo");
|
Contact contact = (Contact) intent.getSerializableExtra("WechatInfo");
|
||||||
if (wechatInfo != null) {
|
if (contact != null) {
|
||||||
mWechatInfo = wechatInfo;
|
mContact = contact;
|
||||||
mViewDataBinding.setWehchatInfo(wechatInfo);
|
mViewDataBinding.setContact(contact);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,7 +57,7 @@ public class CallWechatActivity extends BaseMvvmActivity<CallWechatViewModel, Ac
|
|||||||
public class BtnClick {
|
public class BtnClick {
|
||||||
public void callPhone(View view) {
|
public void callPhone(View view) {
|
||||||
Intent dialIntent = new Intent(Intent.ACTION_CALL);
|
Intent dialIntent = new Intent(Intent.ACTION_CALL);
|
||||||
String phone = mWechatInfo.getMobile();
|
String phone = mContact.getMobile();
|
||||||
Uri data = Uri.parse("tel:" + phone);
|
Uri data = Uri.parse("tel:" + phone);
|
||||||
dialIntent.setData(data);
|
dialIntent.setData(data);
|
||||||
startActivity(dialIntent);
|
startActivity(dialIntent);
|
||||||
@@ -63,16 +65,24 @@ public class CallWechatActivity extends BaseMvvmActivity<CallWechatViewModel, Ac
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void callWechatVideo(View view) {
|
public void callWechatVideo(View view) {
|
||||||
|
if (TextUtils.isEmpty(mContact.getTag())){
|
||||||
|
Toaster.show("没有设置标签,无法拨打微信视频");
|
||||||
|
return;
|
||||||
|
}
|
||||||
Intent intent = new Intent(CallWechatActivity.this, WeAccessibilityService.class);
|
Intent intent = new Intent(CallWechatActivity.this, WeAccessibilityService.class);
|
||||||
intent.putExtra("WechatInfo", mWechatInfo);
|
intent.putExtra("WechatInfo", mContact);
|
||||||
intent.putExtra("call_type", WeAccessibilityService.TYPE_VIDEO);
|
intent.putExtra("call_type", WeAccessibilityService.TYPE_VIDEO);
|
||||||
startService(intent);
|
startService(intent);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void callWechatVoice(View view) {
|
public void callWechatVoice(View view) {
|
||||||
|
if (TextUtils.isEmpty(mContact.getTag())){
|
||||||
|
Toaster.show("没有设置标签,无法拨打微信语音");
|
||||||
|
return;
|
||||||
|
}
|
||||||
Intent intent = new Intent(CallWechatActivity.this, WeAccessibilityService.class);
|
Intent intent = new Intent(CallWechatActivity.this, WeAccessibilityService.class);
|
||||||
intent.putExtra("WechatInfo", mWechatInfo);
|
intent.putExtra("WechatInfo", mContact);
|
||||||
intent.putExtra("call_type", WeAccessibilityService.TYPE_VOICE);
|
intent.putExtra("call_type", WeAccessibilityService.TYPE_VOICE);
|
||||||
startService(intent);
|
startService(intent);
|
||||||
finish();
|
finish();
|
||||||
|
|||||||
@@ -27,11 +27,15 @@ import com.trello.rxlifecycle4.android.ActivityEvent;
|
|||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
import com.uiuios.aios.base.BaseDataBindingActivity;
|
import com.uiuios.aios.base.BaseDataBindingActivity;
|
||||||
import com.uiuios.aios.base.GlideEngine;
|
import com.uiuios.aios.base.GlideEngine;
|
||||||
|
import com.uiuios.aios.base.mvvm.BaseMvvmActivity;
|
||||||
import com.uiuios.aios.bean.BaseResponse;
|
import com.uiuios.aios.bean.BaseResponse;
|
||||||
|
import com.uiuios.aios.databinding.ActivityAddContactBinding;
|
||||||
|
import com.uiuios.aios.fragment.contact.ContactFragment;
|
||||||
import com.uiuios.aios.manager.RemoteManager;
|
import com.uiuios.aios.manager.RemoteManager;
|
||||||
import com.uiuios.aios.network.NetInterfaceManager;
|
import com.uiuios.aios.network.NetInterfaceManager;
|
||||||
import com.uiuios.aios.utils.GlideLoadUtils;
|
import com.uiuios.aios.utils.GlideLoadUtils;
|
||||||
import com.uiuios.aios.view.ToggleButton;
|
import com.uiuios.aios.view.ToggleButton;
|
||||||
|
import com.xiasuhuei321.loadingdialog.view.LoadingDialog;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
@@ -48,64 +52,32 @@ import okhttp3.MediaType;
|
|||||||
import okhttp3.MultipartBody;
|
import okhttp3.MultipartBody;
|
||||||
import okhttp3.RequestBody;
|
import okhttp3.RequestBody;
|
||||||
|
|
||||||
public class AddContactActivity extends BaseDataBindingActivity {
|
public class AddContactActivity extends BaseMvvmActivity<AddContactViewModel, ActivityAddContactBinding> {
|
||||||
private static final String TAG = AddContactActivity.class.getSimpleName();
|
private static final String TAG = AddContactActivity.class.getSimpleName();
|
||||||
|
|
||||||
@BindView(R.id.iv_cancel)
|
|
||||||
ImageView iv_cancel;
|
|
||||||
@BindView(R.id.iv_confirm)
|
|
||||||
ImageView iv_confirm;
|
|
||||||
@BindView(R.id.cl_confirm)
|
|
||||||
ConstraintLayout cl_confirm;
|
|
||||||
@BindView(R.id.nv_avatar)
|
|
||||||
NiceImageView nv_avatar;
|
|
||||||
@BindView(R.id.et_name)
|
|
||||||
EditText et_name;
|
|
||||||
@BindView(R.id.et_phone)
|
|
||||||
EditText et_phone;
|
|
||||||
@BindView(R.id.toggleButton)
|
|
||||||
ToggleButton toggleButton;
|
|
||||||
|
|
||||||
|
|
||||||
private String avatarFilePath;
|
private String avatarFilePath;
|
||||||
private boolean urgent = false;
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.activity_add_contact;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initDataBinding() {
|
protected void initDataBinding() {
|
||||||
DataBindingUtil.setContentView(this, R.layout.activity_add_contact);
|
mViewModel.setCtx(this);
|
||||||
|
mViewModel.setLifecycle(getLifecycleSubject());
|
||||||
|
mViewModel.setVDBinding(mViewDataBinding);
|
||||||
|
mViewDataBinding.setClick(new BtnClick());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initView() {
|
public void initView() {
|
||||||
ButterKnife.bind(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initData() {
|
public void initData() {
|
||||||
nv_avatar.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
selectPicture();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
iv_cancel.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
iv_confirm.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
checkContact();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
cl_confirm.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
checkContact();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectPicture() {
|
private void selectPicture() {
|
||||||
@@ -118,7 +90,7 @@ public class AddContactActivity extends BaseDataBindingActivity {
|
|||||||
public void onResult(ArrayList<LocalMedia> result) {
|
public void onResult(ArrayList<LocalMedia> result) {
|
||||||
avatarFilePath = result.get(0).getPath();
|
avatarFilePath = result.get(0).getPath();
|
||||||
Log.e("selectPicture", "onResult: " + avatarFilePath);
|
Log.e("selectPicture", "onResult: " + avatarFilePath);
|
||||||
GlideLoadUtils.getInstance().glideLoad(AddContactActivity.this, avatarFilePath, nv_avatar, R.drawable.default_avatar);
|
GlideLoadUtils.getInstance().glideLoad(AddContactActivity.this, avatarFilePath, mViewDataBinding.nvAvatar, R.drawable.default_avatar);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -130,12 +102,12 @@ public class AddContactActivity extends BaseDataBindingActivity {
|
|||||||
|
|
||||||
|
|
||||||
private void checkContact() {
|
private void checkContact() {
|
||||||
String name = et_name.getText().toString();
|
String name = mViewDataBinding.etName.getText().toString();
|
||||||
if (TextUtils.isEmpty(name)) {
|
if (TextUtils.isEmpty(name)) {
|
||||||
Toaster.show("请输入联系人姓名");
|
Toaster.show("请输入联系人姓名");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String phone = et_phone.getText().toString();
|
String phone = mViewDataBinding.etPhone.getText().toString();
|
||||||
if (TextUtils.isEmpty(phone)) {
|
if (TextUtils.isEmpty(phone)) {
|
||||||
Toaster.show("请输入手机号码");
|
Toaster.show("请输入手机号码");
|
||||||
return;
|
return;
|
||||||
@@ -155,7 +127,7 @@ public class AddContactActivity extends BaseDataBindingActivity {
|
|||||||
params.put("sn", RemoteManager.getInstance().getSerial());
|
params.put("sn", RemoteManager.getInstance().getSerial());
|
||||||
params.put("name", name);
|
params.put("name", name);
|
||||||
params.put("mobile", phone);
|
params.put("mobile", phone);
|
||||||
params.put("is_urgent", String.valueOf(toggleButton.isToggleOn()));
|
params.put("is_urgent", String.valueOf(mViewDataBinding.toggleButton.isToggleOn()));
|
||||||
NetInterfaceManager.getInstance()
|
NetInterfaceManager.getInstance()
|
||||||
.getMailListAddObservable(params, body)
|
.getMailListAddObservable(params, body)
|
||||||
.compose(RxLifecycle.bindUntilEvent(getLifecycleSubject(), ActivityEvent.DESTROY))
|
.compose(RxLifecycle.bindUntilEvent(getLifecycleSubject(), ActivityEvent.DESTROY))
|
||||||
@@ -220,7 +192,6 @@ public class AddContactActivity extends BaseDataBindingActivity {
|
|||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static File uriToFile(Uri uri, Context context) {
|
public static File uriToFile(Uri uri, Context context) {
|
||||||
String path = null;
|
String path = null;
|
||||||
if ("file".equals(uri.getScheme())) {
|
if ("file".equals(uri.getScheme())) {
|
||||||
@@ -266,4 +237,18 @@ public class AddContactActivity extends BaseDataBindingActivity {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class BtnClick {
|
||||||
|
public void exit(View view) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void selectPic(View v) {
|
||||||
|
selectPicture();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void confirm(View v) {
|
||||||
|
checkContact();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,16 @@
|
|||||||
package com.uiuios.aios.activity.contact;
|
package com.uiuios.aios.activity.contact;
|
||||||
|
|
||||||
|
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||||
import com.uiuios.aios.base.mvvm.BaseViewModel;
|
import com.uiuios.aios.base.mvvm.BaseViewModel;
|
||||||
|
import com.uiuios.aios.databinding.ActivityAddContactBinding;
|
||||||
|
|
||||||
|
public class AddContactViewModel extends BaseViewModel<ActivityAddContactBinding, ActivityEvent> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ActivityAddContactBinding getVDBinding() {
|
||||||
|
return binding;
|
||||||
|
}
|
||||||
|
|
||||||
public class AddContactViewModel extends BaseViewModel {
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,252 @@
|
|||||||
|
package com.uiuios.aios.activity.contact;
|
||||||
|
|
||||||
|
import android.content.ContentResolver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.provider.MediaStore;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.lifecycle.Observer;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||||
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
|
import com.hjq.toast.Toaster;
|
||||||
|
import com.luck.picture.lib.basic.PictureSelector;
|
||||||
|
import com.luck.picture.lib.config.SelectMimeType;
|
||||||
|
import com.luck.picture.lib.entity.LocalMedia;
|
||||||
|
import com.luck.picture.lib.interfaces.OnResultCallbackListener;
|
||||||
|
import com.trello.rxlifecycle4.RxLifecycle;
|
||||||
|
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||||
|
import com.uiuios.aios.R;
|
||||||
|
import com.uiuios.aios.base.GlideEngine;
|
||||||
|
import com.uiuios.aios.base.mvvm.BaseMvvmActivity;
|
||||||
|
import com.uiuios.aios.bean.BaseResponse;
|
||||||
|
import com.uiuios.aios.bean.WechatInfo;
|
||||||
|
import com.uiuios.aios.databinding.ActivityAddWechatContactBinding;
|
||||||
|
import com.uiuios.aios.db.ContactManager;
|
||||||
|
import com.uiuios.aios.manager.RemoteManager;
|
||||||
|
import com.uiuios.aios.network.NetInterfaceManager;
|
||||||
|
import com.uiuios.aios.utils.ScreenUtil;
|
||||||
|
import com.xiasuhuei321.loadingdialog.view.LoadingDialog;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.annotations.NonNull;
|
||||||
|
import io.reactivex.rxjava3.disposables.Disposable;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
|
||||||
|
public class AddWechatContactActivity extends BaseMvvmActivity<AddWechatContactViewModel, ActivityAddWechatContactBinding> {
|
||||||
|
private static final String TAG = AddWechatContactActivity.class.getSimpleName();
|
||||||
|
|
||||||
|
private LoadingDialog mLoadingDialog;
|
||||||
|
private String mPictrueFilePath;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.activity_add_wechat_contact;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initDataBinding() {
|
||||||
|
mViewModel.setCtx(this);
|
||||||
|
mViewModel.setVDBinding(mViewDataBinding);
|
||||||
|
mViewModel.setLifecycle(getLifecycleSubject());
|
||||||
|
mViewDataBinding.setClick(new BtnClick());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initView() {
|
||||||
|
mLoadingDialog = new LoadingDialog(this);
|
||||||
|
mLoadingDialog.setLoadingText("正在上传")
|
||||||
|
.setSuccessText("添加成功")
|
||||||
|
.setFailedText("添加失败")
|
||||||
|
.setInterceptBack(true)
|
||||||
|
.setLoadSpeed(LoadingDialog.Speed.SPEED_TWO)
|
||||||
|
.closeSuccessAnim()
|
||||||
|
.closeFailedAnim();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initData() {
|
||||||
|
mViewModel.getBaseResponseMutableLiveData().observe(this, new Observer<BaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onChanged(BaseResponse baseResponse) {
|
||||||
|
if (baseResponse.code == 200) {
|
||||||
|
mLoadingDialog.loadSuccess();
|
||||||
|
mLoadingDialog.close();
|
||||||
|
finish();
|
||||||
|
} else {
|
||||||
|
mLoadingDialog.setFailedText(baseResponse.msg);
|
||||||
|
mLoadingDialog.loadFailed();
|
||||||
|
mLoadingDialog.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void openSelector() {
|
||||||
|
PictureSelector.create(AddWechatContactActivity.this)
|
||||||
|
.openGallery(SelectMimeType.ofAll())
|
||||||
|
.setSelectionMode(1)
|
||||||
|
.setImageEngine(GlideEngine.createGlideEngine())
|
||||||
|
.forResult(new OnResultCallbackListener<LocalMedia>() {
|
||||||
|
@Override
|
||||||
|
public void onResult(ArrayList<LocalMedia> result) {
|
||||||
|
mPictrueFilePath = result.get(0).getRealPath();
|
||||||
|
File file = new File(mPictrueFilePath);
|
||||||
|
if (file.exists()) {
|
||||||
|
RequestOptions options = new RequestOptions().transform(new RoundedCorners(ScreenUtil.dip2px(AddWechatContactActivity.this, 8F)));
|
||||||
|
Glide.with(mViewDataBinding.nvAvatar).load(file).apply(options).into(mViewDataBinding.nvAvatar);
|
||||||
|
} else {
|
||||||
|
mPictrueFilePath = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCancel() {
|
||||||
|
Log.e(TAG, "onCancel: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkContact() {
|
||||||
|
String name = mViewDataBinding.etName.getText().toString();
|
||||||
|
if (TextUtils.isEmpty(name)) {
|
||||||
|
Toaster.show("请输入联系人姓名");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String phone = mViewDataBinding.etPhone.getText().toString();
|
||||||
|
if (TextUtils.isEmpty(phone)) {
|
||||||
|
Toaster.show("请输入手机号码");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String groupTag = mViewDataBinding.etGroup.getText().toString();
|
||||||
|
if (TextUtils.isEmpty(groupTag)) {
|
||||||
|
Toaster.show("请输入微信群组标签");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
File avatarFile;
|
||||||
|
Log.e("checkContact", "mPictrueFilePath: " + mPictrueFilePath);
|
||||||
|
if (TextUtils.isEmpty(mPictrueFilePath)) {
|
||||||
|
avatarFile = drawableToFile(R.drawable.default_avatar, "avatar");
|
||||||
|
} else {
|
||||||
|
Uri uri = Uri.parse(mPictrueFilePath);
|
||||||
|
avatarFile = uriToFile(uri, AddWechatContactActivity.this);
|
||||||
|
}
|
||||||
|
MediaType mediaType = MediaType.Companion.parse("image/png");
|
||||||
|
RequestBody requestBody = RequestBody.Companion.create(avatarFile, mediaType);
|
||||||
|
MultipartBody.Part body = MultipartBody.Part.createFormData("avatar", avatarFile.getName(), requestBody);
|
||||||
|
Map<String, String> params = new HashMap<>();
|
||||||
|
params.put("sn", RemoteManager.getInstance().getSerial());
|
||||||
|
params.put("name", name);
|
||||||
|
params.put("mobile", phone);
|
||||||
|
params.put("tag", groupTag);
|
||||||
|
params.put("is_urgent", String.valueOf(mViewDataBinding.toggleButton.isToggleOn()));
|
||||||
|
mViewModel.addContact(params, body);
|
||||||
|
mLoadingDialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* drawable转为file
|
||||||
|
*
|
||||||
|
* @param drawableId drawable的ID
|
||||||
|
* @param fileName 转换后的文件名
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public File drawableToFile(int drawableId, String fileName) {
|
||||||
|
// InputStream is = view.getContext().getResources().openRawResource(R.drawable.logo);
|
||||||
|
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), drawableId);
|
||||||
|
// Bitmap bitmap = BitmapFactory.decodeStream(is);
|
||||||
|
String defaultPath = getFilesDir().getAbsolutePath() + "/defaultGoodInfo";
|
||||||
|
File file = new File(defaultPath);
|
||||||
|
if (!file.exists()) {
|
||||||
|
file.mkdirs();
|
||||||
|
}
|
||||||
|
String defaultImgPath = defaultPath + "/" + fileName;
|
||||||
|
file = new File(defaultImgPath);
|
||||||
|
try {
|
||||||
|
file.createNewFile();
|
||||||
|
FileOutputStream fOut = new FileOutputStream(file);
|
||||||
|
bitmap.compress(Bitmap.CompressFormat.PNG, 20, fOut);
|
||||||
|
// is.close();
|
||||||
|
fOut.flush();
|
||||||
|
fOut.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static File uriToFile(Uri uri, Context context) {
|
||||||
|
String path = null;
|
||||||
|
if ("file".equals(uri.getScheme())) {
|
||||||
|
path = uri.getEncodedPath();
|
||||||
|
if (path != null) {
|
||||||
|
path = Uri.decode(path);
|
||||||
|
ContentResolver cr = context.getContentResolver();
|
||||||
|
StringBuffer buff = new StringBuffer();
|
||||||
|
buff.append("(").append(MediaStore.Images.ImageColumns.DATA).append("=").append("'" + path + "'").append(")");
|
||||||
|
Cursor cur = cr.query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, new String[]{MediaStore.Images.ImageColumns._ID, MediaStore.Images.ImageColumns.DATA}, buff.toString(), null, null);
|
||||||
|
int index = 0;
|
||||||
|
int dataIdx = 0;
|
||||||
|
for (cur.moveToFirst(); !cur.isAfterLast(); cur.moveToNext()) {
|
||||||
|
index = cur.getColumnIndex(MediaStore.Images.ImageColumns._ID);
|
||||||
|
index = cur.getInt(index);
|
||||||
|
dataIdx = cur.getColumnIndex(MediaStore.Images.ImageColumns.DATA);
|
||||||
|
path = cur.getString(dataIdx);
|
||||||
|
}
|
||||||
|
cur.close();
|
||||||
|
if (index == 0) {
|
||||||
|
} else {
|
||||||
|
Uri u = Uri.parse("content://media/external/images/media/" + index);
|
||||||
|
System.out.println("temp uri is :" + u);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (path != null) {
|
||||||
|
return new File(path);
|
||||||
|
}
|
||||||
|
} else if ("content".equals(uri.getScheme())) {
|
||||||
|
// 4.2.2以后
|
||||||
|
String[] proj = {MediaStore.Images.Media.DATA};
|
||||||
|
Cursor cursor = context.getContentResolver().query(uri, proj, null, null, null);
|
||||||
|
if (cursor.moveToFirst()) {
|
||||||
|
int columnIndex = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||||
|
path = cursor.getString(columnIndex);
|
||||||
|
}
|
||||||
|
cursor.close();
|
||||||
|
|
||||||
|
return new File(path);
|
||||||
|
} else {
|
||||||
|
//Log.i(TAG, "Uri Scheme:" + uri.getScheme());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BtnClick {
|
||||||
|
public void selectPic(View view) {
|
||||||
|
openSelector();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void exit(View view) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addContact(View view) {
|
||||||
|
checkContact();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.uiuios.aios.activity.contact;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.hjq.toast.Toaster;
|
||||||
|
import com.trello.rxlifecycle4.RxLifecycle;
|
||||||
|
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||||
|
import com.uiuios.aios.base.mvvm.BaseViewModel;
|
||||||
|
import com.uiuios.aios.bean.BaseResponse;
|
||||||
|
import com.uiuios.aios.databinding.ActivityAddWechatContactBinding;
|
||||||
|
import com.uiuios.aios.network.NetInterfaceManager;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.annotations.NonNull;
|
||||||
|
import io.reactivex.rxjava3.core.Observer;
|
||||||
|
import io.reactivex.rxjava3.disposables.Disposable;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
|
||||||
|
public class AddWechatContactViewModel extends BaseViewModel<ActivityAddWechatContactBinding, ActivityEvent> {
|
||||||
|
@Override
|
||||||
|
public ActivityAddWechatContactBinding getVDBinding() {
|
||||||
|
return binding;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private MutableLiveData<BaseResponse> mBaseResponseMutableLiveData = new MutableLiveData<>();
|
||||||
|
|
||||||
|
public MutableLiveData<BaseResponse> getBaseResponseMutableLiveData() {
|
||||||
|
return mBaseResponseMutableLiveData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addContact(Map<String, String> params, MultipartBody.Part body) {
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getMailListAddObservable(params, body)
|
||||||
|
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<BaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Log.e("addContact", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseResponse baseResponse) {
|
||||||
|
Log.e("addContact", "onNext: " + baseResponse);
|
||||||
|
mBaseResponseMutableLiveData.setValue(baseResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Log.e("addContact", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e("addContact", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,6 @@ import java.util.List;
|
|||||||
|
|
||||||
public class ContactActivity extends BaseMvvmActivity<ContactViewModel, ActivityContactBinding> {
|
public class ContactActivity extends BaseMvvmActivity<ContactViewModel, ActivityContactBinding> {
|
||||||
|
|
||||||
|
|
||||||
private OldContactAdapter mOldContactAdapter;
|
private OldContactAdapter mOldContactAdapter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -80,7 +79,7 @@ public class ContactActivity extends BaseMvvmActivity<ContactViewModel, Activity
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void toAdd(View view){
|
public void toAdd(View view){
|
||||||
Intent intent = new Intent(ContactActivity.this, AddContactActivity.class);
|
Intent intent = new Intent(ContactActivity.this, AddWechatContactActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,10 +141,10 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, PhoneActivityM
|
|||||||
mHomeFragment = new HomeFragment();
|
mHomeFragment = new HomeFragment();
|
||||||
mFragments.add(mHomeFragment);
|
mFragments.add(mHomeFragment);
|
||||||
|
|
||||||
ArrayList<DesktopIcon> desktopIcons = ApkUtils.queryFilterAppInfo(this);
|
ArrayList<DesktopIcon> desktopIcons = ApkUtils.getAppstoreAppInfo(this);
|
||||||
int x = 0;
|
int x = 0;
|
||||||
for (int i = 0; i <= desktopIcons.size(); i++) {
|
for (int i = 0; i <= desktopIcons.size(); i++) {
|
||||||
if (i != 0 && i % APP_LIST_SIZE == 0) {
|
if (i != 0 && i % CommonConfig.DESKTOP_LIST_SIZE == 0) {
|
||||||
AppListFragment appListFragment = new AppListFragment();
|
AppListFragment appListFragment = new AppListFragment();
|
||||||
appListFragment.setAppList(new ArrayList<>(desktopIcons.subList(x, i)));
|
appListFragment.setAppList(new ArrayList<>(desktopIcons.subList(x, i)));
|
||||||
mFragments.add(appListFragment);
|
mFragments.add(appListFragment);
|
||||||
@@ -212,7 +212,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, PhoneActivityM
|
|||||||
public void onChanged(ArrayList<DesktopIcon> desktopIcons) {
|
public void onChanged(ArrayList<DesktopIcon> desktopIcons) {
|
||||||
int x = 0;
|
int x = 0;
|
||||||
for (int i = 0; i <= desktopIcons.size(); i++) {
|
for (int i = 0; i <= desktopIcons.size(); i++) {
|
||||||
if (i != 0 && i % APP_LIST_SIZE == 0) {
|
if (i != 0 && i % CommonConfig.DESKTOP_LIST_SIZE == 0) {
|
||||||
AppListFragment appListFragment = new AppListFragment();
|
AppListFragment appListFragment = new AppListFragment();
|
||||||
appListFragment.setAppList(new ArrayList<>(desktopIcons.subList(x, i)));
|
appListFragment.setAppList(new ArrayList<>(desktopIcons.subList(x, i)));
|
||||||
mFragments.add(appListFragment);
|
mFragments.add(appListFragment);
|
||||||
@@ -294,35 +294,42 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, PhoneActivityM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final static int APP_LIST_SIZE = 3 * 4;
|
|
||||||
|
|
||||||
private void addData() {
|
private void addData() {
|
||||||
Log.e(TAG, "addData: ");
|
Log.e(TAG, "addData: ");
|
||||||
List<Fragment> fragmentList = new ArrayList<>();
|
List<Fragment> fragmentList = new ArrayList<>();
|
||||||
ArrayList<DesktopIcon> applicationInfoList = ApkUtils.queryFilterAppInfo(this);
|
ArrayList<DesktopIcon> applicationInfoList = ApkUtils.getAppstoreAppInfo(this);
|
||||||
|
Log.e(TAG, "addData: applicationInfoList = " + applicationInfoList);
|
||||||
|
Log.e(TAG, "addData: applicationInfoList size = " + applicationInfoList.size());
|
||||||
int x = 0;
|
int x = 0;
|
||||||
for (int i = 0; i <= applicationInfoList.size(); i++) {
|
for (int i = 0; i <= applicationInfoList.size(); i++) {
|
||||||
if (i != 0 && i % APP_LIST_SIZE == 0) {
|
Log.e(TAG, "addData: x = " + x + " i = " + i);
|
||||||
|
if (i != 0 && i % (CommonConfig.DESKTOP_LIST_SIZE) == 0) {//图标数量刚好填满
|
||||||
|
Log.e(TAG, "addData: % = 0");
|
||||||
AppListFragment appListFragment = new AppListFragment();
|
AppListFragment appListFragment = new AppListFragment();
|
||||||
appListFragment.setAppList(new ArrayList<>(applicationInfoList.subList(x, i)));
|
appListFragment.setAppList(new ArrayList<>(applicationInfoList.subList(x, i)));
|
||||||
fragmentList.add(appListFragment);
|
fragmentList.add(appListFragment);
|
||||||
x = i;
|
x = i;
|
||||||
} else if (i == applicationInfoList.size()) {
|
} else if (i == applicationInfoList.size()) {
|
||||||
|
Log.e(TAG, "addData: i == size");
|
||||||
AppListFragment appListFragment = new AppListFragment();
|
AppListFragment appListFragment = new AppListFragment();
|
||||||
fragmentList.add(appListFragment);
|
|
||||||
appListFragment.setAppList(new ArrayList<>(applicationInfoList.subList(x, i)));
|
appListFragment.setAppList(new ArrayList<>(applicationInfoList.subList(x, i)));
|
||||||
|
fragmentList.add(appListFragment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Log.e(TAG, "addData: fragmentList = " + fragmentList);
|
||||||
//从第三个开始改
|
//从第三个开始改
|
||||||
for (int i = 0; i < fragmentList.size(); i++) {
|
for (int i = 0; i < fragmentList.size(); i++) {
|
||||||
if (i + appListIndex < mFragments.size()) {
|
if (i + appListIndex < mFragments.size()) {
|
||||||
mBaseFragmentPagerAdapter.replaceFragment(i + appListIndex, fragmentList.get(i));
|
mBaseFragmentPagerAdapter.replaceFragment(i + appListIndex, fragmentList.get(i));
|
||||||
|
Log.e(TAG, "addData: replaceFragment = " + fragmentList.get(i));
|
||||||
// mFragments.remove(i + 2);
|
// mFragments.remove(i + 2);
|
||||||
// mFragments.add(i + 2, fragmentList.get(i));
|
// mFragments.add(i + 2, fragmentList.get(i));
|
||||||
} else {
|
} else {
|
||||||
// mFragments.add(fragmentList.get(i));
|
// mFragments.add(fragmentList.get(i));
|
||||||
// mBaseFragmentPagerAdapter.getFragments();
|
// mBaseFragmentPagerAdapter.getFragments();
|
||||||
mBaseFragmentPagerAdapter.addFragment(fragmentList.get(i));
|
mBaseFragmentPagerAdapter.addFragment(fragmentList.get(i));
|
||||||
|
Log.e(TAG, "addData: addFragment = " + fragmentList.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = mFragments.size(); i > fragmentList.size() + appListIndex; i--) {
|
for (int i = mFragments.size(); i > fragmentList.size() + appListIndex; i--) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.uiuios.aios.activity;
|
package com.uiuios.aios.activity.noti;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -8,37 +8,49 @@ import android.os.Bundle;
|
|||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
import android.os.Vibrator;
|
import android.os.Vibrator;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
|
import com.uiuios.aios.base.BaseDataBindingActivity;
|
||||||
|
import com.uiuios.aios.databinding.ActivityNoticeBinding;
|
||||||
import com.uiuios.aios.utils.WakeUpUtils;
|
import com.uiuios.aios.utils.WakeUpUtils;
|
||||||
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
import cn.jzvd.Jzvd;
|
import cn.jzvd.Jzvd;
|
||||||
|
|
||||||
public class NoticeActivity extends AppCompatActivity {
|
public class NoticeActivity extends BaseDataBindingActivity {
|
||||||
private String TAG = NoticeActivity.class.getSimpleName();
|
private String TAG = NoticeActivity.class.getSimpleName();
|
||||||
|
|
||||||
@BindView(R.id.positive)
|
private ActivityNoticeBinding mBinding;
|
||||||
TextView positive;
|
|
||||||
|
|
||||||
private int mId;
|
private int mId;
|
||||||
private MediaPlayer mMediaPlayer;
|
private MediaPlayer mMediaPlayer;
|
||||||
private PowerManager mPowerManager;
|
private PowerManager mPowerManager;
|
||||||
private PowerManager.WakeLock mWakeLock;
|
private PowerManager.WakeLock mWakeLock;
|
||||||
private AudioManager mAudioManager;
|
private AudioManager mAudioManager;
|
||||||
|
|
||||||
private Vibrator mVibrator;
|
private Vibrator mVibrator;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void initDataBinding() {
|
||||||
super.onCreate(savedInstanceState);
|
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_notice);
|
||||||
setContentView(R.layout.activity_notice);
|
}
|
||||||
ButterKnife.bind(this);
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initView() {
|
||||||
|
mBinding.positive.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
Intent noticeIntent = new Intent(NoticeActivity.this, NoticeInfoActivity.class);
|
||||||
|
noticeIntent.putExtra("id", mId);
|
||||||
|
startActivity(noticeIntent);
|
||||||
|
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initData() {
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
mId = intent.getIntExtra("id", -1);
|
mId = intent.getIntExtra("id", -1);
|
||||||
|
|
||||||
@@ -58,18 +70,7 @@ public class NoticeActivity extends AppCompatActivity {
|
|||||||
// 开始播放
|
// 开始播放
|
||||||
mMediaPlayer.start();
|
mMediaPlayer.start();
|
||||||
|
|
||||||
positive.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
Intent noticeIntent = new Intent(NoticeActivity.this, NoticeInfoActivity.class);
|
|
||||||
noticeIntent.putExtra("id", mId);
|
|
||||||
startActivity(noticeIntent);
|
|
||||||
|
|
||||||
finish();
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
@@ -1,21 +1,13 @@
|
|||||||
package com.uiuios.aios.activity;
|
package com.uiuios.aios.activity.noti;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
import android.media.MediaPlayer;
|
import android.media.MediaPlayer;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.PowerManager;
|
import android.os.PowerManager;
|
||||||
import android.os.Vibrator;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
||||||
|
|
||||||
import com.blankj.utilcode.util.FileUtils;
|
import com.blankj.utilcode.util.FileUtils;
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
@@ -24,13 +16,14 @@ import com.bumptech.glide.request.RequestOptions;
|
|||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
import com.uiuios.aios.alarm.AlarmClockData;
|
import com.uiuios.aios.alarm.AlarmClockData;
|
||||||
import com.uiuios.aios.alarm.AlarmUtils;
|
import com.uiuios.aios.alarm.AlarmUtils;
|
||||||
|
import com.uiuios.aios.base.mvvm.BaseMvvmActivity;
|
||||||
import com.uiuios.aios.bean.BaseResponse;
|
import com.uiuios.aios.bean.BaseResponse;
|
||||||
|
import com.uiuios.aios.databinding.ActivityNoticeInfoBinding;
|
||||||
import com.uiuios.aios.network.NetInterfaceManager;
|
import com.uiuios.aios.network.NetInterfaceManager;
|
||||||
import com.uiuios.aios.utils.FileUtil;
|
import com.uiuios.aios.utils.FileUtil;
|
||||||
import com.uiuios.aios.utils.ScreenUtils;
|
import com.uiuios.aios.utils.ScreenUtils;
|
||||||
import com.uiuios.aios.utils.Utils;
|
import com.uiuios.aios.utils.Utils;
|
||||||
import com.uiuios.aios.utils.WakeUpUtils;
|
import com.uiuios.aios.utils.WakeUpUtils;
|
||||||
import com.uiuios.aios.view.JzvdStdAssert;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
@@ -38,30 +31,15 @@ import java.io.IOException;
|
|||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
import cn.jzvd.JZDataSource;
|
import cn.jzvd.JZDataSource;
|
||||||
import cn.jzvd.Jzvd;
|
import cn.jzvd.Jzvd;
|
||||||
import io.reactivex.rxjava3.annotations.NonNull;
|
import io.reactivex.rxjava3.annotations.NonNull;
|
||||||
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 NoticeInfoActivity extends AppCompatActivity {
|
public class NoticeInfoActivity extends BaseMvvmActivity<NoticeInfoViewModel, ActivityNoticeInfoBinding> {
|
||||||
private String TAG = NoticeInfoActivity.class.getSimpleName();
|
private String TAG = NoticeInfoActivity.class.getSimpleName();
|
||||||
|
|
||||||
@BindView(R.id.tv_title)
|
|
||||||
TextView tv_title;
|
|
||||||
@BindView(R.id.bt_ok)
|
|
||||||
Button bt_ok;
|
|
||||||
@BindView(R.id.cl_voice)
|
|
||||||
ConstraintLayout cl_voice;
|
|
||||||
@BindView(R.id.cl_vp)
|
|
||||||
ConstraintLayout cl_vp;
|
|
||||||
@BindView(R.id.jz_video)
|
|
||||||
JzvdStdAssert jz_video;
|
|
||||||
@BindView(R.id.imageView)
|
|
||||||
ImageView imageView;
|
|
||||||
|
|
||||||
private AlarmClockData mAlarmClockData;
|
private AlarmClockData mAlarmClockData;
|
||||||
private int mId;
|
private int mId;
|
||||||
private MediaPlayer mMediaPlayer;
|
private MediaPlayer mMediaPlayer;
|
||||||
@@ -69,19 +47,31 @@ public class NoticeInfoActivity extends AppCompatActivity {
|
|||||||
private PowerManager.WakeLock mWakeLock;
|
private PowerManager.WakeLock mWakeLock;
|
||||||
private AudioManager mAudioManager;
|
private AudioManager mAudioManager;
|
||||||
|
|
||||||
private Vibrator mVibrator;
|
@Override
|
||||||
|
protected int getLayoutId() {
|
||||||
|
return R.layout.activity_notice_info;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void initDataBinding() {
|
||||||
super.onCreate(savedInstanceState);
|
mViewModel.setCtx(this);
|
||||||
setContentView(R.layout.activity_notice_info);
|
mViewModel.setVDBinding(mViewDataBinding);
|
||||||
ButterKnife.bind(this);
|
mViewModel.setLifecycle(getLifecycleSubject());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initView() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initData() {
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
mId = intent.getIntExtra("id", -1);
|
mId = intent.getIntExtra("id", -1);
|
||||||
|
|
||||||
mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
||||||
mWakeLock = mPowerManager.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.SCREEN_DIM_WAKE_LOCK, "WakeAndLock");
|
mWakeLock = mPowerManager.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.SCREEN_DIM_WAKE_LOCK, "WakeAndLock");
|
||||||
mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
// mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
|
|
||||||
mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
|
mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
|
||||||
int maxVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
|
int maxVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
|
||||||
@@ -93,8 +83,6 @@ public class NoticeInfoActivity extends AppCompatActivity {
|
|||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
mWakeLock.acquire(60 * 1000L);
|
mWakeLock.acquire(60 * 1000L);
|
||||||
long[] pattern = {1000, 5000, 1000, 5000};
|
|
||||||
mVibrator.vibrate(pattern, 0);
|
|
||||||
WakeUpUtils.wakeUpAndUnlockScreen(this);
|
WakeUpUtils.wakeUpAndUnlockScreen(this);
|
||||||
|
|
||||||
HashMap<Integer, AlarmClockData> oldData = AlarmUtils.getInstance().getOldDataMap();
|
HashMap<Integer, AlarmClockData> oldData = AlarmUtils.getInstance().getOldDataMap();
|
||||||
@@ -104,7 +92,7 @@ public class NoticeInfoActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
Log.e(TAG, "onCreate: " + mAlarmClockData);
|
Log.e(TAG, "onCreate: " + mAlarmClockData);
|
||||||
showPic(mAlarmClockData);
|
showPic(mAlarmClockData);
|
||||||
jz_video.postDelayed(new Runnable() {
|
mViewDataBinding.jzVideo.postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
showData(mAlarmClockData);
|
showData(mAlarmClockData);
|
||||||
@@ -114,8 +102,8 @@ public class NoticeInfoActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void showPic(AlarmClockData alarmClockData) {
|
private void showPic(AlarmClockData alarmClockData) {
|
||||||
tv_title.setText(alarmClockData.getTitle());
|
mViewDataBinding.tvTitle.setText(alarmClockData.getTitle());
|
||||||
bt_ok.setOnClickListener(new View.OnClickListener() {
|
mViewDataBinding.btOk.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
HashMap<Integer, AlarmClockData> oldData = AlarmUtils.getInstance().getOldDataMap();
|
HashMap<Integer, AlarmClockData> oldData = AlarmUtils.getInstance().getOldDataMap();
|
||||||
@@ -155,7 +143,7 @@ public class NoticeInfoActivity extends AppCompatActivity {
|
|||||||
String voiceUrl = alarmClockData.getVoice();
|
String voiceUrl = alarmClockData.getVoice();
|
||||||
String voicemd5 = alarmClockData.getVoice_md5();
|
String voicemd5 = alarmClockData.getVoice_md5();
|
||||||
if (!TextUtils.isEmpty(voiceUrl)) {
|
if (!TextUtils.isEmpty(voiceUrl)) {
|
||||||
cl_voice.setVisibility(View.VISIBLE);
|
mViewDataBinding.clVoice.setVisibility(View.VISIBLE);
|
||||||
String fileName = Utils.getFileNamefromURL(voiceUrl);
|
String fileName = Utils.getFileNamefromURL(voiceUrl);
|
||||||
File file = new File(Utils.getDownLoadPath(NoticeInfoActivity.this) + fileName);
|
File file = new File(Utils.getDownLoadPath(NoticeInfoActivity.this) + fileName);
|
||||||
String fileMD5 = FileUtils.getFileMD5ToString(file);
|
String fileMD5 = FileUtils.getFileMD5ToString(file);
|
||||||
@@ -179,17 +167,17 @@ public class NoticeInfoActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
} else {
|
} else {
|
||||||
cl_voice.setVisibility(View.GONE);
|
mViewDataBinding.clVoice.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
String filePath = alarmClockData.getFile();
|
String filePath = alarmClockData.getFile();
|
||||||
RequestOptions options = new RequestOptions().transform(new RoundedCorners(ScreenUtils.dip2px(this, 16F)));
|
RequestOptions options = new RequestOptions().transform(new RoundedCorners(ScreenUtils.dip2px(this, 16F)));
|
||||||
String fileName = filePath.substring(filePath.lastIndexOf("/") + 1, filePath.length());
|
String fileName = filePath.substring(filePath.lastIndexOf("/") + 1, filePath.length());
|
||||||
String realPath = Utils.getDownLoadPath(NoticeInfoActivity.this) + fileName;
|
String realPath = Utils.getDownLoadPath(NoticeInfoActivity.this) + fileName;
|
||||||
File file = new File(realPath);
|
File file = new File(realPath);
|
||||||
if (file.exists()){
|
if (file.exists()) {
|
||||||
Glide.with(NoticeInfoActivity.this).load(file).apply(options).error(R.drawable.icon_nodata).into(imageView);
|
Glide.with(NoticeInfoActivity.this).load(file).apply(options).error(R.drawable.icon_nodata).into(mViewDataBinding.imageView);
|
||||||
}else {
|
} else {
|
||||||
Glide.with(NoticeInfoActivity.this).load(filePath).apply(options).error(R.drawable.icon_nodata).into(imageView);
|
Glide.with(NoticeInfoActivity.this).load(filePath).apply(options).error(R.drawable.icon_nodata).into(mViewDataBinding.imageView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,24 +185,24 @@ public class NoticeInfoActivity extends AppCompatActivity {
|
|||||||
private void showData(AlarmClockData alarmClockData) {
|
private void showData(AlarmClockData alarmClockData) {
|
||||||
String filePath = alarmClockData.getFile();
|
String filePath = alarmClockData.getFile();
|
||||||
if (!TextUtils.isEmpty(filePath)) {
|
if (!TextUtils.isEmpty(filePath)) {
|
||||||
cl_vp.setVisibility(View.VISIBLE);
|
mViewDataBinding.clVp.setVisibility(View.VISIBLE);
|
||||||
String fileType = FileUtil.getFileType(filePath);
|
String fileType = FileUtil.getFileType(filePath);
|
||||||
Log.e(TAG, "showData: " + fileType);
|
Log.e(TAG, "showData: " + fileType);
|
||||||
if (FileUtil.isPictureFile(fileType)) {
|
if (FileUtil.isPictureFile(fileType)) {
|
||||||
jz_video.setVisibility(View.GONE);
|
mViewDataBinding.jzVideo.setVisibility(View.GONE);
|
||||||
imageView.setVisibility(View.VISIBLE);
|
mViewDataBinding.imageView.setVisibility(View.VISIBLE);
|
||||||
RequestOptions options = new RequestOptions().transform(new RoundedCorners(ScreenUtils.dip2px(this, 16F)));
|
RequestOptions options = new RequestOptions().transform(new RoundedCorners(ScreenUtils.dip2px(this, 16F)));
|
||||||
String fileName = filePath.substring(filePath.lastIndexOf("/") + 1, filePath.length());
|
String fileName = filePath.substring(filePath.lastIndexOf("/") + 1, filePath.length());
|
||||||
String realPath = Utils.getDownLoadPath(NoticeInfoActivity.this) + fileName;
|
String realPath = Utils.getDownLoadPath(NoticeInfoActivity.this) + fileName;
|
||||||
File file = new File(realPath);
|
File file = new File(realPath);
|
||||||
if (file.exists()){
|
if (file.exists()) {
|
||||||
Glide.with(NoticeInfoActivity.this).load(file).apply(options).error(R.drawable.icon_nodata).into(imageView);
|
Glide.with(NoticeInfoActivity.this).load(file).apply(options).error(R.drawable.icon_nodata).into(mViewDataBinding.imageView);
|
||||||
}else {
|
} else {
|
||||||
Glide.with(NoticeInfoActivity.this).load(filePath).apply(options).error(R.drawable.icon_nodata).into(imageView);
|
Glide.with(NoticeInfoActivity.this).load(filePath).apply(options).error(R.drawable.icon_nodata).into(mViewDataBinding.imageView);
|
||||||
}
|
}
|
||||||
} else if (FileUtil.isVideoFile(fileType)) {
|
} else if (FileUtil.isVideoFile(fileType)) {
|
||||||
jz_video.setVisibility(View.VISIBLE);
|
mViewDataBinding.jzVideo.setVisibility(View.VISIBLE);
|
||||||
imageView.setVisibility(View.GONE);
|
mViewDataBinding.imageView.setVisibility(View.GONE);
|
||||||
String fileName = filePath.substring(filePath.lastIndexOf("/") + 1, filePath.length());
|
String fileName = filePath.substring(filePath.lastIndexOf("/") + 1, filePath.length());
|
||||||
String realPath = Utils.getDownLoadPath(NoticeInfoActivity.this) + fileName;
|
String realPath = Utils.getDownLoadPath(NoticeInfoActivity.this) + fileName;
|
||||||
File file = new File(realPath);
|
File file = new File(realPath);
|
||||||
@@ -228,13 +216,13 @@ public class NoticeInfoActivity extends AppCompatActivity {
|
|||||||
jzDataSource = new JZDataSource(uri.toString(), "");
|
jzDataSource = new JZDataSource(uri.toString(), "");
|
||||||
}
|
}
|
||||||
jzDataSource.looping = true;
|
jzDataSource.looping = true;
|
||||||
jz_video.setUp(jzDataSource, Jzvd.SCREEN_NORMAL);
|
mViewDataBinding.jzVideo.setUp(jzDataSource, Jzvd.SCREEN_NORMAL);
|
||||||
jz_video.startPreloading();
|
mViewDataBinding.jzVideo.startPreloading();
|
||||||
jz_video.startVideoAfterPreloading();
|
mViewDataBinding.jzVideo.startVideoAfterPreloading();
|
||||||
jz_video.startVideo();
|
mViewDataBinding.jzVideo.startVideo();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cl_vp.setVisibility(View.GONE);
|
mViewDataBinding.clVp.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -249,9 +237,6 @@ public class NoticeInfoActivity extends AppCompatActivity {
|
|||||||
mMediaPlayer.release();
|
mMediaPlayer.release();
|
||||||
mMediaPlayer = null;
|
mMediaPlayer = null;
|
||||||
}
|
}
|
||||||
if (mVibrator != null) {
|
|
||||||
mVibrator.cancel();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.uiuios.aios.activity.noti;
|
||||||
|
|
||||||
|
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||||
|
import com.uiuios.aios.base.mvvm.BaseViewModel;
|
||||||
|
import com.uiuios.aios.databinding.ActivityNoticeInfoBinding;
|
||||||
|
|
||||||
|
public class NoticeInfoViewModel extends BaseViewModel<ActivityNoticeInfoBinding, ActivityEvent> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ActivityNoticeInfoBinding getVDBinding() {
|
||||||
|
return binding;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
package com.uiuios.aios.activity.wecontact;
|
|
||||||
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
|
||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
|
||||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
|
||||||
import com.bumptech.glide.request.RequestOptions;
|
|
||||||
import com.hjq.toast.Toaster;
|
|
||||||
import com.luck.picture.lib.basic.PictureSelector;
|
|
||||||
import com.luck.picture.lib.config.SelectMimeType;
|
|
||||||
import com.luck.picture.lib.entity.LocalMedia;
|
|
||||||
import com.luck.picture.lib.interfaces.OnResultCallbackListener;
|
|
||||||
import com.uiuios.aios.R;
|
|
||||||
import com.uiuios.aios.base.GlideEngine;
|
|
||||||
import com.uiuios.aios.base.mvvm.BaseMvvmActivity;
|
|
||||||
import com.uiuios.aios.bean.WechatInfo;
|
|
||||||
import com.uiuios.aios.databinding.ActivityAddWechatContactBinding;
|
|
||||||
import com.uiuios.aios.db.ContactManager;
|
|
||||||
import com.uiuios.aios.utils.ScreenUtil;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class AddWechatContactActivity extends BaseMvvmActivity<AddWechatContactViewModel, ActivityAddWechatContactBinding> {
|
|
||||||
private static final String TAG = AddWechatContactActivity.class.getSimpleName();
|
|
||||||
|
|
||||||
private String mPictrueFilePath;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int getLayoutId() {
|
|
||||||
return R.layout.activity_add_wechat_contact;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void initDataBinding() {
|
|
||||||
mViewModel.setCtx(this);
|
|
||||||
mViewModel.setVDBinding(mViewDataBinding);
|
|
||||||
mViewModel.setLifecycle(getLifecycleSubject());
|
|
||||||
mViewDataBinding.setClick(new BtnClick());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void initView() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void initData() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void openSelector() {
|
|
||||||
PictureSelector.create(AddWechatContactActivity.this)
|
|
||||||
.openGallery(SelectMimeType.ofAll())
|
|
||||||
.setSelectionMode(1)
|
|
||||||
.setImageEngine(GlideEngine.createGlideEngine())
|
|
||||||
.forResult(new OnResultCallbackListener<LocalMedia>() {
|
|
||||||
@Override
|
|
||||||
public void onResult(ArrayList<LocalMedia> result) {
|
|
||||||
mPictrueFilePath = result.get(0).getRealPath();
|
|
||||||
File file = new File(mPictrueFilePath);
|
|
||||||
if (file.exists()) {
|
|
||||||
RequestOptions options = new RequestOptions().transform(new RoundedCorners(ScreenUtil.dip2px(AddWechatContactActivity.this, 8F)));
|
|
||||||
Glide.with(mViewDataBinding.nvAvatar).load(file).apply(options).into(mViewDataBinding.nvAvatar);
|
|
||||||
} else {
|
|
||||||
mPictrueFilePath = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCancel() {
|
|
||||||
Log.e(TAG, "onCancel: ");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public class BtnClick {
|
|
||||||
public void selectPic(View view){
|
|
||||||
openSelector();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void exit(View view){
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addContact(View view) {
|
|
||||||
if (TextUtils.isEmpty(mViewDataBinding.etName.getText())) {
|
|
||||||
Toaster.show("请输入微信备注");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (TextUtils.isEmpty(mViewDataBinding.etGroup.getText())) {
|
|
||||||
Toaster.show("请输入微信群组标签");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (TextUtils.isEmpty(mViewDataBinding.etPhone.getText())) {
|
|
||||||
Toaster.show("请输入手机号码");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// if (TextUtils.isEmpty(mPictrueFilePath)) {
|
|
||||||
// Toaster.show("请选择图片");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
WechatInfo wechatInfo = new WechatInfo();
|
|
||||||
if (!TextUtils.isEmpty(mViewDataBinding.etName.getText())) {
|
|
||||||
wechatInfo.setNickName(mViewDataBinding.etName.getText().toString());
|
|
||||||
}
|
|
||||||
if (!TextUtils.isEmpty(mViewDataBinding.etGroup.getText())) {
|
|
||||||
wechatInfo.setGroupTag(mViewDataBinding.etGroup.getText().toString());
|
|
||||||
}
|
|
||||||
if (!TextUtils.isEmpty(mViewDataBinding.etWechatId.getText())) {
|
|
||||||
wechatInfo.setWechatId(mViewDataBinding.etWechatId.getText().toString());
|
|
||||||
}
|
|
||||||
if (!TextUtils.isEmpty(mViewDataBinding.etPhone.getText())) {
|
|
||||||
wechatInfo.setMobile(mViewDataBinding.etPhone.getText().toString());
|
|
||||||
}
|
|
||||||
if (!TextUtils.isEmpty(mPictrueFilePath)) {
|
|
||||||
wechatInfo.setAvatarPath(mPictrueFilePath);
|
|
||||||
}
|
|
||||||
if (ContactManager.getInstance().addWechatInfo(wechatInfo)) {
|
|
||||||
Toaster.show("添加成功");
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
package com.uiuios.aios.activity.wecontact;
|
|
||||||
|
|
||||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
|
||||||
import com.uiuios.aios.base.mvvm.BaseViewModel;
|
|
||||||
import com.uiuios.aios.databinding.ActivityAddWechatContactBinding;
|
|
||||||
|
|
||||||
public class AddWechatContactViewModel extends BaseViewModel<ActivityAddWechatContactBinding, ActivityEvent> {
|
|
||||||
@Override
|
|
||||||
public ActivityAddWechatContactBinding getVDBinding() {
|
|
||||||
return binding;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -18,7 +18,7 @@ import com.bumptech.glide.Glide;
|
|||||||
import com.hjq.toast.Toaster;
|
import com.hjq.toast.Toaster;
|
||||||
import com.shehuan.niv.NiceImageView;
|
import com.shehuan.niv.NiceImageView;
|
||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
import com.uiuios.aios.activity.contact.AddContactActivity;
|
import com.uiuios.aios.activity.contact.AddWechatContactActivity;
|
||||||
import com.uiuios.aios.activity.records.RecordsActivity;
|
import com.uiuios.aios.activity.records.RecordsActivity;
|
||||||
import com.uiuios.aios.bean.Contact;
|
import com.uiuios.aios.bean.Contact;
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ public class ContactAdapter extends RecyclerView.Adapter<ContactAdapter.ContactH
|
|||||||
Toaster.show("无法打开电话功能");
|
Toaster.show("无法打开电话功能");
|
||||||
}
|
}
|
||||||
} else if (DIALER_ADD_CONTACT.equals(contact.getMobile())) {
|
} else if (DIALER_ADD_CONTACT.equals(contact.getMobile())) {
|
||||||
Intent intent = new Intent(mContext, AddContactActivity.class);
|
Intent intent = new Intent(mContext, AddWechatContactActivity.class);
|
||||||
mContext.startActivity(intent);
|
mContext.startActivity(intent);
|
||||||
} else if (!TextUtils.isEmpty(phone)) {
|
} else if (!TextUtils.isEmpty(phone)) {
|
||||||
Uri data = Uri.parse("tel:" + phone);
|
Uri data = Uri.parse("tel:" + phone);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import com.bumptech.glide.Glide;
|
|||||||
import com.hjq.toast.Toaster;
|
import com.hjq.toast.Toaster;
|
||||||
import com.shehuan.niv.NiceImageView;
|
import com.shehuan.niv.NiceImageView;
|
||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
import com.uiuios.aios.activity.contact.AddContactActivity;
|
import com.uiuios.aios.activity.contact.AddWechatContactActivity;
|
||||||
import com.uiuios.aios.activity.records.RecordsActivity;
|
import com.uiuios.aios.activity.records.RecordsActivity;
|
||||||
import com.uiuios.aios.bean.Contact;
|
import com.uiuios.aios.bean.Contact;
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ public class HomeContactAdapter extends RecyclerView.Adapter<HomeContactAdapter.
|
|||||||
Toaster.show("无法打开电话功能");
|
Toaster.show("无法打开电话功能");
|
||||||
}
|
}
|
||||||
} else if (DIALER_ADD_CONTACT.equals(contact.getMobile())) {
|
} else if (DIALER_ADD_CONTACT.equals(contact.getMobile())) {
|
||||||
Intent intent = new Intent(mContext, AddContactActivity.class);
|
Intent intent = new Intent(mContext, AddWechatContactActivity.class);
|
||||||
mContext.startActivity(intent);
|
mContext.startActivity(intent);
|
||||||
} else if (!TextUtils.isEmpty(phone)) {
|
} else if (!TextUtils.isEmpty(phone)) {
|
||||||
Uri data = Uri.parse("tel:" + phone);
|
Uri data = Uri.parse("tel:" + phone);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import com.bumptech.glide.Glide;
|
|||||||
import com.hjq.toast.Toaster;
|
import com.hjq.toast.Toaster;
|
||||||
import com.shehuan.niv.NiceImageView;
|
import com.shehuan.niv.NiceImageView;
|
||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
import com.uiuios.aios.activity.contact.AddContactActivity;
|
import com.uiuios.aios.activity.contact.AddWechatContactActivity;
|
||||||
import com.uiuios.aios.activity.records.RecordsActivity;
|
import com.uiuios.aios.activity.records.RecordsActivity;
|
||||||
import com.uiuios.aios.bean.Contact;
|
import com.uiuios.aios.bean.Contact;
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ public class OldContactAdapter extends RecyclerView.Adapter<OldContactAdapter.Co
|
|||||||
Toaster.show("无法打开电话功能");
|
Toaster.show("无法打开电话功能");
|
||||||
}
|
}
|
||||||
} else if (DIALER_ADD_CONTACT.equals(contact.getMobile())) {
|
} else if (DIALER_ADD_CONTACT.equals(contact.getMobile())) {
|
||||||
Intent intent = new Intent(mContext, AddContactActivity.class);
|
Intent intent = new Intent(mContext, AddWechatContactActivity.class);
|
||||||
mContext.startActivity(intent);
|
mContext.startActivity(intent);
|
||||||
} else if (!TextUtils.isEmpty(phone)) {
|
} else if (!TextUtils.isEmpty(phone)) {
|
||||||
Uri data = Uri.parse("tel:" + phone);
|
Uri data = Uri.parse("tel:" + phone);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.shehuan.niv.NiceImageView;
|
|||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
import com.uiuios.aios.activity.callwechat.CallWechatActivity;
|
import com.uiuios.aios.activity.callwechat.CallWechatActivity;
|
||||||
import com.uiuios.aios.alarm.AlarmClockData;
|
import com.uiuios.aios.alarm.AlarmClockData;
|
||||||
|
import com.uiuios.aios.bean.Contact;
|
||||||
import com.uiuios.aios.bean.WechatInfo;
|
import com.uiuios.aios.bean.WechatInfo;
|
||||||
import com.uiuios.aios.db.ContactManager;
|
import com.uiuios.aios.db.ContactManager;
|
||||||
import com.uiuios.aios.dialog.DeleteContactDialog;
|
import com.uiuios.aios.dialog.DeleteContactDialog;
|
||||||
@@ -33,13 +34,13 @@ import java.util.List;
|
|||||||
public class WechatContactAdapter extends RecyclerView.Adapter<WechatContactAdapter.ContactHolder> {
|
public class WechatContactAdapter extends RecyclerView.Adapter<WechatContactAdapter.ContactHolder> {
|
||||||
private static final String TAG = WechatContactAdapter.class.getSimpleName();
|
private static final String TAG = WechatContactAdapter.class.getSimpleName();
|
||||||
|
|
||||||
private List<WechatInfo> mContactList;
|
private List<Contact> mContactList;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
|
||||||
public static final String DIALER_PACKAGE = "com.android.dialer";
|
public static final String DIALER_PACKAGE = "com.android.dialer";
|
||||||
public static final String DIALER_ADD_CONTACT = "com.uiui.aios.contact.add";
|
public static final String DIALER_ADD_CONTACT = "com.uiui.aios.contact.add";
|
||||||
|
|
||||||
public void setContactList(List<WechatInfo> contactList) {
|
public void setContactList(List<Contact> contactList) {
|
||||||
this.mContactList = contactList;
|
this.mContactList = contactList;
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
@@ -51,7 +52,7 @@ public class WechatContactAdapter extends RecyclerView.Adapter<WechatContactAdap
|
|||||||
}
|
}
|
||||||
|
|
||||||
public interface OnLongClick {
|
public interface OnLongClick {
|
||||||
void setOnLongClickListener(WechatInfo wechatInfo);
|
void setOnLongClickListener(Contact contact);
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@@ -63,10 +64,10 @@ public class WechatContactAdapter extends RecyclerView.Adapter<WechatContactAdap
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull ContactHolder contactHolder, int position) {
|
public void onBindViewHolder(@NonNull ContactHolder contactHolder, int position) {
|
||||||
WechatInfo contact = mContactList.get(position);
|
Contact contact = mContactList.get(position);
|
||||||
contactHolder.tv_name.setText(contact.getNickName());
|
contactHolder.tv_name.setText(contact.getName());
|
||||||
contactHolder.tv_phone.setText(contact.getMobile());
|
contactHolder.tv_phone.setText(contact.getMobile());
|
||||||
Glide.with(contactHolder.iv_head).load(contact.getAvatarPath()).error(R.drawable.default_avatar).into(contactHolder.iv_head);
|
Glide.with(contactHolder.iv_head).load(contact.getAvatar()).error(R.drawable.default_avatar).into(contactHolder.iv_head);
|
||||||
contactHolder.root.setOnClickListener(new View.OnClickListener() {
|
contactHolder.root.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import com.bumptech.glide.Glide;
|
|||||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||||
import com.bumptech.glide.request.RequestOptions;
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
import com.uiuios.aios.activity.alarmclock.AlarmClockEditActivity;
|
import com.uiuios.aios.activity.alarmclock.edit.AlarmClockEditActivity;
|
||||||
import com.uiuios.aios.utils.FFmpegUtils;
|
import com.uiuios.aios.utils.FFmpegUtils;
|
||||||
import com.uiuios.aios.utils.ScreenUtils;
|
import com.uiuios.aios.utils.ScreenUtils;
|
||||||
import com.uiuios.aios.utils.Utils;
|
import com.uiuios.aios.utils.Utils;
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ public class BaseFragmentPagerAdapter extends FragmentPagerAdapter {
|
|||||||
removeFragmentInternal(oldFragment);
|
removeFragmentInternal(oldFragment);
|
||||||
mFragmentList.set(position, newFragment);
|
mFragmentList.set(position, newFragment);
|
||||||
notifyItemChanged();
|
notifyItemChanged();
|
||||||
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import java.lang.reflect.ParameterizedType;
|
|||||||
* @date: 2021/12/15
|
* @date: 2021/12/15
|
||||||
*/
|
*/
|
||||||
public abstract class BaseMvvmFragment<VM extends ViewModel, VDB extends ViewDataBinding> extends BaseFragment {
|
public abstract class BaseMvvmFragment<VM extends ViewModel, VDB extends ViewDataBinding> extends BaseFragment {
|
||||||
protected String mTag = this.getClass().getSimpleName();
|
protected String TAG = this.getClass().getSimpleName();
|
||||||
/**
|
/**
|
||||||
* 是否顯示了
|
* 是否顯示了
|
||||||
*/
|
*/
|
||||||
@@ -65,6 +65,7 @@ public abstract class BaseMvvmFragment<VM extends ViewModel, VDB extends ViewDat
|
|||||||
public void onAttach(@NonNull Context context) {
|
public void onAttach(@NonNull Context context) {
|
||||||
super.onAttach(context);
|
super.onAttach(context);
|
||||||
// this.context = context;
|
// this.context = context;
|
||||||
|
Log.e(TAG, "onAttach: ");
|
||||||
ctx = new WeakReference<>(context);
|
ctx = new WeakReference<>(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +83,7 @@ public abstract class BaseMvvmFragment<VM extends ViewModel, VDB extends ViewDat
|
|||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
Log.e(TAG, "onCreateView: ");
|
||||||
//ViewDataBinding
|
//ViewDataBinding
|
||||||
mViewDataBinding = DataBindingUtil.inflate(inflater, getLayoutId(), container, false);
|
mViewDataBinding = DataBindingUtil.inflate(inflater, getLayoutId(), container, false);
|
||||||
mViewDataBinding.setLifecycleOwner(this);
|
mViewDataBinding.setLifecycleOwner(this);
|
||||||
@@ -97,6 +99,7 @@ public abstract class BaseMvvmFragment<VM extends ViewModel, VDB extends ViewDat
|
|||||||
@Override
|
@Override
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
Log.e(TAG, "onViewCreated: ");
|
||||||
|
|
||||||
// if (initStatusBarToolBar()) {
|
// if (initStatusBarToolBar()) {
|
||||||
// toolbar = getToolbar();
|
// toolbar = getToolbar();
|
||||||
@@ -130,6 +133,7 @@ public abstract class BaseMvvmFragment<VM extends ViewModel, VDB extends ViewDat
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
super.onDestroyView();
|
super.onDestroyView();
|
||||||
|
Log.e(TAG, "onDestroyView: ");
|
||||||
mHasPrepare = false;
|
mHasPrepare = false;
|
||||||
mViewDataBinding = null;
|
mViewDataBinding = null;
|
||||||
//移除eventbus
|
//移除eventbus
|
||||||
@@ -141,6 +145,7 @@ public abstract class BaseMvvmFragment<VM extends ViewModel, VDB extends ViewDat
|
|||||||
@Override
|
@Override
|
||||||
public void setUserVisibleHint(boolean isVisibleToUser) {
|
public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||||
super.setUserVisibleHint(isVisibleToUser);
|
super.setUserVisibleHint(isVisibleToUser);
|
||||||
|
Log.e(TAG, "setUserVisibleHint: ");
|
||||||
if (mIsVisible == getUserVisibleHint())
|
if (mIsVisible == getUserVisibleHint())
|
||||||
return;
|
return;
|
||||||
mIsVisible = getUserVisibleHint();
|
mIsVisible = getUserVisibleHint();
|
||||||
@@ -171,6 +176,7 @@ public abstract class BaseMvvmFragment<VM extends ViewModel, VDB extends ViewDat
|
|||||||
@Override
|
@Override
|
||||||
public void onConfigurationChanged(Configuration newConfig) {
|
public void onConfigurationChanged(Configuration newConfig) {
|
||||||
super.onConfigurationChanged(newConfig);
|
super.onConfigurationChanged(newConfig);
|
||||||
|
Log.e(TAG, "onConfigurationChanged: ");
|
||||||
// fitsLayoutOverlap();
|
// fitsLayoutOverlap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public class Contact implements Serializable {
|
|||||||
int is_urgent;//是否紧急联系人 0否1是
|
int is_urgent;//是否紧急联系人 0否1是
|
||||||
String mobile;//手机号
|
String mobile;//手机号
|
||||||
String avatar;//头像
|
String avatar;//头像
|
||||||
|
String tag;//标签
|
||||||
boolean simContact;
|
boolean simContact;
|
||||||
|
|
||||||
public Contact() {
|
public Contact() {
|
||||||
@@ -67,6 +68,14 @@ public class Contact implements Serializable {
|
|||||||
this.avatar = avatar;
|
this.avatar = avatar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getTag() {
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTag(String tag) {
|
||||||
|
this.tag = tag;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isSimContact() {
|
public boolean isSimContact() {
|
||||||
return simContact;
|
return simContact;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package com.uiuios.aios.config;
|
|||||||
|
|
||||||
public class CommonConfig {
|
public class CommonConfig {
|
||||||
public static final String MMKV_ID = "InterProcessKV";
|
public static final String MMKV_ID = "InterProcessKV";
|
||||||
|
/*桌面图标个数*/
|
||||||
|
public final static int DESKTOP_LIST_SIZE = 3 * 3;
|
||||||
|
|
||||||
|
|
||||||
public static final String MAP_LOCATION_JSON_KEY = "MAPLOCATION_JSON_STRING";
|
public static final String MAP_LOCATION_JSON_KEY = "MAPLOCATION_JSON_STRING";
|
||||||
public static final String MAP_LONGITUDE_KEY = "map_longitude_key";
|
public static final String MAP_LONGITUDE_KEY = "map_longitude_key";
|
||||||
@@ -61,7 +64,6 @@ public class CommonConfig {
|
|||||||
public static final String MAP_DEFAULT_ADDRESS_JSON_KEY = "amap_default_address_json_key";
|
public static final String MAP_DEFAULT_ADDRESS_JSON_KEY = "amap_default_address_json_key";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static final String WEATHER_NOW_KEY = "WEATHER_NOW_JSON_STRING";
|
public static final String WEATHER_NOW_KEY = "WEATHER_NOW_JSON_STRING";
|
||||||
public static final String WEATHER_DAILY_KEY = "WEATHER_DAILY_JSON_STRING";
|
public static final String WEATHER_DAILY_KEY = "WEATHER_DAILY_JSON_STRING";
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import com.uiuios.aios.R;
|
|||||||
import com.uiuios.aios.activity.ScreenLockActivity;
|
import com.uiuios.aios.activity.ScreenLockActivity;
|
||||||
import com.uiuios.aios.activity.dailyapp.DailyAppActivity;
|
import com.uiuios.aios.activity.dailyapp.DailyAppActivity;
|
||||||
import com.uiuios.aios.activity.main.OldMainActivity;
|
import com.uiuios.aios.activity.main.OldMainActivity;
|
||||||
|
import com.uiuios.aios.base.BaseFragment;
|
||||||
import com.uiuios.aios.base.mvvm.fragment.BaseMvvmFragment;
|
import com.uiuios.aios.base.mvvm.fragment.BaseMvvmFragment;
|
||||||
import com.uiuios.aios.bean.BaseResponse;
|
import com.uiuios.aios.bean.BaseResponse;
|
||||||
import com.uiuios.aios.bean.DesktopIcon;
|
import com.uiuios.aios.bean.DesktopIcon;
|
||||||
@@ -60,7 +61,7 @@ import io.reactivex.rxjava3.disposables.Disposable;
|
|||||||
* Use the {@link AppListFragment#newInstance} factory method to
|
* Use the {@link AppListFragment#newInstance} factory method to
|
||||||
* create an instance of this fragment.
|
* create an instance of this fragment.
|
||||||
*/
|
*/
|
||||||
public class AppListFragment extends BaseMvvmFragment<AppListViewModel, FragmentApplistBinding> {
|
public class AppListFragment extends BaseFragment {
|
||||||
// TODO: Rename parameter arguments, choose names that match
|
// TODO: Rename parameter arguments, choose names that match
|
||||||
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
||||||
private static final String ARG_PARAM1 = "param1";
|
private static final String ARG_PARAM1 = "param1";
|
||||||
@@ -70,6 +71,7 @@ public class AppListFragment extends BaseMvvmFragment<AppListViewModel, Fragment
|
|||||||
private String mParam1;
|
private String mParam1;
|
||||||
private String mParam2;
|
private String mParam2;
|
||||||
|
|
||||||
|
private Context mContext;
|
||||||
private ArrayList<DesktopIcon> mDesktopIcons;
|
private ArrayList<DesktopIcon> mDesktopIcons;
|
||||||
private MyGridLayout gridLayout;
|
private MyGridLayout gridLayout;
|
||||||
private String TAG = AppListFragment.class.getSimpleName();
|
private String TAG = AppListFragment.class.getSimpleName();
|
||||||
@@ -100,9 +102,9 @@ public class AppListFragment extends BaseMvvmFragment<AppListViewModel, Fragment
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
if (savedInstanceState != null) {
|
// if (savedInstanceState != null) {
|
||||||
mDesktopIcons = savedInstanceState.getParcelableArrayList("applicationInfos");
|
// mDesktopIcons = savedInstanceState.getParcelableArrayList("applicationInfos");
|
||||||
}
|
// }
|
||||||
if (getArguments() != null) {
|
if (getArguments() != null) {
|
||||||
mParam1 = getArguments().getString(ARG_PARAM1);
|
mParam1 = getArguments().getString(ARG_PARAM1);
|
||||||
mParam2 = getArguments().getString(ARG_PARAM2);
|
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||||
@@ -114,34 +116,33 @@ public class AppListFragment extends BaseMvvmFragment<AppListViewModel, Fragment
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private View rootView;
|
||||||
protected int getLayoutId() {
|
|
||||||
return R.layout.fragment_applist;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initDataBinding() {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
mViewModel.setCtx(getCtx());
|
// Inflate the layout for this fragment
|
||||||
mViewModel.setLifecycle(getLifecycleSubject());
|
rootView = inflater.inflate(R.layout.fragment_applist, container, false);
|
||||||
mViewModel.setVDBinding(mViewDataBinding);
|
mContext = rootView.getContext();
|
||||||
|
mLauncherApps = (LauncherApps) mContext.getSystemService(Context.LAUNCHER_APPS_SERVICE);
|
||||||
|
initView();
|
||||||
|
return rootView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private void initView() {
|
||||||
protected void initView(Bundle bundle) {
|
if (mDesktopIcons.size() != CommonConfig.DESKTOP_LIST_SIZE) {
|
||||||
if (mDesktopIcons.size() != 12) {
|
mDesktopIcons.addAll(new ArrayList<>(Arrays.asList(new DesktopIcon[CommonConfig.DESKTOP_LIST_SIZE - mDesktopIcons.size()])));
|
||||||
mDesktopIcons.addAll(new ArrayList<>(Arrays.asList(new DesktopIcon[12 - mDesktopIcons.size()])));
|
|
||||||
}
|
}
|
||||||
gridLayout = getActivity().findViewById(R.id.list);
|
gridLayout = rootView.findViewById(R.id.list);
|
||||||
if (getCtx().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
// if (mContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||||
|
// gridLayout.set(3, 3);
|
||||||
|
// } else {
|
||||||
gridLayout.set(3, 3);
|
gridLayout.set(3, 3);
|
||||||
} else {
|
// }
|
||||||
gridLayout.set(3, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
gridLayout.setGridAdapter(new MyGridLayout.GridAdatper() {
|
gridLayout.setGridAdapter(new MyGridLayout.GridAdatper() {
|
||||||
@Override
|
@Override
|
||||||
public View getView(int index) {
|
public View getView(int index) {
|
||||||
PackageManager pm = getCtx().getPackageManager();
|
PackageManager pm = mContext.getPackageManager();
|
||||||
View view = getLayoutInflater().inflate(R.layout.item_actions, null);
|
View view = getLayoutInflater().inflate(R.layout.item_actions, null);
|
||||||
ImageView iv = view.findViewById(R.id.iv);
|
ImageView iv = view.findViewById(R.id.iv);
|
||||||
ImageView iv_app = view.findViewById(R.id.iv_app);
|
ImageView iv_app = view.findViewById(R.id.iv_app);
|
||||||
@@ -153,7 +154,7 @@ public class AppListFragment extends BaseMvvmFragment<AppListViewModel, Fragment
|
|||||||
String pkg = desktopIcon.getPackage();
|
String pkg = desktopIcon.getPackage();
|
||||||
if (desktopIcon instanceof ShortcutPkgInfo) {
|
if (desktopIcon instanceof ShortcutPkgInfo) {
|
||||||
iv_app.setVisibility(View.VISIBLE);
|
iv_app.setVisibility(View.VISIBLE);
|
||||||
iv_app.setImageDrawable(ApkUtils.getAppDrawable(getCtx(), pkg));
|
iv_app.setImageDrawable(ApkUtils.getAppDrawable(mContext, pkg));
|
||||||
} else {
|
} else {
|
||||||
iv_app.setVisibility(View.GONE);
|
iv_app.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
@@ -181,16 +182,16 @@ public class AppListFragment extends BaseMvvmFragment<AppListViewModel, Fragment
|
|||||||
}
|
}
|
||||||
if (i != -1) {
|
if (i != -1) {
|
||||||
String val = IconUtils.appIconList.get(i);
|
String val = IconUtils.appIconList.get(i);
|
||||||
int resID = getActivity().getResources().getIdentifier(val, "drawable", "com.uiuios.aios");
|
int resID = mContext.getResources().getIdentifier(val, "drawable", "com.uiuios.aios");
|
||||||
if (resID == 0) {
|
if (resID == 0) {
|
||||||
Log.e(TAG, "getView: not found src : " + pkg);
|
Log.e(TAG, "getView: not found src : " + pkg);
|
||||||
iv.setImageDrawable(desktopIcon.getIcon(getCtx()));
|
iv.setImageDrawable(desktopIcon.getIcon(mContext));
|
||||||
} else {
|
} else {
|
||||||
iv.setImageDrawable(getActivity().getResources().getDrawable(resID));
|
iv.setImageDrawable(mContext.getResources().getDrawable(resID));
|
||||||
// desktopIcon.setIcon(getCtx().getResources().getDrawable(resID));
|
// desktopIcon.setIcon(mContext.getResources().getDrawable(resID));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
iv.setImageDrawable(desktopIcon.getIcon(getCtx()));
|
iv.setImageDrawable(desktopIcon.getIcon(mContext));
|
||||||
}
|
}
|
||||||
tv.setText(desktopIcon.getTitle());
|
tv.setText(desktopIcon.getTitle());
|
||||||
// linearLayout.setEnabled(true);
|
// linearLayout.setEnabled(true);
|
||||||
@@ -230,10 +231,10 @@ public class AppListFragment extends BaseMvvmFragment<AppListViewModel, Fragment
|
|||||||
}
|
}
|
||||||
switch (desktopIcon.getPackage()) {
|
switch (desktopIcon.getPackage()) {
|
||||||
case "aios.daily.app":
|
case "aios.daily.app":
|
||||||
startActivity(new Intent(getCtx(), DailyAppActivity.class));
|
startActivity(new Intent(mContext, DailyAppActivity.class));
|
||||||
break;
|
break;
|
||||||
case "aios.exit":
|
case "aios.exit":
|
||||||
int is_activation = Settings.Global.getInt(getCtx().getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
int is_activation = Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.UIUI_ACTIVATION_KEY, 0);
|
||||||
if (is_activation == 0) {
|
if (is_activation == 0) {
|
||||||
RemoteManager.getInstance().openLauncher3();
|
RemoteManager.getInstance().openLauncher3();
|
||||||
} else {
|
} else {
|
||||||
@@ -242,10 +243,10 @@ public class AppListFragment extends BaseMvvmFragment<AppListViewModel, Fragment
|
|||||||
break;
|
break;
|
||||||
case "aios.family":
|
case "aios.family":
|
||||||
// startActivity(new Intent(mContext, FamilySpaceActivity.class));
|
// startActivity(new Intent(mContext, FamilySpaceActivity.class));
|
||||||
ApkUtils.openApp(getCtx(), "com.uiui.videoplayer");
|
ApkUtils.openApp(mContext, "com.uiui.videoplayer");
|
||||||
break;
|
break;
|
||||||
case "aios.appstore":
|
case "aios.appstore":
|
||||||
ApkUtils.openApp(getCtx(), "com.uiuios.appstore");
|
ApkUtils.openApp(mContext, "com.uiuios.appstore");
|
||||||
break;
|
break;
|
||||||
case "com.android.dialer":
|
case "com.android.dialer":
|
||||||
// int aole_call_forbid = Settings.System.getInt(mContext.getContentResolver(), "aole_call_forbid", 0);
|
// int aole_call_forbid = Settings.System.getInt(mContext.getContentResolver(), "aole_call_forbid", 0);
|
||||||
@@ -256,7 +257,7 @@ public class AppListFragment extends BaseMvvmFragment<AppListViewModel, Fragment
|
|||||||
ApkUtils.openPackage(v.getContext(), desktopIcon.getPackage(), desktopIcon.getClazz());
|
ApkUtils.openPackage(v.getContext(), desktopIcon.getPackage(), desktopIcon.getClazz());
|
||||||
AppUsedTimeUtils.getInstance().setAppPackageName(desktopIcon.getPackage());
|
AppUsedTimeUtils.getInstance().setAppPackageName(desktopIcon.getPackage());
|
||||||
AppUsedTimeUtils.getInstance().setStartTime(System.currentTimeMillis());
|
AppUsedTimeUtils.getInstance().setStartTime(System.currentTimeMillis());
|
||||||
// SendRunningApp(getActivity());
|
// SendRunningApp(mContext);
|
||||||
// }
|
// }
|
||||||
break;
|
break;
|
||||||
case "com.uiuios.aios":
|
case "com.uiuios.aios":
|
||||||
@@ -266,19 +267,19 @@ public class AppListFragment extends BaseMvvmFragment<AppListViewModel, Fragment
|
|||||||
ApkUtils.openPackage(v.getContext(), desktopIcon.getPackage(), desktopIcon.getClazz());
|
ApkUtils.openPackage(v.getContext(), desktopIcon.getPackage(), desktopIcon.getClazz());
|
||||||
AppUsedTimeUtils.getInstance().setAppPackageName(desktopIcon.getPackage());
|
AppUsedTimeUtils.getInstance().setAppPackageName(desktopIcon.getPackage());
|
||||||
AppUsedTimeUtils.getInstance().setStartTime(System.currentTimeMillis());
|
AppUsedTimeUtils.getInstance().setStartTime(System.currentTimeMillis());
|
||||||
// SendRunningApp(getActivity());
|
// SendRunningApp(mContext);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
int setting_other_appInstaller = Settings.Global.getInt(getCtx().getContentResolver(), CommonConfig.SETTING_OTHER_APPINSTALLER_KEY, 1);
|
int setting_other_appInstaller = Settings.Global.getInt(mContext.getContentResolver(), CommonConfig.SETTING_OTHER_APPINSTALLER_KEY, 1);
|
||||||
if (setting_other_appInstaller == 0
|
if (setting_other_appInstaller == 0
|
||||||
&& !ApkUtils.isSystemApp(getCtx(), desktopIcon.getPackage()
|
&& !ApkUtils.isSystemApp(mContext, desktopIcon.getPackage()
|
||||||
)) {
|
)) {
|
||||||
Toaster.show("已禁止应用打开");
|
Toaster.show("已禁止应用打开");
|
||||||
} else {
|
} else {
|
||||||
ApkUtils.openPackage(v.getContext(), desktopIcon.getPackage(), desktopIcon.getClazz());
|
ApkUtils.openPackage(v.getContext(), desktopIcon.getPackage(), desktopIcon.getClazz());
|
||||||
AppUsedTimeUtils.getInstance().setAppPackageName(desktopIcon.getPackage());
|
AppUsedTimeUtils.getInstance().setAppPackageName(desktopIcon.getPackage());
|
||||||
AppUsedTimeUtils.getInstance().setStartTime(System.currentTimeMillis());
|
AppUsedTimeUtils.getInstance().setStartTime(System.currentTimeMillis());
|
||||||
// SendRunningApp(getActivity());
|
// SendRunningApp(mContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -308,12 +309,6 @@ public class AppListFragment extends BaseMvvmFragment<AppListViewModel, Fragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void initData(Bundle savedInstanceState) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void updateAppDisableStatus(String pkg, String label) {
|
private void updateAppDisableStatus(String pkg, String label) {
|
||||||
AppManager.getInstance().addAddPakcage(pkg);
|
AppManager.getInstance().addAddPakcage(pkg);
|
||||||
NetInterfaceManager.getInstance().getUpdateAppIconObservable(pkg, label, 0)
|
NetInterfaceManager.getInstance().getUpdateAppIconObservable(pkg, label, 0)
|
||||||
@@ -350,26 +345,26 @@ public class AppListFragment extends BaseMvvmFragment<AppListViewModel, Fragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startScreenLockActivity() {
|
private void startScreenLockActivity() {
|
||||||
Intent intent = new Intent(getCtx(), ScreenLockActivity.class);
|
Intent intent = new Intent(mContext, ScreenLockActivity.class);
|
||||||
getCtx().startActivity(intent);
|
mContext.startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showShortcutDialog(ShortcutPkgInfo shortcutPkgInfo) {
|
private void showShortcutDialog(ShortcutPkgInfo shortcutPkgInfo) {
|
||||||
if (shortcutPkgInfo == null) return;
|
if (shortcutPkgInfo == null) return;
|
||||||
String label = shortcutPkgInfo.getTitle();
|
String label = shortcutPkgInfo.getTitle();
|
||||||
String pkg = shortcutPkgInfo.getPackage();
|
String pkg = shortcutPkgInfo.getPackage();
|
||||||
ShortcutDialog shortcutDialog = new ShortcutDialog(getCtx());
|
ShortcutDialog shortcutDialog = new ShortcutDialog(mContext);
|
||||||
shortcutDialog.setTitle("删除快捷方式");
|
shortcutDialog.setTitle("删除快捷方式");
|
||||||
shortcutDialog.setMessage(label);
|
shortcutDialog.setMessage(label);
|
||||||
shortcutDialog.setIconImage(shortcutPkgInfo.getIcon(getCtx()));
|
shortcutDialog.setIconImage(shortcutPkgInfo.getIcon(mContext));
|
||||||
shortcutDialog.setAppIconImage(ApkUtils.getAppDrawable(getCtx(), pkg));
|
shortcutDialog.setAppIconImage(ApkUtils.getAppDrawable(mContext, pkg));
|
||||||
shortcutDialog.setOnClickBottomListener(new ShortcutDialog.OnClickBottomListener() {
|
shortcutDialog.setOnClickBottomListener(new ShortcutDialog.OnClickBottomListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPositiveClick() {
|
public void onPositiveClick() {
|
||||||
if (!ShortcutUtils.getInstance().deleteShortcut(shortcutPkgInfo.getId(), shortcutPkgInfo.getPackageName())) {
|
if (!ShortcutUtils.getInstance().deleteShortcut(shortcutPkgInfo.getId(), shortcutPkgInfo.getPackageName())) {
|
||||||
Toaster.show("删除失败");
|
Toaster.show("删除失败");
|
||||||
}
|
}
|
||||||
getCtx().sendBroadcast(new Intent(OldMainActivity.ACTION_PACKAGE_HIDE));
|
mContext.sendBroadcast(new Intent(OldMainActivity.ACTION_PACKAGE_HIDE));
|
||||||
shortcutDialog.dismiss();
|
shortcutDialog.dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,10 +379,10 @@ public class AppListFragment extends BaseMvvmFragment<AppListViewModel, Fragment
|
|||||||
private void showHideDialog(DesktopIcon desktopIcon) {
|
private void showHideDialog(DesktopIcon desktopIcon) {
|
||||||
String label = desktopIcon.getTitle();
|
String label = desktopIcon.getTitle();
|
||||||
String pkg = desktopIcon.getPackage();
|
String pkg = desktopIcon.getPackage();
|
||||||
DailyAppDialog dailyAppDialog = new DailyAppDialog(getCtx());
|
DailyAppDialog dailyAppDialog = new DailyAppDialog(mContext);
|
||||||
dailyAppDialog.setTitle("移到日常应用");
|
dailyAppDialog.setTitle("移到日常应用");
|
||||||
dailyAppDialog.setMessage(label);
|
dailyAppDialog.setMessage(label);
|
||||||
dailyAppDialog.setIconImage(desktopIcon.getIcon(getCtx()));
|
dailyAppDialog.setIconImage(desktopIcon.getIcon(mContext));
|
||||||
dailyAppDialog.setOnClickBottomListener(new DailyAppDialog.OnClickBottomListener() {
|
dailyAppDialog.setOnClickBottomListener(new DailyAppDialog.OnClickBottomListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPositiveClick() {
|
public void onPositiveClick() {
|
||||||
@@ -441,12 +436,11 @@ public class AppListFragment extends BaseMvvmFragment<AppListViewModel, Fragment
|
|||||||
|
|
||||||
public void setAppList(ArrayList<DesktopIcon> appList) {
|
public void setAppList(ArrayList<DesktopIcon> appList) {
|
||||||
this.mDesktopIcons = appList;
|
this.mDesktopIcons = appList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||||
outState.putParcelableArrayList("applicationInfos", mDesktopIcons);
|
// outState.putParcelableArrayList("applicationInfos", mDesktopIcons);
|
||||||
super.onSaveInstanceState(outState);
|
// super.onSaveInstanceState(outState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,9 +11,11 @@ import androidx.recyclerview.widget.GridLayoutManager;
|
|||||||
|
|
||||||
import com.hjq.toast.Toaster;
|
import com.hjq.toast.Toaster;
|
||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
import com.uiuios.aios.activity.wecontact.AddWechatContactActivity;
|
import com.uiuios.aios.activity.contact.AddWechatContactActivity;
|
||||||
import com.uiuios.aios.adapter.WechatContactAdapter;
|
import com.uiuios.aios.adapter.WechatContactAdapter;
|
||||||
import com.uiuios.aios.base.mvvm.fragment.BaseMvvmFragment;
|
import com.uiuios.aios.base.mvvm.fragment.BaseMvvmFragment;
|
||||||
|
import com.uiuios.aios.bean.BaseResponse;
|
||||||
|
import com.uiuios.aios.bean.Contact;
|
||||||
import com.uiuios.aios.bean.WechatInfo;
|
import com.uiuios.aios.bean.WechatInfo;
|
||||||
import com.uiuios.aios.databinding.FragmentContactHomeBinding;
|
import com.uiuios.aios.databinding.FragmentContactHomeBinding;
|
||||||
import com.uiuios.aios.db.ContactManager;
|
import com.uiuios.aios.db.ContactManager;
|
||||||
@@ -45,8 +47,8 @@ public class ContactFragment extends BaseMvvmFragment<ContactViewModel, Fragment
|
|||||||
mContactAdapter = new WechatContactAdapter();
|
mContactAdapter = new WechatContactAdapter();
|
||||||
mContactAdapter.setOnLongClick(new WechatContactAdapter.OnLongClick() {
|
mContactAdapter.setOnLongClick(new WechatContactAdapter.OnLongClick() {
|
||||||
@Override
|
@Override
|
||||||
public void setOnLongClickListener(WechatInfo wechatInfo) {
|
public void setOnLongClickListener(Contact contact) {
|
||||||
showDialog(wechatInfo);
|
showDialog(contact);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||||
@@ -59,9 +61,9 @@ public class ContactFragment extends BaseMvvmFragment<ContactViewModel, Fragment
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initData(Bundle savedInstanceState) {
|
protected void initData(Bundle savedInstanceState) {
|
||||||
mViewModel.getContactList().observe(this, new Observer<List<WechatInfo>>() {
|
mViewModel.getContactList().observe(this, new Observer<List<Contact>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(List<WechatInfo> contacts) {
|
public void onChanged(List<Contact> contacts) {
|
||||||
if (contacts == null || contacts.size() == 0) {
|
if (contacts == null || contacts.size() == 0) {
|
||||||
mViewDataBinding.tvNoContact.setVisibility(View.VISIBLE);
|
mViewDataBinding.tvNoContact.setVisibility(View.VISIBLE);
|
||||||
mViewDataBinding.rvContact.setVisibility(View.GONE);
|
mViewDataBinding.rvContact.setVisibility(View.GONE);
|
||||||
@@ -72,6 +74,17 @@ public class ContactFragment extends BaseMvvmFragment<ContactViewModel, Fragment
|
|||||||
mContactAdapter.setContactList(contacts);
|
mContactAdapter.setContactList(contacts);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
mViewModel.getDeleteData().observe(this, new Observer<BaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onChanged(BaseResponse baseResponse) {
|
||||||
|
if (baseResponse.code == 200) {
|
||||||
|
Toaster.show("删除成功");
|
||||||
|
} else {
|
||||||
|
Toaster.show("删除失败:" + baseResponse.msg);
|
||||||
|
}
|
||||||
|
mViewModel.getContact();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -86,7 +99,7 @@ public class ContactFragment extends BaseMvvmFragment<ContactViewModel, Fragment
|
|||||||
mViewModel.getContact();
|
mViewModel.getContact();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showDialog(WechatInfo wechatInfo) {
|
private void showDialog(Contact contact) {
|
||||||
DeleteContactDialog dialog = new DeleteContactDialog(getContext());
|
DeleteContactDialog dialog = new DeleteContactDialog(getContext());
|
||||||
dialog.setTitle("提醒")
|
dialog.setTitle("提醒")
|
||||||
.setMessage("是否要删除联系人")
|
.setMessage("是否要删除联系人")
|
||||||
@@ -95,13 +108,8 @@ public class ContactFragment extends BaseMvvmFragment<ContactViewModel, Fragment
|
|||||||
.setOnClickBottomListener(new DeleteContactDialog.OnClickBottomListener() {
|
.setOnClickBottomListener(new DeleteContactDialog.OnClickBottomListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPositiveClick() {
|
public void onPositiveClick() {
|
||||||
if (ContactManager.getInstance().delete(wechatInfo.getId())) {
|
mViewModel.deleteContact(contact.getId());
|
||||||
Toaster.show("删除成功");
|
|
||||||
} else {
|
|
||||||
Toaster.show("删除失败");
|
|
||||||
}
|
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
mViewModel.getContact();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -46,87 +46,121 @@ public class ContactViewModel extends BaseViewModel<FragmentContactHomeBinding,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private MutableLiveData<List<WechatInfo>> mContactList = new MutableLiveData<>();
|
private MutableLiveData<List<Contact>> mContactList = new MutableLiveData<>();
|
||||||
|
|
||||||
public MutableLiveData<List<WechatInfo>> getContactList() {
|
public MutableLiveData<List<Contact>> getContactList() {
|
||||||
return mContactList;
|
return mContactList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getContact() {
|
public void getContact() {
|
||||||
Observable.create(new ObservableOnSubscribe<List<WechatInfo>>() {
|
// Observable.create(new ObservableOnSubscribe<List<WechatInfo>>() {
|
||||||
@Override
|
// @Override
|
||||||
public void subscribe(@NonNull ObservableEmitter<List<WechatInfo>> emitter) throws Throwable {
|
// public void subscribe(@NonNull ObservableEmitter<List<WechatInfo>> emitter) throws Throwable {
|
||||||
emitter.onNext(ContactManager.getInstance().getWechatInfoList());
|
// emitter.onNext(ContactManager.getInstance().getWechatInfoList());
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), FragmentEvent.DESTROY))
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new Observer<List<WechatInfo>>() {
|
|
||||||
@Override
|
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
|
||||||
Log.e("getWechatInfoList", "onSubscribe: ");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(@NonNull List<WechatInfo> wechatInfos) {
|
|
||||||
Log.e("getWechatInfoList", "onNext: " + wechatInfos);
|
|
||||||
mContactList.setValue(wechatInfos);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(@NonNull Throwable e) {
|
|
||||||
Log.e("getWechatInfoList", "onError: " + e.getMessage());
|
|
||||||
mContactList.setValue(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onComplete() {
|
|
||||||
Log.e("getWechatInfoList", "onComplete: ");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// NetInterfaceManager.getInstance()
|
|
||||||
// .getContactListObservable()
|
|
||||||
// .compose(RxLifecycle.bindUntilEvent(getLifecycle(), FragmentEvent.DESTROY))
|
// .compose(RxLifecycle.bindUntilEvent(getLifecycle(), FragmentEvent.DESTROY))
|
||||||
// .subscribe(new Observer<BaseResponse<List<Contact>>>() {
|
// .subscribeOn(Schedulers.io())
|
||||||
|
// .observeOn(AndroidSchedulers.mainThread())
|
||||||
|
// .subscribe(new Observer<List<WechatInfo>>() {
|
||||||
// @Override
|
// @Override
|
||||||
// public void onSubscribe(@NonNull Disposable d) {
|
// public void onSubscribe(@NonNull Disposable d) {
|
||||||
// Log.e("getContactList", "onSubscribe: ");
|
// Log.e("getWechatInfoList", "onSubscribe: ");
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// @Override
|
// @Override
|
||||||
// public void onNext(@NonNull BaseResponse<List<Contact>> listBaseResponse) {
|
// public void onNext(@NonNull List<WechatInfo> wechatInfos) {
|
||||||
// Log.e("getContactList", "onNext: " + listBaseResponse);
|
// Log.e("getWechatInfoList", "onNext: " + wechatInfos);
|
||||||
// if (listBaseResponse.code == 200) {
|
// mContactList.setValue(wechatInfos);
|
||||||
// mMMKV.putString(UrlAddress.GET_MAIL_LIST, GsonUtils.toJSONString(listBaseResponse.data));
|
|
||||||
// mContactList.setValue(listBaseResponse.data);
|
|
||||||
// } else {
|
|
||||||
// mMMKV.putString(UrlAddress.GET_MAIL_LIST, "");
|
|
||||||
// mContactList.setValue(new ArrayList<>());
|
|
||||||
// }
|
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// @Override
|
// @Override
|
||||||
// public void onError(@NonNull Throwable e) {
|
// public void onError(@NonNull Throwable e) {
|
||||||
// Log.e("getContactList", "onError: " + e.getMessage());
|
// Log.e("getWechatInfoList", "onError: " + e.getMessage());
|
||||||
// String jsonString = mMMKV.getString(UrlAddress.GET_MAIL_LIST, null);
|
// mContactList.setValue(null);
|
||||||
// Gson gson = new Gson();
|
|
||||||
// Type type = new TypeToken<List<Contact>>() {
|
|
||||||
// }.getType();
|
|
||||||
// List<Contact> contacts = gson.fromJson(jsonString, type);
|
|
||||||
// if (contacts == null) {
|
|
||||||
// mContactList.setValue(new ArrayList<>());
|
|
||||||
// } else {
|
|
||||||
// mContactList.setValue(contacts);
|
|
||||||
// }
|
|
||||||
// onComplete();
|
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// @Override
|
// @Override
|
||||||
// public void onComplete() {
|
// public void onComplete() {
|
||||||
// Log.e("getContactList", "onComplete: ");
|
// Log.e("getWechatInfoList", "onComplete: ");
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
NetInterfaceManager.getInstance()
|
||||||
|
.getContactListObservable()
|
||||||
|
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), FragmentEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<BaseResponse<List<Contact>>>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Log.e("getContactList", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseResponse<List<Contact>> listBaseResponse) {
|
||||||
|
Log.e("getContactList", "onNext: " + listBaseResponse);
|
||||||
|
if (listBaseResponse.code == 200) {
|
||||||
|
mMMKV.putString(UrlAddress.GET_MAIL_LIST, GsonUtils.toJSONString(listBaseResponse.data));
|
||||||
|
mContactList.setValue(listBaseResponse.data);
|
||||||
|
} else {
|
||||||
|
mMMKV.putString(UrlAddress.GET_MAIL_LIST, "");
|
||||||
|
mContactList.setValue(new ArrayList<>());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Log.e("getContactList", "onError: " + e.getMessage());
|
||||||
|
String jsonString = mMMKV.getString(UrlAddress.GET_MAIL_LIST, null);
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Type type = new TypeToken<List<Contact>>() {
|
||||||
|
}.getType();
|
||||||
|
List<Contact> contacts = gson.fromJson(jsonString, type);
|
||||||
|
if (contacts == null) {
|
||||||
|
mContactList.setValue(new ArrayList<>());
|
||||||
|
} else {
|
||||||
|
mContactList.setValue(contacts);
|
||||||
|
}
|
||||||
|
onComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e("getContactList", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private MutableLiveData<BaseResponse> mDeleteData =new MutableLiveData<>();
|
||||||
|
|
||||||
|
public MutableLiveData<BaseResponse> getDeleteData() {
|
||||||
|
return mDeleteData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteContact(int id) {
|
||||||
|
NetInterfaceManager.getInstance().getMailListDeleteObservable(id)
|
||||||
|
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), FragmentEvent.DESTROY))
|
||||||
|
.subscribe(new Observer<BaseResponse>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
Log.e("deleteContact", "onSubscribe: ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull BaseResponse baseResponse) {
|
||||||
|
Log.e("deleteContact", "onNext: " + baseResponse);
|
||||||
|
mDeleteData.setValue(baseResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
Log.e("deleteContact", "onError: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
Log.e("deleteContact", "onComplete: ");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ import androidx.fragment.app.Fragment;
|
|||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
import androidx.lifecycle.Observer;
|
import androidx.lifecycle.Observer;
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
||||||
|
|
||||||
|
import com.hjq.toast.Toaster;
|
||||||
import com.jeremyliao.liveeventbus.LiveEventBus;
|
import com.jeremyliao.liveeventbus.LiveEventBus;
|
||||||
import com.qweather.sdk.bean.weather.WeatherDailyBean;
|
import com.qweather.sdk.bean.weather.WeatherDailyBean;
|
||||||
import com.qweather.sdk.bean.weather.WeatherHourlyBean;
|
import com.qweather.sdk.bean.weather.WeatherHourlyBean;
|
||||||
@@ -29,12 +29,12 @@ import com.uiuios.aios.activity.EmergencyActivity;
|
|||||||
import com.uiuios.aios.activity.addicon.AddIconActivity;
|
import com.uiuios.aios.activity.addicon.AddIconActivity;
|
||||||
import com.uiuios.aios.activity.alarm.port.PortAlarmActivity;
|
import com.uiuios.aios.activity.alarm.port.PortAlarmActivity;
|
||||||
import com.uiuios.aios.activity.contact.ContactActivity;
|
import com.uiuios.aios.activity.contact.ContactActivity;
|
||||||
|
import com.uiuios.aios.activity.dailyapp.DailyAppActivity;
|
||||||
import com.uiuios.aios.activity.weather.WeatherActivity;
|
import com.uiuios.aios.activity.weather.WeatherActivity;
|
||||||
import com.uiuios.aios.adapter.HomeAppAdapter;
|
import com.uiuios.aios.adapter.HomeAppAdapter;
|
||||||
import com.uiuios.aios.adapter.NotificationAdapter;
|
|
||||||
import com.uiuios.aios.alarm.AlarmClockData;
|
import com.uiuios.aios.alarm.AlarmClockData;
|
||||||
|
import com.uiuios.aios.alarm.AlarmUtils;
|
||||||
import com.uiuios.aios.base.mvvm.fragment.BaseMvvmFragment;
|
import com.uiuios.aios.base.mvvm.fragment.BaseMvvmFragment;
|
||||||
import com.uiuios.aios.bean.AlarmItem;
|
|
||||||
import com.uiuios.aios.bean.Contact;
|
import com.uiuios.aios.bean.Contact;
|
||||||
import com.uiuios.aios.bean.DesktopIcon;
|
import com.uiuios.aios.bean.DesktopIcon;
|
||||||
import com.uiuios.aios.bean.MapBean;
|
import com.uiuios.aios.bean.MapBean;
|
||||||
@@ -48,6 +48,7 @@ import com.uiuios.aios.utils.ApkUtils;
|
|||||||
import com.uiuios.aios.utils.AppUtil;
|
import com.uiuios.aios.utils.AppUtil;
|
||||||
import com.uiuios.aios.view.RecyclerViewSpacesItemDecoration;
|
import com.uiuios.aios.view.RecyclerViewSpacesItemDecoration;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
@@ -66,8 +67,7 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
|||||||
|
|
||||||
private FragmentActivity mContext;
|
private FragmentActivity mContext;
|
||||||
private HomeAppAdapter mHomeAppAdapter;
|
private HomeAppAdapter mHomeAppAdapter;
|
||||||
private List<AlarmItem> alarmItemList;
|
// private NotificationAdapter notificationAdapter;
|
||||||
private NotificationAdapter notificationAdapter;
|
|
||||||
|
|
||||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||||
|
|
||||||
@@ -145,11 +145,11 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
|||||||
public void onChanged(ArrayList<DesktopIcon> desktopIcons) {
|
public void onChanged(ArrayList<DesktopIcon> desktopIcons) {
|
||||||
Log.e(TAG, "setInstalledApp: " + desktopIcons);
|
Log.e(TAG, "setInstalledApp: " + desktopIcons);
|
||||||
if (desktopIcons == null || desktopIcons.size() == 0) {
|
if (desktopIcons == null || desktopIcons.size() == 0) {
|
||||||
mViewDataBinding.ivNodata.setVisibility(View.VISIBLE);
|
// mViewDataBinding.ivNodata.setVisibility(View.VISIBLE);
|
||||||
mViewDataBinding.rvApp.setVisibility(View.INVISIBLE);
|
// mViewDataBinding.rvApp.setVisibility(View.INVISIBLE);
|
||||||
} else {
|
} else {
|
||||||
mViewDataBinding.ivNodata.setVisibility(View.GONE);
|
// mViewDataBinding.ivNodata.setVisibility(View.GONE);
|
||||||
mViewDataBinding.rvApp.setVisibility(View.VISIBLE);
|
// mViewDataBinding.rvApp.setVisibility(View.VISIBLE);
|
||||||
mHomeAppAdapter.setDesktopIcons(desktopIcons);
|
mHomeAppAdapter.setDesktopIcons(desktopIcons);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,14 +157,35 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
|||||||
|
|
||||||
mViewModel.getAlarmClockData().observe(this, new Observer<List<AlarmClockData>>() {
|
mViewModel.getAlarmClockData().observe(this, new Observer<List<AlarmClockData>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(List<AlarmClockData> alarmClockData) {
|
public void onChanged(List<AlarmClockData> alarmClockDataList) {
|
||||||
if (alarmClockData != null && alarmClockData.size() != 0) {
|
if (alarmClockDataList != null && alarmClockDataList.size() != 0) {
|
||||||
notificationAdapter.setDataList(alarmClockData);
|
// notificationAdapter.setDataList(alarmClockDataList);
|
||||||
mViewDataBinding.rvNoti.setVisibility(View.VISIBLE);
|
AlarmClockData alarmClockData = alarmClockDataList.get(0);
|
||||||
mViewDataBinding.ivNoteNodata.setVisibility(View.GONE);
|
switch (alarmClockData.getType()) {
|
||||||
|
case AlarmUtils.ONCE:
|
||||||
|
try {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||||
|
Date date = sdf.parse(alarmClockData.getTime());
|
||||||
|
SimpleDateFormat hours = new SimpleDateFormat("HH:mm");
|
||||||
|
String time = hours.format(date);
|
||||||
|
mViewDataBinding.tvClock.setText(time);
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case AlarmUtils.LOOP:
|
||||||
|
case AlarmUtils.WORKING_DAY:
|
||||||
|
case AlarmUtils.OFF_DAY:
|
||||||
|
mViewDataBinding.tvClock.setText(alarmClockData.getTime());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
// mViewDataBinding.rvNoti.setVisibility(View.VISIBLE);
|
||||||
|
// mViewDataBinding.ivNoteNodata.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
mViewDataBinding.rvNoti.setVisibility(View.GONE);
|
mViewDataBinding.tvClock.setText("未设置");
|
||||||
mViewDataBinding.ivNoteNodata.setVisibility(View.VISIBLE);
|
// mViewDataBinding.rvNoti.setVisibility(View.GONE);
|
||||||
|
// mViewDataBinding.ivNoteNodata.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -235,19 +256,18 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
|||||||
initAmap();
|
initAmap();
|
||||||
setTime();
|
setTime();
|
||||||
refreshMemory();
|
refreshMemory();
|
||||||
registerTimeReceiver();
|
|
||||||
registerAlarmClockReceiver();
|
|
||||||
|
|
||||||
notificationAdapter = new NotificationAdapter();
|
|
||||||
notificationAdapter.setOnClickListener(new NotificationAdapter.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick() {
|
|
||||||
getAlarm();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mViewDataBinding.rvNoti.setLayoutManager(new LinearLayoutManager(mContext));
|
// notificationAdapter = new NotificationAdapter();
|
||||||
mViewDataBinding.rvNoti.setAdapter(notificationAdapter);
|
// notificationAdapter.setOnClickListener(new NotificationAdapter.OnClickListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onClick() {
|
||||||
|
// getAlarm();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
// mViewDataBinding.rvNoti.setLayoutManager(new LinearLayoutManager(mContext));
|
||||||
|
// mViewDataBinding.rvNoti.setAdapter(notificationAdapter);
|
||||||
|
|
||||||
mViewDataBinding.rvApp.setLayoutManager(new GridLayoutManager(mContext, 3));
|
mViewDataBinding.rvApp.setLayoutManager(new GridLayoutManager(mContext, 3));
|
||||||
HashMap<String, Integer> stringIntegerHashMap = new HashMap<>();
|
HashMap<String, Integer> stringIntegerHashMap = new HashMap<>();
|
||||||
@@ -269,6 +289,27 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
Log.e(TAG, "onResume: ");
|
Log.e(TAG, "onResume: ");
|
||||||
mViewModel.init();
|
mViewModel.init();
|
||||||
|
registerReceivers();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
unregisterReceivers();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void registerReceivers() {
|
||||||
|
registerTimeReceiver();
|
||||||
|
registerAlarmClockReceiver();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void unregisterReceivers() {
|
||||||
|
if (mTimeChangedReceiver != null) {
|
||||||
|
mContext.unregisterReceiver(mTimeChangedReceiver);
|
||||||
|
}
|
||||||
|
if (mAlarmClockReceiver != null) {
|
||||||
|
mContext.unregisterReceiver(mAlarmClockReceiver);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//监听时间和日期变化
|
//监听时间和日期变化
|
||||||
@@ -489,7 +530,13 @@ public class HomeFragment extends BaseMvvmFragment<HomeViewModel, FragmentHomeBi
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void toAppstore(View view) {
|
public void toAppstore(View view) {
|
||||||
ApkUtils.openPackage(mContext, "com.uiuios.appstore");
|
if (!ApkUtils.openPackage(mContext, "com.uiuios.appstore")) {
|
||||||
|
Toaster.show("打开失败,请检查应用是否安装");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void dailyApp(View view) {
|
||||||
|
startActivity(new Intent(getCtx(), DailyAppActivity.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import androidx.lifecycle.Observer;
|
|||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
import com.uiuios.aios.activity.contact.AddContactActivity;
|
import com.uiuios.aios.activity.contact.AddWechatContactActivity;
|
||||||
import com.uiuios.aios.adapter.ContactAdapter;
|
import com.uiuios.aios.adapter.ContactAdapter;
|
||||||
import com.uiuios.aios.base.mvvm.fragment.BaseMvvmFragment;
|
import com.uiuios.aios.base.mvvm.fragment.BaseMvvmFragment;
|
||||||
import com.uiuios.aios.bean.Contact;
|
import com.uiuios.aios.bean.Contact;
|
||||||
@@ -126,7 +126,7 @@ public class ContactFragment extends BaseMvvmFragment<ContactViewModel, Fragment
|
|||||||
|
|
||||||
public class BtnClick {
|
public class BtnClick {
|
||||||
public void add(View view) {
|
public void add(View view) {
|
||||||
Intent intent = new Intent(mContext, AddContactActivity.class);
|
Intent intent = new Intent(mContext, AddWechatContactActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import android.view.View;
|
|||||||
import com.hjq.toast.Toaster;
|
import com.hjq.toast.Toaster;
|
||||||
import com.uiuios.aios.R;
|
import com.uiuios.aios.R;
|
||||||
import com.uiuios.aios.activity.SelectNumberActivity;
|
import com.uiuios.aios.activity.SelectNumberActivity;
|
||||||
import com.uiuios.aios.activity.contact.AddContactActivity;
|
import com.uiuios.aios.activity.contact.AddWechatContactActivity;
|
||||||
import com.uiuios.aios.activity.contact.ContactActivity;
|
import com.uiuios.aios.activity.contact.ContactActivity;
|
||||||
import com.uiuios.aios.activity.records.RecordsActivity;
|
import com.uiuios.aios.activity.records.RecordsActivity;
|
||||||
import com.uiuios.aios.base.mvvm.fragment.BaseMvvmFragment;
|
import com.uiuios.aios.base.mvvm.fragment.BaseMvvmFragment;
|
||||||
@@ -175,7 +175,7 @@ public class DialerFragment extends BaseMvvmFragment<DialerViewModel, FragmentDi
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void add(View view) {
|
public void add(View view) {
|
||||||
Intent intent = new Intent(mContext, AddContactActivity.class);
|
Intent intent = new Intent(mContext, AddWechatContactActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,11 +94,11 @@ public class AppManager {
|
|||||||
Set<String> allowPackages = resolveinfoList.stream().map(resolveInfo -> resolveInfo.activityInfo.packageName).collect(Collectors.toSet());
|
Set<String> allowPackages = resolveinfoList.stream().map(resolveInfo -> resolveInfo.activityInfo.packageName).collect(Collectors.toSet());
|
||||||
|
|
||||||
// List<String> adminApp = RemoteManager.getInstance().getAdminApp();
|
// List<String> adminApp = RemoteManager.getInstance().getAdminApp();
|
||||||
// Log.i(TAG, "queryFilterAppInfo: adminapp = " + adminApp);
|
// Log.i(TAG, "getFilterAppset: adminapp = " + adminApp);
|
||||||
for (ResolveInfo resolveInfo : resolveinfoList) {
|
for (ResolveInfo resolveInfo : resolveinfoList) {
|
||||||
String pkg = resolveInfo.activityInfo.packageName;
|
String pkg = resolveInfo.activityInfo.packageName;
|
||||||
if (ApkUtils.appIsDisable(mContext, pkg)) {
|
if (ApkUtils.appIsDisable(mContext, pkg)) {
|
||||||
Log.e(TAG, "queryFilterAppInfo: disable = " + pkg);
|
Log.e(TAG, "getFilterAppset: disable = " + pkg);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (showPackages.contains(pkg)) {
|
if (showPackages.contains(pkg)) {
|
||||||
@@ -142,11 +142,11 @@ public class AppManager {
|
|||||||
|
|
||||||
|
|
||||||
// List<String> adminApp = RemoteManager.getInstance().getAdminApp();
|
// List<String> adminApp = RemoteManager.getInstance().getAdminApp();
|
||||||
// Log.i(TAG, "queryFilterAppInfo: adminapp = " + adminApp);
|
// Log.i(TAG, "getFilterAppset: adminapp = " + adminApp);
|
||||||
for (ResolveInfo resolveInfo : resolveinfoList) {
|
for (ResolveInfo resolveInfo : resolveinfoList) {
|
||||||
String pkg = resolveInfo.activityInfo.packageName;
|
String pkg = resolveInfo.activityInfo.packageName;
|
||||||
if (ApkUtils.appIsDisable(mContext, pkg)) {
|
if (ApkUtils.appIsDisable(mContext, pkg)) {
|
||||||
Log.e(TAG, "queryFilterAppInfo: disable = " + pkg);
|
Log.e(TAG, "getFilterAppset: disable = " + pkg);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (showPackages.contains(pkg)) {
|
if (showPackages.contains(pkg)) {
|
||||||
@@ -215,11 +215,11 @@ public class AppManager {
|
|||||||
|
|
||||||
|
|
||||||
// List<String> adminApp = RemoteManager.getInstance().getAdminApp();
|
// List<String> adminApp = RemoteManager.getInstance().getAdminApp();
|
||||||
// Log.i(TAG, "queryFilterAppInfo: adminapp = " + adminApp);
|
// Log.i(TAG, "getFilterAppset: adminapp = " + adminApp);
|
||||||
for (ResolveInfo resolveInfo : resolveinfoList) {
|
for (ResolveInfo resolveInfo : resolveinfoList) {
|
||||||
String pkg = resolveInfo.activityInfo.packageName;
|
String pkg = resolveInfo.activityInfo.packageName;
|
||||||
if (ApkUtils.appIsDisable(mContext, pkg)) {
|
if (ApkUtils.appIsDisable(mContext, pkg)) {
|
||||||
Log.e(TAG, "queryFilterAppInfo: disable = " + pkg);
|
Log.e(TAG, "getFilterAppset: disable = " + pkg);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ApkUtils.excludePackageName.contains(pkg)) {
|
if (ApkUtils.excludePackageName.contains(pkg)) {
|
||||||
|
|||||||
@@ -20,8 +20,10 @@ import java.util.function.Predicate;
|
|||||||
|
|
||||||
public class AppStatusManager {
|
public class AppStatusManager {
|
||||||
private static final String TAG = AppStatusManager.class.getSimpleName();
|
private static final String TAG = AppStatusManager.class.getSimpleName();
|
||||||
|
|
||||||
@SuppressLint("StaticFieldLeak")
|
@SuppressLint("StaticFieldLeak")
|
||||||
private static AppStatusManager sInstance;
|
private static AppStatusManager sInstance;
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||||
private Set<String> hidedAppSet;
|
private Set<String> hidedAppSet;
|
||||||
@@ -34,6 +36,9 @@ public class AppStatusManager {
|
|||||||
this.add("com.android.documentsui");
|
this.add("com.android.documentsui");
|
||||||
this.add("com.android.calculator2");
|
this.add("com.android.calculator2");
|
||||||
this.add("com.android.calendar");
|
this.add("com.android.calendar");
|
||||||
|
this.add("com.mediatek.camera");
|
||||||
|
this.add("com.android.dialer");
|
||||||
|
this.add("com.android.settings");
|
||||||
}};
|
}};
|
||||||
|
|
||||||
private AppStatusManager(Context context) {
|
private AppStatusManager(Context context) {
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ import com.uiuios.aios.manager.ConnectMode;
|
|||||||
import com.uiuios.aios.manager.RemoteManager;
|
import com.uiuios.aios.manager.RemoteManager;
|
||||||
import com.uiuios.aios.network.api.ActivityListApi;
|
import com.uiuios.aios.network.api.ActivityListApi;
|
||||||
import com.uiuios.aios.network.api.AddressIndexApi;
|
import com.uiuios.aios.network.api.AddressIndexApi;
|
||||||
|
import com.uiuios.aios.network.api.MailListDeleteApi;
|
||||||
import com.uiuios.aios.network.api.ServeApi;
|
import com.uiuios.aios.network.api.ServeApi;
|
||||||
import com.uiuios.aios.network.api.alarmclock.AlarmClockAddApi;
|
import com.uiuios.aios.network.api.alarmclock.AlarmClockAddApi;
|
||||||
import com.uiuios.aios.network.api.alarmclock.AlarmClockApi;
|
import com.uiuios.aios.network.api.alarmclock.AlarmClockApi;
|
||||||
@@ -398,6 +399,14 @@ public class NetInterfaceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Observable<BaseResponse> getMailListDeleteObservable(int id) {
|
||||||
|
return mRetrofit.create(MailListDeleteApi.class)
|
||||||
|
.deleteMailList(RemoteManager.getInstance().getSerial(), id)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Observable<BaseResponse<List<GoodsType>>> getGoodsTypeListObservable() {
|
public Observable<BaseResponse<List<GoodsType>>> getGoodsTypeListObservable() {
|
||||||
return mRetrofit.create(GoodsTypeApi.class)
|
return mRetrofit.create(GoodsTypeApi.class)
|
||||||
.getGoodsTypeList()
|
.getGoodsTypeList()
|
||||||
@@ -518,7 +527,7 @@ public class NetInterfaceManager {
|
|||||||
|
|
||||||
public Observable<BaseResponse<ExpressData>> getOrderExpressObservable(String order_sn, String order_id) {
|
public Observable<BaseResponse<ExpressData>> getOrderExpressObservable(String order_sn, String order_id) {
|
||||||
return mRetrofit.create(OrderExpressApi.class)
|
return mRetrofit.create(OrderExpressApi.class)
|
||||||
.getOrderExpress(RemoteManager.getInstance().getSerial(), order_sn,order_id)
|
.getOrderExpress(RemoteManager.getInstance().getSerial(), order_sn, order_id)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread());
|
.observeOn(AndroidSchedulers.mainThread());
|
||||||
}
|
}
|
||||||
@@ -1024,7 +1033,7 @@ public class NetInterfaceManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull BaseResponse<List<AlarmClockData>> listBaseResponse) {
|
public void onNext(@NonNull BaseResponse<List<AlarmClockData>> listBaseResponse) {
|
||||||
Log.e("getAlarmClockObserver", "onNext: ");
|
Log.e("getAlarmClockObserver", "onNext: " + listBaseResponse);
|
||||||
if (listBaseResponse.code == 200) {
|
if (listBaseResponse.code == 200) {
|
||||||
List<AlarmClockData> alarmClockData = listBaseResponse.data;
|
List<AlarmClockData> alarmClockData = listBaseResponse.data;
|
||||||
if (alarmClockData != null && alarmClockData.size() != 0) {
|
if (alarmClockData != null && alarmClockData.size() != 0) {
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.uiuios.aios.network.api;
|
||||||
|
|
||||||
|
import com.uiuios.aios.bean.BaseResponse;
|
||||||
|
import com.uiuios.aios.network.UrlAddress;
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
|
import retrofit2.http.Field;
|
||||||
|
import retrofit2.http.FormUrlEncoded;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
|
||||||
|
public interface MailListDeleteApi {
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST(UrlAddress.MAIL_LIST_DELETE)
|
||||||
|
Observable<BaseResponse> deleteMailList(
|
||||||
|
@Field("sn") String sn,
|
||||||
|
@Field("id") int id
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@ import android.view.accessibility.AccessibilityNodeInfo;
|
|||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.tencent.mmkv.MMKV;
|
import com.tencent.mmkv.MMKV;
|
||||||
|
import com.uiuios.aios.bean.Contact;
|
||||||
import com.uiuios.aios.bean.WechatInfo;
|
import com.uiuios.aios.bean.WechatInfo;
|
||||||
import com.uiuios.aios.config.CommonConfig;
|
import com.uiuios.aios.config.CommonConfig;
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ public class WeAccessibilityService extends AccessibilityService {
|
|||||||
|
|
||||||
private int mCallType = TYPE_VOICE;
|
private int mCallType = TYPE_VOICE;
|
||||||
|
|
||||||
private WechatInfo mWechatInfo;
|
private Contact mContact;
|
||||||
private Step mCurrentStep = Step.WAITING;
|
private Step mCurrentStep = Step.WAITING;
|
||||||
private String mName = "";//微信昵称
|
private String mName = "";//微信昵称
|
||||||
private String mTagName = "";//微信联系人标签名
|
private String mTagName = "";//微信联系人标签名
|
||||||
@@ -78,11 +79,11 @@ public class WeAccessibilityService extends AccessibilityService {
|
|||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
Log.e(TAG, "onStartCommand: ");
|
Log.e(TAG, "onStartCommand: ");
|
||||||
if (intent != null) {
|
if (intent != null) {
|
||||||
mWechatInfo = (WechatInfo) intent.getSerializableExtra("WechatInfo");
|
mContact = (Contact) intent.getSerializableExtra("WechatInfo");
|
||||||
Log.e(TAG, "onStartCommand: wechatInfo = " + mWechatInfo);
|
Log.e(TAG, "onStartCommand: wechatInfo = " + mContact);
|
||||||
mCallType = intent.getIntExtra("call_type", TYPE_VOICE);
|
mCallType = intent.getIntExtra("call_type", TYPE_VOICE);
|
||||||
mName = mWechatInfo.getNickName();
|
mName = mContact.getName();
|
||||||
String groupTag = mWechatInfo.getGroupTag();
|
String groupTag = mContact.getTag();
|
||||||
if (TextUtils.isEmpty(groupTag)) {
|
if (TextUtils.isEmpty(groupTag)) {
|
||||||
mTagName = TAG_NAME;
|
mTagName = TAG_NAME;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import com.arialyy.aria.core.Aria;
|
|||||||
import com.arialyy.aria.core.task.DownloadTask;
|
import com.arialyy.aria.core.task.DownloadTask;
|
||||||
import com.blankj.utilcode.util.NetworkUtils;
|
import com.blankj.utilcode.util.NetworkUtils;
|
||||||
import com.uiuios.aios.BuildConfig;
|
import com.uiuios.aios.BuildConfig;
|
||||||
import com.uiuios.aios.activity.NoticeActivity;
|
import com.uiuios.aios.activity.noti.NoticeActivity;
|
||||||
import com.uiuios.aios.alarm.AlarmUtils;
|
import com.uiuios.aios.alarm.AlarmUtils;
|
||||||
import com.uiuios.aios.base.rx.BaseRxService;
|
import com.uiuios.aios.base.rx.BaseRxService;
|
||||||
import com.uiuios.aios.alarm.AlarmClockData;
|
import com.uiuios.aios.alarm.AlarmClockData;
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import androidx.annotation.RequiresApi;
|
|||||||
import com.hjq.toast.Toaster;
|
import com.hjq.toast.Toaster;
|
||||||
import com.tencent.mmkv.MMKV;
|
import com.tencent.mmkv.MMKV;
|
||||||
import com.uiuios.aios.BuildConfig;
|
import com.uiuios.aios.BuildConfig;
|
||||||
import com.uiuios.aios.R;
|
|
||||||
import com.uiuios.aios.activity.QuickAppActivity;
|
import com.uiuios.aios.activity.QuickAppActivity;
|
||||||
import com.uiuios.aios.bean.DesktopIcon;
|
import com.uiuios.aios.bean.DesktopIcon;
|
||||||
import com.uiuios.aios.config.CommonConfig;
|
import com.uiuios.aios.config.CommonConfig;
|
||||||
@@ -99,10 +98,12 @@ public class ApkUtils {
|
|||||||
// this.add("com.android.documentsui");
|
// this.add("com.android.documentsui");
|
||||||
// this.add("com.android.calculator2");
|
// this.add("com.android.calculator2");
|
||||||
}};
|
}};
|
||||||
|
|
||||||
private static HashSet<String> allHintPackage = new HashSet<String>() {{
|
private static HashSet<String> allHintPackage = new HashSet<String>() {{
|
||||||
this.add("com.android.uiuios");
|
this.add("com.android.uiuios");
|
||||||
}};
|
}};
|
||||||
private static String TAG = ApkUtils.class.getSimpleName();
|
|
||||||
|
private static final String TAG = ApkUtils.class.getSimpleName();
|
||||||
|
|
||||||
public static ArrayList<ApplicationInfo> getSystemApp(Context context) {
|
public static ArrayList<ApplicationInfo> getSystemApp(Context context) {
|
||||||
PackageManager pm = context.getPackageManager();
|
PackageManager pm = context.getPackageManager();
|
||||||
@@ -239,10 +240,14 @@ public class ApkUtils {
|
|||||||
if (allowPackages.contains(pkg) && !excludePackageName.contains(pkg)) {
|
if (allowPackages.contains(pkg) && !excludePackageName.contains(pkg)) {
|
||||||
resolveInfos.add(resolveInfo);
|
resolveInfos.add(resolveInfo);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if ("com.uiuios.sn".equals(pkg)) {
|
||||||
|
resolveInfos.add(resolveInfo);
|
||||||
} else {
|
} else {
|
||||||
Log.e(TAG, "queryFilterAppInfo: pkgSet ! contains " + pkg);
|
Log.e(TAG, "queryFilterAppInfo: pkgSet ! contains " + pkg);
|
||||||
AppStatusManager.getInstance().addHidedApp(pkg);
|
AppStatusManager.getInstance().addHidedApp(pkg);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (allowPackages.contains(pkg) && !excludePackageName.contains(pkg)) {
|
if (allowPackages.contains(pkg) && !excludePackageName.contains(pkg)) {
|
||||||
resolveInfos.add(resolveInfo);
|
resolveInfos.add(resolveInfo);
|
||||||
@@ -286,17 +291,17 @@ public class ApkUtils {
|
|||||||
List<ShortcutPkgInfo> shortcutPkgInfos = ShortcutUtils.getInstance().getShortcutList();
|
List<ShortcutPkgInfo> shortcutPkgInfos = ShortcutUtils.getInstance().getShortcutList();
|
||||||
desktopIcons.addAll(shortcutPkgInfos);
|
desktopIcons.addAll(shortcutPkgInfos);
|
||||||
|
|
||||||
DesktopIcon dailyIcon = new DesktopIcon();
|
// DesktopIcon dailyIcon = new DesktopIcon();
|
||||||
// dailyIcon.setIcon(context.getDrawable(R.drawable.icon_daily_app));
|
//// dailyIcon.setIcon(context.getDrawable(R.drawable.icon_daily_app));
|
||||||
dailyIcon.setTitle("日常应用");
|
// dailyIcon.setTitle("日常应用");
|
||||||
dailyIcon.setPackage("aios.daily.app");
|
// dailyIcon.setPackage("aios.daily.app");
|
||||||
desktopIcons.add(0, dailyIcon);
|
// desktopIcons.add(0, dailyIcon);
|
||||||
|
|
||||||
DesktopIcon familyIcon = new DesktopIcon();
|
// DesktopIcon familyIcon = new DesktopIcon();
|
||||||
// familyIcon.setIcon(context.getDrawable(R.drawable.com_android_appstore));
|
//// familyIcon.setIcon(context.getDrawable(R.drawable.com_android_appstore));
|
||||||
familyIcon.setTitle("应用市场");
|
// familyIcon.setTitle("应用市场");
|
||||||
familyIcon.setPackage("aios.appstore");
|
// familyIcon.setPackage("aios.appstore");
|
||||||
desktopIcons.add(1, familyIcon);
|
// desktopIcons.add(0, familyIcon);
|
||||||
|
|
||||||
// DesktopIcon exitIcon = new DesktopIcon();
|
// DesktopIcon exitIcon = new DesktopIcon();
|
||||||
// exitIcon.setIcon(context.getDrawable(R.drawable.exit_icon));
|
// exitIcon.setIcon(context.getDrawable(R.drawable.exit_icon));
|
||||||
@@ -308,6 +313,106 @@ public class ApkUtils {
|
|||||||
return desktopIcons;
|
return desktopIcons;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final HashSet<String> phoneShowPackageName = new HashSet<String>() {{
|
||||||
|
this.add("com.uiuios.sn");
|
||||||
|
// this.add("com.uiuios.browser");
|
||||||
|
// this.add("com.android.dialer");
|
||||||
|
// this.add("com.android.gallery3d");
|
||||||
|
// this.add("com.android.settings");
|
||||||
|
// this.add("com.android.messaging");
|
||||||
|
// this.add("com.android.camera2");
|
||||||
|
// this.add("com.mediatek.camera");
|
||||||
|
// this.add("com.android.mms");
|
||||||
|
// this.add("com.uiui.city");
|
||||||
|
// this.add("com.uiui.health");
|
||||||
|
}};
|
||||||
|
|
||||||
|
public static ArrayList<DesktopIcon> getAppstoreAppInfo(Context context) {
|
||||||
|
MMKV mmkv = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||||
|
PackageManager pm = context.getPackageManager();
|
||||||
|
// 查询所有已经安装的应用程序
|
||||||
|
List<ResolveInfo> resolveInfos = new ArrayList<>();
|
||||||
|
// 创建一个类别为CATEGORY_LAUNCHER的该包名的Intent
|
||||||
|
Intent resolveIntent = new Intent(Intent.ACTION_MAIN, null);
|
||||||
|
resolveIntent.addCategory(Intent.CATEGORY_LAUNCHER);
|
||||||
|
// 通过getPackageManager()的queryIntentActivities方法遍历,得到所有能打开的app的packageName
|
||||||
|
List<ResolveInfo> resolveinfoList = pm.queryIntentActivities(resolveIntent, 0);
|
||||||
|
|
||||||
|
Set<String> allPackages = new HashSet();
|
||||||
|
for (ResolveInfo resolveInfo : resolveinfoList) {
|
||||||
|
Log.i(TAG, "getAppstoreAppInfo: " + resolveInfo.activityInfo.packageName);
|
||||||
|
Log.i(TAG, "getAppstoreAppInfo class: " + resolveInfo.activityInfo.name);
|
||||||
|
allPackages.add(resolveInfo.activityInfo.packageName);
|
||||||
|
}
|
||||||
|
String pkgString = Settings.Global.getString(context.getContentResolver(), CommonConfig.UIUI_APPSTORE_PACKAGE_LIST);
|
||||||
|
Set<String> pkgSet;
|
||||||
|
if (TextUtils.isEmpty(pkgString)) {
|
||||||
|
pkgSet = new ArraySet<>();
|
||||||
|
} else {
|
||||||
|
pkgSet = new HashSet<>(new ArrayList<>(Arrays.asList(pkgString.split(","))));
|
||||||
|
}
|
||||||
|
Log.e(TAG, "getAppstoreAppInfo: pkgSet = " + pkgSet);
|
||||||
|
int frist = mmkv.decodeInt(CommonConfig.UIUI_FIRST_OPEN, 0);
|
||||||
|
for (ResolveInfo resolveInfo : resolveinfoList) {
|
||||||
|
String pkg = resolveInfo.activityInfo.packageName;
|
||||||
|
if (AppStatusManager.getInstance().getHidedAppSet().contains(pkg)) {
|
||||||
|
Log.e(TAG, "getAppstoreAppInfo: hided = " + pkg);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (frist == 0) {
|
||||||
|
if (pkgSet.contains(pkg)) {
|
||||||
|
if (allPackages.contains(pkg) && !excludePackageName.contains(pkg)) {
|
||||||
|
resolveInfos.add(resolveInfo);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ("com.uiuios.sn".equals(pkg)) {
|
||||||
|
resolveInfos.add(resolveInfo);
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "getAppstoreAppInfo: pkgSet ! contains " + pkg);
|
||||||
|
AppStatusManager.getInstance().addHidedApp(pkg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (allPackages.contains(pkg) && !excludePackageName.contains(pkg)) {
|
||||||
|
resolveInfos.add(resolveInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
List<ResolveInfo> sort1 = resolveInfos.stream().sorted(new Comparator<ResolveInfo>() {
|
||||||
|
@Override
|
||||||
|
public int compare(ResolveInfo o1, ResolveInfo o2) {
|
||||||
|
return Collator.getInstance(Locale.CHINESE).compare(o1.loadLabel(pm).toString(), o2.loadLabel(pm).toString());
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
List<ResolveInfo> sort2 = sort1.stream().sorted(new Comparator<ResolveInfo>() {
|
||||||
|
@Override
|
||||||
|
public int compare(ResolveInfo o1, ResolveInfo o2) {
|
||||||
|
try {
|
||||||
|
if ((pm.getApplicationInfo(o1.activityInfo.packageName, 0).flags & ApplicationInfo.FLAG_SYSTEM) < (pm.getApplicationInfo(o2.activityInfo.packageName, 0).flags & ApplicationInfo.FLAG_SYSTEM)) {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
ArrayList<DesktopIcon> desktopIcons = new ArrayList<>();
|
||||||
|
for (ResolveInfo applicationInfo : sort2) {
|
||||||
|
if (!excludeClassName.contains(applicationInfo.activityInfo.name)) {
|
||||||
|
desktopIcons.add(DesktopIcon.creatDesktopIcon(context, applicationInfo));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ShortcutPkgInfo> shortcutPkgInfos = ShortcutUtils.getInstance().getShortcutList();
|
||||||
|
desktopIcons.addAll(shortcutPkgInfos);
|
||||||
|
|
||||||
|
mmkv.encode(CommonConfig.UIUI_FIRST_OPEN, 1);
|
||||||
|
return desktopIcons;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isSystemApp(Context context, String pkg) {
|
public static boolean isSystemApp(Context context, String pkg) {
|
||||||
PackageManager pm = context.getPackageManager();
|
PackageManager pm = context.getPackageManager();
|
||||||
ApplicationInfo applicationInfo = null;
|
ApplicationInfo applicationInfo = null;
|
||||||
|
|||||||
@@ -22,13 +22,14 @@ import static android.view.View.MeasureSpec.makeMeasureSpec;
|
|||||||
* @author zihao
|
* @author zihao
|
||||||
*/
|
*/
|
||||||
public class MyGridLayout extends ViewGroup {
|
public class MyGridLayout extends ViewGroup {
|
||||||
|
private static final String TAG = MyGridLayout.class.getSimpleName();
|
||||||
|
|
||||||
int margin = 0;// 每个格子的水平和垂直间隔
|
int margin = 0;// 每个格子的水平和垂直间隔
|
||||||
int colums = 4;//列数
|
int colums = 3;//列数
|
||||||
int rows = 3;//行数
|
int rows = 3;//行数
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
private GridAdatper adapter;
|
private GridAdatper adapter;
|
||||||
private String TAG = MyGridLayout.class.getSimpleName();
|
|
||||||
|
|
||||||
@SuppressLint("Recycle")
|
@SuppressLint("Recycle")
|
||||||
public MyGridLayout(Context context, AttributeSet attrs, int defStyle) {
|
public MyGridLayout(Context context, AttributeSet attrs, int defStyle) {
|
||||||
@@ -37,7 +38,7 @@ public class MyGridLayout extends ViewGroup {
|
|||||||
TypedArray a = getContext().obtainStyledAttributes(attrs,
|
TypedArray a = getContext().obtainStyledAttributes(attrs,
|
||||||
R.styleable.MyGridLayout);
|
R.styleable.MyGridLayout);
|
||||||
// margin = a.getInteger(R.styleable.MyGridLayout_itemMargin, 2);
|
// margin = a.getInteger(R.styleable.MyGridLayout_itemMargin, 2);
|
||||||
colums = a.getInteger(R.styleable.MyGridLayout_numColumns, 4);
|
colums = a.getInteger(R.styleable.MyGridLayout_numColumns, 3);
|
||||||
rows = a.getInteger(R.styleable.MyGridLayout_numRows, 3);
|
rows = a.getInteger(R.styleable.MyGridLayout_numRows, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.uiuios.aios.view;
|
package com.uiuios.aios.view;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
@@ -10,7 +9,10 @@ import android.os.Build;
|
|||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
public class RulerSeekBar extends androidx.appcompat.widget.AppCompatSeekBar {
|
import androidx.appcompat.widget.AppCompatSeekBar;
|
||||||
|
|
||||||
|
public class RulerSeekBar extends AppCompatSeekBar {
|
||||||
|
private static final String TAG = RulerSeekBar.class.getSimpleName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刻度线画笔
|
* 刻度线画笔
|
||||||
@@ -89,26 +91,26 @@ public class RulerSeekBar extends androidx.appcompat.widget.AppCompatSeekBar {
|
|||||||
Rect rect = getThumb().getBounds();
|
Rect rect = getThumb().getBounds();
|
||||||
thumbRadius = (rect.right - rect.left) / 2;
|
thumbRadius = (rect.right - rect.left) / 2;
|
||||||
}
|
}
|
||||||
Log.e("RulerSeekBar", "onDraw: thumbRadius = " + thumbRadius);
|
Log.e(TAG, "onDraw: thumbRadius = " + thumbRadius);
|
||||||
|
|
||||||
|
|
||||||
//获取每一份的长度
|
//获取每一份的长度
|
||||||
int length = (getWidth() - getPaddingLeft() - getPaddingRight() - (mRulerCount + 1) * (radius) - thumbRadius * 2) / (mRulerCount + 1);
|
int length = (getWidth() - getPaddingLeft() - getPaddingRight() - (mRulerCount + 1) * (radius) - thumbRadius * 2) / (mRulerCount + 1);
|
||||||
Log.e("RulerSeekBar", "onDraw: mRulerCount = " + mRulerCount);
|
Log.e(TAG, "onDraw: mRulerCount = " + mRulerCount);
|
||||||
|
|
||||||
Log.e("RulerSeekBar", "onDraw: getWidth = " + getWidth());
|
Log.e(TAG, "onDraw: getWidth = " + getWidth());
|
||||||
Log.e("RulerSeekBar", "onDraw: getPaddingLeft = " + getPaddingLeft());
|
Log.e(TAG, "onDraw: getPaddingLeft = " + getPaddingLeft());
|
||||||
Log.e("RulerSeekBar", "onDraw: getPaddingRight = " + getPaddingRight());
|
Log.e(TAG, "onDraw: getPaddingRight = " + getPaddingRight());
|
||||||
Log.e("RulerSeekBar", "onDraw: length = " + length);
|
Log.e(TAG, "onDraw: length = " + length);
|
||||||
|
|
||||||
//计算刻度线的顶部坐标和底部坐标
|
//计算刻度线的顶部坐标和底部坐标
|
||||||
Log.e("RulerSeekBar", "onDraw: getHeight = " + getHeight());
|
Log.e(TAG, "onDraw: getHeight = " + getHeight());
|
||||||
Log.e("RulerSeekBar", "onDraw: getMinimumHeight = " + getMinimumHeight());
|
Log.e(TAG, "onDraw: getMinimumHeight = " + getMinimumHeight());
|
||||||
|
|
||||||
int rulerTop = getHeight() / 2 - getMinimumHeight() / 2;
|
int rulerTop = getHeight() / 2 - getMinimumHeight() / 2;
|
||||||
int rulerBottom = rulerTop + getMinimumHeight();
|
int rulerBottom = rulerTop + getMinimumHeight();
|
||||||
Log.e("RulerSeekBar", "onDraw: rulerTop = " + rulerTop);
|
Log.e(TAG, "onDraw: rulerTop = " + rulerTop);
|
||||||
Log.e("RulerSeekBar", "onDraw: rulerBottom = " + rulerBottom);
|
Log.e(TAG, "onDraw: rulerBottom = " + rulerBottom);
|
||||||
int center = getHeight() / 2;
|
int center = getHeight() / 2;
|
||||||
|
|
||||||
//获取滑块的位置信息
|
//获取滑块的位置信息
|
||||||
@@ -116,13 +118,16 @@ public class RulerSeekBar extends androidx.appcompat.widget.AppCompatSeekBar {
|
|||||||
if (getThumb() != null) {
|
if (getThumb() != null) {
|
||||||
thumbRect = getThumb().getBounds();
|
thumbRect = getThumb().getBounds();
|
||||||
}
|
}
|
||||||
Log.e("RulerSeekBar", "onDraw: thumbRect = " + thumbRect);
|
Log.e(TAG, "onDraw: thumbRect = " + thumbRect);
|
||||||
|
|
||||||
//绘制刻度线
|
//绘制刻度线
|
||||||
for (int i = 0; i <= mRulerCount + 1; i++) {
|
for (int i = 0; i <= mRulerCount + 1; i++) {
|
||||||
|
if (getProgress() == i) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
//计算刻度线的左边坐标和右边坐标
|
//计算刻度线的左边坐标和右边坐标
|
||||||
int rulerLeft = i * length + getPaddingLeft();
|
int rulerLeft = i * length + getPaddingLeft();
|
||||||
Log.e("RulerSeekBar", "onDraw: rulerLeft = " + rulerLeft);
|
Log.e(TAG, "onDraw: rulerLeft = " + rulerLeft);
|
||||||
int rulerRight = rulerLeft + mRulerWidth;
|
int rulerRight = rulerLeft + mRulerWidth;
|
||||||
|
|
||||||
//判断是否需要绘制刻度线
|
//判断是否需要绘制刻度线
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.4 KiB |
18
app/src/main/res/drawable/home_alarm_bg.xml
Normal file
18
app/src/main/res/drawable/home_alarm_bg.xml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- 内部颜色 -->
|
||||||
|
<!-- <solid android:color="@color/default_blue" />-->
|
||||||
|
<!-- 圆角的幅度 -->
|
||||||
|
<corners android:radius="@dimen/dp_16" />
|
||||||
|
|
||||||
|
<gradient
|
||||||
|
android:angle="270"
|
||||||
|
android:endColor="#0073FF"
|
||||||
|
android:startColor="#00C5FF" />
|
||||||
|
|
||||||
|
<padding
|
||||||
|
android:bottom="@dimen/dp_4"
|
||||||
|
android:left="@dimen/dp_16"
|
||||||
|
android:right="@dimen/dp_16"
|
||||||
|
android:top="@dimen/dp_4" />
|
||||||
|
</shape>
|
||||||
18
app/src/main/res/drawable/home_card_bg.xml
Normal file
18
app/src/main/res/drawable/home_card_bg.xml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- 内部颜色 -->
|
||||||
|
<!-- <solid android:color="@color/default_blue" />-->
|
||||||
|
<!-- 圆角的幅度 -->
|
||||||
|
<corners android:radius="@dimen/dp_8" />
|
||||||
|
|
||||||
|
<gradient
|
||||||
|
android:angle="270"
|
||||||
|
android:endColor="#4C4C4D"
|
||||||
|
android:startColor="#636364" />
|
||||||
|
|
||||||
|
<!-- <padding-->
|
||||||
|
<!-- android:bottom="0dp"-->
|
||||||
|
<!-- android:left="8dp"-->
|
||||||
|
<!-- android:right="8dp"-->
|
||||||
|
<!-- android:top="0dp" />-->
|
||||||
|
</shape>
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
<!-- android:width="1dp"-->
|
<!-- android:width="1dp"-->
|
||||||
<!-- android:color="#fff" />-->
|
<!-- android:color="#fff" />-->
|
||||||
<corners android:radius="@dimen/dp_8" />
|
<corners android:radius="@dimen/dp_8" />
|
||||||
<solid android:color="@color/control_text_color2" />
|
<solid android:color="@color/control_text_color" />
|
||||||
</shape>
|
</shape>
|
||||||
</clip>
|
</clip>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:id="@android:id/background">
|
<item android:id="@android:id/background">
|
||||||
<shape>
|
<shape>
|
||||||
<solid android:color="#ffe6d4" />
|
<solid android:color="#FFFFFF" />
|
||||||
<size android:height="@dimen/dp_14" />
|
<size android:height="@dimen/dp_14" />
|
||||||
<corners android:radius="@dimen/dp_14" />
|
<corners android:radius="@dimen/dp_14" />
|
||||||
</shape>
|
</shape>
|
||||||
|
|||||||
@@ -31,8 +31,8 @@
|
|||||||
android:id="@+id/cl_weather"
|
android:id="@+id/cl_weather"
|
||||||
android:layout_width="@dimen/dp_157"
|
android:layout_width="@dimen/dp_157"
|
||||||
android:layout_height="@dimen/dp_96"
|
android:layout_height="@dimen/dp_96"
|
||||||
android:onClick="@{click::toWeather}"
|
|
||||||
android:background="@drawable/custom_bg_weather"
|
android:background="@drawable/custom_bg_weather"
|
||||||
|
android:onClick="@{click::toWeather}"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
@@ -170,8 +170,8 @@
|
|||||||
android:layout_width="@dimen/dp_115"
|
android:layout_width="@dimen/dp_115"
|
||||||
android:layout_height="@dimen/dp_142"
|
android:layout_height="@dimen/dp_142"
|
||||||
android:layout_marginStart="@dimen/dp_13"
|
android:layout_marginStart="@dimen/dp_13"
|
||||||
android:onClick="@{click::toVideoplayer}"
|
|
||||||
android:background="@drawable/bg_black_transparent"
|
android:background="@drawable/bg_black_transparent"
|
||||||
|
android:onClick="@{click::toVideoplayer}"
|
||||||
app:layout_constraintStart_toEndOf="@+id/cl_weather"
|
app:layout_constraintStart_toEndOf="@+id/cl_weather"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
@@ -288,6 +288,20 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_clock"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/home_alarm_bg"
|
||||||
|
android:text="未设置"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_16"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/textView3"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_noti"
|
android:id="@+id/rv_noti"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -329,8 +343,8 @@
|
|||||||
android:id="@+id/cl_clear"
|
android:id="@+id/cl_clear"
|
||||||
android:layout_width="@dimen/dp_109"
|
android:layout_width="@dimen/dp_109"
|
||||||
android:layout_height="@dimen/dp_71"
|
android:layout_height="@dimen/dp_71"
|
||||||
android:onClick="@{click::killApp}"
|
|
||||||
android:background="@drawable/bg_black_transparent"
|
android:background="@drawable/bg_black_transparent"
|
||||||
|
android:onClick="@{click::killApp}"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
@@ -367,8 +381,8 @@
|
|||||||
android:layout_width="@dimen/dp_109"
|
android:layout_width="@dimen/dp_109"
|
||||||
android:layout_height="@dimen/dp_71"
|
android:layout_height="@dimen/dp_71"
|
||||||
android:layout_marginStart="@dimen/dp_13"
|
android:layout_marginStart="@dimen/dp_13"
|
||||||
android:onClick="@{click::toSos}"
|
|
||||||
android:background="@drawable/bg_black_transparent"
|
android:background="@drawable/bg_black_transparent"
|
||||||
|
android:onClick="@{click::toSos}"
|
||||||
app:layout_constraintStart_toEndOf="@+id/cl_clear"
|
app:layout_constraintStart_toEndOf="@+id/cl_clear"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
@@ -434,9 +448,9 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cl_appstore"
|
android:id="@+id/cl_appstore"
|
||||||
android:layout_width="@dimen/dp_109"
|
android:layout_width="@dimen/dp_109"
|
||||||
android:onClick="@{click::toAppstore}"
|
|
||||||
android:layout_height="@dimen/dp_71"
|
android:layout_height="@dimen/dp_71"
|
||||||
android:background="@drawable/bg_black_transparent"
|
android:background="@drawable/bg_black_transparent"
|
||||||
|
android:onClick="@{click::toAppstore}"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="@+id/cl_sos"
|
app:layout_constraintStart_toStartOf="@+id/cl_sos"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="@dimen/dp_16"
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
android:layout_marginTop="@dimen/dp_48"
|
android:layout_marginTop="@dimen/dp_24"
|
||||||
android:layout_marginEnd="@dimen/dp_16">
|
android:layout_marginEnd="@dimen/dp_16">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -150,12 +150,10 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cl_space"
|
android:id="@+id/cl_space"
|
||||||
android:layout_width="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="@dimen/dp_6"
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
android:layout_marginEnd="@dimen/dp_6"
|
|
||||||
android:layout_marginBottom="@dimen/dp_6"
|
android:layout_marginBottom="@dimen/dp_6"
|
||||||
android:layout_weight="2"
|
|
||||||
android:background="@drawable/bg_black_transparent"
|
android:background="@drawable/bg_black_transparent"
|
||||||
android:onClick="@{click::toVideoplayer}"
|
android:onClick="@{click::toVideoplayer}"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
@@ -257,6 +255,60 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="visible">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl_clear"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
|
android:layout_marginEnd="@dimen/dp_6"
|
||||||
|
android:layout_marginBottom="@dimen/dp_6"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/home_card_bg"
|
||||||
|
android:onClick="@{click::killApp}"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView15"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/dp_8"
|
||||||
|
android:text="一键加速"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_16"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<com.king.view.circleprogressview.CircleProgressView
|
||||||
|
android:id="@+id/cpv"
|
||||||
|
android:layout_width="@dimen/dp_80"
|
||||||
|
android:layout_height="@dimen/dp_80"
|
||||||
|
app:cpvDuration="1000"
|
||||||
|
app:cpvLabelTextColor="#02B1AF"
|
||||||
|
app:cpvLabelTextSize="@dimen/sp_11"
|
||||||
|
app:cpvNormalColor="#2F7775"
|
||||||
|
app:cpvProgressColor="#02B1AF"
|
||||||
|
app:cpvShowTick="false"
|
||||||
|
app:cpvStrokeWidth="@dimen/dp_8"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/textView15"
|
||||||
|
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
|
||||||
android:id="@+id/cl_alarmclock"
|
android:id="@+id/cl_alarmclock"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
@@ -265,7 +317,8 @@
|
|||||||
android:layout_marginTop="@dimen/dp_6"
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
android:layout_marginBottom="@dimen/dp_6"
|
android:layout_marginBottom="@dimen/dp_6"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/bg_black_transparent"
|
android:background="@drawable/home_card_bg"
|
||||||
|
android:onClick="@{click::getAlarmClock}"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
app:layout_constraintStart_toEndOf="@+id/cl_space"
|
app:layout_constraintStart_toEndOf="@+id/cl_space"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
@@ -274,12 +327,25 @@
|
|||||||
android:id="@+id/textView3"
|
android:id="@+id/textView3"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dp_12"
|
android:layout_marginBottom="@dimen/dp_8"
|
||||||
android:layout_marginTop="@dimen/dp_6"
|
android:text="我的闹钟"
|
||||||
android:text="爱心闹钟"
|
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_16"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_clock"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/home_alarm_bg"
|
||||||
|
android:text="未设置"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_16"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/textView3"
|
||||||
|
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" />
|
||||||
|
|
||||||
@@ -292,77 +358,24 @@
|
|||||||
android:layout_marginEnd="@dimen/dp_16"
|
android:layout_marginEnd="@dimen/dp_16"
|
||||||
android:onClick="@{click::getAlarmClock}"
|
android:onClick="@{click::getAlarmClock}"
|
||||||
android:overScrollMode="never"
|
android:overScrollMode="never"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/textView3"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/textView3" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_note_nodata"
|
android:id="@+id/iv_note_nodata"
|
||||||
android:layout_width="@dimen/dp_60"
|
android:layout_width="@dimen/dp_60"
|
||||||
android:layout_height="@dimen/dp_80"
|
android:layout_height="@dimen/dp_80"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:onClick="@{click::getAlarmClock}"
|
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/icon_add_alarm_clock"
|
android:src="@drawable/icon_add_alarm_clock"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
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_toBottomOf="@+id/textView3" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:visibility="gone">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/cl_clear"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginTop="@dimen/dp_6"
|
|
||||||
android:layout_marginEnd="@dimen/dp_6"
|
|
||||||
android:layout_marginBottom="@dimen/dp_6"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/bg_black_transparent"
|
|
||||||
android:onClick="@{click::killApp}"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView15"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/dp_12"
|
|
||||||
android:layout_marginTop="@dimen/dp_6"
|
|
||||||
android:text="一键加速"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="@dimen/sp_9"
|
|
||||||
android:textStyle="bold"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<com.king.view.circleprogressview.CircleProgressView
|
|
||||||
android:id="@+id/cpv"
|
|
||||||
android:layout_width="@dimen/dp_80"
|
|
||||||
android:layout_height="@dimen/dp_80"
|
|
||||||
app:cpvDuration="1000"
|
|
||||||
app:cpvLabelTextColor="#02B1AF"
|
|
||||||
app:cpvLabelTextSize="@dimen/sp_11"
|
|
||||||
app:cpvNormalColor="#2F7775"
|
|
||||||
app:cpvProgressColor="#02B1AF"
|
|
||||||
app:cpvShowTick="false"
|
|
||||||
app:cpvStrokeWidth="@dimen/dp_6"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/textView15" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
@@ -376,6 +389,7 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/bg_black_transparent"
|
android:background="@drawable/bg_black_transparent"
|
||||||
android:onClick="@{click::toSos}"
|
android:onClick="@{click::toSos}"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintStart_toEndOf="@+id/cl_clear"
|
app:layout_constraintStart_toEndOf="@+id/cl_clear"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
@@ -387,7 +401,7 @@
|
|||||||
android:layout_marginTop="@dimen/dp_6"
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
android:text="紧急呼叫"
|
android:text="紧急呼叫"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_9"
|
android:textSize="@dimen/sp_16"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -408,37 +422,122 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="3">
|
android:layout_weight="2"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl_appstore"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
|
android:layout_marginEnd="@dimen/dp_6"
|
||||||
|
android:layout_marginBottom="@dimen/dp_6"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/home_card_bg"
|
||||||
|
android:onClick="@{click::toAppstore}"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/cl_contact">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView31"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/dp_8"
|
||||||
|
android:text="应用市场"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_16"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/dp_60"
|
||||||
|
android:layout_height="@dimen/dp_60"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/com_android_appstore"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/textView31"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl_contact"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="@dimen/dp_6"
|
||||||
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
|
android:layout_marginBottom="@dimen/dp_6"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/home_card_bg"
|
||||||
|
android:onClick="@{click::toContact}"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView32"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/dp_8"
|
||||||
|
android:text="快捷电话"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_16"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/dp_60"
|
||||||
|
android:layout_height="@dimen/dp_60"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/home_dialer"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/textView32"
|
||||||
|
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
|
||||||
android:id="@+id/cl_app"
|
android:id="@+id/cl_app"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="@dimen/dp_6"
|
||||||
android:layout_marginTop="@dimen/dp_6"
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
android:background="@drawable/bg_black_transparent"
|
android:layout_marginBottom="@dimen/dp_6"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/home_card_bg"
|
||||||
|
android:onClick="@{click::dailyApp}"
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_app"
|
android:id="@+id/tv_app"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dp_12"
|
android:layout_marginBottom="@dimen/dp_8"
|
||||||
android:layout_marginTop="@dimen/dp_6"
|
android:text="更多应用"
|
||||||
android:text="快捷应用"
|
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_16"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="@dimen/dp_6"
|
android:layout_marginEnd="@dimen/dp_6"
|
||||||
android:onClick="@{click::edit}"
|
android:onClick="@{click::edit}"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/tv_app"
|
app:layout_constraintBottom_toBottomOf="@+id/tv_app"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/tv_app">
|
app:layout_constraintTop_toTopOf="@+id/tv_app">
|
||||||
@@ -470,102 +569,50 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginTop="@dimen/dp_6"
|
android:layout_marginTop="@dimen/dp_6"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_app" />
|
app:layout_constraintTop_toBottomOf="@+id/tv_app" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/dp_60"
|
||||||
|
android:layout_height="@dimen/dp_60"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/icon_daily_app"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/tv_app"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_nodata"
|
android:id="@+id/iv_nodata"
|
||||||
android:layout_width="@dimen/dp_100"
|
android:layout_width="@dimen/dp_60"
|
||||||
android:layout_height="@dimen/dp_100"
|
android:layout_height="@dimen/dp_60"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/nodata"
|
android:src="@drawable/nodata"
|
||||||
android:visibility="visible"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toTopOf="@+id/tv_app"
|
||||||
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" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/constraintLayout19"
|
|
||||||
android:layout_width="@dimen/dp_230"
|
|
||||||
android:layout_height="@dimen/dp_154"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/cl_contact"
|
|
||||||
android:layout_width="@dimen/dp_109"
|
|
||||||
android:layout_height="@dimen/dp_71"
|
|
||||||
android:background="@drawable/bg_black_transparent"
|
|
||||||
android:onClick="@{click::toContact}"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/dp_12"
|
|
||||||
android:layout_marginTop="@dimen/dp_6"
|
|
||||||
android:text="快捷电话"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="@dimen/sp_9"
|
|
||||||
android:textStyle="bold"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="@dimen/dp_40"
|
|
||||||
android:layout_height="@dimen/dp_40"
|
|
||||||
android:layout_marginEnd="@dimen/dp_8"
|
|
||||||
android:layout_marginBottom="@dimen/dp_8"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:src="@drawable/home_dialer"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/cl_appstore"
|
|
||||||
android:layout_width="@dimen/dp_109"
|
|
||||||
android:layout_height="@dimen/dp_71"
|
|
||||||
android:background="@drawable/bg_black_transparent"
|
|
||||||
android:onClick="@{click::toAppstore}"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/cl_contact">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/dp_12"
|
|
||||||
android:layout_marginTop="@dimen/dp_6"
|
|
||||||
android:text="应用市场"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="@dimen/sp_9"
|
|
||||||
android:textStyle="bold"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="@dimen/dp_40"
|
|
||||||
android:layout_height="@dimen/dp_40"
|
|
||||||
android:layout_marginEnd="@dimen/dp_8"
|
|
||||||
android:layout_marginBottom="@dimen/dp_8"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
android:src="@drawable/home_application_icon"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/gray"
|
android:background="@color/gray"
|
||||||
tools:context=".activity.alarmclock.AlarmClockAddActivity">
|
tools:context=".activity.alarmclock.add.AlarmClockAddActivity">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/constraintLayout13"
|
android:id="@+id/constraintLayout13"
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/gray"
|
android:background="@color/gray">
|
||||||
tools:context=".activity.alarmclock.AlarmClockAddActivity">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/constraintLayout13"
|
android:id="@+id/constraintLayout13"
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:context=".activity.alarmclock.port.PortAlarmClockAddActivity">
|
tools:context=".activity.alarmclock.add.port.PortAlarmClockAddActivity">
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="click"
|
name="click"
|
||||||
type="com.uiuios.aios.activity.alarmclock.port.PortAlarmClockAddActivity.Click" />
|
type="com.uiuios.aios.activity.alarmclock.add.port.PortAlarmClockAddActivity.Click" />
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cl_exit"
|
android:id="@+id/cl_exit"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_36"
|
android:layout_height="@dimen/dp_48"
|
||||||
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">
|
||||||
@@ -36,8 +36,8 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView12"
|
android:id="@+id/imageView12"
|
||||||
android:layout_width="@dimen/dp_16"
|
android:layout_width="@dimen/dp_32"
|
||||||
android:layout_height="@dimen/dp_16"
|
android:layout_height="@dimen/dp_32"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/back_black"
|
android:src="@drawable/back_black"
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="设置闹钟"
|
android:text="设置闹钟"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_13"
|
android:textSize="@dimen/sp_18"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/imageView12"
|
app:layout_constraintStart_toEndOf="@+id/imageView12"
|
||||||
@@ -59,9 +59,15 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/tv_add"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/cl_exit">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/tv_add"
|
app:layout_constraintBottom_toTopOf="@+id/tv_add"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/cl_exit">
|
app:layout_constraintTop_toBottomOf="@+id/cl_exit">
|
||||||
@@ -69,11 +75,10 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cl_picker"
|
android:id="@+id/cl_picker"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="@dimen/dp_200"
|
||||||
android:layout_marginStart="@dimen/dp_8"
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
android:layout_marginEnd="@dimen/dp_8"
|
android:layout_marginEnd="@dimen/dp_8"
|
||||||
android:layout_marginBottom="@dimen/dp_8"
|
android:layout_marginBottom="@dimen/dp_8"
|
||||||
android:layout_weight="4"
|
|
||||||
android:background="@drawable/add_alarm_background">
|
android:background="@drawable/add_alarm_background">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -84,7 +89,7 @@
|
|||||||
android:layout_marginTop="@dimen/dp_8"
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
android:text="选择时间"
|
android:text="选择时间"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_12"
|
android:textSize="@dimen/sp_16"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@@ -107,7 +112,6 @@
|
|||||||
android:layout_marginStart="@dimen/dp_8"
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
android:layout_marginEnd="@dimen/dp_8"
|
android:layout_marginEnd="@dimen/dp_8"
|
||||||
android:layout_marginBottom="@dimen/dp_8"
|
android:layout_marginBottom="@dimen/dp_8"
|
||||||
android:layout_weight="1"
|
|
||||||
android:background="@drawable/add_alarm_background"
|
android:background="@drawable/add_alarm_background"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
@@ -168,10 +172,9 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="@dimen/dp_120"
|
||||||
android:layout_marginStart="@dimen/dp_8"
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
android:layout_marginEnd="@dimen/dp_8"
|
android:layout_marginEnd="@dimen/dp_8"
|
||||||
android:layout_weight="2"
|
|
||||||
android:background="@drawable/add_alarm_background">
|
android:background="@drawable/add_alarm_background">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -195,7 +198,7 @@
|
|||||||
android:layout_marginStart="@dimen/dp_16"
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
android:text="重复"
|
android:text="重复"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_12"
|
android:textSize="@dimen/sp_16"
|
||||||
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" />
|
||||||
@@ -228,22 +231,22 @@
|
|||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/rb1"
|
android:id="@+id/rb1"
|
||||||
android:layout_width="@dimen/dp_40"
|
android:layout_width="@dimen/dp_50"
|
||||||
android:layout_height="@dimen/dp_20"
|
android:layout_height="@dimen/dp_25"
|
||||||
android:background="@drawable/tv_times_bg_once_selector"
|
android:background="@drawable/tv_times_bg_once_selector"
|
||||||
android:button="@null"
|
android:button="@null"
|
||||||
android:textColor="@color/radio_botton_gray"
|
android:textColor="@color/radio_botton_gray"
|
||||||
android:textSize="@dimen/sp_9" />
|
android:textSize="@dimen/sp_12" />
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/rb2"
|
android:id="@+id/rb2"
|
||||||
android:layout_width="@dimen/dp_40"
|
android:layout_width="@dimen/dp_50"
|
||||||
android:layout_height="@dimen/dp_20"
|
android:layout_height="@dimen/dp_25"
|
||||||
android:layout_marginStart="@dimen/dp_8"
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
android:background="@drawable/tv_times_bg_loop_selector"
|
android:background="@drawable/tv_times_bg_loop_selector"
|
||||||
android:button="@null"
|
android:button="@null"
|
||||||
android:textColor="@color/radio_botton_gray"
|
android:textColor="@color/radio_botton_gray"
|
||||||
android:textSize="@dimen/sp_9" />
|
android:textSize="@dimen/sp_12" />
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -269,7 +272,7 @@
|
|||||||
android:layout_marginStart="@dimen/dp_16"
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
android:text="提醒方式"
|
android:text="提醒方式"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_12"
|
android:textSize="@dimen/sp_16"
|
||||||
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" />
|
||||||
@@ -280,7 +283,7 @@
|
|||||||
android:layout_marginEnd="@dimen/dp_16"
|
android:layout_marginEnd="@dimen/dp_16"
|
||||||
android:text="弹窗"
|
android:text="弹窗"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_12"
|
android:textSize="@dimen/sp_14"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -293,11 +296,10 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="@dimen/dp_80"
|
||||||
android:layout_marginStart="@dimen/dp_8"
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
android:layout_marginTop="@dimen/dp_8"
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
android:layout_marginEnd="@dimen/dp_8"
|
android:layout_marginEnd="@dimen/dp_8"
|
||||||
android:layout_weight="2"
|
|
||||||
android:background="@drawable/add_alarm_background">
|
android:background="@drawable/add_alarm_background">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -337,6 +339,7 @@
|
|||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textColorHint="@color/radio_botton_gray"
|
android:textColorHint="@color/radio_botton_gray"
|
||||||
|
android:textSize="@dimen/sp_16"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -348,12 +351,11 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="@dimen/dp_160"
|
||||||
android:layout_marginStart="@dimen/dp_8"
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
android:layout_marginTop="@dimen/dp_8"
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
android:layout_marginEnd="@dimen/dp_8"
|
android:layout_marginEnd="@dimen/dp_8"
|
||||||
android:layout_marginBottom="@dimen/dp_8"
|
android:layout_marginBottom="@dimen/dp_8"
|
||||||
android:layout_weight="3"
|
|
||||||
android:background="@drawable/add_alarm_background">
|
android:background="@drawable/add_alarm_background">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -363,7 +365,7 @@
|
|||||||
android:layout_marginStart="@dimen/dp_16"
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
android:text="选择图片或视频"
|
android:text="选择图片或视频"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_12"
|
android:textSize="@dimen/sp_16"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/cl_pic"
|
app:layout_constraintBottom_toTopOf="@+id/cl_pic"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -410,6 +412,8 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_add"
|
android:id="@+id/tv_add"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -423,7 +427,7 @@
|
|||||||
android:text="添加闹钟"
|
android:text="添加闹钟"
|
||||||
android:background="@drawable/tv_add_alarm_background"
|
android:background="@drawable/tv_add_alarm_background"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_12"
|
android:textSize="@dimen/sp_18"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
tools:context=".activity.contact.AddContactActivity">
|
tools:context=".activity.contact.AddContactActivity">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<variable
|
||||||
|
name="click"
|
||||||
|
type="com.uiuios.aios.activity.contact.AddContactActivity.BtnClick" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/constraintLayout3"
|
android:id="@+id/constraintLayout3"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -19,6 +27,7 @@
|
|||||||
android:layout_width="@dimen/dp_32"
|
android:layout_width="@dimen/dp_32"
|
||||||
android:layout_height="@dimen/dp_32"
|
android:layout_height="@dimen/dp_32"
|
||||||
android:layout_marginStart="@dimen/dp_16"
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
|
android:onClick="@{click::exit}"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/add_contact_back"
|
android:src="@drawable/add_contact_back"
|
||||||
@@ -41,12 +50,13 @@
|
|||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_confirm"
|
android:id="@+id/iv_confirm"
|
||||||
android:layout_width="@dimen/dp_24"
|
android:layout_width="@dimen/dp_24"
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_height="@dimen/dp_24"
|
android:layout_height="@dimen/dp_24"
|
||||||
android:layout_marginEnd="@dimen/dp_8"
|
android:layout_marginEnd="@dimen/dp_8"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
|
android:onClick="@{click::confirm}"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/icon_confirm"
|
android:src="@drawable/icon_confirm"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -79,6 +89,7 @@
|
|||||||
android:layout_height="@dimen/dp_100"
|
android:layout_height="@dimen/dp_100"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginTop="@dimen/dp_16"
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:onClick="@{click::selectPic}"
|
||||||
android:src="@drawable/default_avatar"
|
android:src="@drawable/default_avatar"
|
||||||
app:is_circle="true"
|
app:is_circle="true"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -117,8 +128,8 @@
|
|||||||
android:layout_marginStart="@dimen/dp_12"
|
android:layout_marginStart="@dimen/dp_12"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:visibility="gone"
|
|
||||||
android:src="@drawable/icon_avatar"
|
android:src="@drawable/icon_avatar"
|
||||||
|
android:visibility="gone"
|
||||||
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" />
|
||||||
@@ -144,9 +155,9 @@
|
|||||||
android:id="@+id/et_name"
|
android:id="@+id/et_name"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
android:layout_marginEnd="@dimen/dp_8"
|
android:layout_marginEnd="@dimen/dp_8"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:layout_marginStart="@dimen/dp_16"
|
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:hint="姓名"
|
android:hint="姓名"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
@@ -256,6 +267,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_52"
|
android:layout_height="@dimen/dp_52"
|
||||||
android:layout_margin="@dimen/dp_8"
|
android:layout_margin="@dimen/dp_8"
|
||||||
|
android:onClick="@{click::confirm}"
|
||||||
android:background="@drawable/add_contact_confirm_background"
|
android:background="@drawable/add_contact_confirm_background"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
tools:layout_editor_absoluteX="14dp">
|
tools:layout_editor_absoluteX="14dp">
|
||||||
@@ -281,4 +293,5 @@
|
|||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
@@ -2,13 +2,13 @@
|
|||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:context=".activity.wecontact.AddWechatContactActivity">
|
tools:context=".activity.contact.AddWechatContactActivity">
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="click"
|
name="click"
|
||||||
type="com.uiuios.aios.activity.wecontact.AddWechatContactActivity.BtnClick" />
|
type="com.uiuios.aios.activity.contact.AddWechatContactActivity.BtnClick" />
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dp_16"
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
android:text="新建微信联系人"
|
android:text="新建联系人"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_22"
|
android:textSize="@dimen/sp_22"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -261,6 +261,34 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_60"
|
||||||
|
android:layout_margin="@dimen/dp_8"
|
||||||
|
android:background="@drawable/add_wechat_contact_background">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_12"
|
||||||
|
android:text="设为紧急联系人"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_16"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<com.uiuios.aios.view.ToggleButton
|
||||||
|
android:id="@+id/toggleButton"
|
||||||
|
android:layout_width="@dimen/dp_37"
|
||||||
|
android:layout_height="@dimen/dp_20"
|
||||||
|
android:layout_marginEnd="@dimen/dp_32"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_60"
|
android:layout_height="@dimen/dp_60"
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:context=".activity.alarm.main.AlarmActivity">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<variable
|
||||||
|
name="click"
|
||||||
|
type="com.uiuios.aios.activity.alarmclock.main.AlarmClockActivity.BtnClick" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/alarm_background_color"
|
android:background="@color/alarm_background_color">
|
||||||
tools:context=".activity.alarm.AlarmActivity">
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
@@ -25,7 +33,7 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView12"
|
android:id="@+id/iv_back"
|
||||||
android:layout_width="@dimen/dp_16"
|
android:layout_width="@dimen/dp_16"
|
||||||
android:layout_height="@dimen/dp_16"
|
android:layout_height="@dimen/dp_16"
|
||||||
android:layout_marginStart="@dimen/dp_4"
|
android:layout_marginStart="@dimen/dp_4"
|
||||||
@@ -45,7 +53,7 @@
|
|||||||
android:textSize="@dimen/sp_13"
|
android:textSize="@dimen/sp_13"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/imageView12"
|
app:layout_constraintStart_toEndOf="@+id/iv_back"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -252,14 +260,14 @@
|
|||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_data"
|
android:id="@+id/rv_data"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:background="#e6e6e6"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:background="#e6e6e6" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cl_nodata"
|
android:id="@+id/cl_nodata"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:background="#e6e6e6"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="#e6e6e6"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -291,4 +299,5 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".activity.alarmclock.AlarmClockActivity">
|
tools:context=".activity.alarmclock.main.AlarmClockActivity">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/constraintLayout4"
|
android:id="@+id/constraintLayout4"
|
||||||
|
|||||||
@@ -1,15 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
tools:context=".activity.noti.NoticeActivity">
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="vertical"
|
<data>
|
||||||
tools:context=".activity.NoticeActivity">
|
|
||||||
|
</data>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="@dimen/dp_240"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_160"
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="@dimen/dp_260"
|
||||||
|
android:layout_height="@dimen/dp_200"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:background="@drawable/bg_dialog"
|
android:background="@drawable/bg_dialog"
|
||||||
android:minWidth="@dimen/dp_240"
|
android:minWidth="@dimen/dp_240"
|
||||||
@@ -49,7 +55,7 @@
|
|||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:text="闹钟提醒"
|
android:text="闹钟提醒"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_14"
|
android:textSize="@dimen/sp_18"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:visibility="visible" />
|
android:visibility="visible" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -66,7 +72,7 @@
|
|||||||
android:minHeight="@dimen/dp_50"
|
android:minHeight="@dimen/dp_50"
|
||||||
android:text="您有新的闹钟,请查收"
|
android:text="您有新的闹钟,请查收"
|
||||||
android:textColor="#9a9a9a"
|
android:textColor="#9a9a9a"
|
||||||
android:textSize="@dimen/sp_12"
|
android:textSize="@dimen/sp_14"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.0"
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
@@ -91,7 +97,7 @@
|
|||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="查看"
|
android:text="查看"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_12"
|
android:textSize="@dimen/sp_16"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -99,4 +105,5 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
@@ -1,28 +1,35 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
tools:context=".activity.noti.NoticeInfoActivity"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".activity.NoticeInfoActivity">
|
>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
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="32dp"
|
android:layout_marginTop="@dimen/dp_32"
|
||||||
android:text="爱心提醒"
|
android:text="爱心提醒"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="50sp"
|
android:textSize="@dimen/sp_30"
|
||||||
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" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cl_voice"
|
android:id="@+id/cl_voice"
|
||||||
android:layout_width="240dp"
|
android:layout_width="@dimen/dp_200"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
android:background="@drawable/notice_voice_background"
|
android:background="@drawable/notice_voice_background"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -41,8 +48,8 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="32dp"
|
android:layout_width="@dimen/dp_24"
|
||||||
android:layout_height="32dp"
|
android:layout_height="@dimen/dp_24"
|
||||||
android:src="@drawable/voice_white"
|
android:src="@drawable/voice_white"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -51,8 +58,10 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/cl_vp"
|
android:id="@+id/cl_vp"
|
||||||
android:layout_width="400dp"
|
android:layout_width="@dimen/dp_300"
|
||||||
android:layout_height="400dp"
|
android:layout_height="@dimen/dp_300"
|
||||||
|
android:layout_marginTop="@dimen/dp_32"
|
||||||
|
android:layout_marginBottom="@dimen/dp_32"
|
||||||
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"
|
||||||
@@ -75,9 +84,9 @@
|
|||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/bt_ok"
|
android:id="@+id/bt_ok"
|
||||||
android:layout_width="100dp"
|
android:layout_width="@dimen/dp_80"
|
||||||
android:layout_height="100dp"
|
android:layout_height="@dimen/dp_80"
|
||||||
android:layout_marginBottom="32dp"
|
android:layout_marginBottom="@dimen/dp_32"
|
||||||
android:background="@drawable/ok_background"
|
android:background="@drawable/ok_background"
|
||||||
android:text="OK"
|
android:text="OK"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
@@ -86,4 +95,5 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</layout>
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
type="com.uiuios.aios.activity.callwechat.CallWechatActivity.BtnClick" />
|
type="com.uiuios.aios.activity.callwechat.CallWechatActivity.BtnClick" />
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="wehchatInfo"
|
name="Contact"
|
||||||
type="com.uiuios.aios.bean.WechatInfo" />
|
type="com.uiuios.aios.bean.Contact" />
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="@{wehchatInfo.mobile}"
|
android:text="@{Contact.mobile}"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_18"
|
android:textSize="@dimen/sp_18"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_60"
|
android:layout_height="@dimen/dp_80"
|
||||||
android:onClick="@{click::callPhone}">
|
android:onClick="@{click::callPhone}">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
android:layout_marginStart="@dimen/dp_16"
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="电话"
|
android:text="拨打电话"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_18"
|
android:textSize="@dimen/sp_18"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -89,14 +89,14 @@
|
|||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="2px"
|
android:layout_height="2px"
|
||||||
android:background="@color/radio_botton_gray"
|
android:background="@color/lightGray"
|
||||||
app:layout_constraintBottom_toBottomOf="parent" />
|
app:layout_constraintBottom_toBottomOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_60"
|
android:layout_height="@dimen/dp_80"
|
||||||
android:onClick="@{click::callWechatVideo}">
|
android:onClick="@{click::callWechatVideo}">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -131,13 +131,13 @@
|
|||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="2px"
|
android:layout_height="2px"
|
||||||
android:background="@color/radio_botton_gray"
|
android:background="@color/lightGray"
|
||||||
app:layout_constraintBottom_toBottomOf="parent" />
|
app:layout_constraintBottom_toBottomOf="parent" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_60"
|
android:layout_height="@dimen/dp_80"
|
||||||
android:onClick="@{click::callWechatVoice}">
|
android:onClick="@{click::callWechatVoice}">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
android:layout_marginStart="@dimen/dp_16"
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text="微信电话"
|
android:text="微信语音"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_18"
|
android:textSize="@dimen/sp_18"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -173,13 +173,13 @@
|
|||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="2px"
|
android:layout_height="2px"
|
||||||
android:background="@color/radio_botton_gray"
|
android:background="@color/lightGray"
|
||||||
app:layout_constraintBottom_toBottomOf="parent" />
|
app:layout_constraintBottom_toBottomOf="parent" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_60"
|
android:layout_height="@dimen/dp_80"
|
||||||
android:layout_marginTop="@dimen/dp_8"
|
android:layout_marginTop="@dimen/dp_8"
|
||||||
android:onClick="@{click::exit}">
|
android:onClick="@{click::exit}">
|
||||||
|
|
||||||
|
|||||||
@@ -15,19 +15,29 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_contact"
|
android:id="@+id/rv_contact"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="@dimen/dp_28"
|
android:layout_marginStart="@dimen/dp_16"
|
||||||
android:layout_marginTop="@dimen/dp_48"
|
android:layout_marginTop="@dimen/dp_24"
|
||||||
android:layout_marginEnd="@dimen/dp_28"
|
android:layout_marginEnd="@dimen/dp_16"
|
||||||
android:layout_marginBottom="@dimen/dp_16"
|
android:layout_marginBottom="@dimen/dp_8"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/tv_add"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
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" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_no_contact"
|
android:id="@+id/tv_no_contact"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -35,9 +45,10 @@
|
|||||||
android:layout_marginStart="@dimen/dp_32"
|
android:layout_marginStart="@dimen/dp_32"
|
||||||
android:layout_marginEnd="@dimen/dp_32"
|
android:layout_marginEnd="@dimen/dp_32"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="暂无快捷联系人"
|
android:text="暂无联系人"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_20"
|
android:textSize="@dimen/sp_20"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/tv_add"
|
app:layout_constraintBottom_toTopOf="@+id/tv_add"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -55,6 +66,7 @@
|
|||||||
android:text="添加联系人"
|
android:text="添加联系人"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_16"
|
android:textSize="@dimen/sp_16"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|||||||
@@ -210,7 +210,7 @@
|
|||||||
android:layout_marginStart="@dimen/dp_8"
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/sound2"
|
android:src="@drawable/sound1"
|
||||||
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" />
|
||||||
@@ -259,7 +259,7 @@
|
|||||||
android:layout_marginStart="@dimen/dp_8"
|
android:layout_marginStart="@dimen/dp_8"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/brightness2"
|
android:src="@drawable/brightness1"
|
||||||
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" />
|
||||||
|
|||||||
12
build.gradle
12
build.gradle
@@ -6,9 +6,9 @@ buildscript {
|
|||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
maven { url 'http://developer.huawei.com/repo/' }
|
maven { url 'https://developer.huawei.com/repo/' }
|
||||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
maven { url 'https://maven.aliyun.com/repository/central/' }
|
||||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/releases/' }
|
maven { url 'https://maven.aliyun.com/repository/public/' }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.6.4'
|
classpath 'com.android.tools.build:gradle:3.6.4'
|
||||||
@@ -28,9 +28,9 @@ allprojects {
|
|||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
maven { url 'http://developer.huawei.com/repo/' }
|
maven { url 'https://developer.huawei.com/repo/' }
|
||||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
maven { url 'https://maven.aliyun.com/repository/central/' }
|
||||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/releases/' }
|
maven { url 'https://maven.aliyun.com/repository/public/' }
|
||||||
}
|
}
|
||||||
gradle.projectsEvaluated {
|
gradle.projectsEvaluated {
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
|
|||||||
Reference in New Issue
Block a user