version:1.0.6
bugfixes: update:切换到联想csdk,增加检查更新页面,增加密码登录
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.hainaos.vc"
|
||||
android:sharedUserId="android.uid.system">
|
||||
package="com.hainaos.vc">
|
||||
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
@@ -11,6 +10,7 @@
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
|
||||
@@ -62,6 +62,12 @@
|
||||
android:name=".activity.category.list.CategoryListActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.update.UpdateActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/DialogCloseOnTouchOutside" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.preview.VideoPreviewActivity"
|
||||
android:launchMode="singleTask"
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.hainaos.vc.bean.BaseResponse;
|
||||
import com.hainaos.vc.bean.CategoryInfo;
|
||||
import com.hainaos.vc.databinding.ActivityCategoryListBinding;
|
||||
import com.hainaos.vc.network.NetInterfaceManager;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
|
||||
@@ -49,6 +50,8 @@ public class CategoryListViewModel extends BaseViewModel<ActivityCategoryListBin
|
||||
if (baseResponse.code == 200) {
|
||||
List<CategoryInfo> categoryInfos = baseResponse.data;
|
||||
mCategoryInfoListData.setValue(categoryInfos);
|
||||
} else {
|
||||
Toaster.show(baseResponse.msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,14 @@ public class LoginActivity extends BaseMvvmActivity<LoginViewModel, ActivityLogi
|
||||
mViewDataBinding.cardView.setEnabled(true);
|
||||
}
|
||||
|
||||
private int mLoginMode = 0;
|
||||
|
||||
public class BtnClick {
|
||||
public void changeLoginMode(View view) {
|
||||
mLoginMode ^= 1;
|
||||
mViewDataBinding.setLoginMode(mLoginMode);
|
||||
}
|
||||
|
||||
public void getCode(View view) {
|
||||
mViewDataBinding.tvGetCode.setText("发送中");
|
||||
mViewDataBinding.cardView.setEnabled(false);
|
||||
@@ -174,6 +181,24 @@ public class LoginActivity extends BaseMvvmActivity<LoginViewModel, ActivityLogi
|
||||
|
||||
mViewModel.codeLogin(mVerifyKey, phoneNumber, captcha);
|
||||
}
|
||||
|
||||
public void passwordLogin(View view) {
|
||||
Editable phoneEditable = mViewDataBinding.etAccount.getText();
|
||||
if (TextUtils.isEmpty(phoneEditable)) {
|
||||
Toaster.show("请输入手机号");
|
||||
return;
|
||||
}
|
||||
Editable codeEditable = mViewDataBinding.etPasswd.getText();
|
||||
if (TextUtils.isEmpty(codeEditable)) {
|
||||
Toaster.show("请输入密码");
|
||||
return;
|
||||
}
|
||||
|
||||
String account = phoneEditable.toString();
|
||||
String passwd = codeEditable.toString();
|
||||
|
||||
mViewModel.accountLogin(account, passwd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,40 @@ public class LoginViewModel extends BaseViewModel<ActivityLoginBinding, Activity
|
||||
|
||||
}
|
||||
|
||||
public void accountLogin(String account, String passwd) {
|
||||
NetInterfaceManager.getInstance().getLoginObservable(account, passwd)
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<LoginInfo>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("accountLogin", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<LoginInfo> baseResponse) {
|
||||
Log.e("accountLogin", "onNext: " + baseResponse);
|
||||
if (baseResponse.code == 200) {
|
||||
LoginInfo loginInfo = baseResponse.data;
|
||||
LoginUtils.getInstance().setLoginInfo(loginInfo);
|
||||
mLoginInfoMutableLiveData.setValue(loginInfo);
|
||||
} else {
|
||||
LoginUtils.getInstance().clearLoginInfo();
|
||||
Toaster.show(baseResponse.msg);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("accountLogin", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("accountLogin", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public MutableLiveData<BaseResponse<CodeInfo>> mCodeInfoyData = new MutableLiveData<>();
|
||||
|
||||
public void sendCode(String phoneNumber) {
|
||||
|
||||
@@ -34,8 +34,8 @@ import com.hainaos.vc.fragment.app.AppFragment;
|
||||
import com.hainaos.vc.fragment.category.CategoryFragment;
|
||||
import com.hainaos.vc.utils.ApkUtils;
|
||||
import com.hainaos.vc.utils.JgyUtils;
|
||||
import com.hainaos.vc.utils.LenovoCsdkUtil;
|
||||
import com.hainaos.vc.utils.ToastUtil;
|
||||
import com.hainaos.vc.utils.Utils;
|
||||
import com.hainaos.vc.utils.VideoUtils;
|
||||
import com.hjq.permissions.OnPermissionCallback;
|
||||
import com.hjq.permissions.XXPermissions;
|
||||
@@ -86,7 +86,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
Log.e(TAG, "initView: getSerial = " + Utils.getSerial());
|
||||
Log.e(TAG, "initView: getSerial = " + LenovoCsdkUtil.getInstance().getSerial());
|
||||
|
||||
mFragmentManager = getSupportFragmentManager();
|
||||
mFragments = new ArrayList<>();
|
||||
@@ -109,6 +109,10 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
} else {
|
||||
if (ApkUtils.isUpdate(MainActivity.this, appUpdateInfo)) {
|
||||
ApkUtils.checkAppUpdate(MainActivity.this, appUpdateInfo);
|
||||
// Intent intent = new Intent(MainActivity.this, UpdateActivity.class);
|
||||
// intent.putExtra("AppInfo", appUpdateInfo.toAppInfo());
|
||||
// startActivity(intent);
|
||||
|
||||
// Toaster.show("有新的版本需要更新");
|
||||
} else {
|
||||
// Toaster.show("已是最新版本");
|
||||
@@ -123,8 +127,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
private void initDatas() {
|
||||
Log.e(TAG, "initDatas: ");
|
||||
|
||||
JgyUtils.getInstance().setDefaultDesktop(getPackageName(), getClass().getCanonicalName());
|
||||
|
||||
LenovoCsdkUtil.getInstance().setCustomLauncher(getPackageName(), getClass().getCanonicalName());
|
||||
|
||||
}
|
||||
|
||||
@@ -337,9 +340,11 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
Log.e(TAG, "onKeyDown: keyCode = " + keyCode);
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == KeyEvent.ACTION_DOWN) {
|
||||
lazyExit();
|
||||
return true;
|
||||
return false;
|
||||
} else if (KeyEvent.KEYCODE_HOME == keyCode) {
|
||||
return false;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.hainaos.vc.BuildConfig;
|
||||
import com.hainaos.vc.base.mvvm.BaseViewModel;
|
||||
import com.hainaos.vc.bean.AppInfo;
|
||||
import com.hainaos.vc.bean.BaseResponse;
|
||||
import com.hainaos.vc.bean.HomeAppInfo;
|
||||
import com.hainaos.vc.bean.uiuios.AppUpdateInfo;
|
||||
@@ -52,14 +53,14 @@ public class MainViewModel extends BaseViewModel<ActivityMainBinding, ActivityEv
|
||||
public void checkUpdate() {
|
||||
NetInterfaceManager.getInstance().getCheckUpdateObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse>() {
|
||||
.subscribe(new Observer<BaseResponse<AppInfo>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("checkUpdate", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse baseResponse) {
|
||||
public void onNext(@NonNull BaseResponse<AppInfo> baseResponse) {
|
||||
Log.e("checkUpdate", "onNext: " + baseResponse);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.hainaos.vc.activity.update;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.view.View;
|
||||
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.arialyy.aria.core.download.DownloadEntity;
|
||||
import com.hainaos.vc.R;
|
||||
import com.hainaos.vc.base.mvvm.BaseMvvmActivity;
|
||||
import com.hainaos.vc.bean.AppInfo;
|
||||
import com.hainaos.vc.databinding.ActivityUpdateBinding;
|
||||
import com.hainaos.vc.service.DownloadService;
|
||||
import com.hainaos.vc.utils.ApkUtils;
|
||||
import com.hainaos.vc.utils.LenovoCsdkUtil;
|
||||
import com.hjq.toast.Toaster;
|
||||
|
||||
import static com.arialyy.aria.core.inf.IEntity.STATE_RUNNING;
|
||||
|
||||
public class UpdateActivity extends BaseMvvmActivity<UpdateViewModel, ActivityUpdateBinding> {
|
||||
|
||||
private AppInfo mAppInfoData;
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_update;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initDataBinding() {
|
||||
mViewModel.setCtx(this);
|
||||
mViewModel.setLifecycle(getLifecycleSubject());
|
||||
mViewModel.setVDBinding(mViewDataBinding);
|
||||
mViewDataBinding.setClick(new BtnClick());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
Intent intent = getIntent();
|
||||
mAppInfoData = (AppInfo) intent.getSerializableExtra("AppInfo");
|
||||
mViewDataBinding.setAppInfo(mAppInfoData);
|
||||
mViewDataBinding.setMsg("检测到新版本,是否更新");
|
||||
}
|
||||
|
||||
|
||||
public class BtnClick {
|
||||
public void empty(View view) {
|
||||
|
||||
}
|
||||
|
||||
public void exit(View view) {
|
||||
finish();
|
||||
}
|
||||
|
||||
public void upgrade(View view) {
|
||||
Intent intent = new Intent(UpdateActivity.this, DownloadService.class);
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
// startForegroundService(intent);
|
||||
// } else {
|
||||
startService(intent);
|
||||
// }
|
||||
if (mAppInfoData != null) {
|
||||
DownloadEntity entity = Aria.download(this).getFirstDownloadEntity(mAppInfoData.getApp_url());
|
||||
if (null != entity) {
|
||||
if (entity.isComplete()) {
|
||||
LenovoCsdkUtil.getInstance().installPackage(entity.getFilePath());
|
||||
} else {
|
||||
if (entity.getState() == STATE_RUNNING) {
|
||||
Toaster.show("文件正在下载中");
|
||||
finish();
|
||||
} else {
|
||||
Aria.download(this).resumeAllTask();
|
||||
Toaster.show("正在下载");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ApkUtils.checkAppUpdate(UpdateActivity.this, mAppInfoData);
|
||||
Toaster.show("正在下载更新");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.hainaos.vc.activity.update;
|
||||
|
||||
import com.hainaos.vc.base.mvvm.BaseViewModel;
|
||||
import com.hainaos.vc.databinding.ActivityUpdateBinding;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
|
||||
public class UpdateViewModel extends BaseViewModel<ActivityUpdateBinding, ActivityEvent> {
|
||||
|
||||
@Override
|
||||
public ActivityUpdateBinding getVDBinding() {
|
||||
return binding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.hainaos.vc.activity.user;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
@@ -11,15 +12,20 @@ import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.lifecycle.Observer;
|
||||
|
||||
import com.hainaos.vc.BuildConfig;
|
||||
import com.hainaos.vc.R;
|
||||
import com.hainaos.vc.activity.lockpasswd.LockPasswdActivity;
|
||||
import com.hainaos.vc.activity.login.LoginActivity;
|
||||
import com.hainaos.vc.activity.mobile.ModifyActivity;
|
||||
import com.hainaos.vc.activity.passwd.PasswdActivity;
|
||||
import com.hainaos.vc.activity.update.UpdateActivity;
|
||||
import com.hainaos.vc.base.mvvm.BaseMvvmActivity;
|
||||
import com.hainaos.vc.bean.AppInfo;
|
||||
import com.hainaos.vc.bean.BaseResponse;
|
||||
import com.hainaos.vc.bean.UserInfo;
|
||||
import com.hainaos.vc.databinding.ActivityUserBinding;
|
||||
import com.hainaos.vc.utils.ApkUtils;
|
||||
import com.hainaos.vc.utils.LenovoCsdkUtil;
|
||||
import com.hainaos.vc.utils.LoginUtils;
|
||||
import com.hainaos.vc.utils.Utils;
|
||||
import com.hjq.toast.Toaster;
|
||||
@@ -45,11 +51,30 @@ public class UserActivity extends BaseMvvmActivity<UserViewModel, ActivityUserBi
|
||||
protected void initView() {
|
||||
mViewDataBinding.setName(LoginUtils.getInstance().getName());
|
||||
mViewDataBinding.setPhoneNumber(LoginUtils.getInstance().getPhoneNumber());
|
||||
|
||||
mViewDataBinding.tvVersion.setText(BuildConfig.VERSION_NAME + "(检查更新)");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
mViewModel.mAppInfoMutableLiveData.observe(this, new Observer<AppInfo>() {
|
||||
@Override
|
||||
public void onChanged(AppInfo appInfo) {
|
||||
if (appInfo != null) {
|
||||
if (ApkUtils.isUpdate(UserActivity.this, appInfo)) {
|
||||
Intent intent = new Intent(UserActivity.this, UpdateActivity.class);
|
||||
intent.putExtra("AppInfo", appInfo);
|
||||
startActivity(intent);
|
||||
Toaster.show("有新的版本需要更新");
|
||||
} else {
|
||||
// Toaster.show("已是最新版本");
|
||||
}
|
||||
} else {
|
||||
// Toaster.show("已是最新版本");
|
||||
}
|
||||
}
|
||||
});
|
||||
mViewModel.checkUpdate();
|
||||
|
||||
mViewModel.mUserInfoMutableLiveData.observe(this, new Observer<BaseResponse<UserInfo>>() {
|
||||
@Override
|
||||
public void onChanged(BaseResponse<UserInfo> baseResponse) {
|
||||
@@ -74,7 +99,7 @@ public class UserActivity extends BaseMvvmActivity<UserViewModel, ActivityUserBi
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
mViewDataBinding.tvSn.setText(Utils.getSerial());
|
||||
mViewDataBinding.tvSn.setText(LenovoCsdkUtil.getInstance().getSerial());
|
||||
mViewDataBinding.tvStorge.setText("已用" + Utils.getRemnantSize(this) + "/" + Utils.getDataTotalSize(this));
|
||||
}
|
||||
|
||||
@@ -85,7 +110,12 @@ public class UserActivity extends BaseMvvmActivity<UserViewModel, ActivityUserBi
|
||||
if (result != null) {
|
||||
Intent intent = result.getData();
|
||||
if (intent != null && result.getResultCode() == Activity.RESULT_OK) {
|
||||
mViewModel.getUserInfo();
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mViewModel.getUserInfo();
|
||||
}
|
||||
}, 1234);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,6 +134,10 @@ public class UserActivity extends BaseMvvmActivity<UserViewModel, ActivityUserBi
|
||||
}
|
||||
}
|
||||
|
||||
public void checkUpdate(View view) {
|
||||
mViewModel.checkUpdate();
|
||||
}
|
||||
|
||||
public void changePasswd(View view) {
|
||||
if (LoginUtils.getInstance().isLogged()) {
|
||||
startActivity(new Intent(UserActivity.this, PasswdActivity.class));
|
||||
|
||||
@@ -4,17 +4,25 @@ import android.util.Log;
|
||||
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.hainaos.vc.BuildConfig;
|
||||
import com.hainaos.vc.base.mvvm.BaseViewModel;
|
||||
import com.hainaos.vc.bean.AppInfo;
|
||||
import com.hainaos.vc.bean.BaseResponse;
|
||||
import com.hainaos.vc.bean.UserInfo;
|
||||
import com.hainaos.vc.bean.uiuios.AppUpdateInfo;
|
||||
import com.hainaos.vc.databinding.ActivityUserBinding;
|
||||
import com.hainaos.vc.network.NetInterfaceManager;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.trello.rxlifecycle4.RxLifecycle;
|
||||
import com.trello.rxlifecycle4.android.ActivityEvent;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.functions.BiFunction;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
public class UserViewModel extends BaseViewModel<ActivityUserBinding, ActivityEvent> {
|
||||
|
||||
@@ -32,7 +40,6 @@ public class UserViewModel extends BaseViewModel<ActivityUserBinding, ActivityEv
|
||||
|
||||
public MutableLiveData<BaseResponse<UserInfo>> mUserInfoMutableLiveData = new MutableLiveData<>();
|
||||
|
||||
|
||||
public void getUserInfo() {
|
||||
NetInterfaceManager.getInstance().getUserInfoObservable()
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
@@ -59,4 +66,84 @@ public class UserViewModel extends BaseViewModel<ActivityUserBinding, ActivityEv
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public MutableLiveData<AppInfo> mAppInfoMutableLiveData = new MutableLiveData<>();
|
||||
|
||||
public void checkUpdate() {
|
||||
Observable.zip(NetInterfaceManager.getInstance().getCheckUpdateObservable(), NetInterfaceManager.getInstance().getCheckUpdateObservable(BuildConfig.APPLICATION_ID), new BiFunction<BaseResponse<AppInfo>, BaseResponse<AppUpdateInfo>, AppInfo>() {
|
||||
@Override
|
||||
public AppInfo apply(BaseResponse<AppInfo> appInfoBaseResponse, BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse) throws Throwable {
|
||||
if (appInfoBaseResponse.code == 200) {
|
||||
AppInfo appInfo = appInfoBaseResponse.data;
|
||||
return appInfo;
|
||||
}
|
||||
if (appUpdateInfoBaseResponse.code == 200) {
|
||||
AppUpdateInfo appUpdateInfo = appUpdateInfoBaseResponse.data;
|
||||
return appUpdateInfo.toAppInfo();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}).subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<AppInfo>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("checkUpdate", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull AppInfo appInfo) {
|
||||
Log.e("checkUpdate", "onNext: " + appInfo);
|
||||
mAppInfoMutableLiveData.setValue(appInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("checkUpdate", "onError: " + e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("checkUpdate", "onComplete: ");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public MutableLiveData<AppUpdateInfo> mAppUpdateInfoUiUiOSData = new MutableLiveData<>();
|
||||
|
||||
public void checkUpdateUiUiOS(String pkg) {
|
||||
NetInterfaceManager.getInstance().getCheckUpdateObservable(pkg)
|
||||
.compose(RxLifecycle.bindUntilEvent(getLifecycle(), ActivityEvent.DESTROY))
|
||||
.subscribe(new Observer<BaseResponse<AppUpdateInfo>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.e("checkUpdate", "onSubscribe: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseResponse<AppUpdateInfo> appUpdateInfoBaseResponse) {
|
||||
Log.e("checkUpdate", "onNext: " + appUpdateInfoBaseResponse);
|
||||
if (appUpdateInfoBaseResponse.code == 200) {
|
||||
AppUpdateInfo appUpdateInfo = appUpdateInfoBaseResponse.data;
|
||||
mAppUpdateInfoUiUiOSData.setValue(appUpdateInfo);
|
||||
} else {
|
||||
mAppUpdateInfoUiUiOSData.setValue(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.e("checkUpdate", "onError: ");
|
||||
Toaster.show("网络连接失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.e("checkUpdate", "onComplete: ");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class HomeAppAdapter extends RecyclerView.Adapter<HomeAppAdapter.Holder>
|
||||
holder.iv_icon.setImageDrawable(mContext.getDrawable(R.drawable.icon_user_center));
|
||||
break;
|
||||
case DOWNLOAD_CENTER:
|
||||
holder.iv_icon.setImageDrawable(mContext.getDrawable(R.drawable.icon_download));
|
||||
holder.iv_icon.setImageDrawable(mContext.getDrawable(R.drawable.icon_download_manager));
|
||||
break;
|
||||
default:
|
||||
holder.iv_icon.setImageDrawable(mContext.getDrawable(R.drawable.icon_category));
|
||||
|
||||
@@ -67,7 +67,7 @@ public class HomeCategoryAdapter extends RecyclerView.Adapter<HomeCategoryAdapte
|
||||
holder.iv_icon.setImageDrawable(mContext.getDrawable(R.drawable.icon_user_center));
|
||||
break;
|
||||
case DOWNLOAD_CENTER:
|
||||
holder.iv_icon.setImageDrawable(mContext.getDrawable(R.drawable.icon_download));
|
||||
holder.iv_icon.setImageDrawable(mContext.getDrawable(R.drawable.icon_download_manager));
|
||||
break;
|
||||
default:
|
||||
GlideLoadUtils.getInstance().glideLoad(mContext, icon, holder.iv_icon, R.drawable.icon_category);
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
package com.hainaos.vc.base;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.multidex.MultiDex;
|
||||
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.hainaos.vc.manager.ConnectManager;
|
||||
import com.hainaos.vc.network.NetInterfaceManager;
|
||||
import com.hainaos.vc.utils.JgyUtils;
|
||||
import com.hainaos.vc.utils.LenovoCsdkUtil;
|
||||
import com.hainaos.vc.utils.LoginUtils;
|
||||
import com.hainaos.vc.utils.ToastUtil;
|
||||
import com.hjq.toast.Toaster;
|
||||
@@ -15,12 +19,19 @@ import com.tencent.mmkv.MMKV;
|
||||
public class BaseApplication extends Application {
|
||||
private static final String TAG = "BaseApplication";
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
MultiDex.install(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
String rootDir = MMKV.initialize(this);
|
||||
Log.i(TAG, "mmkv root: " + rootDir);
|
||||
LenovoCsdkUtil.init(this);
|
||||
JgyUtils.init(this);
|
||||
Aria.init(this);
|
||||
ConnectManager.init(this);
|
||||
|
||||
118
app/src/main/java/com/hainaos/vc/bean/AppInfo.java
Normal file
@@ -0,0 +1,118 @@
|
||||
package com.hainaos.vc.bean;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AppInfo implements Serializable {
|
||||
private static final long serialVersionUID = 2986514983899019093L;
|
||||
|
||||
int id;
|
||||
int app_id;
|
||||
String app_name;
|
||||
String app_package;
|
||||
String app_version_name;
|
||||
long app_version_code;
|
||||
long app_size;
|
||||
String app_desc;
|
||||
String app_md5;
|
||||
String app_url;
|
||||
int is_forcedown;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getApp_id() {
|
||||
return app_id;
|
||||
}
|
||||
|
||||
public void setApp_id(int app_id) {
|
||||
this.app_id = app_id;
|
||||
}
|
||||
|
||||
public String getApp_name() {
|
||||
return app_name;
|
||||
}
|
||||
|
||||
public void setApp_name(String app_name) {
|
||||
this.app_name = app_name;
|
||||
}
|
||||
|
||||
public String getApp_package() {
|
||||
return app_package;
|
||||
}
|
||||
|
||||
public void setApp_package(String app_package) {
|
||||
this.app_package = app_package;
|
||||
}
|
||||
|
||||
public String getApp_version_name() {
|
||||
return app_version_name;
|
||||
}
|
||||
|
||||
public void setApp_version_name(String app_version_name) {
|
||||
this.app_version_name = app_version_name;
|
||||
}
|
||||
|
||||
public long getApp_version_code() {
|
||||
return app_version_code;
|
||||
}
|
||||
|
||||
public void setApp_version_code(long app_version_code) {
|
||||
this.app_version_code = app_version_code;
|
||||
}
|
||||
|
||||
public long getApp_size() {
|
||||
return app_size;
|
||||
}
|
||||
|
||||
public void setApp_size(long app_size) {
|
||||
this.app_size = app_size;
|
||||
}
|
||||
|
||||
public String getApp_desc() {
|
||||
return app_desc;
|
||||
}
|
||||
|
||||
public void setApp_desc(String app_desc) {
|
||||
this.app_desc = app_desc;
|
||||
}
|
||||
|
||||
public String getApp_md5() {
|
||||
return app_md5;
|
||||
}
|
||||
|
||||
public void setApp_md5(String app_md5) {
|
||||
this.app_md5 = app_md5;
|
||||
}
|
||||
|
||||
public String getApp_url() {
|
||||
return app_url;
|
||||
}
|
||||
|
||||
public void setApp_url(String app_url) {
|
||||
this.app_url = app_url;
|
||||
}
|
||||
|
||||
public int getIs_forcedown() {
|
||||
return is_forcedown;
|
||||
}
|
||||
|
||||
public void setIs_forcedown(int is_forcedown) {
|
||||
this.is_forcedown = is_forcedown;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,13 @@ public class CategoryInfo implements Serializable {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public CategoryInfo(String category_name, String uuid, int is_free, String folder) {
|
||||
this.category_name = category_name;
|
||||
this.uuid = uuid;
|
||||
this.is_free = is_free;
|
||||
this.folder = folder;
|
||||
}
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.hainaos.vc.bean.AppInfo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -18,7 +19,7 @@ public class AppUpdateInfo implements Serializable {
|
||||
String app_desc;
|
||||
String app_md5;
|
||||
String app_url;
|
||||
String is_forcedown;
|
||||
int is_forcedown;
|
||||
AppBase app;
|
||||
|
||||
public int getId() {
|
||||
@@ -85,11 +86,11 @@ public class AppUpdateInfo implements Serializable {
|
||||
this.app_url = app_url;
|
||||
}
|
||||
|
||||
public String getIs_forcedown() {
|
||||
public int getIs_forcedown() {
|
||||
return is_forcedown;
|
||||
}
|
||||
|
||||
public void setIs_forcedown(String is_forcedown) {
|
||||
public void setIs_forcedown(int is_forcedown) {
|
||||
this.is_forcedown = is_forcedown;
|
||||
}
|
||||
|
||||
@@ -106,4 +107,24 @@ public class AppUpdateInfo implements Serializable {
|
||||
public String toString() {
|
||||
return JsonParser.parseString(new Gson().toJson(this)).getAsJsonObject().toString();
|
||||
}
|
||||
|
||||
public AppInfo toAppInfo() {
|
||||
AppInfo appInfo = new AppInfo();
|
||||
appInfo.setId(this.id);
|
||||
if (app != null) {
|
||||
appInfo.setApp_id(app.getId());
|
||||
appInfo.setApp_name(app.getApp_name());
|
||||
appInfo.setApp_package(app.getApp_package());
|
||||
}
|
||||
|
||||
appInfo.setApp_version_name(this.app_version_name);
|
||||
appInfo.setApp_version_code(this.app_version_code);
|
||||
appInfo.setApp_size(this.app_size);
|
||||
appInfo.setApp_desc(this.app_desc);
|
||||
appInfo.setApp_md5(this.app_md5);
|
||||
appInfo.setApp_url(this.app_url);
|
||||
appInfo.setIs_forcedown(this.is_forcedown);
|
||||
|
||||
return appInfo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import androidx.annotation.NonNull;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.hainaos.vc.bean.AppInfo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -134,19 +135,19 @@ public class AriaDownloadInfo implements Serializable {
|
||||
);
|
||||
}
|
||||
|
||||
// public static AriaDownloadInfo toAriaDownloadInfo(AppInfo appInfo) {
|
||||
// return new AriaDownloadInfo(
|
||||
// appInfo.getId(),
|
||||
// appInfo.getApp_name(),
|
||||
// appInfo.getApp_package(),
|
||||
// appInfo.getApp_version_name(),
|
||||
// appInfo.getApp_version_code(),
|
||||
// appInfo.getApp_url(),
|
||||
// appInfo.getApp_img(),
|
||||
// appInfo.getApp_size(),
|
||||
// appInfo.getApp_md5()
|
||||
// );
|
||||
// }
|
||||
public static AriaDownloadInfo toAriaDownloadInfo(AppInfo appInfo) {
|
||||
return new AriaDownloadInfo(
|
||||
appInfo.getId(),
|
||||
appInfo.getApp_name(),
|
||||
appInfo.getApp_package(),
|
||||
appInfo.getApp_version_name(),
|
||||
appInfo.getApp_version_code(),
|
||||
appInfo.getApp_url(),
|
||||
"",
|
||||
appInfo.getApp_size(),
|
||||
appInfo.getApp_md5()
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// public static AriaDownloadInfo toAriaDownloadInfo(AppDetails appDetails) {
|
||||
|
||||
@@ -12,6 +12,8 @@ import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.hainaos.vc.R;
|
||||
|
||||
import me.jessyan.autosize.AutoSizeCompat;
|
||||
|
||||
|
||||
public class PermissionsDialog extends AlertDialog {
|
||||
private Context mContext;
|
||||
@@ -61,6 +63,8 @@ public class PermissionsDialog extends AlertDialog {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
AutoSizeCompat.autoConvertDensityOfGlobal(mContext.getResources());
|
||||
|
||||
setContentView(R.layout.dialog_permissions);
|
||||
setCanceledOnTouchOutside(false);
|
||||
tv_content = findViewById(R.id.tv_content);
|
||||
@@ -90,6 +94,7 @@ public class PermissionsDialog extends AlertDialog {
|
||||
@Override
|
||||
public void show() {
|
||||
super.show();
|
||||
AutoSizeCompat.autoConvertDensityOfGlobal(mContext.getResources());
|
||||
setText();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.hainaos.vc.fragment.app;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
@@ -15,6 +16,7 @@ import com.hainaos.vc.databinding.FragmentAppBinding;
|
||||
import java.util.List;
|
||||
|
||||
public class AppFragment extends BaseMvvmFragment<AppViewModel, FragmentAppBinding> {
|
||||
private static final String TAG = "AppFragment";
|
||||
|
||||
private Activity mContext;
|
||||
private HomeAppAdapter mHomeAppAdapter;
|
||||
@@ -56,6 +58,14 @@ public class AppFragment extends BaseMvvmFragment<AppViewModel, FragmentAppBindi
|
||||
|
||||
@Override
|
||||
public void fetchData() {
|
||||
Log.e(TAG, "fetchData: ");
|
||||
mViewModel.getAppList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
Log.e(TAG, "onResume: ");
|
||||
mViewModel.getAppList();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.hainaos.vc.fragment.category;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
@@ -16,6 +17,7 @@ import com.hainaos.vc.databinding.FragmentCategoryBinding;
|
||||
import java.util.List;
|
||||
|
||||
public class CategoryFragment extends BaseMvvmFragment<CategoryViewModel, FragmentCategoryBinding> {
|
||||
private static final String TAG = "CategoryFragment";
|
||||
|
||||
private Activity mContext;
|
||||
// private HomeAppAdapter mHomeAppAdapter;
|
||||
@@ -66,10 +68,18 @@ public class CategoryFragment extends BaseMvvmFragment<CategoryViewModel, Fragme
|
||||
|
||||
@Override
|
||||
public void fetchData() {
|
||||
Log.e(TAG, "fetchData: ");
|
||||
// mViewModel.getDirList();
|
||||
mViewModel.getCategoryList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
Log.e(TAG, "onResume: ");
|
||||
mViewModel.getCategoryList();
|
||||
}
|
||||
|
||||
public class BtnClick {
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import android.util.Log;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.hainaos.vc.BuildConfig;
|
||||
import com.hainaos.vc.adapter.HomeAppAdapter;
|
||||
import com.hainaos.vc.base.mvvm.BaseViewModel;
|
||||
import com.hainaos.vc.bean.BaseResponse;
|
||||
import com.hainaos.vc.bean.CategoryInfo;
|
||||
@@ -43,22 +42,22 @@ public class CategoryViewModel extends BaseViewModel<FragmentCategoryBinding, Fr
|
||||
|
||||
@Deprecated
|
||||
public void getDirList() {
|
||||
List<HomeAppInfo> homeAppInfos = new ArrayList<>();
|
||||
homeAppInfos.add(new HomeAppInfo("分类1", "", "", "1", true));
|
||||
homeAppInfos.add(new HomeAppInfo("分类2", "", "", "2", true));
|
||||
homeAppInfos.add(new HomeAppInfo("分类3", "", "", "3", true));
|
||||
homeAppInfos.add(new HomeAppInfo("分类4", "", "", "4", true));
|
||||
homeAppInfos.add(new HomeAppInfo("分类5", "", "", "5", true));
|
||||
homeAppInfos.add(new HomeAppInfo("分类6", "", "", "6", true));
|
||||
homeAppInfos.add(new HomeAppInfo("分类7", "", "", "7", true));
|
||||
homeAppInfos.add(new HomeAppInfo("分类8", "", "", "8", true));
|
||||
homeAppInfos.add(new HomeAppInfo("分类9", "", "", "9", true));
|
||||
homeAppInfos.add(new HomeAppInfo("分类10", "", "", "10", true));
|
||||
List<CategoryInfo> homeAppInfos = new ArrayList<>();
|
||||
homeAppInfos.add(new CategoryInfo("分类1", "", 1, "a1"));
|
||||
homeAppInfos.add(new CategoryInfo("分类2", "", 1, "a2"));
|
||||
homeAppInfos.add(new CategoryInfo("分类3", "", 1, "a3"));
|
||||
homeAppInfos.add(new CategoryInfo("分类4", "", 1, "a4"));
|
||||
homeAppInfos.add(new CategoryInfo("分类5", "", 1, "a5"));
|
||||
homeAppInfos.add(new CategoryInfo("分类6", "", 1, "a6"));
|
||||
homeAppInfos.add(new CategoryInfo("分类7", "", 1, "a7"));
|
||||
homeAppInfos.add(new CategoryInfo("分类8", "", 1, "a8"));
|
||||
homeAppInfos.add(new CategoryInfo("分类9", "", 1, "a9"));
|
||||
homeAppInfos.add(new CategoryInfo("分类10", "", 1, "a10"));
|
||||
|
||||
homeAppInfos.add(new HomeAppInfo("下载视频", HomeAppAdapter.DOWNLOAD_CENTER, "", "", true));
|
||||
homeAppInfos.add(new HomeAppInfo("用户中心", HomeAppAdapter.USER_CENTER, "", "", true));
|
||||
// homeAppInfos.add(new CategoryInfo("下载视频", HomeAppAdapter.DOWNLOAD_CENTER, 1, ""));
|
||||
// homeAppInfos.add(new CategoryInfo("用户中心", HomeAppAdapter.USER_CENTER, 1, ""));
|
||||
|
||||
mHomeAppInfoListData.setValue(homeAppInfos);
|
||||
mCategoryInfoListData.setValue(homeAppInfos);
|
||||
}
|
||||
|
||||
public MutableLiveData<List<CategoryInfo>> mCategoryInfoListData = new MutableLiveData<>();
|
||||
@@ -78,6 +77,8 @@ public class CategoryViewModel extends BaseViewModel<FragmentCategoryBinding, Fr
|
||||
if (baseResponse.code == 200) {
|
||||
List<CategoryInfo> categoryInfos = baseResponse.data;
|
||||
mCategoryInfoListData.setValue(categoryInfos);
|
||||
} else {
|
||||
getDirList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
|
||||
import com.hainaos.vc.BuildConfig;
|
||||
import com.hainaos.vc.bean.AppInfo;
|
||||
import com.hainaos.vc.bean.BaseResponse;
|
||||
import com.hainaos.vc.bean.CategoryInfo;
|
||||
import com.hainaos.vc.bean.CodeInfo;
|
||||
@@ -19,8 +20,8 @@ import com.hainaos.vc.network.api.VideoApi;
|
||||
import com.hainaos.vc.network.api.uiuios.CheckUpdateApi;
|
||||
import com.hainaos.vc.network.interceptor.RepeatRequestInterceptor;
|
||||
import com.hainaos.vc.utils.FileUtils;
|
||||
import com.hainaos.vc.utils.LenovoCsdkUtil;
|
||||
import com.hainaos.vc.utils.LoginUtils;
|
||||
import com.hainaos.vc.utils.Utils;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
|
||||
import java.io.File;
|
||||
@@ -154,16 +155,16 @@ public class NetInterfaceManager {
|
||||
*
|
||||
* */
|
||||
|
||||
public Observable<BaseResponse> getLoginObservable(String mobile, String password) {
|
||||
public Observable<BaseResponse<LoginInfo>> getLoginObservable(String mobile, String password) {
|
||||
return getLoginApi()
|
||||
.login(Utils.getSerial(), mobile, password)
|
||||
.login(LenovoCsdkUtil.getInstance().getSerial(), mobile, password)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse<LoginInfo>> getPhoneLoginObservable(String verify_key, String mobile, String captcha) {
|
||||
return getLoginApi()
|
||||
.mobileLogin(Utils.getSerial(), mobile, captcha, verify_key)
|
||||
.mobileLogin(LenovoCsdkUtil.getInstance().getSerial(), mobile, captcha, verify_key)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
@@ -247,7 +248,7 @@ public class NetInterfaceManager {
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Observable<BaseResponse> getCheckUpdateObservable() {
|
||||
public Observable<BaseResponse<AppInfo>> getCheckUpdateObservable() {
|
||||
return mRetrofit.create(AppApi.class)
|
||||
.checkUpdate(BuildConfig.APPLICATION_ID)
|
||||
.subscribeOn(Schedulers.io())
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.hainaos.vc.network.api;
|
||||
|
||||
import com.hainaos.vc.bean.AppInfo;
|
||||
import com.hainaos.vc.bean.BaseResponse;
|
||||
import com.hainaos.vc.network.UrlAddress;
|
||||
|
||||
@@ -9,7 +10,7 @@ import retrofit2.http.Query;
|
||||
|
||||
public interface AppApi {
|
||||
@GET(UrlAddress.app_CHECK_UPDATE)
|
||||
Observable<BaseResponse> checkUpdate(
|
||||
Observable<BaseResponse<AppInfo>> checkUpdate(
|
||||
@Query("app_package") String app_package
|
||||
);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import retrofit2.http.Query;
|
||||
public interface LoginApi {
|
||||
@FormUrlEncoded
|
||||
@POST(UrlAddress.LOGIN)
|
||||
Observable<BaseResponse> login(
|
||||
Observable<BaseResponse<LoginInfo>> login(
|
||||
@Field("sn") String sn,
|
||||
@Field("mobile") String mobile,
|
||||
@Field("password") String password
|
||||
|
||||
@@ -23,7 +23,7 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.hainaos.vc.R;
|
||||
import com.hainaos.vc.bean.uiuios.AriaDownloadInfo;
|
||||
import com.hainaos.vc.utils.ApkUtils;
|
||||
import com.hainaos.vc.utils.LenovoCsdkUtil;
|
||||
import com.hjq.toast.Toaster;
|
||||
|
||||
import java.io.File;
|
||||
@@ -206,7 +206,7 @@ public class DownloadService extends Service {
|
||||
String path = task.getFilePath();
|
||||
Log.e(TAG, "taskComplete: " + path);
|
||||
if (path.endsWith(".apk")) {
|
||||
ApkUtils.installApp(DownloadService.this, task.getFilePath());
|
||||
LenovoCsdkUtil.getInstance().installPackage(task.getFilePath());
|
||||
String jsonString = task.getExtendField();
|
||||
Log.e(TAG, "taskComplete: " + "下载完成:" + jsonString);
|
||||
AriaDownloadInfo ariaDownloadInfo = getAriaDownloadInfo(jsonString);
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.app.PendingIntent;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageInstaller;
|
||||
import android.content.pm.PackageManager;
|
||||
@@ -15,6 +16,7 @@ import android.util.Log;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.hainaos.vc.BuildConfig;
|
||||
import com.hainaos.vc.bean.AppInfo;
|
||||
import com.hainaos.vc.bean.uiuios.AppUpdateInfo;
|
||||
import com.hainaos.vc.receiver.InstallResultReceiver;
|
||||
import com.hjq.toast.Toaster;
|
||||
@@ -248,6 +250,12 @@ public class ApkUtils {
|
||||
return isUpdate(context, packageName, versionCode);
|
||||
}
|
||||
|
||||
public static boolean isUpdate(Context context, AppInfo appUpdateInfo) {
|
||||
String packageName = appUpdateInfo.getApp_package();
|
||||
long versionCode = appUpdateInfo.getApp_version_code();
|
||||
return isUpdate(context, packageName, versionCode);
|
||||
}
|
||||
|
||||
public static boolean isUpdate(Context context, String packageName, long versionCode) {
|
||||
PackageInfo packageInfo = null;
|
||||
try {
|
||||
@@ -273,6 +281,33 @@ public class ApkUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkAppUpdate(Context context, AppInfo appInfo) {
|
||||
String packageName = appInfo.getApp_package();
|
||||
long versionCode = appInfo.getApp_version_code();
|
||||
String url = appInfo.getApp_url();
|
||||
PackageInfo packageInfo = null;
|
||||
try {
|
||||
packageInfo = context.getPackageManager().getPackageInfo(packageName, 0);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (packageInfo == null) {
|
||||
FileUtils.ariaDownload(context, url, appInfo);
|
||||
} else {
|
||||
long appVersionCode;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
appVersionCode = packageInfo.getLongVersionCode();
|
||||
} else {
|
||||
appVersionCode = packageInfo.versionCode;
|
||||
}
|
||||
if (appVersionCode < versionCode) {
|
||||
FileUtils.ariaDownload(context, url, appInfo);
|
||||
} else {
|
||||
Log.e(TAG, "checkUpdate: " + packageName + "\t已经是最新版");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void checkAppUpdate(Context context, AppUpdateInfo appUpdateInfo) {
|
||||
String packageName = appUpdateInfo.getApp().getApp_package();
|
||||
long versionCode = appUpdateInfo.getApp_version_code();
|
||||
@@ -300,5 +335,17 @@ public class ApkUtils {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据文件路径获取包名
|
||||
*/
|
||||
public static String getPackageName(Context context, String filePath) {
|
||||
PackageManager packageManager = context.getPackageManager();
|
||||
PackageInfo info = packageManager.getPackageArchiveInfo(filePath, PackageManager.GET_ACTIVITIES);
|
||||
if (info != null) {
|
||||
ApplicationInfo appInfo = info.applicationInfo;
|
||||
Log.e(TAG, "getPackageName: " + appInfo.packageName);
|
||||
return appInfo.packageName; //得到安装包名称
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,8 @@ import android.os.Environment;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.hainaos.vc.bean.AppInfo;
|
||||
import com.hainaos.vc.bean.uiuios.AppUpdateInfo;
|
||||
import com.hainaos.vc.bean.uiuios.AriaDownloadInfo;
|
||||
import com.hainaos.vc.gson.GsonUtils;
|
||||
@@ -82,7 +81,8 @@ public class FileUtils {
|
||||
}
|
||||
|
||||
public static String getDownLoadPath(Context context) {
|
||||
String path = ContextCompat.getExternalFilesDirs(context, Environment.DIRECTORY_DOWNLOADS)[0].getAbsolutePath();
|
||||
// String path = ContextCompat.getExternalFilesDirs(context, Environment.DIRECTORY_DOWNLOADS)[0].getAbsolutePath();
|
||||
String path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath();
|
||||
return path + File.separator;
|
||||
}
|
||||
|
||||
@@ -122,6 +122,12 @@ public class FileUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void ariaDownload(Context context, String url, AppInfo appInfo) {
|
||||
Log.e(TAG, "ariaDownload: " + appInfo);
|
||||
AriaDownloadInfo ariaDownloadInfo = AriaDownloadInfo.toAriaDownloadInfo(appInfo);
|
||||
ariaDownload(context, url, ariaDownloadInfo);
|
||||
}
|
||||
|
||||
public static void ariaDownload(Context context, String url, AppUpdateInfo appUpdateInfo) {
|
||||
Log.e(TAG, "ariaDownload: " + appUpdateInfo);
|
||||
AriaDownloadInfo ariaDownloadInfo = AriaDownloadInfo.toAriaDownloadInfo(appUpdateInfo);
|
||||
@@ -138,7 +144,7 @@ public class FileUtils {
|
||||
String fileMd5 = com.blankj.utilcode.util.FileUtils.getFileMD5ToString(file);
|
||||
Log.e("ariaDownload", "fileMD5 = " + fileMd5);
|
||||
if (fileMd5.equalsIgnoreCase(app_md5)) {
|
||||
ApkUtils.installApp(context, file.getAbsolutePath());
|
||||
LenovoCsdkUtil.getInstance().installPackage(file.getAbsolutePath());
|
||||
} else {
|
||||
file.delete();
|
||||
Aria.download(context)
|
||||
|
||||
137
app/src/main/java/com/hainaos/vc/utils/LenovoCsdkUtil.java
Normal file
@@ -0,0 +1,137 @@
|
||||
package com.hainaos.vc.utils;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.csdk.CSDKManager;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.hainaos.vc.BuildConfig;
|
||||
import com.hainaos.vc.config.CommonConfig;
|
||||
import com.tencent.mmkv.MMKV;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class LenovoCsdkUtil {
|
||||
private static final String TAG = "LenovoCsdkUtil";
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static LenovoCsdkUtil sInstance;
|
||||
private MMKV mMMKV = MMKV.mmkvWithID(CommonConfig.MMKV_ID, MMKV.MULTI_PROCESS_MODE);
|
||||
private Context mContext;
|
||||
private CSDKManager mCSDKManager;
|
||||
|
||||
|
||||
private LenovoCsdkUtil(Context context) {
|
||||
if (context == null) {
|
||||
throw new RuntimeException("Context is NULL");
|
||||
}
|
||||
this.mContext = context;
|
||||
try {
|
||||
this.mCSDKManager = new CSDKManager(context);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "LenovoCsdkUtil: " + e.getMessage());
|
||||
}
|
||||
if (mCSDKManager.isLicenseKeyEnabled(BuildConfig.APPLICATION_ID)) {
|
||||
Log.e(TAG, "LenovoCsdkUtil: devices activated");
|
||||
} else {
|
||||
Log.e(TAG, "LenovoCsdkUtil: devices not activated");
|
||||
}
|
||||
List<String> packages = mCSDKManager.getRuntimePermissionWhiteList();
|
||||
if (!packages.contains(BuildConfig.APPLICATION_ID)) {
|
||||
packages.add(BuildConfig.APPLICATION_ID);
|
||||
}
|
||||
mCSDKManager.addRuntimePermissionWhiteList(packages);
|
||||
Log.e(TAG, "setDefaultSetting: getRuntimePermissionWhiteList = " + mCSDKManager.getRuntimePermissionWhiteList());
|
||||
}
|
||||
|
||||
public static void init(Context context) {
|
||||
if (sInstance == null) {
|
||||
Log.e(TAG, "init: ");
|
||||
sInstance = new LenovoCsdkUtil(context);
|
||||
}
|
||||
}
|
||||
|
||||
public static LenovoCsdkUtil getInstance() {
|
||||
if (sInstance == null) {
|
||||
throw new IllegalStateException("You must be init LenovoCsdkUtil first");
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
/**
|
||||
* int: 1 MAC
|
||||
* int: 2 SN
|
||||
* int: 3 Model
|
||||
* int: 4 IMEI
|
||||
*/
|
||||
public String getDeviceMac() {
|
||||
String mac = mCSDKManager.getDeviceInfo(1);
|
||||
return mac;
|
||||
}
|
||||
|
||||
public String getSerial() {
|
||||
if (BuildConfig.DEBUG) {
|
||||
return "T98005H1024GB32GB";
|
||||
}
|
||||
|
||||
String sn = mCSDKManager.getDeviceInfo(2);
|
||||
return sn;
|
||||
}
|
||||
|
||||
public String getDeviceModel() {
|
||||
String model = mCSDKManager.getDeviceInfo(3);
|
||||
return model;
|
||||
}
|
||||
|
||||
public String getDeviceIMEI() {
|
||||
String imei = mCSDKManager.getDeviceInfo(4);
|
||||
return imei;
|
||||
}
|
||||
|
||||
public void setCustomLauncher(String launcherPackageName, String launcherActivity) {
|
||||
Log.e(TAG, "setDefaultLauncher: " + launcherPackageName);
|
||||
mCSDKManager.setCustomLauncher(launcherPackageName, launcherActivity);
|
||||
}
|
||||
|
||||
public void addInstallPackageWhiteList(String pkg) {
|
||||
List<String> pkgList = mCSDKManager.getInstallPackageWhiteList();
|
||||
Set<String> pkgSet;
|
||||
if (pkgList == null) {
|
||||
pkgSet = new HashSet<>();
|
||||
} else {
|
||||
pkgSet = new HashSet<>(pkgList);
|
||||
}
|
||||
pkgSet.add(pkg);
|
||||
// pkgSet.addAll(ApkUtils.aoleyunAPP);
|
||||
Log.e(TAG, "addInstallPackageWhiteList: " + pkgSet);
|
||||
mCSDKManager.addInstallPackageWhiteList(new ArrayList<>(pkgSet));
|
||||
}
|
||||
|
||||
public void installPackage(String path) {
|
||||
String pkg = ApkUtils.getPackageName(mContext, path);
|
||||
addInstallPackageWhiteList(pkg);
|
||||
Log.e(TAG, "installPackage: " + path);
|
||||
mCSDKManager.setPersistValue("persist.sys.csdk.installpackage.verification", "true");
|
||||
mCSDKManager.installPackage(path);
|
||||
}
|
||||
|
||||
public void installPackage(File file) {
|
||||
String path = file.getAbsolutePath();
|
||||
String pkg = ApkUtils.getPackageName(mContext, path);
|
||||
addInstallPackageWhiteList(pkg);
|
||||
Log.e(TAG, "installPackage: " + path);
|
||||
mCSDKManager.setPersistValue("persist.sys.csdk.installpackage.verification", "true");
|
||||
mCSDKManager.installPackage(path);
|
||||
}
|
||||
|
||||
public void killApplicationProcess(String packageName) {
|
||||
Log.e(TAG, "killApplicationProcess: " + packageName);
|
||||
mCSDKManager.killApplicationProcess(packageName);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -21,7 +21,7 @@ public class LoginUtils {
|
||||
|
||||
private static final String USER_TOKEN_KEY = "user_token";
|
||||
|
||||
private static final String USER_LOGIN_STATU_KEY = "user_token";
|
||||
private static final String USER_LOGIN_STATU_KEY = "user_login_status";
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static LoginUtils sInstance;
|
||||
|
||||
@@ -7,17 +7,15 @@ import android.os.StatFs;
|
||||
import android.text.format.Formatter;
|
||||
import android.util.Log;
|
||||
|
||||
import com.hainaos.vc.BuildConfig;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class Utils {
|
||||
|
||||
@SuppressLint({"MissingPermission", "HardwareIds"})
|
||||
public static String getSerial() {
|
||||
if (BuildConfig.DEBUG) {
|
||||
return "T98005H1024GB32GB";
|
||||
}
|
||||
// if (BuildConfig.DEBUG) {
|
||||
// return "T98005H1024GB32GB";
|
||||
// }
|
||||
String serial = "unknow";
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {//9.0+
|
||||
|
||||
BIN
app/src/main/res/drawable-hdpi/icon_close.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/drawable-hdpi/icon_download_manager.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
9
app/src/main/res/drawable/dialog_background.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#ffffff" />
|
||||
<stroke
|
||||
android:width="0.8dp"
|
||||
android:color="#ffffff" />
|
||||
<!-- 圆角 -->
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
13
app/src/main/res/drawable/update_background.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?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="16dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="4dp"
|
||||
android:left="20dp"
|
||||
android:right="20dp"
|
||||
android:top="4dp" />
|
||||
</shape>
|
||||
13
app/src/main/res/drawable/update_cancel_background.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 内部颜色 -->
|
||||
<solid android:color="@color/lightGray" />
|
||||
<!-- 圆角的幅度 -->
|
||||
<corners android:radius="16dp" />
|
||||
|
||||
<padding
|
||||
android:bottom="4dp"
|
||||
android:left="20dp"
|
||||
android:right="20dp"
|
||||
android:top="4dp" />
|
||||
</shape>
|
||||
@@ -17,13 +17,58 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:onClick="@{click::exit}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_back_white"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="下载视频"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_category"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/cl_title" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
@@ -9,6 +9,13 @@
|
||||
<variable
|
||||
name="click"
|
||||
type="com.hainaos.vc.activity.login.LoginActivity.BtnClick" />
|
||||
|
||||
<variable
|
||||
name="loginMode"
|
||||
type="int" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
@@ -26,137 +33,260 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
<TextView
|
||||
android:id="@+id/tv_login_mode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="@{loginMode==0?`验证码登录`:`密码登录`}"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="验证码登录" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tv_change_mode"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_login_mode">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_code"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
android:text="账号登录"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:orientation="vertical"
|
||||
android:visibility="@{loginMode==0?View.VISIBLE:View.GONE}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_phone_number"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/edit_background"
|
||||
android:hint="请输入手机号码"
|
||||
android:inputType="phone"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="4dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="#848484"
|
||||
android:textSize="13sp"
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/edit_background"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_code"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@null"
|
||||
android:hint="请输入验证码"
|
||||
android:inputType="phone"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="#848484"
|
||||
android:textSize="13sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cardView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:onClick="@{click::getCode}"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_get_code"
|
||||
<EditText
|
||||
android:id="@+id/et_phone_number"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/edit_background"
|
||||
android:hint="请输入手机号码"
|
||||
android:inputType="phone"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="4dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="#848484"
|
||||
android:textSize="13sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/edit_background"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_code"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@null"
|
||||
android:hint="请输入验证码"
|
||||
android:inputType="phone"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="#848484"
|
||||
android:textSize="13sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cardView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="4dp"
|
||||
android:gravity="center"
|
||||
android:text="验证码"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="13sp" />
|
||||
android:layout_marginEnd="8dp"
|
||||
android:onClick="@{click::getCode}"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
<TextView
|
||||
android:id="@+id/tv_get_code"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="4dp"
|
||||
android:gravity="center"
|
||||
android:text="验证码"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="13sp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<TextView
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="@drawable/bg_login_button"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:onClick="@{click::codeLogin}"
|
||||
android:singleLine="true"
|
||||
android:text="登录"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_passwd"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="@drawable/bg_login_button"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:onClick="@{click::codeLogin}"
|
||||
android:singleLine="true"
|
||||
android:text="登录"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="@{loginMode==0?View.GONE:View.VISIBLE}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</LinearLayout>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_account"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/edit_background"
|
||||
android:hint="请输入手机号码"
|
||||
android:inputType="phone"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="4dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="#848484"
|
||||
android:textSize="13sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/edit_background"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_passwd"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@null"
|
||||
android:hint="请输入密码"
|
||||
android:inputType="textPassword"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="#848484"
|
||||
android:textSize="13sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="@drawable/bg_login_button"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:onClick="@{click::passwordLogin}"
|
||||
android:singleLine="true"
|
||||
android:text="登录"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_change_mode"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:maxLines="1"
|
||||
android:onClick="@{click::changeLoginMode}"
|
||||
android:singleLine="true"
|
||||
android:text="@{loginMode==0?`密码登录`:`验证码登录`}"
|
||||
android:textColor="#848484"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:text="密码登录" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</layout>
|
||||
164
app/src/main/res/layout/activity_update.xml
Normal file
@@ -0,0 +1,164 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".activity.update.UpdateActivity">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="appInfo"
|
||||
type="com.hainaos.vc.bean.AppInfo" />
|
||||
|
||||
<variable
|
||||
name="msg"
|
||||
type="String" />
|
||||
|
||||
<variable
|
||||
name="click"
|
||||
type="com.hainaos.vc.activity.update.UpdateActivity.BtnClick" />
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/dialog_background"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click::exit}"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/icon_close"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center_vertical"
|
||||
android:text="检查更新"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toTopOf="@+id/linearLayout3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/linearLayout2">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="2dp"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:minHeight="50dp"
|
||||
android:minLines="2"
|
||||
android:text="@{msg}"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="11sp"
|
||||
tools:text="提示消息提示消息提示消息提示消息提示消息" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="8dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@{appInfo.app_version_name}"
|
||||
android:textColor="@color/contact_text_color"
|
||||
android:textSize="10sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/linearLayout3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/negtive"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/update_cancel_background"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click::exit}"
|
||||
android:singleLine="true"
|
||||
android:text="取消"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/positive"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/update_background"
|
||||
android:gravity="center"
|
||||
android:onClick="@{click::upgrade}"
|
||||
android:singleLine="true"
|
||||
android:text="更新"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -30,15 +30,15 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_height="40dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:onClick="@{click::exit}"
|
||||
@@ -54,7 +54,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="个人中心"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="18sp"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -79,8 +79,8 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.shehuan.niv.NiceImageView
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_width="88dp"
|
||||
android:layout_height="88dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
@@ -128,8 +128,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_more1"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_width="@dimen/user_center_more_size"
|
||||
android:layout_height="@dimen/user_center_more_size"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
@@ -179,8 +179,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_more2"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_width="@dimen/user_center_more_size"
|
||||
android:layout_height="@dimen/user_center_more_size"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
@@ -228,8 +228,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_more3"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_width="@dimen/user_center_more_size"
|
||||
android:layout_height="@dimen/user_center_more_size"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
@@ -278,8 +278,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_more4"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_width="@dimen/user_center_more_size"
|
||||
android:layout_height="@dimen/user_center_more_size"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
@@ -328,8 +328,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_more5"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_width="@dimen/user_center_more_size"
|
||||
android:layout_height="@dimen/user_center_more_size"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
@@ -377,8 +377,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_more6"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_width="@dimen/user_center_more_size"
|
||||
android:layout_height="@dimen/user_center_more_size"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
@@ -402,9 +402,22 @@
|
||||
android:singleLine="true"
|
||||
android:text="登录"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="@dimen/user_center_title_size" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/user_center_layout_margin_horizontal"
|
||||
android:layout_marginTop="@dimen/user_cneter_item_margin_top"
|
||||
android:layout_gravity="center"
|
||||
android:maxLines="1"
|
||||
android:onClick="@{click::checkUpdate}"
|
||||
android:singleLine="true"
|
||||
android:text="检查更新"
|
||||
android:textColor="#0084FF"
|
||||
android:textSize="@dimen/user_center_text_size" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
@@ -21,8 +21,9 @@
|
||||
android:id="@+id/rv_app"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="32dp"
|
||||
android:overScrollMode="never" />
|
||||
android:overScrollMode="never"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 10 KiB |
@@ -6,7 +6,7 @@
|
||||
<color name="colorBackground">#000000</color>
|
||||
|
||||
<color name="splash_color">#f7f7f9</color>
|
||||
<color name="default_blue">#0166ff</color>
|
||||
<color name="default_blue">#4880ff</color>
|
||||
|
||||
<color name="white">#FFFFFF</color>
|
||||
<color name="black">#000000</color>
|
||||
@@ -22,6 +22,8 @@
|
||||
<color name="main_card_text_color1">#D0A65E</color>
|
||||
<color name="main_card_text_color">#FFFFFF</color>
|
||||
|
||||
<color name="contact_text_color">#98999a</color>
|
||||
|
||||
|
||||
<!--https://www.jianshu.com/p/8dc258dfd189-->
|
||||
<color name="transparent">#00000000</color><!--透明色-->
|
||||
|
||||
@@ -8,10 +8,11 @@
|
||||
<dimen name="main_card_text_top">12dp</dimen>
|
||||
<dimen name="main_card_margin">4dp</dimen>
|
||||
|
||||
<dimen name="user_center_title_size">16sp</dimen>
|
||||
<dimen name="user_center_text_size">15sp</dimen>
|
||||
<dimen name="user_center_item_height">40dp</dimen>
|
||||
<dimen name="user_cneter_item_margin_top">12dp</dimen>
|
||||
<dimen name="user_center_title_size">13sp</dimen>
|
||||
<dimen name="user_center_text_size">12sp</dimen>
|
||||
<dimen name="user_center_item_height">32dp</dimen>
|
||||
<dimen name="user_cneter_item_margin_top">8dp</dimen>
|
||||
<dimen name="user_center_layout_margin_horizontal">16dp</dimen>
|
||||
<dimen name="user_center_more_size">12dp</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -70,4 +70,26 @@
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
</style>
|
||||
|
||||
<style name="DialogCloseOnTouchOutside" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- <item name="android:windowFullscreen">true</item>-->
|
||||
<!--设置dialog的背景-->
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<!--设置Dialog的windowFrame框为无-->
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<!--设置无标题-->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!--是否浮现在activity之上-->
|
||||
<!--为false会导致windowCloseOnTouchOutside 失效-->
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<!--是否半透明-->
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<!--设置窗口内容不覆盖-->
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<!--设置动画,在这里使用让它继承系统的Animation.Dialog-->
|
||||
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
|
||||
<!--背景是否模糊显示-->
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowCloseOnTouchOutside">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||